/* ============================================================
   FIRE Simulator — Refresh design system
   ============================================================ */
/* Webフォントは index.html の <link rel="stylesheet"> で並列読込（@import の直列ロードを回避） */

:root {
  /* Warm neutral base */
  --paper:        oklch(0.984 0.006 75);
  --paper-2:      oklch(0.965 0.009 73);
  --card:         oklch(0.998 0.003 80);
  --ink:          oklch(0.235 0.018 55);
  --ink-soft:     oklch(0.45 0.02 55);
  --ink-faint:    oklch(0.62 0.018 60);
  --line:         oklch(0.905 0.012 70);
  --line-soft:    oklch(0.935 0.009 72);

  /* Ember brand */
  --ember:        oklch(0.648 0.178 41);   /* ~#EA580C */
  --ember-deep:   oklch(0.52 0.155 38);
  --ember-bright: oklch(0.74 0.165 55);
  --ember-tint:   oklch(0.955 0.022 60);
  --ember-tint-2: oklch(0.92 0.04 58);

  /* Sage — "survival / safe" */
  --sage:         oklch(0.60 0.072 158);
  --sage-deep:    oklch(0.46 0.06 158);
  --sage-tint:    oklch(0.95 0.022 158);

  /* Danger — destructive */
  --danger:       oklch(0.575 0.15 26);
  --danger-tint:  oklch(0.955 0.025 28);

  /* Data-viz semantics */
  --gold:         oklch(0.72 0.13 78);
  --cash:         oklch(0.60 0.105 242);
  --cash-tint:    oklch(0.95 0.03 242);

  /* Hero ink (deep warm charcoal) */
  --hero-bg:      oklch(0.215 0.022 48);
  --hero-bg-2:    oklch(0.27 0.035 42);
  --hero-line:    oklch(0.42 0.03 50);

  --radius:   18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow-sm: 0 1px 2px oklch(0.4 0.03 50 / 0.05), 0 2px 8px oklch(0.4 0.03 50 / 0.04);
  --shadow:    0 2px 6px oklch(0.4 0.03 50 / 0.05), 0 12px 32px oklch(0.4 0.03 50 / 0.07);
  --shadow-lg: 0 4px 12px oklch(0.4 0.03 50 / 0.07), 0 24px 60px oklch(0.4 0.03 50 / 0.12);

  --sans: "Noto Sans JP", system-ui, sans-serif;
  --display: "Noto Sans JP", system-ui, sans-serif;
  --mono: "Space Grotesk", "Noto Sans JP", sans-serif;

  --maxw: 1140px;
}

html.dark {
  --paper:    oklch(0.205 0.018 50);
  --paper-2:  oklch(0.24 0.022 48);
  --card:     oklch(0.255 0.02 50);
  --ink:      oklch(0.95 0.01 75);
  --ink-soft: oklch(0.78 0.014 70);
  --ink-faint: oklch(0.64 0.016 65);
  --line:     oklch(0.36 0.018 52);
  --line-soft: oklch(0.31 0.016 52);
  --ember-tint:  oklch(0.32 0.04 50);
  --ember-tint-2: oklch(0.38 0.06 48);
  --sage-tint:   oklch(0.30 0.03 158);
  --danger-tint: oklch(0.33 0.05 28);
  --gold:        oklch(0.80 0.135 80);
  --cash:        oklch(0.70 0.11 242);
  --cash-tint:   oklch(0.33 0.05 242);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* スクリーンリーダー専用（視覚非表示・レイアウトに影響しない）*/
.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

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

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember);
}

.num { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
}

/* ===== クイック固定バー（スクロール時の操作バー）===== */
.quick-bar {
  position: fixed; left: 0; right: 0; top: var(--header-h, 64px); z-index: 45;
  background: color-mix(in oklch, var(--card) 90%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(20, 15, 10, .06);
  transform: translateY(-130%); opacity: 0; pointer-events: none;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), opacity .2s;
}
.quick-bar.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.quick-inner { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 10px 28px; }
.qb-actions { display: flex; gap: 14px; flex-shrink: 0; }
.qb-detail { gap: 7px; }
/* 詳細・実行ボタンを同サイズに（.run-btn の height:50px 等を上書き）。PCでは見栄え重視でやや大きめ */
.quick-bar .qb-history, .quick-bar .qb-detail, .quick-bar .qb-run { height: auto; min-width: 124px; padding: 12px 28px; font-size: 14.5px; border-radius: 999px; }
.quick-bar .qb-history svg, .quick-bar .qb-detail svg, .quick-bar .qb-run svg { width: 15px; height: 15px; }

/* ===== 詳細条件ドロワー ===== */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(20, 15, 10, .42); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.detail-drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(520px, 94vw); z-index: 61;
  background: var(--paper); border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(20, 15, 10, .16);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column;
}
.detail-drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); flex-shrink: 0; }
.drawer-head h3 { font-family: var(--display); font-weight: 700; font-size: 17px; }
.drawer-close { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--paper-2); color: var(--ink-soft); border: none; cursor: pointer; }
.drawer-close:hover { background: var(--ember-tint); color: var(--ember); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.drawer-body .panel { margin-bottom: 14px; }
/* 狭いドロワー内は2カラム系を単一カラムへ */
.drawer-body .cfg-2col,
.drawer-body .tbl-grid,
.drawer-body .batch-grid,
.drawer-body .wd-grid,
.drawer-body .radio-grid,
.drawer-body .field-row { grid-template-columns: 1fr; }
/* 本文内の実行ボタンは隠し、固定フッターの実行へ一本化（スクロールで消えないように）*/
.drawer-body .run-btn { display: none; }
/* ドロワー内ではリビール演出を無効化（未交差で .in が付かず opacity:0 のままになるのを防ぐ）*/
.drawer-body .reveal { opacity: 1; transform: none; }

/* 固定フッター（詳細モードのCTA）: 本文と分離し常時表示 */
.drawer-foot { flex-shrink: 0; padding: 14px 20px; border-top: 1px solid var(--line-soft); background: var(--paper); }
.drawer-foot[hidden] { display: none; }
.drawer-foot .run-btn { width: 100%; }

/* ===== 計算中オーバーレイ（実行の進行表示）===== */
.sim-loading {
  position: fixed; inset: 0; z-index: 9998; display: none; place-items: center;
  background: color-mix(in oklch, var(--paper) 68%, transparent);
  backdrop-filter: blur(4px) saturate(1.1);
}
.sim-loading.show { display: grid; }
.sim-loading-box {
  text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 30px 40px; box-shadow: 0 20px 50px rgba(20, 15, 10, .2);
}
.sim-spinner {
  display: inline-block; width: 44px; height: 44px; border: 4px solid var(--line);
  border-top-color: var(--ember); border-radius: 50%; animation: sim-spin .8s linear infinite;
}
@keyframes sim-spin { to { transform: rotate(360deg); } }
.sim-loading-msg { margin-top: 18px; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); }
.sim-loading-sub { margin-top: 6px; font-size: 13px; color: var(--ink-faint); }
@media (prefers-reduced-motion: reduce) { .sim-spinner { animation-duration: 2s; } }

