/* ===================================
   MAKE ONE × LIFE PLAN STUDIO
   公式HP配色を厳密に踏襲
   --ink #050810 / --text #0a0e1a / --blue #0044ff / --cyan #00b8ff
   =================================== */

:root {
  /* Background — クールホワイト系 */
  --bg: #f5f7fb;
  --bg-alt: #eef2f8;
  --surface: #ffffff;
  --surface-elev: #ffffff;

  /* HP準拠：ボーダー */
  --line: rgba(10, 14, 26, 0.08);
  --border: rgba(10, 14, 26, 0.14);
  --border-soft: rgba(10, 14, 26, 0.07);

  /* テキスト：深紺ベース */
  --ink: #0f1d36;
  --text: #1a2a4a;
  --ink-soft: #2a3d5e;
  --ink-muted: #6b7184;
  --mute: #6b7184;

  /* 高級感のあるラグジュアリーネイビー（オフィス壁面参考） */
  --navy: #1c2e4e;       /* メイン深紺（壁面色） */
  --navy-light: #2a3d5e; /* 上部ライティング */
  --navy-mid: #1c2e4e;   /* 中央 */
  --navy-deep: #0f1d36;  /* 影部 */
  --navy-darkest: #08152a; /* 最深部 */

  /* Brand Blue + Cyan + Silver アクセント */
  --accent: #1e88e5;     /* 明るく洗練されたブルー（ロゴ参考） */
  --blue: #0044ff;
  --accent-deep: #0d47a1;
  --accent-mid: #1565c0;
  --accent-soft: #e3eefb;
  --cyan: #00b8ff;
  --cyan-soft: #d4f1ff;
  --silver: #b0b8c4;     /* メタリックシルバー */
  --silver-soft: #d8dde5;

  /* 上品なメタリックブルーグラデーション（ロゴM参考） */
  --grad: linear-gradient(135deg, #0d47a1 0%, #1976d2 50%, #1e88e5 100%);
  --grad-h: linear-gradient(90deg, #0d47a1 0%, #1e88e5 100%);
  --grad-soft: linear-gradient(135deg, #e3eefb 0%, #d8e3f0 100%);
  --grad-luxury: linear-gradient(180deg, #2a3d5e 0%, #1c2e4e 45%, #0f1d36 100%);

  --success: #00b8ff;
  --danger: #e53935;
  --warn-bg: #e2ecff;

  --serif: "Shippori Mincho", "Noto Serif JP", "Times New Roman", serif;
  --sans: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;

  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem;
  --text-lg: 1.125rem; --text-xl: 1.375rem; --text-2xl: 1.75rem;
  --text-3xl: clamp(2rem, 1.4rem + 2.4vw, 3.2rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.5rem; --space-6: 2rem;
  --space-7: 3rem; --space-8: 4rem;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms; --dur: 320ms; --dur-slow: 600ms;

  --r-sm: 6px; --r-md: 12px; --r-lg: 18px; --r-xl: 28px;

  /* HP準拠：シャドウスケール */
  --shadow-sm: 0 6px 18px -8px rgba(10, 14, 26, 0.12);
  --shadow-md: 0 16px 38px -16px rgba(10, 14, 26, 0.18);
  --shadow-lg: 0 30px 60px -30px rgba(0, 68, 255, 0.32);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  /* オフィス壁面の照明グラデーション：上からスポットライトが落ち、下に向かって深まる */
  background:
    radial-gradient(ellipse at 50% 0%, #2a3d5e 0%, transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(30, 136, 229, 0.18), transparent 50%),
    radial-gradient(ellipse at 20% 70%, rgba(0, 184, 255, 0.10), transparent 55%),
    linear-gradient(180deg, #1c2e4e 0%, #0f1d36 60%, #08152a 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.serif { font-family: var(--serif); font-weight: 600; letter-spacing: 0.02em; }

/* ========== APP SHELL ========== */
.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
}

/* ========== TOPBAR ========== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) 0; gap: var(--space-4);
}
.brand { display: flex; align-items: center; gap: 1.4rem; }

.brand-logo {
  display: inline-flex; align-items: center;
  text-decoration: none;
  position: relative;
  padding: 0.2rem 0.4rem;
  transition: transform var(--dur) var(--ease);
  animation: brandFadeIn 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* ロゴ背後に青のバックドロップグロー（光輪）— 高級感UP */
.brand-logo::before {
  content: ""; position: absolute;
  inset: -18% -8%;
  background:
    radial-gradient(ellipse at center, rgba(30, 136, 229, 0.42), transparent 60%),
    radial-gradient(ellipse at 30% 50%, rgba(0, 184, 255, 0.18), transparent 65%);
  filter: blur(28px);
  z-index: -1;
  opacity: 0.85;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.brand-logo:hover { transform: translateY(-2px) scale(1.015); }
.brand-logo:hover::before { opacity: 1; transform: scale(1.08); }

.brand-logo-img,
.brand-logo-svg {
  height: 144px; width: auto; display: block;
  /* brightness(0)で全ピクセルを黒化 → invert(1)で白化 = 純白シルエット */
  filter:
    brightness(0) invert(1)
    drop-shadow(0 10px 32px rgba(30, 136, 229, 0.55))
    drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
  position: relative;
}

/* ロゴ右の区切り・テキスト — プロらしく控えめに */
.brand-text {
  display: flex; flex-direction: column; gap: 5px;
  padding-left: 1.25rem;
  border-left: 1.5px solid rgba(255, 255, 255, 0.18);
  min-width: 0;
  animation: brandFadeIn 800ms cubic-bezier(0.16, 1, 0.3, 1) 180ms both;
}
.brand-name {
  font-family: var(--sans); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.32em; color: #8fc1f8;
  text-transform: uppercase; line-height: 1;
  white-space: nowrap;
  opacity: 0.92;
}
.brand-sub {
  font-size: 0.86rem; color: #e8edf5;
  letter-spacing: 0.05em; line-height: 1.35;
  font-weight: 500;
  font-family: var(--serif);
}

@keyframes brandFadeIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-logo, .brand-text { animation: none; }
}
.topbar-actions { display: flex; gap: var(--space-2); }

.ghost-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 0.6rem 1rem; font-size: var(--text-sm); font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px; color: #e2e8f0; cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.16); color: white;
  border-color: rgba(255, 255, 255, 0.35); transform: translateY(-1px);
}

/* ========== PROGRESS ========== */
.progress-rail {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 29, 54, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: var(--space-4) 0;
  margin: 0 calc(clamp(1rem, 4vw, 2.5rem) * -1);
  padding-left: clamp(1rem, 4vw, 2.5rem);
  padding-right: clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.progress-line { position: relative; height: 2px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 auto var(--space-4); max-width: 720px; }
.progress-fill { position: absolute; inset: 0 auto 0 0; width: 0%;
  background: var(--grad-h);
  transition: width var(--dur-slow) var(--ease); border-radius: 2px; }

.steps {
  list-style: none; margin: 0; padding: 0; display: flex;
  justify-content: space-between; max-width: 720px; margin: 0 auto; gap: var(--space-2);
}
.steps li { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; flex: 1; position: relative; }
.step-dot {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%; font-size: var(--text-xs); font-weight: 600;
  font-family: var(--serif); color: #c8d0dc;
  transition: all var(--dur) var(--ease);
}
.step-label { font-size: 0.7rem; color: #a8b3c4; letter-spacing: 0.05em;
  font-weight: 500; transition: color var(--dur) var(--ease); }
.steps li.active .step-dot {
  background: var(--grad); border-color: transparent; color: white;
  transform: scale(1.12); box-shadow: 0 0 0 6px rgba(30, 136, 229, 0.22);
}
.steps li.active .step-label { color: white; font-weight: 700; }
.steps li.done .step-dot { background: var(--accent); border-color: var(--accent); color: white; }

@media (max-width: 640px) { .step-label { display: none; } }

/* ========== CANVAS ========== */
.canvas { padding: var(--space-7) 0 var(--space-8); position: relative; min-height: 60vh; }
.step { display: none; animation: stepIn 0.5s var(--ease); }
.step.active { display: block; }

@keyframes stepIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.step-head { max-width: 720px; margin: 0 auto var(--space-6); padding: 0 var(--space-2); }

.step-eyebrow {
  font-size: var(--text-xs); letter-spacing: 0.25em; color: #5fa8f5;
  text-transform: uppercase; font-weight: 700; margin-bottom: var(--space-3);
  display: flex; align-items: center; gap: 0.7rem;
  text-shadow: 0 0 16px rgba(30, 136, 229, 0.35);
}
.step-eyebrow .serif { font-size: 1.1rem; color: #5fa8f5; letter-spacing: 0.05em; }

.step-title {
  font-family: var(--serif); font-size: var(--text-3xl); font-weight: 600;
  letter-spacing: 0.02em; line-height: 1.25; color: white; margin: 0 0 var(--space-3);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.step-sub { color: #c8d0dc; font-size: var(--text-base); margin: 0; max-width: 50ch; }

/* ========== FORM ========== */
.form {
  max-width: 720px; margin: 0 auto;
  background: var(--surface-elev);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-xl); padding: clamp(1.5rem, 4vw, 2.75rem);
  box-shadow: 0 30px 60px -25px rgba(15, 29, 54, 0.65), 0 12px 28px -12px rgba(0, 0, 0, 0.35);
}
.field-grid { display: grid; gap: var(--space-4); margin-bottom: var(--space-4); }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field-grid.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .field-grid.two, .field-grid.three { grid-template-columns: 1fr; }
}
.field { display: flex; flex-direction: column; gap: 0.4rem; position: relative; }
.field-label { font-size: var(--text-sm); font-weight: 500; color: var(--ink-soft); letter-spacing: 0.01em; }

.field input[type="text"], .field input[type="number"], .field input[type="date"], .field select {
  width: 100%; padding: 0.85rem 1rem; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--bg); color: var(--ink);
  font-size: 1.05rem; font-family: inherit;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  min-height: 52px;
}
.field input:hover, .field select:hover { border-color: var(--ink-muted); }
.field input:focus, .field select:focus {
  outline: none; border-color: var(--navy); background: var(--surface-elev);
  box-shadow: 0 0 0 4px rgba(0, 68, 255, 0.1);
}

.input-with-suffix { position: relative; }
.input-with-suffix input { padding-right: 5.5rem; }
.input-with-suffix .suffix {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  font-size: var(--text-sm); color: var(--ink-muted); font-weight: 500;
  letter-spacing: 0.02em; pointer-events: none;
}

/* ========== DIVIDER ========== */
.divider { position: relative; text-align: center; margin: var(--space-6) 0 var(--space-4); }
.divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border-soft); }
.divider span {
  position: relative; display: inline-block; padding: 0 1rem;
  background: var(--surface-elev); font-family: var(--serif);
  font-weight: 600; font-size: var(--text-sm); color: var(--ink-soft); letter-spacing: 0.15em;
}

/* ========== TOGGLE ========== */
.toggle-row { display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0; margin-bottom: var(--space-3); }
.field-label-inline { font-weight: 500; color: var(--ink); }
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; inset: 0;
  background-color: #cbd0d8; border-radius: 30px;
  transition: background-color var(--dur) var(--ease); }
.switch-slider::before { content: ""; position: absolute; height: 24px; width: 24px;
  left: 3px; top: 3px; background-color: white; border-radius: 50%;
  transition: transform var(--dur) var(--ease); box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.switch input:checked + .switch-slider { background-color: var(--navy); }
.switch input:checked + .switch-slider::before { transform: translateX(22px); }

.collapse { max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height var(--dur-slow) var(--ease), opacity var(--dur) var(--ease), margin var(--dur) var(--ease); }
.collapse.open { max-height: 1200px; opacity: 1; margin-bottom: var(--space-4); }

/* ========== CHILDREN ========== */
.children-list { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-3); }
.child-row {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--space-3);
  padding: var(--space-3); background: var(--bg);
  border: 1px solid var(--border-soft); border-radius: var(--r-md);
  align-items: end; animation: rowIn 0.4s var(--ease);
}
@keyframes rowIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) {
  .child-row { grid-template-columns: 1fr 1fr; }
  .child-row > :nth-last-child(1) { grid-column: 1 / -1; justify-self: end; }
}
.child-row .field input { min-height: 44px; padding: 0.6rem 0.85rem; font-size: 1rem; }

.remove-btn {
  width: 44px; height: 44px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: white; color: var(--danger);
  cursor: pointer; display: grid; place-items: center;
  transition: all var(--dur-fast) var(--ease); align-self: end;
}
.remove-btn:hover { background: #fde2e2; border-color: var(--danger); transform: scale(1.04); }

.add-row-btn {
  width: 100%; padding: 0.9rem 1rem; background: transparent;
  border: 1.5px dashed var(--border); border-radius: var(--r-md);
  color: var(--ink-soft); font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2); transition: all var(--dur-fast) var(--ease);
}
.add-row-btn span { font-size: 1.2em; color: var(--accent); font-weight: 600; }
.add-row-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }

/* ========== EDU ========== */
.hint, .hint-bold { font-size: var(--text-sm); color: var(--ink-muted); margin: 0 0 var(--space-3); }
.hint-bold { color: var(--ink-soft); font-weight: 600; }
.edu-grid { display: flex; flex-direction: column; gap: var(--space-3); }
.edu-row {
  display: flex; align-items: center; gap: var(--space-4);
  padding: 0.7rem var(--space-3); background: var(--bg);
  border-radius: var(--r-md); border: 1px solid var(--border-soft);
}
.edu-label { min-width: 80px; font-weight: 500; font-size: var(--text-sm); color: var(--ink-soft); }

.seg-control {
  display: inline-flex; background: var(--surface-elev);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 3px; gap: 2px; flex-wrap: wrap;
}
.seg-control button {
  padding: 0.5rem 1rem; border: none; background: transparent;
  border-radius: 999px; color: var(--ink-muted);
  font-size: var(--text-sm); font-weight: 500; cursor: pointer;
  transition: all var(--dur-fast) var(--ease); min-height: 36px;
}
.seg-control button.active {
  background: var(--navy); color: white;
  box-shadow: 0 2px 6px rgba(0, 68, 255, 0.32);
}
.seg-control button:not(.active):hover { color: var(--ink); }

@media (max-width: 640px) {
  .edu-row { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .edu-label { min-width: auto; }
}

/* ========== CALLOUT ========== */
.callout {
  padding: var(--space-3) var(--space-4); background: var(--accent-soft);
  border-left: 3px solid var(--accent); border-radius: var(--r-sm);
  font-size: var(--text-sm); color: var(--ink-soft); margin-bottom: var(--space-4);
}

/* ========== STEP NAV ========== */
.step-nav {
  max-width: 720px; margin: var(--space-6) auto 0;
  display: flex; justify-content: space-between; gap: var(--space-3);
}
.step-nav > :only-child { margin-left: auto; }

.btn-primary, .btn-secondary {
  padding: 0.95rem 1.75rem; border-radius: 999px;
  font-size: 1rem; font-weight: 600; letter-spacing: 0.02em;
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 56px; border: 1px solid transparent;
}
.btn-primary {
  background: var(--grad); color: white; border-color: transparent;
  box-shadow: 0 8px 22px -8px rgba(0, 68, 255, 0.55);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0033cc 0%, #0066dd 50%, #0099ee 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(0, 68, 255, 0.7);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

/* ========== SCENARIO PILLS ========== */
.scenario-pills {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3);
  max-width: 720px; margin: 0 auto var(--space-4);
}
.pill {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  background: var(--surface-elev); border: 1.5px solid var(--border);
  border-radius: var(--r-lg); text-align: left; cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  font-family: inherit; color: var(--ink-soft);
}
.pill:hover { border-color: var(--ink-muted); background: var(--bg); transform: translateY(-1px); }
.pill.active {
  border-color: transparent; background: var(--grad); color: white;
  box-shadow: 0 10px 28px -10px rgba(0, 68, 255, 0.55);
}
.pill.active[data-scenario="minimal"] {
  border-color: #00b8ff; background: linear-gradient(135deg, #0a1530, #0a4a7a);
  box-shadow: 0 8px 24px -8px rgba(0, 184, 255, 0.4);
}
.pill-icon { font-size: 1.7rem; flex-shrink: 0; }
.pill-title { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.03em; }
.pill-sub { display: block; font-size: var(--text-xs); opacity: 0.85; margin-top: 2px; }
@media (max-width: 640px) { .scenario-pills { grid-template-columns: 1fr; } }

.scenario-form { position: relative; }
.scenario-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); padding: var(--space-4) var(--space-5);
  background: linear-gradient(135deg, #e2ecff, #d4e1ff);
  border-radius: var(--r-lg); margin-bottom: var(--space-5);
  border: 1px solid var(--border-soft); flex-wrap: wrap;
}
.scenario-banner[data-banner="minimal"] {
  background: linear-gradient(135deg, #e2f4ff, #d4ecff);
}
.banner-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.banner-desc { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); max-width: 42ch; }
.btn-preset {
  padding: 0.6rem 1.1rem; background: white; border: 1px solid var(--border);
  border-radius: 999px; font-size: var(--text-sm); font-weight: 600;
  color: var(--ink); cursor: pointer; transition: all var(--dur-fast) var(--ease); white-space: nowrap;
}
.btn-preset:hover { background: var(--accent); border-color: var(--accent); color: white; transform: translateY(-1px); }

.banner-tag {
  display: inline-block; padding: 2px 10px; background: rgba(255,255,255,0.6);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.7rem; font-weight: 600; color: var(--accent);
  margin-left: 0.4rem; letter-spacing: 0.05em; vertical-align: middle;
}
.scenario-banner[data-banner="minimal"] .banner-tag { color: #0078a8; }

.hide { display: none !important; }

.form-section {
  margin: var(--space-5) 0 var(--space-3);
  font-family: var(--serif); font-size: 0.95rem; font-weight: 600;
  letter-spacing: 0.08em; color: var(--ink);
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-soft);
}
.form-section:first-child { margin-top: 0; }
.form-section small {
  font-weight: 400; font-size: 0.75rem; letter-spacing: 0.02em;
  color: var(--ink-muted); margin-left: 0.5rem;
}

/* ========== TREAT CHIPS ========== */
.treat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3); margin-bottom: var(--space-4);
}
.treat-chip {
  position: relative; display: flex; align-items: flex-start; gap: 0.7rem;
  padding: var(--space-3) var(--space-3);
  background: var(--surface-elev); border: 1.5px solid var(--border);
  border-radius: var(--r-lg); cursor: pointer; text-align: left;
  transition: all var(--dur-fast) var(--ease); font-family: inherit;
  overflow: hidden; min-height: 88px;
}
.treat-chip::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent, rgba(0, 68, 255, 0.05));
  opacity: 0; transition: opacity var(--dur-fast) var(--ease); pointer-events: none;
}
.treat-chip:hover {
  border-color: var(--ink-muted); transform: translateY(-2px);
  box-shadow: 0 8px 18px -8px rgba(5, 8, 16, 0.18);
}
.treat-chip:hover::before { opacity: 1; }
.treat-chip.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, #e2ecff, #d4e1ff);
  box-shadow: 0 4px 14px -4px rgba(0, 68, 255, 0.4), inset 0 1px 0 rgba(255,255,255,0.6);
  transform: scale(1.01);
}
.treat-chip[data-pick^="nisa"].selected,
.treat-chip[data-pick="ideco"].selected,
.treat-chip[data-pick="sp500"].selected,
.treat-chip[data-pick="jp-divid"].selected,
.treat-chip[data-pick="crypto"].selected,
.treat-chip[data-pick="sidegig"].selected,
.treat-chip[data-pick="skillup"].selected,
.treat-chip[data-pick="realestate"].selected,
.treat-chip[data-pick="mba"].selected {
  border-color: #00b8ff;
  background: linear-gradient(135deg, #e2f4ff, #d4ecff);
  box-shadow: 0 4px 14px -4px rgba(0, 184, 255, 0.4), inset 0 1px 0 rgba(255,255,255,0.6);
}
.treat-icon { font-size: 1.7rem; line-height: 1; flex-shrink: 0; margin-top: 2px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.08)); }
.treat-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.treat-name { font-weight: 600; font-size: 0.95rem; color: var(--ink); letter-spacing: 0.01em; }
.treat-detail { font-size: 0.72rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; font-weight: 500; }
.treat-quip { font-size: 0.7rem; color: var(--ink-muted); font-style: italic; margin-top: 1px; line-height: 1.35; }
.treat-mark {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--border-soft); color: var(--ink-muted);
  font-size: 14px; font-weight: 700; transition: all var(--dur-fast) var(--ease);
}
.treat-chip.selected .treat-mark { background: var(--accent); color: white; transform: rotate(45deg); }
.treat-chip[data-pick="nisa"].selected .treat-mark,
.treat-chip[data-pick="ideco"].selected .treat-mark,
.treat-chip[data-pick="sp500"].selected .treat-mark,
.treat-chip[data-pick="jp-divid"].selected .treat-mark,
.treat-chip[data-pick="crypto"].selected .treat-mark,
.treat-chip[data-pick="sidegig"].selected .treat-mark,
.treat-chip[data-pick="skillup"].selected .treat-mark,
.treat-chip[data-pick="realestate"].selected .treat-mark,
.treat-chip[data-pick="mba"].selected .treat-mark {
  background: #00b8ff;
}

