@import url("https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@400;500;700;900&family=Archivo:wght@600;800;900&family=Roboto+Mono:wght@400;500&display=swap");

:root {
  --paper: #f1f2f4;
  --card: #ffffff;
  --ink: #14161a;
  --ink-soft: #4d5560;
  --navy: #1f3a5f;
  --navy-soft: #e7ecf3;
  --save: #0b6e4f;
  --save-soft: #e3f0ea;
  --alert: #b4432e;
  --rule: #c9cdd4;
  --rule-soft: #e3e5e9;
  --jp: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --num: "Archivo", "Zen Kaku Gothic New", sans-serif;
  --mono: "Roboto Mono", "SFMono-Regular", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161a;
    --card: #1c1f25;
    --ink: #eceef1;
    --ink-soft: #9aa3b0;
    --navy: #a8c4e6;
    --navy-soft: #232b38;
    --save: #4fd6a5;
    --save-soft: #16302a;
    --alert: #f0866c;
    --rule: #3a4149;
    --rule-soft: #2a3037;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--jp);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.75;
  background: var(--paper);
  color: var(--ink);
}

main, .site-header, footer { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ── ヘッダー:明細書のヘッダー罫 ───────────── */
.site-header {
  padding-top: 40px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 0;
}
.site-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.month-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--navy);
  background: var(--navy-soft);
  border-radius: 2px;
  padding: 3px 8px;
  margin-left: 12px;
  vertical-align: middle;
  white-space: nowrap;
}
.tagline {
  margin: 10px 0 0;
  font-size: 1.02rem;
  color: var(--ink-soft);
}
.updated {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}
.breadcrumb {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── セクション ───────────────────────────── */
section { margin: 44px 0; }
h1 + section, .answer-block:first-child { margin-top: 32px; }

h2 {
  font-size: 1.22rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 26px 0 8px;
}

main > h1 {
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 26px 0 0;
}

p { margin: 0 0 14px; }

/* ── 結論ブロック:紙に押した印 ────────────── */
.answer-block {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--navy);
  padding: 18px 22px;
  font-size: 1.05rem;
}
.answer-block p:last-child { margin-bottom: 0; }
.answer-block strong { font-weight: 900; }

/* ── 計算機 ───────────────────────────────── */
.calculator {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 24px 22px 26px;
}
.calculator h2 { margin-top: 0; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.presets button {
  font-family: var(--jp);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 7px 15px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.presets button:hover { border-color: var(--navy); color: var(--navy); }
.presets button.active {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-soft);
}
input, select {
  font-family: var(--num);
  font-weight: 600;
  font-size: 1.28rem;
  padding: 9px 12px;
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--rule);
  border-radius: 0;
  transition: border-color .12s;
}
select { font-family: var(--jp); font-size: 1rem; font-weight: 500; }
input:focus, select:focus {
  outline: none;
  border-bottom-color: var(--navy);
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
input[type="number"] { -moz-appearance: textfield; }

.input-with-unit { display: flex; gap: 8px; align-items: baseline; }
.input-with-unit select { width: auto; }
.unit {
  font-family: var(--jp);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}

.advanced { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--rule); }
.advanced summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--navy);
}
.advanced .field-grid { margin-top: 16px; }

.note {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 0;
}

/* ── 結果:年間差額が主役 ─────────────────── */
.result-summary {
  margin: 26px 0 0;
  padding: 20px 22px;
  background: var(--save-soft);
  border: 1px solid var(--save);
  font-size: 1.02rem;
  line-height: 1.7;
}
.result-summary strong {
  font-family: var(--num);
  font-weight: 900;
  font-size: 1.35em;
  letter-spacing: -0.02em;
  color: var(--save);
  font-variant-numeric: tabular-nums;
}
.result-summary .brand { font-family: var(--jp); font-size: 1.05em; color: var(--ink); }