/* モバイル: 固定バーを画面下へ / ドロワーをボトムシート化 */
@media (max-width: 760px) {
  .quick-bar {
    top: auto; bottom: 0; transform: translateY(130%);
    border-bottom: none; border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(20, 15, 10, .08);
  }
  /* 上下余白を確実に効かせる（.wrap の 0 上下padding を高詳細度で上書き）＋ iOS safe-area */
  .quick-bar .quick-inner { padding: 13px 16px; gap: 10px; padding-bottom: calc(13px + env(safe-area-inset-bottom)); }
  /* SP: バー入力は非表示（資産/現金/試行は「詳細」ドロワーで編集）→ 3ボタンを均等幅に */
  .qb-fields { display: none; }
  .qb-actions { flex: 1; gap: 10px; }
  .quick-bar .qb-history, .quick-bar .qb-detail, .quick-bar .qb-run { flex: 1; min-width: 0; justify-content: center; padding: 9px 8px; font-size: 13px; }
  .detail-drawer {
    width: 100vw; height: 88dvh; top: auto; bottom: 0; right: 0;
    border-left: none; border-top: 1px solid var(--line);
    border-top-left-radius: 18px; border-top-right-radius: 18px;
    transform: translateY(100%);
  }
  .detail-drawer.show { transform: translateY(0); }
  /* SP: フッターは iOS ホームバーを避けて余白を確保 */
  .drawer-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  /* モバイルメニュー: ハンバーガーで開閉 */
  .site-header.nav-open .nav-links {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: 6px 0; box-shadow: 0 10px 28px rgba(20, 15, 10, .12);
  }
  .site-header.nav-open .nav-links a { padding: 14px 24px; width: 100%; font-size: 15px; }
  .mobile-menu-btn.is-open { background: var(--ember-tint); color: var(--ember); border-color: var(--ember-tint-2); }
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--ember-bright), var(--ember-deep));
  box-shadow: 0 4px 12px oklch(0.648 0.178 41 / 0.32);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { display: block; font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.2; white-space: nowrap; }
.brand-sub { display: block; font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.03em; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 30px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ember); }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  background: var(--paper-2); border: 1px solid var(--line);
  padding: 8px 13px; border-radius: 999px; cursor: pointer;
  font-family: var(--sans);
  transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--ember); color: var(--ember); }
.theme-toggle svg { width: 15px; height: 15px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 14.5px;
  padding: 11px 20px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ember); color: white;
  box-shadow: 0 6px 18px oklch(0.648 0.178 41 / 0.32);
}
.btn-primary:hover { background: var(--ember-deep); transform: translateY(-1px); box-shadow: 0 10px 24px oklch(0.648 0.178 41 / 0.38); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ember); color: var(--ember); }
.btn-light { background: rgba(255,255,255,0.95); color: var(--ember-deep); }
.btn-light:hover { background: white; transform: translateY(-1px); }
.btn-lg { padding: 15px 28px; font-size: 16px; }

.mobile-menu-btn { display: none; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 85% 0%, var(--hero-bg-2), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, oklch(0.30 0.05 40), transparent 60%),
    var(--hero-bg);
  color: oklch(0.97 0.01 80);
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(oklch(1 0 0 / 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.6; pointer-events: none;
}
.hero-glow {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, oklch(0.648 0.178 41 / 0.45), transparent 65%);
  filter: blur(40px); top: -120px; right: -60px; pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px;
  align-items: center;
  padding: 86px 0 96px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ember-bright);
  border: 1px solid oklch(0.648 0.178 41 / 0.4);
  background: oklch(0.648 0.178 41 / 0.12);
  padding: 7px 15px; border-radius: 999px;
  margin-bottom: 28px; white-space: nowrap;
}
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember-bright); box-shadow: 0 0 10px var(--ember-bright); }
.hero h1 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(44px, 6vw, 76px); line-height: 1.08;
  letter-spacing: -0.01em; text-wrap: balance;
}
.hero h1 .accent {
  color: transparent;
  background: linear-gradient(105deg, var(--ember-bright), oklch(0.82 0.13 70));
  -webkit-background-clip: text; background-clip: text;
}
.hero-lede {
  margin-top: 26px; font-size: 17px; line-height: 1.9;
  color: oklch(0.86 0.015 75); max-width: 30em;
}
.hero-actions { margin-top: 36px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hero-trust {
  margin-top: 28px; display: flex; gap: 22px; flex-wrap: wrap;
  font-size: 13px; color: oklch(0.78 0.015 75);
}
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero-trust .tick { color: var(--sage); }

/* Hero chart card */
.chart-card {
  background: oklch(0.255 0.022 48 / 0.7);
  border: 1px solid oklch(1 0 0 / 0.1);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(8px);
  box-shadow: 0 30px 70px oklch(0.15 0.02 50 / 0.5);
}
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.chart-title { font-size: 13px; color: oklch(0.8 0.015 75); font-weight: 500; }
.chart-title b { display: block; font-family: var(--display); font-weight: 700; font-size: 16px; color: oklch(0.97 0.01 80); margin-top: 2px; }
.chart-legend { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; font-family: var(--mono); font-size: 11px; color: oklch(0.78 0.015 75); }
.chart-legend i { display: inline-block; width: 16px; height: 2px; margin-left: 7px; vertical-align: middle; border-radius: 2px; }
.chart-svg { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart-badge {
  position: absolute; right: 30px; bottom: 76px;
  background: oklch(0.255 0.022 48 / 0.85);
  border: 1px solid var(--sage);
  border-radius: 14px; padding: 10px 16px; text-align: center;
  box-shadow: 0 10px 30px oklch(0.15 0.02 50 / 0.5);
}
.chart-badge .lbl { font-size: 11px; color: oklch(0.8 0.015 75); letter-spacing: 0.08em; }
.chart-badge .val { font-family: var(--mono); font-weight: 700; font-size: 26px; color: var(--sage); line-height: 1.1; }
.chart-wrap { position: relative; }

/* ============================================================
   Sections
   ============================================================ */
section { position: relative; }
.section-pad { padding: 92px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head .eyebrow { display: block; margin-bottom: 14px; }
.section-head h2 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(30px, 3.6vw, 44px); line-height: 1.18;
  letter-spacing: -0.01em;
}
.section-head p { margin-top: 14px; color: var(--ink-soft); font-size: 16px; }

/* Steps */
.steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  position: relative;
}
.step { text-align: center; padding: 0 18px; position: relative; }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 33px; right: -10px;
  width: 20px; height: 20px;
  border-top: 2px solid var(--ember-tint-2); border-right: 2px solid var(--ember-tint-2);
  transform: rotate(45deg);
}
.step-icon {
  width: 68px; height: 68px; border-radius: 20px; margin: 0 auto 20px;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ember);
}
.step-icon svg { width: 30px; height: 30px; }
.step-no { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.18em; color: var(--ember); }
.step h3 { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 6px 0 8px; }
.step p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }

/* KPI preview */
.kpi-preview {
  margin-top: 64px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 8px;
  box-shadow: var(--shadow);
}
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.kpi {
  text-align: center; padding: 30px 20px; position: relative;
}
.kpi:not(:last-child) { border-right: 1px solid var(--line-soft); }
.kpi .lbl { font-size: 13px; color: var(--ink-faint); letter-spacing: 0.06em; margin-bottom: 8px; }
.kpi .val { font-family: var(--mono); font-weight: 700; font-size: 40px; line-height: 1; letter-spacing: -0.02em; }
.kpi .val small { font-size: 17px; font-weight: 600; }
.kpi.good .val { color: var(--sage-deep); }
.kpi-note { text-align: center; padding: 14px; font-size: 13px; color: var(--ink-faint); border-top: 1px solid var(--line-soft); }

/* ============================================================
   Simulator panel
   ============================================================ */
.sim-section { background: var(--paper-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 16px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 26px; border-bottom: 1px solid var(--line-soft);
}
.panel-head .pic {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--ember-tint); color: var(--ember);
}
.panel-head .pic svg { width: 20px; height: 20px; }
.panel-head h3 { font-family: var(--display); font-weight: 700; font-size: 18px; }
.panel-body { padding: 26px; }
.hint {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--ember-tint); border: 1px solid var(--ember-tint-2);
  border-radius: var(--radius-sm); padding: 13px 16px; font-size: 13.5px;
  color: var(--ink-soft); margin-bottom: 22px;
}
.hint svg { width: 17px; height: 17px; color: var(--ember); flex-shrink: 0; margin-top: 2px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 18px; align-items: end; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-bottom: 8px; }
.field label .q { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--line); color: var(--ink-faint); font-size: 10px; margin-left: 5px; }
.field input {
  width: 100%; font-family: var(--mono); font-size: 17px; font-weight: 500;
  padding: 13px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); transition: all 0.15s;
}
.field input:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px oklch(0.648 0.178 41 / 0.15); background: var(--card); }
.run-btn { padding: 14px 26px; font-size: 16px; height: 50px; justify-content: center; }