/* チップ内：ローン購入バッジ */
.chip-loan-badge {
  position: absolute; top: 6px; right: 32px;
  font-size: 13px; line-height: 1;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--accent); color: white;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.treat-chip.selected .treat-mark {
  background: var(--navy); color: white; transform: rotate(0);
}
.treat-chip[data-pick="nisa"].selected .treat-mark,
.treat-chip[data-pick="ideco"].selected .treat-mark,
.treat-chip[data-pick="sp500"].selected .treat-mark,
.treat-chip[data-pick="jp-divid"].selected .treat-mark,
.treat-chip[data-pick="crypto"].selected .treat-mark,
.treat-chip[data-pick="sidegig"].selected .treat-mark,
.treat-chip[data-pick="skillup"].selected .treat-mark,
.treat-chip[data-pick="realestate"].selected .treat-mark,
.treat-chip[data-pick="mba"].selected .treat-mark {
  background: #00b8ff;
}

/* ===========================================
   💳 支払い設定セクション（独立配置）
   =========================================== */
.pay-configs {
  display: flex; flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.pay-empty {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: var(--r-md);
  font-size: 0.85rem; color: var(--ink-soft);
  line-height: 1.6;
}
.pay-empty-icon { font-size: 1.5rem; flex-shrink: 0; }
.pay-empty strong { color: var(--ink); font-weight: 700; }

.pay-row-card {
  background: white;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  display: flex; flex-direction: column;
  gap: var(--space-3);
  transition: box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  box-shadow: 0 1px 3px rgba(20,30,50,0.04);
}
.pay-row-card:hover {
  border-color: var(--border);
  box-shadow: 0 4px 12px -4px rgba(20,30,50,0.08);
}

.pay-row-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-soft);
}
.pay-row-icon {
  font-size: 2rem; line-height: 1;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: var(--bg);
  border-radius: 12px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.06));
}
.pay-row-info { flex: 1; min-width: 0; }
.pay-row-name {
  font-family: var(--serif);
  font-size: 1.05rem; font-weight: 600;
  color: var(--ink); letter-spacing: 0.01em;
}
.pay-row-meta {
  font-size: 0.78rem; color: var(--ink-muted);
  font-weight: 500; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.pay-row-controls {
  display: flex; flex-direction: column;
  gap: var(--space-3);
}

.pay-method-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
}
.pay-tab {
  padding: 0.7rem 0.5rem; border: none; background: transparent;
  border-radius: 7px; font-size: 0.88rem; font-weight: 600;
  color: var(--ink-muted); cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  font-family: inherit; min-height: 44px;
}
.pay-tab:hover { color: var(--ink); background: rgba(0,0,0,0.04); }
.pay-tab.active {
  background: var(--navy); color: white;
  box-shadow: 0 2px 6px rgba(0, 68, 255, 0.32);
}
.pay-tab.active[data-method-set="loan"] {
  background: var(--grad);
  box-shadow: 0 4px 12px -2px rgba(0, 68, 255, 0.5);
}
.pay-tab.active[data-method-set="installment"] {
  background: #00b8ff;
  box-shadow: 0 2px 6px rgba(0, 184, 255, 0.4);
}