.savings-hero {
  margin: 26px 0 0;
  padding: 24px 22px;
  background: var(--save-soft);
  border: 1px solid var(--save);
}
.savings-hero .label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--save);
  margin: 0 0 4px;
}
.savings-hero .amount {
  font-family: var(--num);
  font-weight: 900;
  font-size: clamp(2.6rem, 11vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--save);
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.savings-hero .amount .yen { font-size: 0.42em; margin-left: 4px; letter-spacing: 0; }
.savings-hero .detail { margin: 12px 0 0; font-size: 0.95rem; color: var(--ink); }
.savings-hero .detail .from { color: var(--alert); font-weight: 700; }
.savings-hero .detail .to { color: var(--save); font-weight: 700; }

/* ── ステップ入力:1画面完結 ─────────────── */
.step { display: none; }
.step.active { display: block; animation: stepIn .22s ease-out; }
@keyframes stepIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--navy);
  margin: 0 0 8px;
}
.step-q {
  font-size: clamp(1.35rem, 6vw, 1.75rem);
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  border: 0;
  padding: 0;
}
.big-field {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 3px solid var(--navy);
  padding-bottom: 4px;
}
.big-field input {
  flex: 1;
  min-width: 0;
  font-family: var(--num);
  font-weight: 900;
  font-size: clamp(2.4rem, 13vw, 3.4rem);
  letter-spacing: -0.03em;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.big-field input::placeholder { color: var(--rule); }
.big-field input:focus { outline: none; }
.big-unit { font-size: 1.05rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.step-hint { margin: 10px 0 0; font-size: 0.8rem; line-height: 1.6; color: var(--ink-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips button {
  font-family: var(--jp);
  font-size: 0.94rem;
  font-weight: 700;
  padding: 12px 18px;
  min-height: 46px;
  border: 1.5px solid var(--rule);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  flex: 1 1 auto;
  transition: border-color .12s, background .12s, color .12s;
}
.chips button:hover, .chips button.on { border-color: var(--navy); background: var(--navy); color: #fff; }

.step-nav { display: flex; gap: 10px; margin-top: 26px; }
.done .step-nav { display: none; }
.btn-primary {
  flex: 1;
  font-family: var(--jp);
  font-size: 1.02rem;
  font-weight: 900;
  padding: 15px 20px;
  min-height: 52px;
  border: 0;
  border-radius: 3px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost {
  font-family: var(--jp);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 13px 18px;
  min-height: 46px;
  border: 1.5px solid var(--rule);
  border-radius: 3px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }

/* ── 結果:年間差額を主役に ───────────────── */
.verdict {
  background: var(--save);
  color: #fff;
  padding: 26px 22px 22px;
  margin: 0 0 18px;
}
.verdict.flat { background: var(--navy); }
.v-label { margin: 0; font-size: 0.88rem; font-weight: 700; opacity: 0.9; }
.v-amount {
  font-family: var(--num);
  font-weight: 900;
  font-size: clamp(3rem, 15vw, 5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 6px 0 0;
  font-variant-numeric: tabular-nums;
}
.v-amount.small { font-size: clamp(1.6rem, 7vw, 2.2rem); letter-spacing: -0.02em; }
.v-amount .yen { font-size: 0.36em; margin-left: 6px; letter-spacing: 0; }
.v-sub { margin: 8px 0 0; font-size: 0.92rem; opacity: 0.94; line-height: 1.6; }
.v-five { margin: 16px 0 0; font-size: 0.9rem; opacity: 0.94; }
.v-five strong { font-family: var(--num); font-weight: 900; font-size: 1.2em; }

.bar-compare { margin: 20px 0 0; display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 5.4em 1fr 4.6em; align-items: center; gap: 9px; font-size: 0.8rem; }
.bar-name { opacity: 0.9; }
.bar { height: 12px; background: rgba(255,255,255,.22); border-radius: 2px; overflow: hidden; }
.fill { height: 100%; border-radius: 2px; }
.fill.base { background: rgba(255,255,255,.55); }
.fill.save { background: #fff; }
.bar-val { text-align: right; font-family: var(--num); font-weight: 800; font-variant-numeric: tabular-nums; }

.winner {
  background: var(--card);
  border: 2px solid var(--save);
  padding: 22px;
  margin-bottom: 26px;
}
.w-eyebrow {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--save);
}
.w-brand { margin: 6px 0 0; font-size: 1.5rem; font-weight: 900; letter-spacing: -0.02em; }
.w-plan { margin: 2px 0 0; font-size: 0.92rem; color: var(--ink-soft); }
.w-price { margin: 14px 0 0; display: flex; align-items: baseline; gap: 4px; }
.w-price .n {
  font-family: var(--num);
  font-weight: 900;
  font-size: clamp(2.6rem, 12vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--save);
  font-variant-numeric: tabular-nums;
}
.w-price .u { font-size: 1rem; font-weight: 700; color: var(--ink-soft); }
.w-specs { margin: 18px 0 0; display: grid; gap: 0; }
.w-specs > div {
  display: grid;
  grid-template-columns: 4.6em 1fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.88rem;
}
.w-specs > div:last-child { border-bottom: 0; }
.w-specs dt { margin: 0; font-weight: 700; color: var(--ink-soft); }
.w-specs dd { margin: 0; }
.w-src { margin: 14px 0 0; font-size: 0.78rem; color: var(--ink-soft); }

.next-steps { margin: 30px 0 0; padding: 20px 22px; background: var(--navy-soft); }
.next-steps h3 { margin: 0 0 12px; font-size: 1.04rem; font-weight: 900; }
.steps-list { margin: 0; padding-left: 1.3em; font-size: 0.9rem; line-height: 1.7; }
.steps-list li { margin-bottom: 7px; }
.next-steps p { margin: 12px 0 0; font-size: 0.9rem; }

/* ── 結果カード:スマホ基準 ───────────────── */
.results-head {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: 26px 0 10px;
}
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-card {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  grid-template-areas: "rank main price" ". meta meta";
  gap: 2px 10px;
  align-items: start;
  padding: 14px 4px;
  border-bottom: 1px solid var(--rule-soft);
}
.plan-card:first-child { border-top: 2px solid var(--ink); }
.plan-card.best { background: var(--save-soft); padding-left: 10px; padding-right: 10px; }
.rank {
  grid-area: rank;
  font-family: var(--num);
  font-weight: 900;
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.plan-card.best .rank { color: var(--save); }
.plan-main { grid-area: main; min-width: 0; }
.plan-brand {
  margin: 0;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.4;
}
.badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--save);
  border-radius: 2px;
  padding: 2px 6px;
  margin-left: 7px;
  vertical-align: 2px;
}
.plan-name { margin: 1px 0 0; font-size: 0.86rem; color: var(--ink-soft); line-height: 1.4; }
.plan-price { grid-area: price; text-align: right; white-space: nowrap; }
.monthly { margin: 0; font-size: 0.86rem; font-weight: 500; line-height: 1.3; }
.monthly .n {
  font-family: var(--num);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.plan-card.best .monthly .n { color: var(--save); }
.monthly .per { font-size: 0.78rem; color: var(--ink-soft); }
.annual {
  margin: 2px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--save);
  font-variant-numeric: tabular-nums;
}
.plan-meta {
  grid-area: meta;
  margin: 6px 0 0;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ── 表:明細 ─────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 18px 0; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
  background: var(--card);
}
th, td {
  border-bottom: 1px solid var(--rule-soft);
  padding: 11px 13px;
  text-align: right;
  white-space: nowrap;
  vertical-align: baseline;
}
td { font-family: var(--num); font-weight: 600; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
td:first-child, td:nth-child(2) { font-family: var(--jp); font-weight: 500; }
td small { font-family: var(--jp); font-weight: 400; color: var(--ink-soft); font-size: 0.76rem; }
thead th {
  font-family: var(--jp);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
  background: transparent;
}
tbody tr:last-child td { border-bottom: 0; }
tr.cheapest { background: var(--save-soft); }
tr.cheapest td { color: var(--save); font-weight: 800; }
tr.cheapest td:first-child, tr.cheapest td:nth-child(2) { color: var(--ink); font-weight: 700; }
td.cheapest { background: var(--save-soft); color: var(--save); font-weight: 800; }

/* ── FAQ・リスト ─────────────────────────── */
.faq details {
  border-bottom: 1px solid var(--rule-soft);
  padding: 14px 2px;
  background: transparent;
}
.faq details:first-of-type { border-top: 1px solid var(--rule-soft); }
.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "Q";
  font-family: var(--num);
  font-weight: 900;
  color: var(--navy);
  flex-shrink: 0;
}
.faq details[open] summary { color: var(--navy); }
.faq p { margin: 10px 0 2px 24px; font-size: 0.94rem; color: var(--ink-soft); }

.picks { margin: 0; }
.picks dt { font-weight: 700; margin-top: 18px; font-size: 1rem; }
.picks dt:first-child { margin-top: 0; }
.picks dt a { font-size: 1.06rem; }
.picks dd {
  margin: 5px 0 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--rule);
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.picks dd strong { color: var(--ink); }

.vs-list { columns: 2; column-gap: 28px; padding-left: 20px; font-size: 0.92rem; }
.vs-list li { margin-bottom: 5px; break-inside: avoid; }
@media (max-width: 640px) { .vs-list { columns: 1; } }

.sources ul, .policy ul, .article-links ul { padding-left: 20px; font-size: 0.92rem; }
.sources li, .policy li { margin-bottom: 7px; }

/* ── 共有 ─────────────────────────────────── */
.share { display: flex; gap: 10px; align-items: center; margin: 18px 0 0; flex-wrap: wrap; }
.share button, .share a {
  font-family: var(--jp);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 9px 18px;
  border: 1.5px solid var(--navy);
  border-radius: 2px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.share button:hover, .share a:hover { background: var(--navy); color: #fff; }

/* ── 広告枠・ポリシー ─────────────────────── */
.aff-slot {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 20px 22px;
}
.aff-slot .note { margin-bottom: 10px; font-weight: 700; color: var(--alert); }
.aff-slot ul { padding-left: 20px; }

.policy {
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  padding-top: 22px;
}
.policy h2 { font-size: 1rem; border: 0; padding: 0; margin-bottom: 10px; }

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

footer {
  border-top: 2px solid var(--ink);
  margin-top: 52px;
  padding-top: 18px;
  padding-bottom: 44px;
}
footer p {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-soft);
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