.panel.collapsed .panel-body { display: none; }
.panel-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 20px 26px; cursor: pointer; background: none; border: none;
  font-family: var(--sans); color: var(--ink); text-align: left;
}
.panel-toggle .lhs { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 16px; }
.panel-toggle .lhs .pic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--paper-2); color: var(--ink-soft); }
.panel-toggle .lhs .pic svg { width: 18px; height: 18px; }
.panel-toggle .tag { font-family: var(--sans); font-weight: 500; font-size: 12px; color: var(--ink-faint); background: var(--paper-2); padding: 3px 10px; border-radius: 999px; margin-left: 4px; }
.panel-toggle .chev { transition: transform 0.25s; color: var(--ink-faint); }
.panel:not(.collapsed) .panel-toggle .chev { transform: rotate(180deg); }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; transition: border-color 0.2s; }
.faq-item.open { border-color: oklch(0.648 0.178 41 / 0.4); box-shadow: var(--shadow-sm); }
.faq-q {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 20px 24px; cursor: pointer; background: none; border: none;
  font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); text-align: left;
}
.faq-q .qn { color: var(--ember); font-family: var(--mono); flex-shrink: 0; }
.faq-q .qtext { flex: 1; }
.faq-q .chev { color: var(--ink-faint); transition: transform 0.25s; flex-shrink: 0; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); color: var(--ember); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-a-inner { padding: 0 24px 22px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.85; }

/* Guide CTA */
.guide-cta {
  max-width: 760px; margin: 48px auto 0; text-align: center;
  background: linear-gradient(135deg, var(--ember-deep), var(--ember));
  border-radius: var(--radius-lg); padding: 44px;
  color: white; box-shadow: 0 20px 50px oklch(0.648 0.178 41 / 0.3);
}
.guide-cta p { font-size: 15px; opacity: 0.92; margin-bottom: 20px; }

/* SEO content */
.seo { background: var(--paper-2); border-top: 1px solid var(--line-soft); }
.seo-card { max-width: 820px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 56px; box-shadow: var(--shadow); }
.seo-card h2 { font-family: var(--display); font-weight: 800; font-size: 28px; margin-bottom: 22px; }
.seo-card h3 { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 32px 0 14px; }
.seo-card p { color: var(--ink-soft); font-size: 15px; line-height: 2; margin-bottom: 16px; }
.seo-card strong { color: var(--ink); font-weight: 700; }
.seo-card a { color: var(--ember); font-weight: 500; border-bottom: 1px solid oklch(0.648 0.178 41 / 0.3); }
.seo-card ul { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.seo-card li { position: relative; padding-left: 26px; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
.seo-card li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--ember); }
.seo-back { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-family: var(--display); font-weight: 700; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--hero-bg); color: oklch(0.85 0.012 75); padding: 60px 0 40px; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; padding-bottom: 36px; border-bottom: 1px solid var(--hero-line); }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-links a { font-size: 14px; color: oklch(0.82 0.012 75); transition: color 0.2s; }
.footer-links a:hover { color: var(--ember-bright); }
.footer-disclaimer { padding-top: 26px; font-size: 12.5px; color: oklch(0.66 0.012 70); line-height: 1.8; max-width: 860px; word-break: keep-all; line-break: strict; overflow-wrap: anywhere; }
.footer-copy { margin-top: 16px; font-family: var(--mono); font-size: 12px; color: oklch(0.6 0.012 70); }
/* SP: 下部固定バー分の余白を確保し、コピーライトが隠れないように（.site-footer 定義の後に置く）*/
@media (max-width: 760px) {
  .site-footer { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; padding: 64px 0 72px; }
  .nav-links, .header-cta-desktop { display: none; }
  /* SP: テーマトグルはアイコンのみ（文字は折り返しでデザイン崩れするため非表示）*/
  #themeLabel { display: none; }
  .theme-toggle { padding: 9px; }
  .mobile-menu-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--paper-2); border: 1px solid var(--line); cursor: pointer; color: var(--ink); }
  .steps { grid-template-columns: 1fr 1fr; gap: 36px 0; }
  .step:not(:last-child)::after { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi:not(:last-child) { border-right: none; border-bottom: 1px solid var(--line-soft); }
  .field-row { grid-template-columns: 1fr 1fr; }
  .run-btn { grid-column: 1 / -1; }
  .seo-card { padding: 36px 26px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  /* SP: STEPを横並びリスト化（アイコン左・テキスト左寄せ）で縦横の余白を圧縮 */
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step {
    display: grid; grid-template-columns: 44px 1fr; align-items: start;
    column-gap: 14px; text-align: left; padding: 16px 4px;
  }
  .step:not(:last-child) { border-bottom: 1px solid var(--line-soft); }
  .step-icon {
    width: 44px; height: 44px; border-radius: 12px; margin: 0;
    grid-row: 1 / span 3; align-self: center;
  }
  .step-icon svg { width: 22px; height: 22px; }
  .step-no { grid-column: 2; margin-bottom: 2px; }
  .step h3 { grid-column: 2; margin: 0 0 3px; font-size: 16px; }
  .step p { grid-column: 2; font-size: 13px; line-height: 1.6; }
  .field-row { grid-template-columns: 1fr; }
  .chart-badge { right: 18px; bottom: 70px; }
  .section-pad { padding: 64px 0; }
}

/* ============================================================
   History / Saved panel
   ============================================================ */
.hist-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.hist-tab {
  flex: 1 1 0; min-width: 0; justify-content: center; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; padding: 11px 8px;
  background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--ink-faint);
  margin-bottom: -1px; transition: color 0.2s;
}
.hist-tab:hover { color: var(--ink-soft); }
.hist-tab.active { color: var(--ember); border-bottom-color: var(--ember); }
.hist-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.hist-tab .cnt {
  font-family: var(--mono); font-size: 11px; font-weight: 600; white-space: nowrap;
  background: var(--paper-2); color: var(--ink-soft); padding: 2px 8px; border-radius: 999px;
}
.hist-tab.active .cnt { background: var(--ember-tint); color: var(--ember); }
/* 3タブが狭い幅（SPボトムシート等）で折り返さないよう、アイコンを隠してコンパクト化 */
@media (max-width: 560px) {
  .hist-tab { gap: 5px; padding: 10px 4px; font-size: 13px; }
  .hist-tab svg { display: none; }
  .hist-tab .cnt { padding: 2px 6px; font-size: 10px; }
}

.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-empty { color: var(--ink-faint); font-size: 13px; padding: 14px 4px; }
.hist-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); transition: border-color 0.2s, background 0.2s;
}
.hist-item:hover { border-color: var(--ember-tint-2); background: var(--card); }
.hist-meta { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.hist-meta .title { font-family: var(--display); font-weight: 700; font-size: 14.5px; color: var(--ink); line-height: 1.45; word-break: break-word; }
.hist-meta .title .star { color: var(--ember); margin-right: 4px; }
.hist-meta .time { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--ink-faint); min-width: 0; }
.hist-meta .time svg { width: 13px; height: 13px; flex-shrink: 0; }
.hist-meta .time .star { color: var(--ember); flex-shrink: 0; display: inline-flex; }
.hist-meta .time .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-actions { display: flex; gap: 8px; flex-shrink: 0; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans);
  font-weight: 600; font-size: 12.5px; padding: 8px 13px; border-radius: 9px;
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.mini-btn svg { width: 13px; height: 13px; }
.mini-btn.call { background: var(--ember); color: #fff; }
.mini-btn.call:hover { background: var(--ember-deep); }
.mini-btn.save { background: var(--card); border-color: var(--line); color: var(--ink-soft); }
.mini-btn.save:hover { border-color: var(--ember); color: var(--ember); }
.mini-btn.del { background: var(--card); border-color: var(--line); color: var(--danger); }
.mini-btn.del:hover { background: var(--danger-tint); border-color: var(--danger); }

.hist-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.pager-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  cursor: pointer; font-family: var(--sans); font-size: 13px; color: var(--ink-soft); transition: all 0.15s;
}
.pager-btn:disabled { opacity: 0.4; cursor: default; }
.pager-btn:not(:disabled):hover { border-color: var(--ember); color: var(--ember); }