.pay-options-row {
  display: flex; gap: var(--space-3); flex-wrap: wrap;
  align-items: flex-end;
}
.pay-field { display: flex; flex-direction: column; gap: 4px; }
.pay-field label {
  font-size: 0.72rem; font-weight: 600;
  color: var(--ink-soft); letter-spacing: 0.05em;
}
.pay-field select {
  font-size: 1rem; padding: 0.65rem 2rem 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px; background: white;
  cursor: pointer; min-height: 44px; min-width: 110px;
  font-family: inherit; color: var(--ink);
  font-weight: 600; font-variant-numeric: tabular-nums;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' fill='none' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  transition: all var(--dur-fast) var(--ease);
}
.pay-field select:hover { border-color: var(--ink-muted); }
.pay-field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 68, 255, 0.15);
}
.pay-field-hint {
  font-size: 0.72rem; color: var(--ink-muted);
  align-self: center; padding-bottom: 0.3rem;
  font-style: italic;
}

.pay-result {
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, #eef2fb, #e2ecff);
  border-radius: 10px;
  border-left: 4px solid var(--accent);
}
.pay-result-main {
  font-family: var(--serif);
  font-size: 1.1rem; font-weight: 700;
  color: var(--ink); letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.pay-result-sub {
  font-size: 0.78rem; color: var(--ink-soft);
  margin-top: 4px; font-variant-numeric: tabular-nums;
}

/* Method-specific result colors */
.pay-row-card:has(.pay-tab.active[data-method-set="loan"]) .pay-result {
  background: linear-gradient(135deg, #e2ecff, #d4e1ff);
  border-left-color: var(--accent);
}
.pay-row-card:has(.pay-tab.active[data-method-set="installment"]) .pay-result {
  background: linear-gradient(135deg, #d4f1ff, #c2eaff);
  border-left-color: #00b8ff;
}
.pay-row-card:has(.pay-tab.active[data-method-set="cash"]) .pay-result {
  background: linear-gradient(135deg, #eef2fb, #e8edf6);
  border-left-color: var(--navy);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .pay-row-card { padding: var(--space-3); }
  .pay-row-icon { font-size: 1.6rem; width: 40px; height: 40px; }
  .pay-row-name { font-size: 0.95rem; }
  .pay-tab { font-size: 0.8rem; padding: 0.6rem 0.3rem; }
  .pay-field { flex: 1; min-width: 0; }
  .pay-field select { min-width: 0; width: 100%; }
  .pay-result-main { font-size: 1rem; }
  .pay-empty { padding: var(--space-3); font-size: 0.78rem; }
  .chip-loan-badge { width: 18px; height: 18px; font-size: 11px; right: 28px; }
}

/* ========== RESULTS ========== */
.results-step { max-width: none; }
.results-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap;
}
.results-head-top { flex: 1; min-width: 280px; }
.results-actions { display: flex; gap: var(--space-3); }

@media print {
  .results-head, .step-nav, .topbar, .progress-rail, .results-actions { display: none !important; }
}

.report-root {
  background: var(--surface-elev); border-radius: var(--r-xl);
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 40px 80px -30px rgba(15, 29, 54, 0.7), 0 16px 36px -16px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.report-cover {
  text-align: center; padding: var(--space-5) 0 var(--space-6);
  border-bottom: 1px solid var(--border-soft); margin-bottom: var(--space-6);
}
.cover-eyebrow {
  font-size: var(--text-xs); letter-spacing: 0.4em; color: var(--accent);
  text-transform: uppercase; font-weight: 600; margin-bottom: var(--space-3);
}
.cover-name {
  font-family: var(--serif); font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem);
  font-weight: 600; color: var(--ink); margin: 0 0 var(--space-3); letter-spacing: 0.02em;
}
.cover-meta { display: flex; justify-content: center; align-items: center; gap: var(--space-2);
  color: var(--ink-muted); font-size: var(--text-sm); }
.cover-meta .dot { color: var(--border); }

/* ========== VERDICT ========== */
.verdict-box {
  margin-bottom: var(--space-4); padding: var(--space-4) var(--space-5);
  background: var(--grad-soft);
  border: 1px solid rgba(0, 68, 255, 0.18); border-radius: var(--r-lg);
  position: relative; overflow: hidden;
}
.verdict-box::before { content: none; }
.verdict-eyebrow {
  font-size: var(--text-xs); letter-spacing: 0.3em; color: var(--accent);
  text-transform: uppercase; font-weight: 600; margin-bottom: var(--space-2); display: block;
}
.verdict {
  font-family: var(--serif); font-size: clamp(1.15rem, 0.8rem + 1.2vw, 1.5rem);
  line-height: 1.6; color: var(--ink); font-weight: 500; letter-spacing: 0.02em;
}
.verdict .vlife {
  display: inline-block; padding: 2px 14px; background: white;
  border: 1px solid var(--border); border-radius: 999px;
  font-family: var(--sans); font-size: 0.85rem; font-weight: 600;
  margin-right: 0.5em; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.verdict .vincome {
  display: inline-block; padding: 2px 14px; background: var(--grad); color: white;
  border-radius: 999px; font-family: var(--serif); font-size: 0.9rem; font-weight: 700;
  margin-right: 0.5em; letter-spacing: 0.02em;
  box-shadow: 0 6px 14px -3px rgba(0, 68, 255, 0.55);
}

/* ========== BADGES ========== */
.badge-strip {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: var(--space-5); justify-content: flex-start;
}
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.9rem; background: var(--surface-elev);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; color: var(--ink);
  letter-spacing: 0.02em; box-shadow: 0 2px 6px -2px rgba(20,30,50,0.08);
  animation: badgePop 0.5s var(--ease) both;
}
.badge-icon { font-size: 1.1rem; line-height: 1; }
@keyframes badgePop { from { opacity: 0; transform: scale(0.7) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ========== HERO REQUIRED ========== */
.hero-required {
  margin-bottom: var(--space-6); padding: var(--space-5);
  /* オフィス壁面のように上から下へ深まる照明グラデーション */
  background: linear-gradient(180deg, #2a3d5e 0%, #1c2e4e 40%, #0f1d36 100%);
  border-radius: var(--r-xl); color: white; position: relative; overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(15, 29, 54, 0.55);
}
/* スポットライトの落ち際（右上） */
.hero-required::before {
  content: ""; position: absolute; top: -30%; right: -10%;
  width: 60%; height: 180%;
  background: radial-gradient(ellipse, rgba(30, 136, 229, 0.28), rgba(0, 136, 255, 0.1) 40%, transparent 70%);
  transform: rotate(-12deg); pointer-events: none;
}
/* 環境光の柔らかな反射（左下） */
.hero-required::after {
  content: ""; position: absolute; bottom: -40%; left: -10%;
  width: 50%; height: 140%;
  background: radial-gradient(ellipse, rgba(0, 184, 255, 0.16), transparent 70%);
  transform: rotate(18deg); pointer-events: none;
}
.hero-eyebrow {
  font-size: var(--text-xs); letter-spacing: 0.3em; text-transform: uppercase;
  opacity: 0.7; margin-bottom: var(--space-3); font-weight: 600;
}
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); position: relative; }
@media (max-width: 640px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-card {
  padding: var(--space-4); background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1); border-radius: var(--r-lg);
  backdrop-filter: blur(6px);
}
.hero-card.ideal {
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.22), rgba(30, 136, 229, 0.05));
  border-color: rgba(30, 136, 229, 0.42);
}
.hero-card.minimal {
  background: linear-gradient(135deg, rgba(176, 184, 196, 0.18), rgba(176, 184, 196, 0.04));
  border-color: rgba(176, 184, 196, 0.35);
}
.hero-label { font-size: var(--text-sm); opacity: 0.85; margin-bottom: var(--space-2); font-weight: 500; letter-spacing: 0.02em; }
.hero-value {
  font-family: var(--serif); font-size: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
  font-weight: 700; line-height: 1; letter-spacing: 0.01em;
  display: flex; align-items: baseline; gap: 0.4rem; margin-bottom: var(--space-2);
}
.hero-card.ideal .hero-value {
  color: #5fa8f5;
  text-shadow: 0 0 32px rgba(30, 136, 229, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
}
.hero-card.minimal .hero-value {
  color: #c8d0dc;
  text-shadow: 0 0 32px rgba(176, 184, 196, 0.45), 0 2px 4px rgba(0, 0, 0, 0.3);
}
.hero-value em {
  font-style: normal; font-family: var(--sans); font-size: 0.32em;
  opacity: 0.75; font-weight: 500; letter-spacing: 0.04em;
}
.hero-diff { font-size: var(--text-sm); opacity: 0.85; font-weight: 500; }
.hero-diff .gap-positive {
  display: inline-block; padding: 2px 10px;
  background: rgba(255, 80, 80, 0.22); color: #ff8a8a;
  border-radius: 999px; font-weight: 600;
}
.hero-diff .gap-negative {
  display: inline-block; padding: 2px 10px;
  background: rgba(0, 184, 255, 0.22); color: #66d4ff;
  border-radius: 999px; font-weight: 600;
}

/* ========== CARDS ========== */
.chart-card, .table-card {
  background: var(--surface-elev); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); padding: var(--space-5); margin-bottom: var(--space-5);
}
.card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap;
}
.card-eyebrow {
  font-size: 0.7rem; letter-spacing: 0.25em; color: var(--accent);
  text-transform: uppercase; font-weight: 600; margin-bottom: 0.3rem;
}
.card-title { font-family: var(--serif); font-size: var(--text-xl); font-weight: 600; margin: 0; color: var(--ink); }

.legend { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; font-size: var(--text-xs); color: var(--ink-muted); }
.legend-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.chart-wrap { height: clamp(280px, 38vw, 420px); position: relative; }

.advisory {
  margin-top: var(--space-4); padding: var(--space-3) var(--space-4);
  background: var(--warn-bg); border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); font-size: var(--text-sm);
  color: var(--ink-soft); line-height: 1.7;
}
.advisory.success { background: #d4f1ff; border-left-color: var(--cyan); }
.advisory:empty { display: none; }

/* ========== INCOME LADDER ========== */
.ladder { padding: var(--space-4) var(--space-2) 0; }
.ladder-bar {
  position: relative; height: 72px; background: var(--bg);
  border-radius: 36px; margin: 0 0 var(--space-3); overflow: visible;
}
.ladder-zones { position: absolute; inset: 0; display: flex; border-radius: 36px; overflow: hidden; }
.zone {
  flex: 1; display: grid; place-items: center;
  font-size: var(--text-xs); font-weight: 600;
  color: var(--ink-soft); letter-spacing: 0.05em; position: relative;
}
.zone:not(:last-child)::after { content: ""; position: absolute; right: 0; top: 20%; bottom: 20%; width: 1px; background: rgba(0,0,0,0.06); }
.zone-1 { background: #fce8e8; color: #b03434; }
.zone-2 { background: #f1f3f8; color: #4a5266; }
.zone-3 { background: #d4f1ff; color: #006a8c; }
.zone-4 { background: #d4e1ff; color: #0033cc; }

.ladder-marks { position: absolute; inset: 0; pointer-events: none; }
.ladder-mark {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.ladder-mark .pin {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; color: white; font-weight: 700;
  border: 3px solid white; box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  z-index: 2; font-family: var(--serif);
}
.ladder-mark.current .pin { background: #050810; }
.ladder-mark.minimal .pin { background: #00b8ff; }
.ladder-mark.ideal .pin { background: #0044ff; }
.ladder-mark .pin-label {
  position: absolute; white-space: nowrap; font-size: 0.7rem; font-weight: 600;
  background: white; padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12); letter-spacing: 0.02em; z-index: 3;
}
.ladder-mark.current .pin-label { top: -34px; color: #050810; }
.ladder-mark.minimal .pin-label { bottom: -34px; color: #0078a8; }
.ladder-mark.ideal .pin-label { bottom: -34px; color: #0033cc; }

.ladder-axis {
  display: flex; justify-content: space-between; padding: 0 4px;
  margin-top: var(--space-2); font-size: var(--text-xs);
  color: var(--ink-muted); font-variant-numeric: tabular-nums;
}
.ladder-axis span { font-weight: 500; }
.ladder-legend {
  display: flex; justify-content: center; gap: var(--space-4);
  margin-top: var(--space-4); padding-top: var(--space-3);
  border-top: 1px solid var(--border-soft); flex-wrap: wrap;
}
.dot-cur { background: #050810; }
.dot-min { background: #00b8ff; }
.dot-ideal { background: #0044ff; }

/* ========== LIFESTYLE BREAKDOWN ========== */
.lifestyle-card { background: var(--surface-elev); }
.lifestyle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
@media (max-width: 720px) { .lifestyle-grid { grid-template-columns: 1fr; } }
.lifestyle-col {
  padding: var(--space-4); background: var(--bg);
  border-radius: var(--r-lg); border: 1px solid var(--border-soft);
}
.lifestyle-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin-bottom: var(--space-2); }
.lifestyle-total { font-size: var(--text-sm); color: var(--ink-soft); margin-bottom: var(--space-3); }
.lifestyle-total strong { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); margin: 0 0.2em; }
.lifestyle-bar {
  display: flex; height: 14px; border-radius: 7px;
  overflow: hidden; background: var(--border-soft); margin-bottom: var(--space-3);
}
.lifestyle-bar-seg { height: 100%; transition: width var(--dur) var(--ease); }
.seg-living { background: #0044ff; }
.seg-housing { background: #050810; }
.seg-education { background: #00b8ff; }
.seg-events { background: #6da3ff; }

.lifestyle-items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.lifestyle-items li { display: flex; justify-content: space-between; align-items: center;
  font-size: var(--text-sm); padding: 4px 0; }
.lifestyle-items li .label { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink-soft); }
.lifestyle-items li .label i { width: 10px; height: 10px; border-radius: 3px; }
.lifestyle-items li .value { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

/* ========== REFERENCE STATISTICS (4-step presentation) ========== */
.reference-card { background: var(--surface-elev); }

/* Step navigation (prev/indicator/next) */
.ref-step-nav { display: flex; align-items: center; gap: 0.5rem; }
.ref-step-nav button {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.5rem 0.9rem; background: var(--surface-elev);
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; font-size: 0.82rem; font-weight: 600;
  color: var(--ink-soft); font-family: inherit;
  transition: all var(--dur-fast) var(--ease);
}
.ref-step-nav button:hover {
  background: var(--navy); color: white;
  border-color: var(--navy); transform: translateY(-1px);
}
#refStepIndicator {
  font-family: var(--serif); font-weight: 700;
  font-size: 1.05rem; color: var(--accent);
  letter-spacing: 0.1em; padding: 0 0.6rem;
  min-width: 50px; text-align: center;
}

/* Quick-jump tabs (smaller, secondary) */
.ref-tabs {
  display: flex; flex-wrap: wrap; margin: 0 0 var(--space-4);
}
.ref-tabs button { padding: 0.4rem 1rem; min-height: 34px; font-size: var(--text-sm); }

/* Panels */
.ref-panels { position: relative; }
.ref-panel { display: none; }
.ref-panel.active { display: block; animation: refFade 0.4s var(--ease); }
@keyframes refFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Step head (badge + title + text) */
.ref-step-head { margin-bottom: var(--space-4); }
.ref-step-badge {
  display: inline-block; padding: 4px 12px;
  background: var(--navy); color: white;
  border-radius: 999px; font-size: 0.7rem;
  font-weight: 700; letter-spacing: 0.15em;
  margin-bottom: var(--space-3); font-family: var(--serif);
}
.ref-step-title {
  font-family: var(--serif); font-size: 1.45rem;
  font-weight: 600; margin: 0 0 var(--space-2);
  color: var(--ink); letter-spacing: 0.02em;
}
.ref-step-text {
  margin: 0; font-size: 0.98rem;
  color: var(--ink-soft); line-height: 1.75;
  max-width: 62ch;
}

/* Content: image OR chart fallback — image area is the star */
.ref-content {
  position: relative;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ref-panel.has-image .ref-content {
  border-style: solid;
  border-color: var(--border-soft);
  background: white;
}
.ref-image {
  display: none; max-width: 100%; max-height: 540px;
  height: auto; border-radius: var(--r-md);
}
.ref-panel.has-image .ref-image { display: block; }
.ref-panel.has-image .ref-chart-wrap { display: none; }

.ref-chart-wrap {
  height: clamp(380px, 50vw, 520px);
  width: 100%;
  position: relative;
}

.ref-source {
  font-size: 0.72rem; color: var(--ink-muted);
  letter-spacing: 0.02em; margin-bottom: var(--space-3);
  text-align: right; font-style: italic;
}
.ref-hint {
  display: block; margin-top: 0.3rem;
  font-style: normal; opacity: 0.85;
}
.ref-hint::before { content: "📷 "; }
.ref-hint:empty { display: none; }
.ref-hint:empty::before { content: none; }

/* ========== COMPANY MESSAGE ========== */
.company-message {
  margin-top: var(--space-5); padding: var(--space-5) var(--space-6);
  /* オフィスエントランスの壁面照明グラデーション */
  background: linear-gradient(180deg, #2a3d5e 0%, #1c2e4e 45%, #0f1d36 100%);
  color: white; border-radius: var(--r-lg);
  position: relative; overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(15, 29, 54, 0.55);
}
.company-message::before {
  content: ""; position: absolute; top: -25%; right: -12%;
  width: 60%; height: 150%;
  background: radial-gradient(ellipse, rgba(30, 136, 229, 0.26), rgba(0, 136, 255, 0.12) 40%, transparent 70%);
  transform: rotate(-15deg); pointer-events: none;
}
.company-message::after {
  content: ""; position: absolute; bottom: -35%; left: -15%;
  width: 50%; height: 140%;
  background: radial-gradient(ellipse, rgba(0, 184, 255, 0.18), transparent 70%);
  transform: rotate(15deg); pointer-events: none;
}
.cm-eyebrow {
  font-family: var(--serif); font-size: 1.1rem; letter-spacing: 0.08em;
  color: #c8d0dc; font-weight: 600; margin-bottom: var(--space-3);
  position: relative;
  text-shadow: 0 0 18px rgba(176, 184, 196, 0.35);
}
.company-message p {
  margin: 0; font-family: var(--serif); font-size: 1.05rem;
  line-height: 1.85; letter-spacing: 0.02em; position: relative;
}
.company-message strong {
  font-weight: 700;
  color: #5fa8f5;
  text-shadow: 0 0 16px rgba(30, 136, 229, 0.4);
}
.company-message em {
  font-style: normal; display: inline-block; margin-top: 0.6rem;
  font-size: 0.92em; opacity: 0.88;
}

/* ========== TABLE ========== */
.table-tabs button { padding: 0.4rem 0.9rem; min-height: 32px; font-size: var(--text-xs); }

.table-controls { display: flex; gap: var(--space-3); align-items: center; }
.check { display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: var(--text-sm); color: var(--ink-soft); cursor: pointer; }

.table-wrap {
  overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border-soft);
}

.cashflow-table {
  width: 100%; min-width: 880px;
  border-collapse: separate; border-spacing: 0;
  font-size: 0.82rem; background: var(--surface-elev); table-layout: fixed;
}
.cashflow-table col.c-year   { width: 64px; }
.cashflow-table col.c-age    { width: 104px; }
.cashflow-table col.c-num    { width: 78px; }
.cashflow-table col.c-event  { width: auto; min-width: 180px; }
.cashflow-table col.c-flow   { width: 88px; }
.cashflow-table col.c-asset  { width: 104px; }

.cashflow-table thead th {
  position: sticky; top: 0; z-index: 2; background: var(--bg);
  padding: 0.7rem 0.7rem; font-size: 0.7rem; font-weight: 600;
  color: var(--ink-soft); letter-spacing: 0.08em;
  text-align: right; white-space: nowrap;
  border-bottom: 1.5px solid var(--border);
}
.cashflow-table thead th.tl { text-align: left; }

.cashflow-table tbody td {
  padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border-soft);
  text-align: right; font-variant-numeric: tabular-nums;
  vertical-align: middle; white-space: nowrap; color: var(--ink);
  background: var(--surface-elev); transition: background var(--dur-fast) var(--ease);
}
.cashflow-table tbody td.tl { text-align: left; font-weight: 600; color: var(--ink); }
.cashflow-table tbody td .age-sub { font-weight: 400; color: var(--ink-muted); font-size: 0.95em; }

.cashflow-table tbody td.event-cell {
  white-space: normal; text-align: left;
  padding: 0.4rem 0.7rem; line-height: 1.5; font-weight: 400;
}
.cashflow-table tbody tr:nth-child(even) td { background: #f8f9fc; }
.cashflow-table tbody tr.decade-start td { border-top: 1.5px solid var(--border); }
.cashflow-table tbody tr.has-event td { background: #eef3fc; }
.cashflow-table tbody tr:hover td { background: #e2ecff; }

.cashflow-table tbody td.cell-neg { color: var(--danger); font-weight: 700; }
.cashflow-table tbody td.cell-pos { color: #0078a8; font-weight: 600; }
.cashflow-table tbody td .dim { color: #bdc3c8; font-weight: 400; }

.event-chip {
  display: inline-block; padding: 1px 8px;
  background: var(--surface-elev); border: 1px solid var(--border-soft);
  border-radius: 5px; font-size: 0.7rem; color: var(--ink-soft);
  margin: 1px 3px 1px 0; white-space: nowrap;
  font-weight: 500; line-height: 1.6; font-variant-numeric: tabular-nums;
}
.event-chip.major {
  background: #e2ecff; border-color: #6da3ff;
  color: #0033cc; font-weight: 600;
}
.event-chip.housing {
  background: #d4f1ff; border-color: #00b8ff;
  color: #006a8c; font-weight: 600;
}

.report-footer {
  margin-top: var(--space-6); padding-top: var(--space-4);
  border-top: 1px solid var(--border-soft);
  font-size: var(--text-xs); color: var(--ink-muted);
  text-align: center; letter-spacing: 0.02em;
}

/* ========== TOAST & OVERLAY ========== */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy-deep); color: white;
  padding: 0.85rem 1.5rem; border-radius: 999px;
  font-size: var(--text-sm); font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

.overlay {
  position: fixed; inset: 0;
  background: rgba(15, 29, 54, 0.6);
  display: grid; place-items: center; z-index: 200;
  backdrop-filter: blur(4px);
}
.overlay[hidden] { display: none; }
.overlay-content {
  background: var(--surface-elev); padding: var(--space-6) var(--space-7);
  border-radius: var(--r-lg); text-align: center;
  display: flex; flex-direction: column; gap: var(--space-3);
  align-items: center; box-shadow: var(--shadow-lg);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sm-only { display: none; }
@media (max-width: 640px) { .sm-only { display: inline; } }

/* ===================================
   PDF MODE — html2pdf 出力時の最適化
   =================================== */
/* PDF出力時：A4ページ幅(190mm=720px)に厳格に固定 */
.report-root.pdf-mode {
  box-shadow: none !important;
  border: none !important;
  background: white !important;
  width: 720px !important;
  max-width: 720px !important;
  min-width: 720px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
/* PDF内の全要素を 720px の中に収める */
.report-root.pdf-mode *,
.report-root.pdf-mode *::before,
.report-root.pdf-mode *::after {
  max-width: 100% !important;
  box-sizing: border-box !important;
}
/* テーブルが page 幅を超えないように min-width をリセット */
.report-root.pdf-mode .cashflow-table {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed !important;
}
/* テーブル各列幅を最適化（720px 内に収まる配分） */
.report-root.pdf-mode .cashflow-table col.c-year   { width: 42px !important; }
.report-root.pdf-mode .cashflow-table col.c-age    { width: 64px !important; }
.report-root.pdf-mode .cashflow-table col.c-num    { width: 62px !important; }
.report-root.pdf-mode .cashflow-table col.c-event  { width: auto !important; min-width: 130px !important; }
.report-root.pdf-mode .cashflow-table col.c-flow   { width: 68px !important; }
.report-root.pdf-mode .cashflow-table col.c-asset  { width: 80px !important; }
.report-root.pdf-mode .table-wrap { overflow: visible !important; }
.report-root.pdf-mode .chart-wrap { height: 220px !important; }
/* 装飾を抑えてファイル軽量化＆視認性UP */
.report-root.pdf-mode * {
  text-shadow: none !important;
  filter: none !important;
  animation: none !important;
  transition: none !important;
}

/* PDF時：4ステップ全部を縦に並べる（コンパクトに） */
.report-root.pdf-mode .ref-tabs,
.report-root.pdf-mode .ref-step-nav { display: none !important; }
.report-root.pdf-mode .ref-panels {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.report-root.pdf-mode .ref-panel {
  display: block !important;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: white;
}
.report-root.pdf-mode .ref-step-head { margin-bottom: 0.5rem; }
.report-root.pdf-mode .ref-step-badge { font-size: 0.6rem; padding: 2px 8px; margin-bottom: 0.4rem; }
.report-root.pdf-mode .ref-step-title { font-size: 1rem; margin-bottom: 0.3rem; }
.report-root.pdf-mode .ref-step-text { font-size: 0.75rem; line-height: 1.5; }
.report-root.pdf-mode .ref-content {
  min-height: auto; padding: 0.3rem;
  border: 1px solid var(--border-soft); border-style: solid;
}
.report-root.pdf-mode .ref-chart-wrap { height: 220px !important; }
.report-root.pdf-mode .ref-image { max-height: 240px; }
.report-root.pdf-mode .ref-source { font-size: 0.62rem; margin-bottom: 0.3rem; }
.report-root.pdf-mode .ref-hint { display: none; }

/* PDF時：分割禁止は「葉ノード」だけに限定（親に掛けると逆効果） */
/* .reference-card は意図的に除外：子のref-panelが自然に複数収まるように */
.report-root.pdf-mode .verdict-box,
.report-root.pdf-mode .hero-required,
.report-root.pdf-mode .chart-card,
.report-root.pdf-mode .lifestyle-card,
.report-root.pdf-mode .company-message,
.report-root.pdf-mode .table-card,
.report-root.pdf-mode .ref-panel,
.report-root.pdf-mode .badge-strip,
.report-root.pdf-mode .kpi-grid,
.report-root.pdf-mode .lifestyle-grid,
.report-root.pdf-mode .ladder,
.report-root.pdf-mode .chart-wrap,
.report-root.pdf-mode .ref-chart-wrap,
.report-root.pdf-mode .ref-content,
.report-root.pdf-mode .card-head,
.report-root.pdf-mode .report-cover,
.report-root.pdf-mode tr {
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

/* テーブルだけ新ページから（長いので独立した方が見やすい） */
.report-root.pdf-mode .table-card {
  page-break-before: always !important;
  break-before: page !important;
}

/* チャートの高さを A4 1ページに収まるサイズに最適化 */
.report-root.pdf-mode .chart-wrap { height: 280px !important; max-height: 280px !important; }
.report-root.pdf-mode .ref-chart-wrap { height: 200px !important; max-height: 200px !important; }
.report-root.pdf-mode .ladder-bar { height: 60px; }

/* リファレンス：4パネルを 2×2 グリッドで1ページに収める */
.report-root.pdf-mode .reference-card { padding: 10px !important; }
.report-root.pdf-mode .ref-panels {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}
.report-root.pdf-mode .ref-panel {
  display: block !important;
  padding: 8px 10px !important;
  border: 1px solid #e5e8ec !important;
  border-radius: 6px !important;
  background: white !important;
  max-height: 240px;
}
.report-root.pdf-mode .ref-chart-wrap {
  height: 150px !important;
  max-height: 150px !important;
}
.report-root.pdf-mode .ref-step-head { margin-bottom: 4px !important; }
.report-root.pdf-mode .ref-step-badge { font-size: 8px !important; padding: 1px 6px !important; }
.report-root.pdf-mode .ref-step-title { font-size: 11px !important; margin-bottom: 2px !important; }
.report-root.pdf-mode .ref-step-text { font-size: 9px !important; line-height: 1.4 !important; }
.report-root.pdf-mode .ref-source { font-size: 8px !important; }

/* セクション間の余白圧縮で1ページにより多く収める */
.report-root.pdf-mode .chart-card,
.report-root.pdf-mode .table-card,
.report-root.pdf-mode .lifestyle-card {
  margin-bottom: 12px !important;
  padding: 14px !important;
  box-shadow: none !important;
  border: 1px solid #e5e8ec !important;
  border-radius: 8px !important;
}

/* ヒーロー必要年収：シンプル深紺で軽量化、装飾擬似要素を非表示 */
.report-root.pdf-mode .hero-required {
  background: #050810 !important;
  padding: 18px !important;
  border-radius: 8px !important;
  margin-bottom: 14px !important;
}
.report-root.pdf-mode .hero-required::before,
.report-root.pdf-mode .hero-required::after,
.report-root.pdf-mode .company-message::before,
.report-root.pdf-mode .company-message::after,
.report-root.pdf-mode .verdict-box::before {
  display: none !important;
}

/* 会社メッセージ：シンプル深紺で軽量化 */
.report-root.pdf-mode .company-message {
  background: #050810 !important;
  padding: 22px 24px !important;
  border-radius: 8px !important;
}

/* verdict-box：軽量グラデを単色淡青に */
.report-root.pdf-mode .verdict-box {
  background: #e8eef8 !important;
  padding: 14px 16px !important;
  border-radius: 8px !important;
  margin-bottom: 12px !important;
}

/* レポートカバー：余白圧縮して綺麗に */
.report-root.pdf-mode .report-cover {
  padding: 8px 0 16px !important;
  margin-bottom: 14px !important;
}

/* KPIグリッドの余白整理 */
.report-root.pdf-mode .kpi-grid { gap: 8px !important; margin-bottom: 12px !important; }
.report-root.pdf-mode .lifestyle-grid { gap: 10px !important; }

/* バッジ：余白とドロップシャドウ削除 */
.report-root.pdf-mode .badge {
  box-shadow: none !important;
  padding: 3px 9px !important;
}
.report-root.pdf-mode .badge-strip { margin-bottom: 12px !important; gap: 4px !important; }

/* テーブル：余白圧縮、罫線をシャープに */
.report-root.pdf-mode .cashflow-table { font-size: 10.5px !important; }
.report-root.pdf-mode .cashflow-table thead th { padding: 6px 5px !important; font-size: 9px !important; }
.report-root.pdf-mode .cashflow-table tbody td { padding: 5px 5px !important; }
.report-root.pdf-mode .event-chip { font-size: 9px !important; padding: 1px 5px !important; }

/* report-footer：版数タグ含めて軽く */
.report-root.pdf-mode .report-footer { margin-top: 18px !important; font-size: 9px !important; }
.report-root.pdf-mode .version-tag { background: #f0f0f3 !important; }

.version-tag {
  display: inline-block;
  margin-left: 0.8em;
  padding: 1px 8px;
  background: var(--border-soft);
  border-radius: 999px;
  font-size: 0.65rem;
  color: var(--ink-muted);
  font-family: var(--sans);
  letter-spacing: 0.05em;
}

/* ===========================================
   @media print — ブラウザのネイティブPDF印刷
   =========================================== */
@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {
  /* ベース：白背景、印刷不要要素を非表示 */
  html, body {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #0f1d36 !important;
  }
  body.printing .topbar,
  body.printing .progress-rail,
  body.printing .results-head,
  body.printing .step:not([data-step="4"]),
  body.printing .overlay,
  body.printing .toast { display: none !important; }

  /* 親レイアウトを解除して reportRoot を全幅で表示 */
  body.printing .app { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  body.printing .canvas { padding: 0 !important; min-height: 0 !important; }
  body.printing .results-step { padding: 0 !important; margin: 0 !important; max-width: none !important; }

  #reportRoot {
    background: white !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  /* 装飾削減で軽量化 */
  #reportRoot * {
    text-shadow: none !important;
    filter: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* テーブル：印刷時は min-width 解除＆コンパクト化 */
  .cashflow-table {
    min-width: 0 !important;
    width: 100% !important;
    font-size: 9px !important;
    table-layout: fixed !important;
  }
  .cashflow-table thead th { padding: 4px 3px !important; font-size: 8px !important; }
  .cashflow-table tbody td { padding: 3px 4px !important; }
  .event-chip { font-size: 7.5px !important; padding: 1px 4px !important; }

  /* リファレンス：2×2 グリッドで4種類を1ページに */
  .reference-card .ref-tabs,
  .reference-card .ref-step-nav { display: none !important; }
  .reference-card .ref-panels {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .reference-card .ref-panel {
    display: block !important;
    padding: 6px 8px !important;
    border: 1px solid #e5e8ec !important;
    border-radius: 6px !important;
    background: white !important;
  }
  .ref-chart-wrap { height: 150px !important; }
  .ref-step-title { font-size: 11px !important; }
  .ref-step-text { font-size: 9px !important; line-height: 1.4 !important; }
  .ref-source { font-size: 8px !important; }

  /* チャート高さ調整 */
  .chart-wrap { height: 220px !important; }

  /* セクション間の余白圧縮 */
  .chart-card, .table-card, .lifestyle-card {
    padding: 12px !important;
    margin-bottom: 10px !important;
    box-shadow: none !important;
    border: 1px solid #e5e8ec !important;
    border-radius: 6px !important;
  }
  .hero-required, .company-message { padding: 16px !important; border-radius: 6px !important; }
  .verdict-box { padding: 12px 14px !important; border-radius: 6px !important; }

  /* ページブレイク制御 */
  .chart-card, .lifestyle-card, .reference-card, .company-message,
  .ref-panel, .hero-required, .verdict-box, .badge-strip,
  .kpi-grid, .ladder, .chart-wrap, .ref-chart-wrap, tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .table-card { page-break-before: always; break-before: page; }
}

/* ===================================
   MOBILE UX REFINEMENT — 640px以下
   =================================== */
/* ===========================================
   📱 MOBILE — 640px 以下（タブレット縦・スマホ）
   各セクション最適化
   =========================================== */
@media (max-width: 640px) {
  .app { padding: 0 0.85rem; padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom)); }

  /* ── TOPBAR：縦ロゴが映えるレイアウト ── */
  .topbar {
    padding: 0.85rem 0;
    gap: 0.5rem;
    align-items: center;
  }
  .brand { gap: 0.85rem; align-items: center; min-width: 0; flex: 1; }
  .brand-logo { padding: 0.1rem 0.2rem; }
  .brand-logo::before { inset: -22% -14%; filter: blur(20px); }
  .brand-logo-img, .brand-logo-svg {
    height: 104px; width: auto;
    filter:
      brightness(0) invert(1)
      drop-shadow(0 6px 22px rgba(30, 136, 229, 0.5))
      drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  }
  .brand-text { padding-left: 0.7rem; gap: 3px; border-left-width: 1px; }
  .brand-name { font-size: 0.6rem; letter-spacing: 0.22em; }
  .brand-sub { font-size: 0.72rem; }
  .brand-text { min-width: 0; }
  .brand-name { font-size: 0.7rem; letter-spacing: 0.18em; }
  .brand-sub { font-size: 0.6rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ghost-btn { padding: 0.5rem 0.75rem; font-size: 0.72rem; flex-shrink: 0; }

  /* ── PROGRESS ── */
  .progress-rail {
    margin: 0 -0.85rem;
    padding: 0.7rem 0.85rem;
  }
  .progress-line { margin-bottom: 0.7rem; max-width: 100%; }
  .step-dot { width: 24px; height: 24px; font-size: 0.7rem; }

  /* ── CANVAS ── */
  .canvas { padding: 1.25rem 0 3rem; }
  .step-head { margin-bottom: 1.25rem; padding: 0; }
  .step-eyebrow { font-size: 0.68rem; letter-spacing: 0.18em; }
  .step-title { font-size: 1.7rem; line-height: 1.25; letter-spacing: 0.01em; }
  .step-sub { font-size: 0.88rem; line-height: 1.7; }

  /* ── FORM 共通 ── */
  .form { padding: 1.1rem; border-radius: 16px; }
  .field-grid { gap: 0.85rem; }
  .field-grid.two,
  .field-grid.three { grid-template-columns: 1fr; }
  .field input[type="text"],
  .field input[type="number"],
  .field input[type="date"],
  .field select { min-height: 50px; padding: 0.8rem 0.9rem; font-size: 1rem; border-radius: 10px; }
  .input-with-suffix input { padding-right: 4.5rem; }
  .input-with-suffix .suffix { font-size: 0.78rem; right: 0.85rem; font-weight: 600; }
  .field-label { font-size: 0.82rem; font-weight: 600; }
  .divider span { font-size: 0.78rem; padding: 0 0.75rem; }
  .toggle-row { padding: 0.35rem 0; }
  .callout { font-size: 0.8rem; padding: 0.7rem 0.85rem; }

  /* ── STEP 1 子供行 ── */
  .child-row { padding: 0.7rem; gap: 0.6rem; }
  .child-row .field input { min-height: 44px; }
  .remove-btn { width: 40px; height: 40px; }
  .add-row-btn { padding: 0.85rem; font-size: 0.9rem; }

  /* ── STEP NAV：戻る/次へ ── */
  .step-nav { gap: 0.5rem; margin-top: 1.5rem; flex-wrap: nowrap; }
  .btn-primary, .btn-secondary {
    padding: 0.85rem 0.9rem;
    font-size: 0.92rem;
    min-height: 52px;
    flex: 1;
    justify-content: center;
    border-radius: 999px;
  }
  .btn-primary svg { display: none; }

  /* ── STEP 3 シナリオピル ── */
  .scenario-pills { grid-template-columns: 1fr; gap: 0.6rem; margin-bottom: 1rem; }
  .pill { padding: 0.85rem 1rem; gap: 0.7rem; border-radius: 14px; }
  .pill-icon { font-size: 1.5rem; }
  .pill-title { font-size: 0.95rem; }
  .pill-sub { font-size: 0.7rem; }

  /* ── シナリオバナー ── */
  .scenario-banner { padding: 0.85rem; gap: 0.7rem; border-radius: 12px; }
  .banner-title { font-size: 0.95rem; }
  .banner-tag { font-size: 0.62rem; padding: 2px 8px; }
  .banner-desc { font-size: 0.78rem; line-height: 1.6; }
  .btn-preset { padding: 0.5rem 0.85rem; font-size: 0.78rem; }
  .form-section { font-size: 0.88rem; margin-top: 1.2rem; padding-bottom: 0.45rem; }
  .form-section small { display: block; margin-left: 0; margin-top: 0.25rem; font-size: 0.7rem; }

  /* ── 教育セグメント ── */
  .edu-row { padding: 0.6rem; gap: 0.4rem; }
  .edu-label { font-size: 0.82rem; }
  .seg-control button { padding: 0.5rem 0.7rem; font-size: 0.78rem; min-height: 40px; }

  /* ── TREAT CHIPS：2列 ── */
  .treat-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .treat-chip {
    padding: 0.7rem 0.55rem;
    min-height: 100px;
    gap: 0.5rem;
    border-radius: 12px;
  }
  .treat-icon { font-size: 1.45rem; }
  .treat-name { font-size: 0.82rem; line-height: 1.25; }
  .treat-detail { font-size: 0.66rem; line-height: 1.35; }
  .treat-quip { font-size: 0.64rem; line-height: 1.3; }
  .treat-mark { width: 22px; height: 22px; font-size: 13px; top: 6px; right: 6px; }
  .chip-loan-badge { width: 18px; height: 18px; font-size: 11px; right: 30px; top: 5px; }

  /* ── 支払い設定カード ── */
  .pay-empty { padding: 0.85rem; font-size: 0.78rem; gap: 0.6rem; border-radius: 10px; }
  .pay-empty-icon { font-size: 1.3rem; }
  .pay-row-card { padding: 0.85rem; border-radius: 14px; gap: 0.7rem; }
  .pay-row-head { padding-bottom: 0.7rem; gap: 0.6rem; }
  .pay-row-icon { font-size: 1.5rem; width: 42px; height: 42px; border-radius: 10px; }
  .pay-row-name { font-size: 0.95rem; }
  .pay-row-meta { font-size: 0.72rem; }
  .pay-method-tabs { padding: 3px; }
  .pay-tab { font-size: 0.8rem; padding: 0.6rem 0.3rem; min-height: 42px; border-radius: 8px; }
  .pay-options-row { gap: 0.5rem; }
  .pay-field { flex: 1; min-width: 0; }
  .pay-field select { min-width: 0; width: 100%; min-height: 44px; font-size: 0.95rem; padding: 0.55rem 1.8rem 0.55rem 0.75rem; }
  .pay-field label { font-size: 0.7rem; }
  .pay-field-hint { font-size: 0.68rem; }
  .pay-result { padding: 0.7rem 0.85rem; border-radius: 8px; }
  .pay-result-main { font-size: 0.95rem; }
  .pay-result-sub { font-size: 0.7rem; }

  /* ── STEP 4 結果ヘッダー ── */
  .results-head { margin-bottom: 1.25rem; gap: 1rem; flex-direction: column; align-items: stretch; }
  .results-head-top { min-width: 0; }
  .results-head .step-title { font-size: 1.55rem; }
  .results-actions { width: 100%; gap: 0.5rem; }
  .results-actions .btn-primary,
  .results-actions .btn-secondary { flex: 1; padding: 0.8rem 0.9rem; font-size: 0.88rem; }
  .results-actions .btn-primary svg { display: inline-block; width: 14px; height: 14px; }
  .report-root { padding: 1.1rem; border-radius: 18px; }

  /* ── レポートカバー ── */
  .report-cover { padding: 0.5rem 0 1.25rem; margin-bottom: 1.25rem; }
  .cover-eyebrow { font-size: 0.6rem; letter-spacing: 0.22em; }
  .cover-name { font-size: 1.4rem; }
  .cover-meta { font-size: 0.74rem; flex-wrap: wrap; gap: 0.3rem; }

  /* ── VERDICT ── */
  .verdict-box { padding: 0.95rem 1rem; }
  .verdict-eyebrow { font-size: 0.6rem; letter-spacing: 0.22em; }
  .verdict { font-size: 1rem; line-height: 1.6; }
  .verdict .vlife { font-size: 0.74rem; padding: 2px 10px; margin: 0 0.3em 0.3em 0; }
  .verdict .vincome { font-size: 0.78rem; padding: 3px 10px; margin: 0 0.3em 0.3em 0; }

  /* ── BADGES ── */
  .badge-strip { gap: 0.4rem; margin-bottom: 1.25rem; }
  .badge { font-size: 0.7rem; padding: 0.32rem 0.7rem; gap: 0.3rem; }
  .badge-icon { font-size: 0.95rem; }

  /* ── HERO 必要年収 ── */
  .hero-required { padding: 1.1rem; margin-bottom: 1.5rem; border-radius: 18px; }
  .hero-eyebrow { font-size: 0.6rem; letter-spacing: 0.2em; }
  .hero-grid { gap: 0.7rem; }
  .hero-card { padding: 0.9rem; border-radius: 12px; }
  .hero-label { font-size: 0.74rem; margin-bottom: 0.35rem; }
  .hero-value { font-size: 2.2rem; gap: 0.2rem; }
  .hero-value em { font-size: 0.42em; }
  .hero-diff { font-size: 0.76rem; }
  .hero-diff .gap-positive,
  .hero-diff .gap-negative { padding: 2px 8px; font-size: 0.78rem; }

  /* ── CARDS ── */
  .chart-card, .table-card { padding: 0.95rem; border-radius: 14px; margin-bottom: 1rem; }
  .card-head { margin-bottom: 0.85rem; gap: 0.5rem; }
  .card-eyebrow { font-size: 0.58rem; letter-spacing: 0.18em; }
  .card-title { font-size: 1.05rem; }
  .legend { gap: 0.5rem; }
  .legend-item { font-size: 0.66rem; }
  .chart-wrap { height: 240px; }

  /* ── LADDER：ピン重なり対策 ── */
  .ladder { padding: 0.5rem 0 0; }
  .ladder-bar { height: 56px; border-radius: 28px; margin-bottom: 0.5rem; }
  .zone { font-size: 0.62rem; letter-spacing: 0.03em; }
  .ladder-mark .pin { width: 22px; height: 22px; font-size: 11px; border-width: 2px; }
  .ladder-mark .pin-label {
    font-size: 0.58rem; padding: 2px 6px; letter-spacing: 0.01em;
  }
  .ladder-mark.current .pin-label { top: -28px; }
  .ladder-mark.minimal .pin-label { bottom: -28px; }
  .ladder-mark.ideal .pin-label { bottom: -28px; }
  .ladder-axis { font-size: 0.6rem; padding: 0 2px; }
  .ladder-legend { gap: 0.6rem; margin-top: 1.1rem; padding-top: 0.6rem; }
  .ladder-legend .legend-item { font-size: 0.64rem; }

  /* ── LIFESTYLE ── */
  .lifestyle-grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .lifestyle-col { padding: 0.85rem; border-radius: 12px; }
  .lifestyle-title { font-size: 0.95rem; }
  .lifestyle-total { font-size: 0.78rem; }
  .lifestyle-total strong { font-size: 1.05rem; }
  .lifestyle-items li { font-size: 0.78rem; padding: 3px 0; }
  .lifestyle-bar { height: 12px; }

  /* ── REFERENCE（4ステップ） ── */
  .ref-step-nav { gap: 0.35rem; flex-wrap: nowrap; }
  .ref-step-nav button { padding: 0.4rem 0.65rem; font-size: 0.72rem; }
  .ref-step-nav button svg { width: 11px; height: 11px; }
  #refStepIndicator { font-size: 0.85rem; min-width: 36px; padding: 0 0.25rem; }
  .ref-tabs { gap: 2px; }
  .ref-tabs button { padding: 0.4rem 0.6rem; font-size: 0.68rem; min-height: 32px; }
  .ref-step-badge { font-size: 0.6rem; padding: 3px 9px; }
  .ref-step-title { font-size: 1.05rem; }
  .ref-step-text { font-size: 0.82rem; line-height: 1.65; }
  .ref-content { min-height: 240px; padding: 0.5rem; border-radius: 10px; }
  .ref-chart-wrap { height: 280px; }
  .ref-image { max-height: 360px; }
  .ref-source { font-size: 0.6rem; }

  /* ── COMPANY MESSAGE ── */
  .company-message { padding: 1.1rem 1rem; margin-top: 1.25rem; border-radius: 14px; }
  .cm-eyebrow { font-size: 0.95rem; margin-bottom: 0.7rem; }
  .company-message p { font-size: 0.88rem; line-height: 1.75; }

  /* ── ADVISORY ── */
  .advisory { font-size: 0.8rem; padding: 0.75rem 0.85rem; line-height: 1.7; }

  /* ── TABLE：モバイルでは住居・教育を非表示（内訳カードと重複） ── */
  .table-controls { gap: 0.5rem; flex-wrap: wrap; }
  .table-tabs button { font-size: 0.7rem; min-height: 30px; padding: 0.32rem 0.7rem; }
  .check { font-size: 0.84rem; padding: 0.4rem 0.2rem; min-height: 40px; cursor: pointer; }
  .check input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }

  /* 住居（5番目）・教育（6番目）列を非表示 → 7列に縮小 */
  .cashflow-table col:nth-child(5),
  .cashflow-table col:nth-child(6),
  .cashflow-table thead th:nth-child(5),
  .cashflow-table thead th:nth-child(6),
  .cashflow-table tbody td:nth-child(5),
  .cashflow-table tbody td:nth-child(6) { display: none; }

  /* 列幅を狭めて min-width を圧縮 → 1画面に収まりやすく */
  .cashflow-table { min-width: 540px; font-size: 0.7rem; }
  .cashflow-table col.c-year   { width: 50px; }
  .cashflow-table col.c-age    { width: 70px; }
  .cashflow-table col.c-num    { width: 62px; }
  .cashflow-table col.c-event  { width: auto; min-width: 110px; }
  .cashflow-table col.c-flow   { width: 70px; }
  .cashflow-table col.c-asset  { width: 78px; }
  .cashflow-table thead th { padding: 0.55rem 0.4rem; font-size: 0.62rem; letter-spacing: 0.04em; }
  .cashflow-table tbody td { padding: 0.4rem 0.4rem; font-size: 0.7rem; }
  .cashflow-table tbody td.event-cell { padding: 0.35rem 0.4rem; }
  .event-chip { font-size: 0.6rem; padding: 1px 5px; margin: 1px 2px 1px 0; }

  /* スクロール可能なヒント表示 */
  .table-wrap {
    position: relative;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap::after {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 24px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.95));
    pointer-events: none; opacity: 0.8;
  }

  /* ── TOAST ── */
  .toast { bottom: 16px; padding: 0.7rem 1.1rem; font-size: 0.82rem; max-width: 90vw; }

  /* ── REPORT FOOTER ── */
  .report-footer { font-size: 0.65rem; padding-top: 0.85rem; margin-top: 1.25rem; }
  .version-tag { font-size: 0.6rem; margin-left: 0.4em; }
}

/* ===========================================
   📱 EXTRA SMALL — 380px 以下（iPhone SE 等）
   =========================================== */
@media (max-width: 380px) {
  .app { padding: 0 0.6rem; }
  .topbar { gap: 0.4rem; }
  .brand-logo-img, .brand-logo-svg { height: 86px; width: auto; }
  .brand-text { padding-left: 0.5rem; }
  .brand-name { font-size: 0.55rem; letter-spacing: 0.18em; }
  .brand-sub { font-size: 0.66rem; }
  .brand-text {
    display: flex; padding-left: 0.4rem; margin-left: 0.4rem;
    gap: 2px;
  }
  .brand-name { font-size: 0.66rem; letter-spacing: 0.12em; }
  .brand-sub { font-size: 0.66rem; }
  .brand-name { font-size: 0.64rem; letter-spacing: 0.15em; }
  .brand-sub { font-size: 0.55rem; }
  .ghost-btn { padding: 0.4rem 0.6rem; font-size: 0.68rem; }
  .progress-rail { margin: 0 -0.6rem; padding: 0.6rem 0.6rem; }
  .step-title { font-size: 1.45rem; }
  .step-sub { font-size: 0.82rem; }
  .form { padding: 0.85rem; }
  .hero-value { font-size: 1.95rem; }
  .verdict { font-size: 0.94rem; }
  .cover-name { font-size: 1.25rem; }
  .report-root { padding: 0.85rem; }
  .ref-step-nav button .label-text { display: none; }
}

/* ===========================================
   タブレット 641-900px
   =========================================== */
@media (min-width: 641px) and (max-width: 900px) {
  .treat-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-value { font-size: 3rem; }
  .brand-logo-img, .brand-logo-svg { height: 132px; width: auto; }
}

/* ===========================================
   📱 ランドスケープ短い iPhone 対策
   =========================================== */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .progress-rail { position: relative; }
  .step-title { font-size: 1.3rem; }
}
