/* =========================================================================
 * Design tokens — copied from じぶん設計図/money-sim/life-money-sim.html
 * (:root block, L9-57). Same finance-calm palette across the product line.
 * ========================================================================= */
:root {
  --paper: #F3F1EB;
  --panel: #FFFFFF;
  --panel-soft: #EDEBE2;
  --panel-3: #E4E1D6;
  --ink: #1B1D22;
  --ink-2: #565B66;
  --ink-3: #5F6570;
  --line: #E1DED3;
  --hair: #EAE7DC;
  --accent: #26405F;
  --accent-2: #35577E;
  --accent-soft: #E6ECF3;
  --accent-ink: #1E3450;
  /* Text color for a SOLID --accent fill (buttons). Kept separate from
   * --accent-ink (which is tuned for --accent-soft backgrounds) because a
   * light-mode value that reads fine on --accent-soft can fail contrast on
   * solid --accent, and vice versa in dark mode where --accent itself
   * inverts from a dark navy to a light pastel blue. See hallmark audit
   * Critical #1 (2026-07-21): dark-mode --btn-primary text was #fff on
   * --accent #8FB2E0, contrast ~2.2:1 (WCAG AA needs 4.5:1). */
  --accent-fill-ink: #ffffff;
  --warn: #B0792B;
  --warn-soft: #F5EBD6;
  --warn-ink: #8A5E1C;
  --good: #3E7C5A;
  --good-soft: #E4EFE8;
  --danger: #A5544A;
  --danger-soft: #F3E4E1;
  --shadow: 0 1px 2px rgba(27,29,34,.05), 0 1px 1px rgba(27,29,34,.04);
  --shadow-lg: 0 20px 48px -22px rgba(27,29,34,.28), 0 4px 14px rgba(27,29,34,.06);
  --radius-lg: 18px; --radius-md: 13px; --radius-sm: 8px;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  --mono: "SFMono-Regular", "SF Mono", "Roboto Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101216; --panel: #1A1D22; --panel-soft: #21252B; --panel-3: #2A2F36;
    --ink: #EEF0F3; --ink-2: #A9AFB9; --ink-3: #9AA0AA;
    --line: #2B3038; --hair: #23272E;
    --accent: #8FB2E0; --accent-2: #A6C4EA; --accent-soft: #202E42; --accent-ink: #BAD3F4;
    --accent-fill-ink: #1E3450;
    --warn: #D9A55B; --warn-soft: #33291A; --warn-ink: #E8BE7C;
    --good: #6DBF95; --good-soft: #1B3527; --danger: #D08A81; --danger-soft: #35211E;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    --shadow-lg: 0 24px 54px -18px rgba(0,0,0,.6), 0 4px 16px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); }

/* ---- header / footer ---- */
.hub-header { border-bottom: 1px solid var(--line); background: var(--panel); }
.hub-header__inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.hub-logo { font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.hub-nav a { font-size: 13px; color: var(--ink-2); text-decoration: none; }
.hub-nav a:hover { color: var(--ink); }

.hub-main { max-width: 1080px; margin: 0 auto; padding: 0 20px 60px; }

.hub-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.hub-footer__inner { max-width: 1080px; margin: 0 auto; padding: 20px; font-size: 12px; color: var(--ink-2); }
.hub-footer__note { margin: 6px 0 0; color: var(--ink-3); }

/* ---- breadcrumb ---- */
.breadcrumb { font-size: 12.5px; color: var(--ink-3); padding: 18px 0 0; }
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-2); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
  border-radius: 999px; padding: 11px 22px; border: 1px solid var(--line);
  background: var(--panel-soft); color: var(--ink);
  transition: transform .12s var(--ease-out), background-color .15s var(--ease-out);
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fill-ink); }
.btn-primary:hover { background: var(--accent-2); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
/* Narrow phones (320-375px): the CTA label is long enough that even after
 * shortening it (see partials/cta.html) there is little margin left inside
 * .cta-card's padding, so shave a little off the button font-size there. */
@media (max-width: 380px) {
  .cta-card .btn-primary { font-size: 12.5px; padding: 11px 16px; }
}

/* ---- Aurora hero (LP) ---- */
.hero--aurora {
  position: relative; overflow: hidden;
  margin: 0 -20px 8px; padding: 72px 20px 56px; text-align: center;
  background:
    radial-gradient(60% 90% at 15% 0%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(50% 80% at 85% 10%, var(--good-soft) 0%, transparent 55%),
    var(--paper);
}
.hero__inner { max-width: 640px; margin: 0 auto; }
.hero__eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--accent-ink);
  background: var(--accent-soft); display: inline-block; padding: 5px 14px; border-radius: 999px;
  margin: 0 0 18px;
}
.hero__title { font-size: 38px; line-height: 1.3; font-weight: 800; letter-spacing: -.01em; margin: 0 0 16px; }
.hero__lead { font-size: 15px; color: var(--ink-2); margin: 0; }
@media (max-width: 560px) { .hero__title { font-size: 28px; } }