/* ドロワー内（PC=520px幅 / SP=全幅）では縦積みにして崩れ・ボタンはみ出しを防ぐ */
.drawer-body .hist-item { flex-direction: column; align-items: stretch; }
.drawer-body .hist-actions { justify-content: flex-end; }
.drawer-body .mini-btn { flex: 1; justify-content: center; padding: 8px 6px; }

@media (max-width: 560px) {
  .hist-item { flex-direction: column; align-items: stretch; }
  .hist-actions { justify-content: flex-end; }
  .hist-actions .mini-btn { flex: 1; justify-content: center; padding: 8px 6px; }
}

/* ============================================================
   Advanced settings (詳細条件)
   ============================================================ */
.adv-body { background: var(--paper-2); }
.session-bar {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap;
  background: var(--ember-tint); border: 1px solid var(--ember-tint-2);
  border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 18px;
}
.session-bar .txt { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-soft); }
.session-bar .txt svg { width: 16px; height: 16px; color: var(--ember); flex-shrink: 0; }
.session-bar .txt b { color: var(--ink); }
.reset-btn { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink-soft); background: var(--card); border: 1px solid var(--line); padding: 7px 14px; border-radius: 8px; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.reset-btn:hover { border-color: var(--ember); color: var(--ember); }

.cfg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 22px; margin-bottom: 14px; }
.cfg-head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; font-family: var(--display); font-weight: 700; font-size: 15px; }
.cfg-head .ico { color: var(--ember); display: inline-flex; }
.cfg-head .ico svg { width: 18px; height: 18px; }
.cfg-head .help { width: 16px; height: 16px; border-radius: 50%; background: var(--line); color: var(--ink-faint); font-size: 10px; display: grid; place-items: center; font-family: var(--mono); }
.cfg-note { font-size: 12.5px; color: var(--ink-faint); margin-top: 10px; line-height: 1.7; }
.cfg-note b { color: var(--ember); }
.cfg-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }

/* radio cards */
.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-card { display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 16px; cursor: pointer; transition: all 0.15s; background: var(--paper); }
.radio-card:hover { border-color: var(--ember-tint-2); }
.radio-card:has(input:checked) { border-color: var(--ember); background: var(--ember-tint); }
.radio-card .rc-top { display: flex; align-items: center; gap: 9px; font-weight: 700; font-family: var(--display); font-size: 14px; }
.radio-card input { accent-color: var(--ember); width: 16px; height: 16px; margin: 0; }
.radio-card p { margin-top: 7px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.65; padding-left: 25px; }

/* checkbox row */
.check-row { display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; }
.check-row input { accent-color: var(--ember); width: 18px; height: 18px; margin: 0; flex-shrink: 0; }

/* slider */
.slider-wrap { margin-top: 16px; }
.slider-label { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 9px; }
.slider-label b { color: var(--ember); font-family: var(--mono); font-weight: 700; }
.slider-label .wd-hint { color: var(--ink-faint); font-weight: 400; font-size: 12px; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--line); accent-color: var(--ember); cursor: pointer; }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ember); border: 3px solid var(--card); box-shadow: 0 2px 6px oklch(0.648 0.178 41 / 0.4); cursor: pointer; }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ember); border: 3px solid var(--card); box-shadow: 0 2px 6px oklch(0.648 0.178 41 / 0.4); cursor: pointer; }

/* dual-thumb range（期間設定：開始・終了を1本のレンジで） */
.range-dual-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.range-dual-top .rd-edge { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ember); }
.range-dual-top .rd-edge b { font-family: var(--mono); }
.range-dual-top .rd-years { font-size: 12.5px; font-weight: 600; color: var(--ink-faint); }
.range-dual { position: relative; height: 28px; margin: 2px 0; }
.range-dual .rd-track, .range-dual .rd-fill { position: absolute; top: 50%; transform: translateY(-50%); height: 6px; border-radius: 999px; }
.range-dual .rd-track { left: 0; right: 0; background: var(--line); }
.range-dual .rd-fill { background: var(--ember); }
.range-dual .rd-input { position: absolute; top: 0; left: 0; width: 100%; height: 28px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.range-dual .rd-input::-webkit-slider-runnable-track { background: none; border: none; }
.range-dual .rd-input::-moz-range-track { background: none; border: none; }
.range-dual .rd-input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: var(--ember); border: 3px solid var(--card); box-shadow: 0 2px 6px oklch(0.648 0.178 41 / 0.4); cursor: pointer; }
.range-dual .rd-input::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: var(--ember); border: 3px solid var(--card); box-shadow: 0 2px 6px oklch(0.648 0.178 41 / 0.4); cursor: pointer; }
.range-dual-ends { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; }

/* number with unit */
.num-field { display: flex; align-items: stretch; max-width: 220px; }
.num-field input { font-family: var(--mono); font-size: 15px; font-weight: 500; padding: 11px 14px; border: 1px solid var(--line); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--paper); color: var(--ink); width: 100%; flex: 1; min-width: 0; }
.num-field input:focus { outline: none; border-color: var(--ember); }
.num-field .unit { display: grid; place-items: center; padding: 0 15px; border: 1px solid var(--line); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--paper-2); color: var(--ink-soft); font-size: 13px; font-family: var(--mono); white-space: nowrap; flex-shrink: 0; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 9px; }
.field-label b { color: var(--ember); font-family: var(--mono); }

/* select */
.sel { font-family: var(--sans); font-size: 13.5px; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); cursor: pointer; }
.sel:focus { outline: none; border-color: var(--ember); }

/* withdrawal radio (取崩方式) */
.wd-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: center; }

/* batch (一括設定) */
.batch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.batch-title { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.batch-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.batch-row .sep { color: var(--ink-faint); }
.batch-row .sel { flex: 1; min-width: 90px; }
.batch-row .num-field { max-width: 130px; }
.btn-block { width: 100%; justify-content: center; }

/* presets */
.preset-row { display: flex; gap: 10px; flex-wrap: wrap; }
.preset-btn { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); cursor: pointer; transition: all 0.15s; }
.preset-btn:hover { border-color: var(--ember); background: var(--ember-tint); transform: translateY(-1px); }
.preset-btn.active { border-color: var(--ember); background: var(--ember-tint); box-shadow: 0 0 0 2px oklch(0.648 0.178 41 / 0.18) inset; }
.preset-btn .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.preset-btn .pname { font-family: var(--display); font-weight: 700; font-size: 14px; display: block; line-height: 1.2; }
.preset-btn .pdesc { font-size: 10.5px; color: var(--ink-faint); font-family: var(--mono); }
.preset-src { font-size: 12px; color: var(--ink-faint); margin-top: 14px; }
.preset-src a { color: var(--ember); border-bottom: 1px solid oklch(0.648 0.178 41 / 0.3); }

