/* ふるさと納税のものさし — ふるさと納税 控除上限額シミュレーター
   設計: 白いワークシート（入力）と、墨色の計器（結果）。アクセントはコバルト1色、計器の針だけ琥珀色。 */

:root {
  --ink: #141B26;
  --ink-2: #4A5565;
  --ink-3: #5F6B7A;
  --line: #E1E5EA;
  --line-2: #C9D0D9;
  --paper: #F2F4F6;
  --surface: #FFFFFF;
  --accent: #2348C9;
  --accent-ink: #1A389E;
  --accent-soft: #EAEFFC;
  --amber: #F0B429;
  --danger: #B42318;
  --on-ink: #FFFFFF;
  --on-ink-2: #AEB8C6;
  --on-ink-line: rgba(255, 255, 255, .12);

  --r-ctrl: 10px;
  --r-box: 16px;
  --r-card: 20px;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);

  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .02em;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: 0; }
h1, h2, h3 { font-feature-settings: "palt"; letter-spacing: .03em; }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }

.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ---------- 上部 ---------- */
.disclosure-strip .wrap { display: block; }
.disclosure-strip { margin: 0; background: #E6EAEE; color: var(--ink-2); font-size: 12px; line-height: 1.5; padding: 6px 0; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .08em; }
.top-nav { display: flex; gap: 4px; }
.top-nav a { color: var(--ink-2); text-decoration: none; font-size: 13px; padding: 6px 8px; border-radius: 8px; white-space: nowrap; }
.top-nav a:first-child { display: none; }
.brand-name { white-space: nowrap; }
.brand-pre { display: block; font-size: 10px; font-weight: 600; letter-spacing: .06em; line-height: 1.1; color: var(--ink-2); }
.brand-main { display: block; line-height: 1.1; }
.top-nav a:hover { color: var(--ink); background: var(--paper); }

/* ---------- ヒーロー ---------- */
.hero { padding-top: 28px; padding-bottom: 20px; }
.hero-kicker { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge-year { display: inline-block; background: var(--ink); color: #fff; font-weight: 600; font-size: 12px; padding: 2px 9px; border-radius: 6px; }
.hero h1 { margin: 0 0 12px; font-size: 27px; line-height: 1.4; font-weight: 700; }
.hero-lead { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; max-width: 40em; }
.trust { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
.trust li { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.br-sp { display: inline; }

/* ---------- シミュレーター ---------- */
.app { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "result" "more"; gap: 16px; align-items: start; padding-bottom: 8px; }
.panel-main { grid-area: main; }
.result { grid-area: result; }
.panel-more { grid-area: more; }
.next-wrap { margin-top: 16px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); margin: 0; }
.group { padding: 22px 18px; border-top: 1px solid var(--line); }
.group:first-of-type { border-top: 0; }
.group-head { margin-bottom: 14px; }
.g-title { display: block; font-size: 16px; font-weight: 700; line-height: 1.5; }
.g-help { margin: 4px 0 0; font-size: 13px; line-height: 1.65; color: var(--ink-3); }

/* 年収 */
.income-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 10px; align-items: center; }
.money-field { position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-ctrl); transition: border-color 150ms ease, box-shadow 150ms ease; }
.money-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.money-field input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font: inherit; font-size: 17px; padding: 11px 0 11px 14px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: 0; outline: none; }
.money-field .unit { padding: 0 14px 0 6px; color: var(--ink-3); font-size: 14px; white-space: nowrap; }
.money-field.big input { font-size: 30px; font-weight: 700; padding: 8px 0 8px 14px; text-align: right; }
.money-field.big .unit { font-size: 15px; color: var(--ink-2); }
.money-field input::placeholder { color: #737E8C; font-size: 15px; }
input[aria-invalid="true"] { color: var(--danger); }
.money-field:has(input[aria-invalid="true"]) { border-color: var(--danger); }
.money-field:has(input[aria-invalid="true"]):focus-within { box-shadow: 0 0 0 3px #FDE8E6; }

.step-btn { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-ctrl); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: transform 140ms var(--ease-out), background-color 150ms ease, border-color 150ms ease; }
.step-btn svg { width: 16px; height: 16px; }
.step-btn:active { transform: scale(.95); background: var(--paper); }
.step-btn.sm { width: 38px; height: 38px; }
@media (hover: hover) and (pointer: fine) {
  .step-btn:hover { background: var(--paper); border-color: #B3BCC8; }
}

/* スライダー（ものさし） */
.ruler { margin-top: 18px; }
.ruler input[type="range"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; --p: 21%; }
.ruler input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--accent) 0 var(--p), var(--line) var(--p) 100%); }
.ruler input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line); }
.ruler input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
.ruler input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; border: 1px solid #B3BCC8; box-shadow: 0 1px 2px rgba(20, 27, 38, .18), 0 3px 8px rgba(20, 27, 38, .10); transition: transform 140ms var(--ease-out); }
.ruler input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid #B3BCC8; box-shadow: 0 1px 2px rgba(20, 27, 38, .18), 0 3px 8px rgba(20, 27, 38, .10); }
.ruler input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.08); }
.ruler input[type="range"]:focus-visible { outline: none; }
.ruler input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 6px var(--accent); }
.ruler input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 6px var(--accent); }
.ruler-scale { position: relative; height: 26px; margin: 4px 13px 0; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums;
  background: repeating-linear-gradient(to right, var(--line-2) 0 1px, transparent 1px calc(100% / 19)) top left / calc(100% + 1px) 5px no-repeat; }
