/* ─── 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: .45rem;
}

.field-input {
  width: 100%;
  border: 1.5px solid #e7e5e4;
  border-radius: 10px;
  padding: .55rem .8rem;
  font-size: .95rem;
  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-row { display: flex; gap: 1.25rem; }
.field-half { flex: 1; min-width: 0; }

/* セグメントボタン（月給/年収・額面/手取り） */
.seg-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .55rem; }
.seg-group {
  display: inline-flex;
  border: 1.5px solid #fed7aa;
  border-radius: 9px;
  overflow: hidden;
  background: #fff7ed;
}
.seg-btn {
  border: none;
  background: none;
  padding: .35rem .9rem;
  font-size: .82rem;
  font-weight: 700;
  color: #9a3412;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg-btn.active { background: #ea580c; color: #fff; }

/* 金額入力 */
.amount-row { display: flex; align-items: center; gap: .6rem; }
.amount-input {
  font-size: 1.35rem;
  font-weight: 800;
  text-align: right;
  max-width: 160px;
  color: #ea580c;
}
.amount-unit { font-size: .9rem; font-weight: 700; color: #57534e; white-space: nowrap; }

/* ミニ入力グリッド */
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mini-grid-4 { grid-template-columns: repeat(4, 1fr); }
.mini-field { display: block; }
.mini-field > span {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: #78716c;
  margin-bottom: .3rem;
  white-space: nowrap;
}
.mini-input-row { display: flex; align-items: center; gap: .4rem; }
.mini-input-row .field-input { text-align: right; padding: .45rem .6rem; }
.mini-input-row > span { font-size: .8rem; color: #78716c; font-weight: 600; flex-shrink: 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;
  white-space: nowrap;
}
.stat-val small { font-size: .8rem; font-weight: 700; margin-left: 1px; }
.stat-val-main { color: #c2410c; }
.stat-val.over { color: #dc2626; }
.stat-key {
  font-size: .72rem;
  color: #a8a29e;
  font-weight: 600;
  margin-top: .1rem;
  white-space: nowrap;
}
.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);
}
.result-inner { padding: 1.5rem 1.25rem; }

/* メイン結果 */
.verdict {
  text-align: center;
  padding: 1.25rem 1rem 1.5rem;
  background: linear-gradient(180deg, #fff7ed, #fff);
  border: 1.5px solid #fed7aa;
  border-radius: 14px;
  margin-bottom: 1.25rem;
}
.verdict-label { font-size: .85rem; font-weight: 700; color: #9a3412; margin-bottom: .25rem; }
.verdict-value {
  font-size: 3rem;
  font-weight: 900;
  color: #ea580c;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.verdict-yen { font-size: 1.4rem; font-weight: 800; margin-left: 2px; }
.verdict-sub { font-size: .875rem; color: #57534e; margin-top: .4rem; font-weight: 600; }
.verdict-badge {
  display: inline-block;
  margin-top: .65rem;
  padding: .3rem .9rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}
.verdict-badge.ok   { background: #dcfce7; color: #15803d; }
.verdict-badge.warn { background: #fef9c3; color: #a16207; }
.verdict-badge.bad  { background: #fee2e2; color: #b91c1c; }
.verdict-badge:empty { display: none; }

/* 比較バー */
.compare-bars { display: flex; flex-direction: column; gap: .55rem; margin-bottom: .35rem; }
.compare-row {
  display: grid;
  grid-template-columns: 9.5rem 1fr 5.5rem;
  align-items: center;
  gap: .75rem;
}
.compare-label { font-size: .82rem; font-weight: 700; color: #44403c; text-align: right; }
.compare-row-ref .compare-label { color: #a8a29e; font-weight: 600; }
.compare-bar-wrap {
  height: 18px;
  background: #f5f5f4;
  border-radius: 999px;
  overflow: hidden;
}
.compare-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.bar-nominal { background: linear-gradient(90deg, #fb923c, #fdba74); }
.bar-real    { background: linear-gradient(90deg, #ea580c, #f97316); }
.bar-ref     { background: #d6d3d1; }
.compare-val { font-size: .85rem; font-weight: 800; color: #44403c; white-space: nowrap; }
.compare-row-ref .compare-val { color: #a8a29e; font-weight: 600; }

.serp-note {
  font-size: .76rem;
  color: #a8a29e;
  margin: .5rem 0 1.25rem;
  line-height: 1.6;
}

/* 内訳 */
.breakdown { margin-bottom: 1.25rem; }
.breakdown-title { font-size: .95rem; font-weight: 700; color: #44403c; margin-bottom: .65rem; }
.breakdown-list { display: flex; flex-direction: column; gap: .35rem; }
.bd-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr auto;
  align-items: center;
  gap: .6rem;
  padding: .35rem .5rem;
  border-radius: 8px;
}
.bd-row:hover { background: #fff7ed; }
.bd-label { font-size: .85rem; font-weight: 600; color: #1c1917; white-space: nowrap; }
.bd-bar-wrap { height: 8px; background: #f0efed; border-radius: 999px; overflow: hidden; }
.bd-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ea580c, #f97316); transition: width .4s; }
.bd-bar.unpaid { background: linear-gradient(90deg, #a8a29e, #d6d3d1); }
.bd-val { font-size: .82rem; font-weight: 700; color: #ea580c; white-space: nowrap; min-width: 4.5rem; text-align: right; }
.bd-row .bd-val.unpaid-val { color: #78716c; }

/* 年間換算 */
.yearly-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.yearly-item {
  text-align: center;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  padding: .85rem .5rem;
}
.yearly-val { display: block; font-size: 1.15rem; font-weight: 800; color: #c2410c; }
.yearly-key { display: block; font-size: .72rem; color: #9a3412; font-weight: 600; margin-top: .15rem; }

/* シェア */
.share-row { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.btn-share {
  background: none;
  border: 1.5px solid #e7e5e4;
  border-radius: 9px;
  padding: .55rem 1.3rem;
  font-size: .9rem;
  font-weight: 700;
  color: #57534e;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-share:hover { background: #f5f5f4; border-color: #d6d3d1; }
.btn-share-x {
  background: #1c1917;
  border-color: #1c1917;
  color: #fff;
}
.btn-share-x:hover { background: #44403c; border-color: #44403c; }

/* ─── 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.05rem; }
  .field-row { flex-direction: column; gap: 0; }
  .field-half { margin-bottom: 1rem; }
  .mini-grid-4 { grid-template-columns: 1fr 1fr; }
  .verdict-value { font-size: 2.4rem; }
  .compare-row { grid-template-columns: 7rem 1fr 4.5rem; gap: .5rem; }
  .compare-label { font-size: .72rem; }
  .compare-val { font-size: .78rem; }
  .bd-row { grid-template-columns: 7rem 1fr auto; }
  .yearly-grid { grid-template-columns: 1fr; }
  .scene-grid { grid-template-columns: 1fr; }
}

/* ━━━ 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; }
.faq-a a { color: #ea580c; }