/* data tables */
.tbl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tbl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; }
.tbl-card h4 { font-family: var(--display); font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.tbl-card .desc { font-size: 12px; color: var(--ink-faint); line-height: 1.6; margin-bottom: 14px; }
.data-table-wrap { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th { position: sticky; top: 0; z-index: 1; background: var(--paper-2); font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--ink-soft); text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .yr { font-family: var(--mono); color: var(--ink-soft); white-space: nowrap; }
.data-table .ti { width: 100%; font-family: var(--mono); font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); }
.data-table .ti:focus { outline: none; border-color: var(--ember); }
.data-table .note-tag { font-size: 11px; color: var(--ember-deep); background: var(--ember-tint); padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.del-mini { font-family: var(--sans); font-size: 11.5px; font-weight: 600; color: var(--danger); background: var(--card); border: 1px solid var(--danger-tint); padding: 5px 9px; border-radius: 6px; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.del-mini:hover { background: var(--danger-tint); border-color: var(--danger); }
.add-row-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-family: var(--sans); font-weight: 600; font-size: 13px; color: var(--ink-soft); background: var(--paper); border: 1px dashed var(--line); padding: 9px 16px; border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.add-row-btn:hover { border-color: var(--ember); color: var(--ember); }

/* 年利かんたん調整 */
.rate-quick { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px; }
.rate-quick .rq-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rate-quick .rq-info { flex: 1; font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--ember); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.rate-quick .rq-lbl { font-family: var(--sans); font-size: 11.5px; font-weight: 500; color: var(--ink-soft); }
.rate-quick .rq-unit { font-family: var(--sans); font-size: 11px; font-weight: 400; color: var(--ink-faint); }
.rate-quick .rq-sub { font-family: var(--sans); font-size: 11.5px; font-weight: 500; color: var(--ink-soft); }
.rate-quick .rq-btn { width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink-soft); font-size: 16px; font-weight: 700; cursor: pointer; flex-shrink: 0; transition: all .15s; }
.rate-quick .rq-btn.wide { width: 44px; }
.rate-quick .rq-btn:hover { border-color: var(--ember); color: var(--ember); }
.rate-quick .rq-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: var(--card); border-radius: 8px; padding: 10px 6px; }
.rate-quick .rq-stats > div { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.rate-quick .rq-stats b { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.rate-quick .rq-stats span { font-size: 9.5px; color: var(--ink-faint); }

/* ライフプラン一括設定 */
.plan-grid { display: flex; flex-direction: column; gap: 12px; }
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-label { font-size: 13px; color: var(--ink-soft); }
.plan-row .num-field { max-width: 150px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .step-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink-soft); font-size: 17px; font-weight: 700; cursor: pointer; transition: all .15s; }
.stepper .step-btn:hover { border-color: var(--ember); color: var(--ember); }
.stepper .step-val { min-width: 56px; text-align: center; font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--ink); }
.stepper .step-val b { font-family: var(--mono); color: var(--ember); }

/* トリガーカード（年利/スケジュール → モーダル） */
.trigger-card { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 14px; cursor: pointer; transition: all .15s; font-family: inherit; }
.trigger-card:hover { border-color: var(--ember); background: var(--ember-tint); }
.trigger-card .tc-ico { color: var(--ember); display: inline-flex; flex-shrink: 0; }
.trigger-card .tc-ico svg { width: 22px; height: 22px; }
.trigger-card .tc-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.trigger-card .tc-title { font-family: var(--display); font-weight: 700; font-size: 14.5px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.trigger-card .tc-badge { font-size: 10.5px; font-weight: 600; color: var(--ember); background: var(--ember-tint); border-radius: 5px; padding: 2px 7px; font-family: var(--sans); }
.trigger-card .tc-desc { font-size: 11.5px; color: var(--ink-faint); }
.trigger-card .tc-chev { color: var(--ink-faint); font-size: 22px; line-height: 1; flex-shrink: 0; }

/* 設定モーダル（年利/スケジュール） */
.rs-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1190; }
.rs-modal-backdrop.show { opacity: 1; pointer-events: auto; }
.rs-modal { position: fixed; z-index: 1200; left: 50%; top: 50%; transform: translate(-50%, calc(-50% + 14px)); width: min(680px, calc(100vw - 32px)); max-height: 88vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 70px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.rs-modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.rs-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); flex-shrink: 0; }
.rs-modal-head h3 { font-family: var(--display); font-weight: 700; font-size: 17px; }
.rs-modal-close { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--paper-2); color: var(--ink-soft); border: none; cursor: pointer; }
.rs-modal-close:hover { background: var(--ember-tint); color: var(--ember); }
.rs-modal-body { flex: 1; overflow-y: auto; padding: 18px; }
.rs-modal-body .modal-desc { font-size: 12px; color: var(--ink-faint); line-height: 1.7; margin-bottom: 16px; }
.rs-modal-foot { flex-shrink: 0; padding: 14px 20px; border-top: 1px solid var(--line-soft); }

/* 個別編集アコーディオン */
.edit-acc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 14px; overflow: hidden; }
.edit-acc-head { display: flex; align-items: center; gap: 9px; width: 100%; padding: 16px 18px; background: none; border: none; cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--ink); text-align: left; }
.edit-acc-head .ico { color: var(--ember); display: inline-flex; }
.edit-acc-head .ico svg { width: 18px; height: 18px; }
.edit-acc-head .edit-acc-title { flex: 1; }
.edit-acc-head .acc-count { color: var(--ink-faint); font-weight: 500; font-size: 12px; font-family: var(--sans); }
.edit-acc-head .acc-chev { color: var(--ink-faint); transition: transform .2s; flex-shrink: 0; }
.edit-acc-head[aria-expanded="true"] .acc-chev { transform: rotate(180deg); }
.edit-acc-body { padding: 0 18px 18px; }
@media (max-width: 640px) {
  .rs-modal { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 92vh; transform: translateY(100%); border-radius: var(--radius) var(--radius) 0 0; }
  .rs-modal.show { transform: translateY(0); }
}