.ruler-scale span { position: absolute; top: 8px; transform: translateX(-50%); white-space: nowrap; }
.ruler-scale span:nth-child(1) { left: 0; }
.ruler-scale span:nth-child(2) { left: 21.05%; }
.ruler-scale span:nth-child(3) { left: 47.37%; }
.ruler-scale span:nth-child(4) { left: 73.68%; }
.ruler-scale span:nth-child(5) { left: 100%; transform: translateX(-80%); }

.err { margin: 8px 0 0; font-size: 13px; color: var(--danger); line-height: 1.5; }
.err:empty { display: none; }

/* セグメント */
.seg { display: grid; gap: 4px; padding: 4px; background: var(--paper); border-radius: 12px; border: 1px solid var(--line); }
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg label { position: relative; display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; padding: 8px 4px; border-radius: 9px; text-align: center; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink-2); transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease; }
.seg small { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 27, 38, .10), 0 0 0 1px rgba(20, 27, 38, .07); }
.seg input:checked + span small { color: var(--ink-2); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) {
  .seg input:not(:checked) + span:hover { color: var(--ink); background: rgba(255, 255, 255, .55); }
}

/* 人数ステッパー */
.steppers { list-style: none; margin: 0; padding: 0; }
.steppers li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.steppers li:first-child { border-top: 0; padding-top: 0; }
.steppers li:last-child { padding-bottom: 0; }
.steppers label { font-size: 15px; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper input { width: 46px; height: 38px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: center; font: inherit; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: 0; }
.stepper input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stepper .unit-s { font-size: 13px; color: var(--ink-3); min-width: 1.2em; }
.stepper.wide input { width: 56px; }

/* 詳細 */
.more { border-top: 0; }
.more summary { list-style: none; position: relative; display: block; padding: 18px 52px 18px 18px; cursor: pointer; border-radius: var(--r-box); }
.more[open] summary { border-radius: var(--r-box) var(--r-box) 0 0; border-bottom: 1px solid var(--line); }
.more summary::-webkit-details-marker { display: none; }
.more-title { display: block; font-weight: 700; color: var(--accent); font-size: 15px; }
.more-sub { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.more .chev { position: absolute; right: 18px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--accent); transition: transform 200ms var(--ease-out); }
.more[open] .chev { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .more summary:hover { background: #FAFBFC; } }
.more-body { padding: 6px 18px 22px; }
.field { padding-top: 18px; }
.field > label, .f-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.hint { margin: 8px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }
.hint output { color: var(--ink); font-weight: 600; }

/* ---------- 結果（計器） ---------- */
.result { position: relative; }
.result-card { background: var(--ink); color: var(--on-ink); border-radius: var(--r-card); padding: 22px 20px 6px; box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 12px 32px -12px rgba(20, 27, 38, .45); }
.result-card :focus-visible { outline-color: #9DB2FF; }
.r-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.r-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--on-ink-2); letter-spacing: .04em; }
.r-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--on-ink-2); white-space: nowrap; }
.r-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.r-amount { margin: 6px 0 0; display: flex; align-items: baseline; gap: 6px; line-height: 1.1; }
.r-amount .num { font-size: 52px; font-weight: 700; letter-spacing: -.01em; }
.r-yen { font-size: 20px; font-weight: 600; }
.r-note { margin: 10px 0 0; font-size: 13px; line-height: 1.6; color: var(--on-ink-2); }
.result.is-invalid .r-amount { opacity: .35; }