/* ---- bento grid (calc list) ---- */
.bento { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 28px 0; }
.bento__card {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 22px 20px; transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.bento__card--active:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.bento__card--soon { opacity: .55; }
.bento__card:focus-visible, .hub-nav a:focus-visible, .breadcrumb a:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px;
}
.bento__badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--accent-ink);
  background: var(--accent-soft); padding: 3px 9px; border-radius: 999px;
}
.bento__card h2 { font-size: 16px; margin: 12px 0 6px; }
.bento__card p { font-size: 13px; color: var(--ink-2); margin: 0 0 14px; }
.bento__cta { font-size: 13px; font-weight: 600; color: var(--accent-2); }

/* ---- calc page: cards / fields (pattern reused from life-money-sim) ---- */
.calc-head { padding: 18px 0 8px; }
.calc-head h1 { font-size: 24px; margin: 0 0 8px; }
.calc-lead { color: var(--ink-2); font-size: 13.5px; margin: 0; max-width: 640px; }

.calc-layout { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 18px; align-items: start; margin: 20px 0; }
@media (max-width: 820px) { .calc-layout { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 18px 18px 20px;
}
.card h2 { font-size: 14px; margin: 0 0 14px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.field input[type=number], .field select {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--panel-soft); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 10px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { min-height: 15px; font-size: 11.5px; color: var(--danger); margin: 5px 0 0; }
.field-help { font-size: 11.5px; color: var(--ink-3); margin: 0 0 6px; }
.field #usePensionAverageBtn { width: auto; margin-top: 8px; padding: 7px 14px; font-size: 12.5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggle-row { display: flex; gap: 16px; margin-top: 2px; }
.toggle-option { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.toggle-option input { cursor: pointer; }
.toggle-option input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

#calcBtn { width: 100%; margin-top: 6px; }

/* ---- result card (juicy: fade+rise on reveal) ---- */
.calc-result { opacity: 0; }
.calc-result.is-visible { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .calc-result.is-visible { animation: result-rise .42s var(--ease-out); }
}
@keyframes result-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--panel-soft); border-radius: var(--radius-md); padding: 12px 14px; border: 1px solid var(--hair); }
.stat .label { font-size: 11.5px; color: var(--ink-2); margin-bottom: 4px; }
.stat .value { font-size: 18px; font-weight: 700; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.stat--primary { background: var(--accent-soft); }
.stat--primary .value { color: var(--accent-ink); font-size: 21px; }
/* Compare mode: neutral signed-diff coloring (増加/減少を示すのみ、煽らない). */
.stat .value--good { color: var(--good); }
.stat .value--danger { color: var(--danger); }

.schedule-details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.table-wrap { max-height: 320px; overflow: auto; border: 1px solid var(--hair); border-radius: var(--radius-sm); margin-top: 10px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12px; font-family: var(--mono); }
table.data-table th, table.data-table td { padding: 5px 8px; border-bottom: 1px solid var(--hair); text-align: right; white-space: nowrap; }
table.data-table th { position: sticky; top: 0; background: var(--panel); color: var(--ink-2); }
table.data-table td:first-child, table.data-table th:first-child { text-align: left; }

/* ---- CTA card ---- */
.cta-card {
  background: var(--accent-soft); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px 22px 24px; margin: 24px 0; text-align: center;
}
.cta-card h2 { font-size: 17px; margin: 0 0 8px; color: var(--accent-ink); }
.cta-card p { font-size: 13px; color: var(--ink-2); max-width: 560px; margin: 0 auto 16px; }

/* ---- disclaimer ---- */
.disclaimer-box {
  background: var(--panel-soft); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 16px; font-size: 12px; color: var(--ink-2); line-height: 1.7; margin: 20px auto;
  max-width: 65ch;
}
.disclaimer-box strong { color: var(--ink); }

/* ---- ad slot (fixed dimensions — no CLS) ---- */
.ad-slot {
  margin: 22px auto; background: var(--panel-soft); border: 1px dashed var(--line);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 11px; contain: layout;
}
.ad-slot--leaderboard { width: 728px; max-width: 100%; height: 90px; }
.ad-slot--rect { width: 300px; height: 250px; }
@media (max-width: 480px) {
  .ad-slot--leaderboard { width: 320px; height: 100px; }
}