/* result toolbar */
.result-toolbar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 28px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.rt-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink); cursor: pointer; transition: all 0.15s; }
.rt-btn svg { width: 15px; height: 15px; color: var(--ember); }
.rt-btn:hover { border-color: var(--ember); color: var(--ember); transform: translateY(-1px); }
.rt-btn.active { background: var(--ember); color: #fff; border-color: var(--ember); }
.rt-btn.active svg { color: #fff; }

@media (max-width: 760px) {
  .cfg-2col, .radio-grid, .batch-grid, .tbl-grid, .wd-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Results dashboard (実行後)
   ============================================================ */
.results-section { background: var(--paper-2); border-top: 1px solid var(--line-soft); }
.results-section[hidden] { display: none; }
.res-block { margin-bottom: 22px; }
.res-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.res-card-head { display: flex; align-items: center; gap: 11px; padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
.res-card-head .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--ember-tint); color: var(--ember); flex-shrink: 0; }
.res-card-head .ico svg { width: 19px; height: 19px; }
.res-card-head h3 { font-family: var(--display); font-weight: 700; font-size: 17px; }
.res-card-head .help { width: 16px; height: 16px; border-radius: 50%; background: var(--line); color: var(--ink-faint); font-size: 10px; display: grid; place-items: center; font-family: var(--mono); }

/* ===== ツールチップ（? ヘルプアイコン）===== */
.field label .q, .cfg-head .help, .res-card-head .help { cursor: help; transition: background 0.15s, color 0.15s; }
.field label .q:hover,
.cfg-head .help:hover,
.res-card-head .help:hover { background: var(--ember); color: #fff; }
.om-tip {
  position: fixed; z-index: 200; left: 0; top: 0;
  max-width: 268px; width: max-content;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 13px; line-height: 1.7; font-weight: 500;
  text-align: center; padding: 12px 16px; border-radius: 13px;
  box-shadow: var(--shadow-lg);
  pointer-events: none; opacity: 0; transform: translateY(4px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
  letter-spacing: 0.01em;
}
.om-tip.show { opacity: 1; transform: none; }
.om-tip::after {
  content: ""; position: absolute; width: 12px; height: 12px;
  background: var(--ink); border-radius: 2px;
  transform: rotate(45deg); left: var(--arrow-x, 50%); margin-left: -6px;
}
.om-tip[data-pos="top"]::after { bottom: -5px; }
.om-tip[data-pos="bottom"]::after { top: -5px; }
.om-tip b { color: var(--ember-bright); font-family: var(--mono); font-weight: 700; }
.res-card-body { padding: 24px; }
.res-card-head.danger .ico { background: var(--danger-tint); color: var(--danger); }
.res-card-head.danger h3 { color: var(--danger); }
.res-card-head.sage .ico { background: var(--sage-tint); color: var(--sage-deep); }

/* summary */
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 52px; }
.sum-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.sum-row .k { color: var(--ink-soft); font-size: 14px; }
.sum-row .v { font-family: var(--display); font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; text-align: right; }
.chip { font-family: var(--sans); font-weight: 600; font-size: 11px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.chip.ember { background: var(--ember); color: #fff; }
.chip.cash { background: var(--cash-tint); color: var(--cash); border: 1px solid var(--cash); }
.chip.soft { background: var(--line-soft); color: var(--ink-soft); border: 1px solid var(--line); }

/* KPI result cards */
.res-kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.res-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; text-align: center; }
.res-kpi .lbl { font-size: 13px; color: var(--ink-faint); letter-spacing: 0.04em; margin-bottom: 12px; }
.res-kpi .big { font-family: var(--mono); font-weight: 700; font-size: 38px; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.res-kpi .big small { font-size: 18px; font-weight: 600; }
.res-kpi .sub { font-size: 12px; color: var(--ink-faint); margin-top: 11px; line-height: 1.55; }
.res-kpi.rate .big { color: var(--sage-deep); }
.res-kpi.money .big { color: var(--gold); }
html.dark .res-kpi.money .big { color: var(--gold); }

/* eval banner */
.eval-banner { border-radius: var(--radius); padding: 24px 26px; border: 1px solid var(--sage); background: var(--sage-tint); border-left: 4px solid var(--sage); }
.eval-banner .et { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--sage-deep); }
html.dark .eval-banner .et { color: oklch(0.78 0.09 158); }
.eval-banner .et svg { width: 20px; height: 20px; }
.eval-banner .ed { margin-top: 10px; font-size: 14px; color: var(--ink-soft); line-height: 1.7; }

/* learn links */
.learn-bar { display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 22px; }
.learn-bar .ll-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.learn-bar .ll-label svg { width: 16px; height: 16px; color: var(--ember); }
.learn-bar a { font-size: 13.5px; font-weight: 600; color: var(--ember); }
.learn-bar a:hover { text-decoration: underline; }

/* chart box */
.chart-box { position: relative; height: 380px; width: 100%; }
.chart-box.tall { height: 440px; }
.chart-box.short { height: 300px; }

/* analysis tabs */
.an-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.an-tab { padding: 11px 18px; background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--ink-faint); margin-bottom: -1px; transition: color 0.2s; }
.an-tab.active { color: var(--ember); border-bottom-color: var(--ember); }
.an-tab:hover { color: var(--ink-soft); }
.an-desc { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 18px; }
.an-panel[hidden] { display: none; }
.radio-inline { display: flex; gap: 24px; flex-wrap: wrap; }
.radio-inline label { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; }
.radio-inline input { accent-color: var(--ember); width: 16px; height: 16px; margin: 0; }
.rev-result { margin-top: 22px; display: inline-block; min-width: 280px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 28px; text-align: center; }
.rev-result .lbl { font-size: 13px; color: var(--ink-faint); margin-bottom: 8px; }
.rev-result .big { font-family: var(--mono); font-weight: 700; font-size: 38px; line-height: 1; color: var(--gold); letter-spacing: -0.02em; }
.rev-result .big small { font-size: 18px; font-weight: 600; }
.rev-result .sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 11px; }

/* 必要資産LP（/required-assets/） */
.ra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.ra-field .num-field { max-width: none; }
@media (max-width: 560px) { .ra-grid { grid-template-columns: 1fr; } }

/* ロングテール着地ページ（/fire/） */
.lt-siblings { list-style: none; display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
.lt-siblings li { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 4px; border-bottom: 1px solid var(--line-soft); }
.lt-siblings a.inline { color: var(--ember); font-weight: 600; }
.lt-cur { color: var(--ink); font-weight: 700; }
.lt-cur b { color: var(--ink-faint); font-weight: 600; font-size: 12.5px; }
.lt-metric { flex-shrink: 0; font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; }

/* heatmap */
.heatmap { display: grid; grid-template-columns: auto repeat(5, 1fr); gap: 4px; margin-top: 8px; }
.hm-cell { aspect-ratio: 1.6; border-radius: 7px; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 600; color: #fff; }
.hm-axis { display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

/* detail tables (calc breakdown) */
.scenario-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.scenario-filter .lab { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.sc-btn { font-family: var(--sans); font-weight: 600; font-size: 13px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer; transition: all 0.15s; }
.sc-btn:hover { border-color: var(--ember); }
.sc-btn.active { background: var(--sage); border-color: var(--sage); color: #fff; }
.sc-btn.active.bad { background: var(--danger); border-color: var(--danger); }
.trial-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; font-family: var(--display); font-weight: 700; font-size: 16px; }
.trial-head .badge { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--paper-2); color: var(--ink-soft); }
.trial-head .badge.ok { background: var(--sage-tint); color: var(--sage-deep); }
.trial-head .badge.bad { background: var(--danger-tint); color: var(--danger); }
.detail-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.detail-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 760px; }
.detail-table th { position: sticky; top: 0; z-index: 2; background: var(--paper-2); font-family: var(--display); font-weight: 700; font-size: 11.5px; color: var(--ink-soft); text-align: right; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
/* 横スクロール時に1列目（年代）を固定 */
.detail-table th:first-child { text-align: left; left: 0; z-index: 3; box-shadow: 1px 0 0 var(--line); }
.detail-table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); text-align: right; font-family: var(--mono); white-space: nowrap; }
.detail-table td:first-child { text-align: left; color: var(--ink-soft); position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: 1px 0 0 var(--line); }
.detail-table tr:last-child td { border-bottom: none; }
.detail-table .pos { color: var(--sage-deep); }
.detail-table .neg { color: var(--danger); }
.detail-table .cashv { color: var(--cash); font-weight: 600; }
.detail-table .gold { color: var(--gold); }
html.dark .detail-table .pos { color: oklch(0.74 0.09 158); }
.detail-banner { display: flex; gap: 10px; align-items: center; background: var(--ember-tint); border: 1px solid var(--ember-tint-2); border-radius: var(--radius-sm); padding: 13px 16px; font-size: 13.5px; color: var(--ink-soft); margin-bottom: 18px; }
.detail-banner svg { width: 17px; height: 17px; color: var(--ember); flex-shrink: 0; }
.detail-banner b { color: var(--ember); }
.filter-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-row .lab { font-size: 13px; color: var(--ink-soft); font-weight: 600; }

/* 年代別 two tables */
.era-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
table.era-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.era-table th { background: var(--paper-2); font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--ink-soft); text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.era-table th:first-child { text-align: left; }
.era-table td { padding: 7px 12px; border-bottom: 1px solid var(--line-soft); text-align: right; font-family: var(--mono); }
.era-table td:first-child { text-align: left; color: var(--ink-soft); }
.era-table .o { color: var(--ember); } .era-table .g { color: var(--sage-deep); } .era-table .r { color: var(--danger); }
.era-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.era-table thead th { position: sticky; top: 0; z-index: 1; }

@media (max-width: 820px) {
  .sum-grid, .res-kpi-grid, .era-grid { grid-template-columns: 1fr; }
  .res-kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .res-kpi-grid { grid-template-columns: 1fr; }
}

/* Reveal animation */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .reveal.in { opacity: 1; transform: none; }
}

/* 動き低減（OSの「視差効果を減らす」設定）: アニメ・スライド・スムーススクロールを無効化 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ===== 以下、サブページ（ガイド/記事/404/文書）用スタイル（handoffより取り込み）===== */
/* ============================================================
   Guide / article index page
   ============================================================ */
.guide-hero { padding: 56px 0 24px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--ember); margin-bottom: 30px; transition: gap 0.18s; }
.back-link:hover { gap: 11px; }
.guide-hero h1 { font-family: var(--display); font-weight: 900; font-size: clamp(32px, 4.6vw, 50px); line-height: 1.12; letter-spacing: -0.01em; }
.guide-hero .lede { margin-top: 18px; max-width: 46em; color: var(--ink-soft); font-size: 16px; line-height: 1.9; }

.article-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 12px; }
.article-card {
  display: flex; align-items: center; gap: 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.article-card:hover { border-color: oklch(0.648 0.178 41 / 0.45); transform: translateY(-2px); box-shadow: var(--shadow); }
.article-ico {
  width: 58px; height: 58px; flex-shrink: 0; border-radius: 16px; display: grid; place-items: center;
  background: var(--ember-tint); color: var(--ember); border: 1px solid var(--ember-tint-2);
  transition: background 0.2s, color 0.2s;
}
.article-card:hover .article-ico { background: var(--ember); color: #fff; border-color: var(--ember); }
.article-ico svg { width: 27px; height: 27px; }
.article-body { flex: 1; min-width: 0; }
.article-body h3 { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.4; letter-spacing: 0.005em; }
.article-body p { margin-top: 7px; font-size: 14px; color: var(--ink-soft); line-height: 1.72; text-wrap: pretty; }
.article-arrow { flex-shrink: 0; color: var(--ink-faint); transition: transform 0.2s, color 0.2s; }
.article-card:hover .article-arrow { color: var(--ember); transform: translateX(4px); }
.article-arrow svg { width: 22px; height: 22px; display: block; }

.guide-foot-cta {
  margin-top: 26px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 44px; box-shadow: var(--shadow-sm);
}
.guide-foot-cta h2 { font-family: var(--display); font-weight: 800; font-size: 28px; }
.guide-foot-cta p { margin-top: 14px; max-width: 44em; color: var(--ink-soft); font-size: 15px; line-height: 1.9; }
.guide-foot-cta .go { display: inline-flex; align-items: center; gap: 9px; margin-top: 24px; font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--ember); transition: gap 0.18s; white-space: nowrap; }
.guide-foot-cta .go:hover { gap: 13px; }

@media (max-width: 560px) {
  .article-card { gap: 16px; padding: 18px; }
  .article-ico { width: 48px; height: 48px; border-radius: 13px; }
  .article-ico svg { width: 22px; height: 22px; }
  .article-body h3 { font-size: 16px; }
  .article-arrow { display: none; }
  .guide-foot-cta { padding: 30px 22px; }
}

/* ============================================================
   Guide article — detail page
   ============================================================ */
.article-wrap { max-width: 840px; margin: 0 auto; padding: 0 28px; }

.breadcrumb {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-faint); margin-bottom: 20px;
}
.breadcrumb a { font-weight: 600; color: var(--ember); transition: color 0.18s; }
.breadcrumb a:hover { color: var(--ember-deep); }
.breadcrumb .sep { color: var(--line); }
.breadcrumb .cur { color: var(--ink-faint); }