.split { margin-top: 20px; }
.split-bar { display: flex; height: 10px; gap: 2px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.split-bar i { display: block; height: 100%; transition: width 380ms var(--ease-out); }
.s-self { background: #6A7585; width: var(--w-self, 4%); }
.s-it { background: #7F9BFF; width: var(--w-it, 9%); }
.s-basic { background: #C6D2FF; width: var(--w-basic, 18%); }
.s-special { background: var(--amber); width: var(--w-special, 69%); }
.split-cap { margin: 10px 0 6px; font-size: 12px; color: var(--on-ink-2); }
.split-legend { margin: 0; display: grid; gap: 2px; }
.split-legend div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; line-height: 1.7; }
.split-legend dt { display: inline-flex; align-items: center; gap: 8px; color: #DCE2EA; }
.split-legend dd { margin: 0; color: #fff; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.split-foot { margin: 8px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--on-ink-2); }

.r-facts { margin: 18px 0 0; border-top: 1px solid var(--on-ink-line); }
.r-facts div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--on-ink-line); font-size: 13px; }
.r-facts dt { color: var(--on-ink-2); }
.r-facts dd { margin: 0; color: #fff; text-align: right; white-space: nowrap; }
.r-warn { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(240, 180, 41, .12); color: #FBE2A4; font-size: 12.5px; line-height: 1.7; }
.r-next { margin-top: 8px; display: grid; }
.r-link { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px 22px 12px 0; position: relative; font-size: 13px; font-weight: 600; color: #C9D5FF; text-decoration: none; cursor: pointer; border-top: 1px solid var(--on-ink-line); }
.r-next .r-link:first-child { border-top: 0; }
.r-link::after { content: ""; position: absolute; right: 4px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-right: 1.6px solid currentColor; border-top: 1.6px solid currentColor; transform: rotate(45deg); }
.r-link:hover { color: #fff; }
.r-private { display: flex; gap: 8px; align-items: flex-start; margin: 12px 4px 0; font-size: 12px; line-height: 1.6; color: var(--ink-2); }
.r-private svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--ink-2); }

/* ---------- 広告 ---------- */
.sponsor { margin-top: 40px; }
.sponsor-inner { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: 12px; background: #FAFBFC; }
.pr-tag { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 4px; padding: 1px 6px; line-height: 1.5; margin-top: 2px; }
.sponsor p { margin: 0; font-size: 14px; }
.sponsor .sponsor-label { font-size: 11.5px; color: var(--ink-3); margin-bottom: 2px; }
.sponsor .sponsor-note { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.sponsor-inline { margin: 40px 0; padding: 0; }

/* ---------- 読み物 ---------- */
.reading { margin-top: 48px; padding-bottom: 64px; }
.toc { display: none; }
.prose { max-width: 680px; }
.prose .prose-intro { margin: 0 0 8px; font-size: 13px; line-height: 1.8; color: var(--ink-3); }
.prose section { padding-top: 36px; margin-top: 36px; border-top: 1px solid var(--line-2); }
.prose section:first-of-type { margin-top: 16px; }
.prose h2 { margin: 0 0 16px; font-size: 22px; line-height: 1.45; font-weight: 700; }
.prose h3 { margin: 32px 0 10px; font-size: 17px; line-height: 1.5; font-weight: 700; }
.prose p, .prose li, .prose dd { font-size: 16px; line-height: 1.95; }
.prose p { margin: 0 0 16px; }
.prose ul { margin: 0 0 16px; padding-left: 1.2em; }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--ink-3); }

.formula { margin: 20px 0 24px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.formula figcaption { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.formula p { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.8; font-variant-numeric: tabular-nums; }

.t { width: 100%; border-collapse: collapse; margin: 8px 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14.5px; line-height: 1.7; }
.t th, .t td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.t tr:first-child th, .t tr:first-child td { border-top: 0; }
.t th { width: 7.5em; font-weight: 600; color: var(--ink-2); background: #FAFBFC; white-space: nowrap; }

.defs { margin: 8px 0 16px; }
.defs dt { font-weight: 700; margin-top: 16px; }
.defs dt::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); margin-right: 10px; vertical-align: middle; }
.defs dd { margin: 4px 0 0 16px; }

.example { margin: 20px 0 24px; padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.example-cap { margin: 0 0 12px !important; font-size: 13px !important; color: var(--ink-2); line-height: 1.6 !important; }
.example-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.example-row > div { display: flex; flex-direction: column; }
.ex-k { font-size: 12px; color: var(--ink-3); }
.ex-v { font-size: 24px; font-weight: 700; line-height: 1.3; }
.ex-s { font-size: 12px; color: var(--ink-2); }
.ex-diff { grid-column: 1 / -1; flex-direction: row !important; align-items: baseline; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.ex-diff .ex-v { font-size: 17px; color: var(--accent-ink); }

.compare { display: grid; gap: 12px; margin: 8px 0 20px; }
.compare > div { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.compare h3 { margin: 0 0 6px; font-size: 16px; }
.compare p { margin: 0; font-size: 15px; line-height: 1.85; }

.faq { border-top: 1px solid var(--line-2); }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq summary { list-style: none; position: relative; cursor: pointer; padding: 16px 40px 16px 0; font-weight: 700; font-size: 16px; line-height: 1.6; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 14px; height: 1.8px; background: var(--ink-2); border-radius: 2px; transition: transform 200ms var(--ease-out); }
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq details p { margin: 0 0 18px; color: var(--ink-2); }

.basis { margin: 0 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.basis div { padding: 14px 18px; border-top: 1px solid var(--line); }
.basis div:first-child { border-top: 0; }
.basis dt { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.basis dd { margin: 2px 0 0; font-size: 15px !important; line-height: 1.8 !important; }
.assume li { font-size: 14.5px !important; line-height: 1.85 !important; color: var(--ink-2); overflow-wrap: anywhere; }

/* ---------- フッター ---------- */
.foot { background: var(--ink); color: #D5DBE3; padding: 36px 0 40px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; letter-spacing: .08em; font-size: 16px; }
.foot-brand span { white-space: nowrap; }
.foot-meta { margin: 18px 0 0; display: grid; gap: 4px; font-size: 13px; }
.foot-meta div { display: flex; gap: 12px; }
.foot-meta dt { color: var(--on-ink-2); min-width: 6.5em; }
.foot-meta dd { margin: 0; }
.foot-legal { margin: 18px 0 0; font-size: 12px; line-height: 1.8; color: var(--on-ink-2); max-width: 48em; }

/* ---------- スマホ：追従バーとシート ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 0 10px calc(10px + env(safe-area-inset-bottom)); transform: translateY(120%); transition: transform 260ms var(--ease-drawer); pointer-events: none; }
.dock.is-on { transform: translateY(0); pointer-events: auto; }
.dock-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 10px 10px 18px; box-shadow: 0 10px 30px -8px rgba(20, 27, 38, .55); }
.dock-val { display: flex; flex-direction: column; line-height: 1.2; cursor: pointer; }
.dock-k { font-size: 11px; color: var(--on-ink-2); }
.dock-n { font-size: 24px; font-weight: 700; }
.dock-n small { font-size: 13px; font-weight: 600; margin-left: 3px; }
.dock-btn { flex: none; border: 0; border-radius: 11px; background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; padding: 11px 16px; cursor: pointer; transition: transform 140ms var(--ease-out); }
.dock-btn:active { transform: scale(.96); }

.sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 560px; max-height: 88vh; max-height: 88dvh; overflow: auto; border: 0; padding: 0 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--ink); color: #fff; transform: translateY(0); transition: transform 300ms var(--ease-drawer), overlay 300ms allow-discrete, display 300ms allow-discrete; overscroll-behavior: contain; }
@starting-style { .sheet[open] { transform: translateY(100%); } }
.sheet.is-closing { transform: translateY(100%); transition-duration: 200ms; transition-timing-function: ease-out; }
.sheet::backdrop { background: rgba(10, 14, 20, .5); transition: opacity 300ms ease; }
.sheet.is-closing::backdrop { opacity: 0; }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); margin: 10px auto 4px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 4px; }
.sheet-head h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--on-ink-2); }
.sheet-close { width: 40px; height: 40px; border: 0; background: rgba(255, 255, 255, .08); border-radius: 50%; color: #fff; display: grid; place-items: center; cursor: pointer; margin-right: -4px; }
.sheet-close svg { width: 16px; height: 16px; }
.sheet :focus-visible { outline-color: #9DB2FF; }
.sheet-body .r-link { border-top: 1px solid var(--on-ink-line); margin-top: 8px; }


/* ---------- 画面幅：中 ---------- */
@media (min-width: 600px) {
  .wrap { padding: 0 32px; }
  .top-nav a:first-child { display: inline; }
  .hero h1 { font-size: 34px; }
  .br-sp { display: none; }
  .group { padding: 26px 28px; }
  .more summary { padding-left: 28px; padding-right: 60px; }
  .more .chev { right: 28px; }
  .more-body { padding: 6px 28px 26px; }
  .result-card { padding: 26px 28px 8px; }
  .compare { grid-template-columns: 1fr 1fr; }
}

/* ---------- 画面幅：PC ---------- */
@media (min-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "main result" "more result"; column-gap: 28px; row-gap: 16px; }
  .result { align-self: start; }
  .r-cond { display: none; }
  .top-nav a { font-size: 14px; padding: 6px 12px; }
  .hero { padding-top: 48px; padding-bottom: 32px; }
  .hero h1 { font-size: 40px; line-height: 1.35; }
  .hero-lead { font-size: 16px; }
  .r-amount .num { font-size: 60px; }
  .sheet { display: none; }
  /* PC：上限額が画面外に出たら、結果の列の下端に小さな追従カードを出す */
  .dock { left: auto; right: calc(max(0px, (100vw - 1160px) / 2) + 32px); width: 400px; padding: 0 0 20px; }
  .dock-inner { padding: 12px 12px 12px 20px; border-radius: 16px; }
  .dock-n { font-size: 26px; }
  .reading { display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 56px; margin-top: 64px; }
  .toc { display: block; position: sticky; top: 24px; align-self: start; padding-top: 4px; }
  .toc-title { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .08em; }
  .toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
  .toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 14px; color: var(--ink-2); text-decoration: none; line-height: 1.5; }
  .toc a:hover { color: var(--ink); border-left-color: var(--ink-3); }
  .foot-inner { display: grid; grid-template-columns: 220px 1fr; column-gap: 56px; }
  .foot-meta { margin-top: 0; }
  .foot-legal { grid-column: 2; }
}

@media (min-width: 960px) and (min-height: 1000px) {
  .result { position: sticky; top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .split-bar i { transition: none !important; }
  @starting-style { .sheet[open] { transform: none; } }
}
.prose .sponsor p { margin: 0; font-size: 14px; line-height: 1.75; }
.prose .sponsor .sponsor-label { font-size: 11.5px; margin-bottom: 2px; }
.r-amount.is-long .num { font-size: 42px; }
@media (min-width: 960px) { .r-amount.is-long .num { font-size: 48px; } }

/* ---------- 文節での改行 ---------- */
h1, h2, h3, .hero-lead, .trust li, .g-help, .hint, .err, .seg span, .r-example, .r-note, .r-warn, .split-cap, .split-foot, .r-formula, .r-basis dd, .r-private, .faq summary, .sponsor p, .example-cap, .more-sub { word-break: auto-phrase; }

/* ---------- 年収の早選び ---------- */
.quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.quick button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 0; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; letter-spacing: 0; touch-action: manipulation; transition: transform 140ms var(--ease-out), background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
.quick button:active { transform: scale(.96); }
.quick button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (hover: hover) and (pointer: fine) { .quick button:not([aria-pressed="true"]):hover { border-color: #9AA5B3; color: var(--ink); } }
@media (max-width: 599px) { .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); } .quick button { padding: 8px 0; } }
@media (max-width: 959px) { .r-facts-social { display: none !important; } }

/* ---------- 結果カードの追加要素 ---------- */
.r-example { margin: 12px 0 0; padding: 7px 10px; border-radius: 8px; background: rgba(240, 180, 41, .14); color: #FBE2A4; font-size: 12.5px; line-height: 1.6; }
.r-example[hidden] { display: none; }
.r-note span { display: block; }
.r-sub { margin: 20px 0 0; font-size: 12px; font-weight: 600; color: var(--on-ink-2); letter-spacing: .04em; }
.r-cond dl { margin: 6px 0 0; border-top: 1px solid var(--on-ink-line); }
.r-cond dl div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--on-ink-line); font-size: 13px; }
.r-cond dt { color: var(--on-ink-2); flex: none; }
.r-cond dd { margin: 0; display: flex; align-items: center; gap: 10px; text-align: right; color: #fff; }
.edit-btn { flex: none; border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: #C9D5FF; border-radius: 8px; font-size: 12px; font-weight: 600; padding: 5px 10px; cursor: pointer; transition: transform 140ms var(--ease-out), background-color 150ms ease; }
.edit-btn:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .edit-btn:hover { background: rgba(255, 255, 255, .08); } }
.r-sub-facts + .r-facts { margin-top: 6px; }
.r-formula { margin: 12px 0 0; font-size: 12px; line-height: 1.7; color: var(--on-ink-2); font-variant-numeric: tabular-nums; }
.r-formula a { color: #C9D5FF; white-space: nowrap; margin-left: 4px; }
.result-card { padding-bottom: 22px; }
.r-basis { margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: grid; gap: 6px; }
.r-basis div { display: grid; grid-template-columns: 2.6em 1fr; gap: 8px; font-size: 12px; line-height: 1.65; }
.r-basis dt { font-weight: 700; color: var(--ink-2); }
.r-basis dd { margin: 0; color: var(--ink-2); }

/* ---------- 次にすること ---------- */
.next { margin-top: 0; padding: 22px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); }
.next-title { margin: 0 0 14px; font-size: 18px; font-weight: 700; }
.next-list { list-style: none; margin: 0; padding: 0; counter-reset: nx; display: grid; gap: 0; }
.next-list li { position: relative; padding: 14px 0 14px 40px; border-top: 1px solid var(--line); counter-increment: nx; }
.next-list li:first-child { border-top: 0; padding-top: 2px; }
.next-list li::before { content: counter(nx); position: absolute; left: 0; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.next-list li:first-child::before { top: 2px; }
.next-list h3 { margin: 0 0 4px; font-size: 15.5px; line-height: 1.6; }
.next-list p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--ink-2); }
.next-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.next-link svg { width: 14px; height: 14px; }
.next-link:hover { color: var(--accent-ink); text-decoration: underline; }
.next-wrap + .sponsor { margin-top: 16px; }

/* ---------- 早見表 ---------- */
.t-scroll { overflow-x: auto; margin: 8px 0 20px; -webkit-overflow-scrolling: touch; }
.t-quick { margin: 0; font-variant-numeric: tabular-nums; }
.t-quick thead th { background: var(--paper); font-size: 12.5px; color: var(--ink-2); font-weight: 600; line-height: 1.4; white-space: normal; width: auto; }
.t-quick thead th small { display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); }
.t-quick td, .t-quick th { padding: 10px 12px; }
.t-quick td { text-align: right; white-space: nowrap; }
.t-quick tbody th { width: auto; white-space: nowrap; }
.t-quick tbody tr:nth-child(3) { background: #F7F9FF; }

@media (min-width: 600px) {
  .next { padding: 26px 28px; }
  .next-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .next-list li, .next-list li:first-child { border-top: 0; padding: 40px 0 0 0; }
  .next-list li::before, .next-list li:first-child::before { top: 0; }
}

.result.is-invalid .r-yen { visibility: hidden; }
.dock.is-invalid .dock-n small { display: none; }
.t-quick thead th:not(:first-child) { text-align: right; }
.nw { white-space: nowrap; }

/* 早見表：390px（表示枠350px）に収める */
@media (max-width: 599px) {
  .t-quick { font-size: 13px; letter-spacing: 0; }
  .t-quick td, .t-quick th { padding: 9px 6px; }
  .t-quick thead th { font-size: 11.5px; }
  .t-quick tbody th { font-size: 12.5px; }
}
/* 入力した条件：長い値は右寄せで折り返す */
.r-cond dd > span:first-child { flex: 1; text-align: right; line-height: 1.5; }
.r-cond dd { flex: 1; justify-content: flex-end; min-width: 0; }
/* 「次にすること」の上に乗っているときは、下からせり上がらずその場でフェードする（移動中に下の要素と重ならないように） */
.dock { transition: transform 260ms var(--ease-drawer), opacity 200ms ease; }
.dock.is-lifted { transition: opacity 160ms ease; }
.dock.is-lifted:not(.is-on), .dock.is-lifted.is-on { transform: none; }

/* ---------- フッターのリンク ---------- */
.foot-links { margin: 14px 0 0; font-size: 13px; }
.foot-links a { color: #C9D5FF; }
.foot-links a:hover { color: #fff; }
@media (min-width: 960px) { .foot-links { grid-column: 2; } }

/* ---------- 文書ページ（プライバシーポリシーなど） ---------- */
.doc { padding-top: 24px; padding-bottom: 72px; }
.crumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin-bottom: 20px; }
.crumb a { color: var(--ink-2); }
.doc-head, .doc-summary, .doc-body { max-width: 720px; }
.doc-head h1 { margin: 0 0 12px; font-size: 27px; line-height: 1.4; font-weight: 700; }
.doc-lead { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; line-height: 1.85; }
.doc-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 13px; color: var(--ink-2); }
.doc-meta div { display: flex; gap: 8px; }
.doc-meta dt { color: var(--ink-3); }
.doc-meta dd { margin: 0; }
.doc-summary { margin: 28px 0 8px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; }
.doc-summary-title { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: .06em; }
.doc-summary ul { margin: 0; padding-left: 1.2em; }
.doc-summary li { font-size: 14.5px; line-height: 1.85; margin-bottom: 2px; }
.doc-summary li::marker { color: var(--ink-3); }
.doc-body section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line-2); }
.doc-body h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; font-size: 21px; line-height: 1.45; font-weight: 700; }
.sec-no { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; transform: translateY(-2px); }
.doc-body p, .doc-body li { font-size: 16px; line-height: 1.95; }
.doc-body p { margin: 0 0 14px; }
.doc-body ul { margin: 0 0 16px; padding-left: 1.2em; }
.doc-body li { margin-bottom: 8px; }
.doc-body li::marker { color: var(--ink-3); }
.doc-contact { margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.doc-contact div { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.7; }
.doc-contact div:first-child { border-top: 0; }
.doc-contact dt { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.doc-contact dd { margin: 0; overflow-wrap: anywhere; }
.doc-contact dd[data-site="contact"], .foot-meta dd[data-site="contact"] { overflow-wrap: normal; word-break: normal; }
.doc-back { margin-top: 40px !important; }
.doc-body li, .doc-body p, .doc-lead, .doc-summary li { overflow-wrap: anywhere; }
.doc-head h1, .doc-body h2, .doc-lead, .doc-summary li, .doc-body p, .doc-body li { word-break: auto-phrase; }
@media (min-width: 600px) {
  .doc { padding-top: 32px; }
  .doc-head h1 { font-size: 34px; }
  .doc-summary { padding: 20px 24px; }
}
@media (min-width: 960px) { .doc { padding-top: 40px; } }
