/* ─── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: #fff7ed;
  color: #1c1917;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─────────────────────────────────────── */
header {
  background: #ea580c;
  color: #fff;
  padding: 0 1rem;
  height: 52px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(234,88,12,.35);
}
.header-inner { max-width: 900px; width: 100%; margin: 0 auto; }
.logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }

/* ─── Main ───────────────────────────────────────── */
main { max-width: 900px; width: 100%; margin: 0 auto; padding: 1.5rem 1rem 3rem; flex: 1; }

/* ─── Hero ───────────────────────────────────────── */
.hero { text-align: center; margin-bottom: 1.5rem; }
.hero-icon { font-size: 3rem; margin-bottom: .5rem; }
.hero h1 { font-size: 1.75rem; font-weight: 800; color: #ea580c; margin-bottom: .5rem; }
.description { color: #57534e; font-size: .95rem; line-height: 1.7; }

/* ━━━ ヒーローバッジ ━━━ */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.hero-badges .badge {
  display: inline-block;
  padding: 5px 13px;
  background: #ffedd5;
  color: #9a3412;
  border: 1.5px solid #fdba74;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Input Card ─────────────────────────────────── */
.input-card {
  background: #fff;
  border: 1.5px solid #fed7aa;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(234,88,12,.07);
}

.field-group { margin-bottom: 1rem; }
.field-group:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: #44403c;
  margin-bottom: .35rem;
}

.field-input {
  width: 100%;
  border: 1.5px solid #e7e5e4;
  border-radius: 10px;
  padding: .6rem .9rem;
  font-size: .925rem;
  font-family: inherit;
  color: #1c1917;
  background: #fafaf9;
  outline: none;
  transition: border-color .15s;
}
.field-input:focus { border-color: #ea580c; background: #fff; }
.field-input::placeholder { color: #a8a29e; }
.field-textarea { resize: vertical; line-height: 1.7; min-height: 80px; }

.field-meter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .35rem;
  gap: .75rem;
}
.field-status {
  font-size: .78rem;
  font-weight: 700;
  padding: .15rem .6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.status-ok   { background: #dcfce7; color: #15803d; }
.status-warn { background: #fef9c3; color: #a16207; }
.status-bad  { background: #fee2e2; color: #b91c1c; }
.field-count { font-size: .78rem; color: #78716c; font-weight: 600; }
.field-count span { color: #44403c; font-weight: 800; }

.meter-bar {
  height: 6px;
  background: #f0efed;
  border-radius: 999px;
  overflow: hidden;
  margin-top: .35rem;
}
.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width .25s ease, background .25s ease;
}
.meter-fill.warn { background: linear-gradient(90deg, #eab308, #facc15); }
.meter-fill.bad  { background: linear-gradient(90deg, #dc2626, #ef4444); }

.field-row { display: flex; gap: 1rem; }
.field-half { flex: 1; min-width: 0; }

/* Options Row */
.options-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .85rem;
  flex-wrap: wrap;
}
.opt-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  color: #57534e;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.opt-label input[type="checkbox"] {
  accent-color: #ea580c;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ─── Stats Bar ──────────────────────────────────── */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  padding: .75rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 6px rgba(234,88,12,.06);
  flex-wrap: wrap;
  row-gap: .5rem;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.1rem;
  flex: 1;
  min-width: 80px;
}
.stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ea580c;
  line-height: 1.2;
}
.stat-val.over { color: #dc2626; }
.stat-key {
  font-size: .72rem;
  color: #a8a29e;
  font-weight: 600;
  margin-top: .1rem;
}
.stat-divider {
  width: 1px;
  height: 32px;
  background: #f0efed;
  flex-shrink: 0;
}

/* ─── Result Area ────────────────────────────────── */
.result-area {
  background: #fff;
  border: 1.5px solid #e7e5e4;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}

/* ─── Tabs ───────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 1.5px solid #f0efed;
  background: #fafaf9;
}
.tab-btn {
  flex: 1;
  padding: .75rem .5rem;
  font-size: .875rem;
  font-weight: 600;
  color: #78716c;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: #ea580c; background: #fff7ed; }
.tab-btn.active { color: #ea580c; border-bottom-color: #ea580c; background: #fff; }

.tab-pane { display: none; padding: 1.25rem; }
.tab-pane.active { display: block; }

/* Pane header */
.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: .75rem;
}
.pane-title { font-size: .95rem; font-weight: 700; color: #44403c; }
.btn-export {
  background: none;
  border: 1.5px solid #e7e5e4;
  border-radius: 7px;
  padding: .3rem .85rem;
  font-size: .8rem;
  color: #57534e;
  cursor: pointer;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.btn-export:hover { background: #f5f5f4; border-color: #d6d3d1; }

/* ─── SERP Preview ───────────────────────────────── */
.serp-frame {
  background: #fff;
  border: 1.5px solid #e7e5e4;
  border-radius: 12px;
  padding: 1.5rem;
}
.serp-frame-sp {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
}

.serp-result {
  font-family: Arial, 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  max-width: 600px;
}
.serp-result-sp { max-width: 100%; }

.serp-url-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .35rem;
}
.serp-favicon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f1f3f4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}
.serp-url-texts { min-width: 0; }
.serp-sitename {
  font-size: 14px;
  color: #202124;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.serp-url {
  font-size: 12px;
  color: #4d5156;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serp-title {
  font-size: 20px;
  line-height: 1.3;
  color: #1a0dab;
  margin-bottom: .25rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.serp-title:hover { text-decoration: underline; }

.serp-title-sp {
  font-size: 17px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.serp-desc {
  font-size: 14px;
  line-height: 1.58;
  color: #4d5156;
  word-break: break-word;
}
.serp-desc-sp { font-size: 14px; }
.serp-desc .serp-date { color: #70757a; }

.serp-note {
  font-size: .78rem;
  color: #a8a29e;
  margin-top: .75rem;
  line-height: 1.6;
}

/* ─── HTML出力 ───────────────────────────────────── */
.html-output {
  background: #1c1917;
  color: #e7e5e4;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  font-size: .8rem;
  font-family: Consolas, 'Courier New', monospace;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ─── 診断結果 ───────────────────────────────────── */
.check-list { display: flex; flex-direction: column; gap: .6rem; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .65rem 1rem;
  border-radius: 10px;
  border: 1.5px solid #f0efed;
}
.check-row.ok   { background: #f0fdf4; border-color: #bbf7d0; }
.check-row.warn { background: #fefce8; border-color: #fde68a; }
.check-row.bad  { background: #fef2f2; border-color: #fecaca; }
.check-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1.4; }
.check-body strong { display: block; font-size: .875rem; font-weight: 700; color: #1c1917; margin-bottom: .15rem; }
.check-body p { font-size: .8rem; color: #57534e; line-height: 1.55; margin: 0; }

.empty-state {
  text-align: center;
  color: #a8a29e;
  font-size: .875rem;
  padding: 2rem 1rem;
}

/* ─── Info Card ──────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #fed7aa;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(234,88,12,.07);
  margin-bottom: 1rem;
}
.card h2 { font-size: 1.1rem; font-weight: 700; color: #ea580c; margin-bottom: .75rem; }

/* ─── Footer ─────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: .82rem;
  color: #a8a29e;
  border-top: 1px solid #e7e5e4;
  margin-top: auto;
}
footer a { color: #ea580c; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p + p { margin-top: .3rem; }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 680px) {
  .hero h1 { font-size: 1.4rem; }
  .stats-bar { padding: .65rem .75rem; }
  .stat-item { padding: 0 .6rem; min-width: 60px; }
  .stat-val { font-size: 1.15rem; }
  .tab-btn { font-size: .78rem; padding: .65rem .25rem; }
  .scene-grid { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
  .field-half { margin-bottom: 1rem; }
  .serp-frame { padding: 1rem; }
  .serp-title { font-size: 18px; }
}

/* ━━━ Amazonおすすめ ━━━ */
.amazon-card h2 { margin-bottom: 0.25rem; }
.amazon-note { font-size: 0.82rem; color: #999; margin-bottom: 1rem; }
.amazon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.amazon-item {
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 0.9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.amazon-item:hover {
  border-color: #FF9900;
  box-shadow: 0 2px 8px rgba(255,153,0,0.15);
  transform: translateY(-1px);
}
.amazon-item-icon { font-size: 1.7rem; margin-bottom: 0.35rem; }
.amazon-item-name { font-size: 0.88rem; font-weight: bold; margin-bottom: 0.2rem; }
.amazon-item-desc { font-size: 0.76rem; color: #888; line-height: 1.5; margin-bottom: 0.45rem; }
.amazon-item-link { font-size: 0.78rem; color: #FF9900; font-weight: bold; }

.amazon-notice {
  font-size: 0.72rem;
  color: #bbb;
  margin-top: 0.2rem;
}

/* ━━━ 活用シーン ━━━ */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.scene-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
}
.scene-icon { font-size: 1.7rem; flex-shrink: 0; }
.scene-body strong { display: block; font-size: .88rem; font-weight: 700; color: #9a3412; margin-bottom: .2rem; }
.scene-body p { font-size: .78rem; color: #4b5563; line-height: 1.55; margin: 0; }

/* ━━━ 関連ツール ━━━ */
.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}
.related-tool-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .85rem 1rem;
  border: 1.5px solid #e7e5e4;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.related-tool-item:hover { border-color: #ea580c; box-shadow: 0 2px 8px rgba(234,88,12,.1); }
.related-tool-icon { font-size: 1.6rem; flex-shrink: 0; }
.related-tool-item strong { display: block; font-size: .88rem; font-weight: 700; color: #ea580c; margin-bottom: .2rem; }
.related-tool-item p { font-size: .76rem; color: #888; line-height: 1.5; margin: 0; }

/* ━━━ FAQ ━━━ */
.faq-list { display: flex; flex-direction: column; }
.faq-item { padding: .9rem 0; border-bottom: 1px solid #f0f0f0; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: .9rem; font-weight: 700; color: #ea580c; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #555; line-height: 1.75; }