.art-head { padding: 48px 0 8px; }
.art-head h1 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(30px, 4.4vw, 46px); line-height: 1.16; letter-spacing: -0.01em;
  text-wrap: balance;
}
.art-head .lede { margin-top: 18px; color: var(--ink-soft); font-size: 16.5px; line-height: 1.92; max-width: 44em; }

/* table of contents */
.toc {
  margin: 36px 0 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 26px 32px; box-shadow: var(--shadow-sm);
}
.toc-title {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--display); font-weight: 700; font-size: 15px; margin-bottom: 14px;
}
.toc-title svg { width: 18px; height: 18px; color: var(--ember); }
.toc ol { list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 9px; }
.toc li { counter-increment: toc; display: flex; align-items: baseline; gap: 11px; }
.toc li::before {
  content: counter(toc) "."; font-family: var(--mono); font-weight: 600; font-size: 13.5px;
  color: var(--ink-faint); flex-shrink: 0; min-width: 18px;
}
.toc a { color: var(--ember); font-weight: 500; font-size: 15px; line-height: 1.6; transition: color 0.18s; border-bottom: 1px solid transparent; }
.toc a:hover { color: var(--ember-deep); border-bottom-color: oklch(0.648 0.178 41 / 0.4); }

/* article body */
.art-body { padding: 18px 0 8px; }
.art-body section { scroll-margin-top: 88px; padding-top: 44px; }
.art-body h2 {
  font-family: var(--display); font-weight: 800; font-size: clamp(21px, 2.6vw, 26px);
  line-height: 1.35; letter-spacing: -0.005em; margin-bottom: 18px;
}
.art-body h2 .n { color: var(--ember); font-family: var(--mono); margin-right: 4px; }
.art-body h3 { font-family: var(--display); font-weight: 700; font-size: 17px; margin: 26px 0 12px; }
.art-body p { color: var(--ink-soft); font-size: 16px; line-height: 1.95; margin-bottom: 18px; }
.art-body p strong, .art-body li strong { color: var(--ink); font-weight: 700; }
.art-body a.inline { color: var(--ember); font-weight: 600; border-bottom: 1px solid oklch(0.648 0.178 41 / 0.4); }
.art-body a.inline:hover { color: var(--ember-deep); }

.art-body ul { list-style: none; display: flex; flex-direction: column; gap: 11px; margin-bottom: 18px; }
.art-body ul li { position: relative; padding-left: 26px; color: var(--ink-soft); font-size: 16px; line-height: 1.8; }
.art-body ul li::before { content: ""; position: absolute; left: 5px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--ember); }

/* callout */
.callout {
  display: flex; gap: 0; background: var(--paper-2); border: 1px solid var(--line);
  border-left: 4px solid var(--ember); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 22px; margin: 8px 0 20px;
}
.callout p { margin: 0; font-size: 15.5px; color: var(--ink-soft); line-height: 1.85; }
.callout strong { color: var(--ink); }

/* type table */
.art-table-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin: 6px 0 22px; }
table.art-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.art-table th { background: var(--paper-2); font-family: var(--display); font-weight: 700; font-size: 13.5px; color: var(--ink); text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.art-table td { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); line-height: 1.75; vertical-align: top; }
.art-table tr:last-child td { border-bottom: none; }
.art-table td:first-child { font-family: var(--display); font-weight: 700; color: var(--ink); }

/* ordered lists (numbered steps) */
.art-body ol, .doc-card ol {
  list-style: decimal; padding-left: 1.5em; display: flex; flex-direction: column; gap: 11px; margin: 4px 0 18px;
}
.art-body ol li, .doc-card ol li { color: var(--ink-soft); font-size: 16px; line-height: 1.85; padding-left: 4px; }
.art-body ol li::marker, .doc-card ol li::marker { color: var(--ember); font-family: var(--mono); font-weight: 600; }
.doc-card ol li { font-size: 15.5px; }
.art-body ol li strong, .doc-card ol li strong { color: var(--ink); font-weight: 700; }

/* references list */
.ref-list li { font-size: 14.5px; line-height: 1.7; }

/* related articles */
.related { margin-top: 56px; }
.related h2 { font-family: var(--display); font-weight: 800; font-size: 24px; margin-bottom: 18px; }
.rel-card {
  display: flex; align-items: center; gap: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow-sm); margin-bottom: 14px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.rel-card:hover { border-color: oklch(0.648 0.178 41 / 0.45); transform: translateY(-2px); box-shadow: var(--shadow); }
.rel-ico { width: 48px; height: 48px; flex-shrink: 0; border-radius: 13px; display: grid; place-items: center; background: var(--ember-tint); color: var(--ember); border: 1px solid var(--ember-tint-2); transition: background 0.2s, color 0.2s; }
.rel-card:hover .rel-ico { background: var(--ember); color: #fff; border-color: var(--ember); }
.rel-ico svg { width: 23px; height: 23px; }
.rel-body { flex: 1; min-width: 0; }
.rel-body h3 { font-family: var(--display); font-weight: 700; font-size: 16.5px; line-height: 1.4; }
.rel-body p { margin-top: 5px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }
.rel-arrow { flex-shrink: 0; color: var(--ink-faint); transition: transform 0.2s, color 0.2s; }
.rel-card:hover .rel-arrow { color: var(--ember); transform: translateX(4px); }
.rel-arrow svg { width: 20px; height: 20px; display: block; }

.art-updated { margin: 40px 0 8px; font-family: var(--mono); font-size: 13px; color: var(--ink-faint); }

@media (max-width: 560px) {
  .article-wrap { padding: 0 18px; }
  .toc { padding: 22px; }
  .art-table th, .art-table td { padding: 11px 13px; font-size: 13.5px; }
  .rel-card { gap: 14px; padding: 16px; }
  .rel-arrow { display: none; }
}

/* Reveal animation */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .reveal.in { opacity: 1; transform: none; }
}

/* ============================================================
   404 — not found
   ============================================================ */
.nf-wrap { max-width: 840px; margin: 0 auto; padding: 0 28px; min-height: calc(100vh - 73px); display: flex; flex-direction: column; }
.nf-back { padding: 40px 0 0; }
.nf-center { flex: 1; display: grid; place-items: center; padding: 28px 0 64px; }
.nf-card {
  width: 100%; max-width: 720px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 64px 56px; text-align: center;
}
.nf-mark {
  width: 84px; height: 84px; margin: 0 auto 26px; border-radius: 24px;
  display: grid; place-items: center; background: var(--ember-tint); border: 1px solid var(--ember-tint-2);
  color: var(--ember);
}
.nf-mark svg { width: 42px; height: 42px; }
.nf-code {
  display: inline-block; font-family: var(--mono); font-weight: 600; font-size: 13px; letter-spacing: 0.08em;
  color: var(--ember); background: var(--ember-tint); border: 1px solid var(--ember-tint-2);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 18px; white-space: nowrap;
}
.nf-card h1 { font-family: var(--display); font-weight: 900; font-size: clamp(26px, 4vw, 36px); line-height: 1.2; letter-spacing: -0.01em; }
.nf-card p.nf-lede { margin-top: 16px; color: var(--ink-soft); font-size: 16px; line-height: 1.9; text-wrap: balance; }
.nf-actions { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.nf-actions .btn { font-size: 15px; padding: 13px 24px; }

.nf-suggest { margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--line-soft); text-align: left; }
.nf-suggest h2 { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ink-soft); margin-bottom: 16px; text-align: center; }
.nf-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nf-link {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}
.nf-link:hover { border-color: oklch(0.648 0.178 41 / 0.45); transform: translateY(-2px); background: var(--card); }
.nf-link .ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; background: var(--ember-tint); color: var(--ember); border: 1px solid var(--ember-tint-2); transition: background 0.18s, color 0.18s; }
.nf-link:hover .ic { background: var(--ember); color: #fff; border-color: var(--ember); }
.nf-link .ic svg { width: 17px; height: 17px; }
.nf-link .tx { font-family: var(--display); font-weight: 700; font-size: 14.5px; color: var(--ink); line-height: 1.3; }
.nf-link .tx small { display: block; font-family: var(--sans); font-weight: 500; font-size: 12px; color: var(--ink-faint); margin-top: 3px; }

@media (max-width: 560px) {
  .nf-wrap { padding: 0 18px; }
  .nf-card { padding: 44px 26px; }
  .nf-actions .btn { width: 100%; justify-content: center; }
  .nf-links { grid-template-columns: 1fr; }
}

/* ============================================================
   Document / legal / info pages (about, privacy, disclaimer, contact)
   ============================================================ */
.doc-wrap { max-width: 900px; margin: 0 auto; padding: 0 28px 80px; }

.doc-head { padding: 48px 0 28px; }
.doc-head h1 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(28px, 4vw, 42px); line-height: 1.16; letter-spacing: -0.01em; text-wrap: balance;
}
.doc-head .lede { margin-top: 16px; color: var(--ink-soft); font-size: 16px; line-height: 1.9; max-width: 48em; }

/* big content card */
.doc-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 52px 60px; box-shadow: var(--shadow);
}
.doc-card > section { scroll-margin-top: 88px; }
.doc-card > section + section { margin-top: 40px; }
.doc-card h2 {
  font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1.4;
  letter-spacing: -0.005em; margin-bottom: 14px;
}
.doc-card h2 .n { color: var(--ember); font-family: var(--mono); margin-right: 5px; }
.doc-card p { color: var(--ink-soft); font-size: 15.5px; line-height: 1.95; margin-bottom: 16px; }
.doc-card p:last-child { margin-bottom: 0; }
.doc-card strong { color: var(--ink); font-weight: 700; }
.doc-card a.inline { color: var(--ember); font-weight: 600; border-bottom: 1px solid oklch(0.648 0.178 41 / 0.4); }
.doc-card a.inline:hover { color: var(--ember-deep); }

.doc-card ul { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 4px 0 16px; }
.doc-card ul li { position: relative; padding-left: 24px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.85; }
.doc-card ul li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--ember); }
.doc-card ul li strong { color: var(--ink); }

/* meta info box (運営者) */
.doc-meta {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 22px 26px; margin: 6px 0 18px;
}
.doc-meta p { margin-bottom: 10px; font-size: 15px; }
.doc-meta p:last-child { margin-bottom: 0; }
.doc-meta b { color: var(--ink); font-weight: 700; }

.doc-updated { margin-top: 40px; padding-top: 8px; font-family: var(--mono); font-size: 13px; color: var(--ink-faint); }

/* contact form */
.cf-field { margin-bottom: 22px; }
.cf-field:last-of-type { margin-bottom: 8px; }
.cf-label { display: block; font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 9px; }
.cf-label .req { color: var(--ember); margin-left: 4px; }
.cf-label .opt { color: var(--ink-faint); font-weight: 500; font-size: 13px; margin-left: 4px; }
.cf-input, .cf-textarea {
  width: 100%; font-family: var(--sans); font-size: 15px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  transition: all 0.15s;
}
.cf-textarea { resize: vertical; min-height: 150px; line-height: 1.7; }
.cf-input:focus, .cf-textarea:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px oklch(0.648 0.178 41 / 0.15); background: var(--card); }
.cf-input::placeholder, .cf-textarea::placeholder { color: var(--ink-faint); }
.cf-help { margin-top: 8px; font-size: 12.5px; color: var(--ink-faint); }
.cf-submit { margin-top: 4px; }
.cf-sub-section { margin-top: 44px; padding-top: 8px; }
.cf-status { margin-top: 14px; font-size: 13.5px; color: var(--sage-deep); display: none; }
.cf-status.show { display: block; }
html.dark .cf-status { color: oklch(0.78 0.09 158); }

@media (max-width: 560px) {
  .doc-wrap { padding: 0 18px 60px; }
  .doc-card { padding: 30px 22px; }
  .doc-card h2 { font-size: 18px; }
}

/* ===== 入力バリデーション表示 ===== */
.field-error { margin-top: 6px; color: var(--danger); font-size: 12px; font-weight: 600; line-height: 1.4; }
input[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 3px oklch(0.58 0.18 25 / 0.14); }

/* ===== 共有ボタン（公開共有ページ／発行後FAB 共通） ===== */
.share-cta { display: inline-flex; flex-direction: column; align-items: center; gap: 12px; }
.share-cta-label { font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--muted, #8a7d70); }
.share-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.share-btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 700; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  line-height: 1; transition: transform .08s ease, opacity .15s ease, box-shadow .15s ease; }
.share-btn:hover { transform: translateY(-1px); }
.share-btn:active { transform: translateY(0); }
.share-btn svg { width: 16px; height: 16px; flex: none; }
.share-btn.x { background: #000; color: #fff; }
.share-btn.line { background: #06C755; color: #fff; }
.share-btn.native { background: var(--ember, #EA580C); color: #fff; }
.share-btn.copy { background: transparent; color: var(--ink, #2a221c); border-color: rgba(120,110,100,.4); }
.share-btn.copy:hover { background: rgba(120,110,100,.08); }

/* ===== 記事内SVG図解 ===== */
.art-fig { margin: 26px auto 30px; text-align: center; }
.art-fig svg { display: block; margin: 0 auto; }
.art-fig figcaption { margin-top: 10px; color: var(--ink-faint); font-size: 13px; line-height: 1.7; }

/* ===== ガイド一覧のカテゴリ表示 ===== */
.guide-start { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px 24px; margin-bottom: 26px; }
.guide-start h2 { font-size: 16px; margin: 0 0 10px; }
.guide-start ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 7px; }
.guide-start a { color: var(--ember); text-decoration: none; }
.guide-start a:hover { text-decoration: underline; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 36px; }
.cat-chips a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); text-decoration: none; font-size: 13.5px; transition: border-color .2s, color .2s; }
.cat-chips a:hover { border-color: var(--ember); color: var(--ember); }
.cat-chips a .n { color: var(--ink-faint); font-size: 12px; }
.cat-sec { margin-bottom: 46px; scroll-margin-top: 90px; }
.cat-sec > h2 { font-size: 21px; margin: 0 0 6px; }
.cat-lead { color: var(--ink-faint); font-size: 13.5px; margin: 0 0 16px; }
.order-badge { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; background: var(--ember); color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; vertical-align: 2px; }
