:root {
  color-scheme: light;
  --ink: #102522;
  --ink-soft: #526460;
  --forest: #0b3b36;
  --forest-2: #11534b;
  --mint: #45c9a6;
  --mint-pale: #e9f8f3;
  --amber: #f1a93b;
  --amber-pale: #fff6e7;
  --slate: #64748b;
  --paper: #f4f7f5;
  --white: #fff;
  --line: #dce5e1;
  --line-dark: rgba(255,255,255,.16);
  --danger: #b54739;
  --danger-pale: #fff1ed;
  --shadow-sm: 0 1px 2px rgba(12, 40, 35, .05), 0 6px 18px rgba(12, 40, 35, .05);
  --shadow-lg: 0 24px 70px rgba(8, 49, 43, .12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --font-num: Inter, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 92% 2%, rgba(69, 201, 166, .11), transparent 29rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }

button, select, input[type="checkbox"], input[type="range"] { cursor: pointer; }

button { color: inherit; }

a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 999;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--white);
  color: var(--forest);
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(11, 59, 54, .08);
  background: rgba(244, 247, 245, .88);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1480px, calc(100% - 48px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--forest);
  box-shadow: 0 8px 22px rgba(11, 59, 54, .18);
}

.brand-mark svg { width: 27px; height: 27px; }
.brand-mark path { fill: none; stroke: #8ce5cd; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }

.brand strong { display: block; font-size: .96rem; letter-spacing: .02em; line-height: 1.25; }
.brand small { display: block; margin-top: 2px; color: var(--forest-2); font-size: .71rem; font-weight: 800; letter-spacing: .15em; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #48625c;
  font-size: .78rem;
  font-weight: 650;
}

.privacy-chip span { color: var(--mint); font-size: .63rem; }

.button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: .8rem;
  font-weight: 750;
}

.button-ghost { border-color: #cbd8d3; background: rgba(255,255,255,.62); }
.button-ghost:hover { border-color: #9db6ae; background: var(--white); }

.page-wrap {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 80px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(360px, 580px);
  align-items: end;
  gap: 64px;
  padding: 0 12px 48px;
}

.eyebrow, .step-label, .card-kicker {
  margin: 0 0 10px;
  color: var(--forest-2);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .2em;
}

.intro h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2.6rem, 4.1vw, 4.85rem);
  line-height: 1.12;
  letter-spacing: -.05em;
}

.intro h1 span {
  position: relative;
  color: var(--forest-2);
  white-space: nowrap;
}

.intro h1 span::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: .05em;
  height: .25em;
  border-radius: 99px;
  background: rgba(69, 201, 166, .34);
  transform: rotate(-1.2deg);
}

.intro-copy {
  margin: 0 0 8px;
  padding-left: 28px;
  border-left: 2px solid var(--mint);
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.9;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(430px, .82fr) minmax(620px, 1.18fr);
  align-items: start;
  gap: 28px;
}

.input-panel, .results-panel > section, .metric-card {
  border: 1px solid rgba(9, 57, 51, .09);
  box-shadow: var(--shadow-sm);
}

.input-panel {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--white);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, #fbfdfc, #f2faf7);
}

.panel-heading h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }
.panel-heading .step-label { margin-bottom: 2px; }

.save-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #b7cdc6;
  border-radius: 9px;
  background: var(--white);
  color: var(--forest-2);
  font-size: .76rem;
  font-weight: 800;
}

.save-button:hover { border-color: var(--mint); background: var(--mint-pale); }

.form-section {
  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-child { border-bottom: 0; }

.section-title-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--forest);
  color: var(--white);
  font-family: var(--font-num);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
}

.section-number.mint { background: var(--mint-pale); color: #08785e; }
.section-number.amber { background: var(--amber-pale); color: #a96607; }
.section-number.slate { background: #eef2f7; color: #536176; }

.section-title-row h3 { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.section-title-row p { margin: 3px 0 0; color: #75847f; font-size: .75rem; line-height: 1.4; }

.field-grid { display: grid; gap: 16px; }
.field-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.compact-top { margin-top: 16px; }
.field { display: block; min-width: 0; margin-bottom: 18px; }
.field-grid .field { margin-bottom: 18px; }
.field:last-child, .field-grid:last-child .field { margin-bottom: 0; }

.field-label, .field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: #344843;
  font-size: .79rem;
  font-weight: 750;
}

.field small, .range-field small, .check-row small {
  display: block;
  margin-top: 6px;
  color: #81908b;
  font-size: .69rem;
  line-height: 1.55;
}

.input-with-unit {
  min-height: 48px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #cfdbd7;
  border-radius: 11px;
  background: #fbfdfc;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.input-with-unit:focus-within {
  border-color: var(--mint);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(69, 201, 166, .15);
}

.input-with-unit input {
  width: 100%;
  min-width: 0;
  padding: 0 4px 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 1rem;
  font-weight: 700;
  text-align: right;
}

.input-with-unit span {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 13px 0 7px;
  color: #60726d;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.select-wrap { position: relative; display: block; }
.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 7px;
  height: 7px;
  border-right: 2px solid #6d7e79;
  border-bottom: 2px solid #6d7e79;
  transform: translateY(-68%) rotate(45deg);
  pointer-events: none;
}

.select-wrap select {
  width: 100%;
  min-height: 48px;
  padding: 0 40px 0 14px;
  appearance: none;
  border: 1px solid #cfdbd7;
  border-radius: 11px;
  outline: 0;
  background: #fbfdfc;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 650;
}

.select-wrap select:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(69, 201, 166, .15); }

.range-field { margin-top: 3px; }
.field-label-row output { color: var(--forest-2); font-family: var(--font-num); font-size: 1.05rem; font-weight: 800; }

input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 6px 0 0;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--mint) var(--range-fill, 40%), #dce7e3 var(--range-fill, 40%)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: #dce7e3; }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--mint); }
input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -7px; appearance: none; border: 4px solid var(--white); border-radius: 50%; background: var(--forest-2); box-shadow: 0 1px 5px rgba(0,0,0,.24); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 4px solid var(--white); border-radius: 50%; background: var(--forest-2); box-shadow: 0 1px 5px rgba(0,0,0,.24); }
.range-scale { display: flex; justify-content: space-between; margin-top: -1px; color: #91a09b; font-family: var(--font-num); font-size: .65rem; }

.toggle { position: relative; display: inline-flex; align-items: center; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle > span:not(.sr-only) {
  width: 43px;
  height: 24px;
  display: block;
  border-radius: 99px;
  background: #cbd7d3;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
  transition: background .18s;
}
.toggle > span:not(.sr-only)::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
  transition: transform .18s;
}
.toggle input:checked + span { background: var(--forest-2); }
.toggle input:checked + span::after { transform: translateX(19px); }
.toggle input:focus-visible + span { outline: 3px solid rgba(69, 201, 166, .3); outline-offset: 2px; }

.advanced-settings {
  overflow: hidden;
  margin-top: 5px;
  border: 1px solid #dbe5e1;
  border-radius: 11px;
  background: #fbfdfc;
}
.advanced-settings summary {
  position: relative;
  padding: 13px 42px 13px 15px;
  list-style: none;
  color: #51635e;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 750;
}
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 15px;
  color: var(--forest-2);
  font-size: 1.1rem;
  font-weight: 400;
  transform: translateY(-52%);
}
.advanced-settings[open] summary::after { content: "−"; }
.details-content { padding: 16px 15px 4px; border-top: 1px solid var(--line); }

.check-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 4px;
  padding: 13px;
  border: 1px solid #edd8b7;
  border-radius: 11px;
  background: var(--amber-pale);
  cursor: pointer;
}
.check-row input { position: absolute; opacity: 0; }
.check-mark {
  position: relative;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1px solid #d2af76;
  border-radius: 5px;
  background: var(--white);
}
.check-row input:checked + .check-mark { border-color: #bd790f; background: #bd790f; }
.check-row input:checked + .check-mark::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check-row input:focus-visible + .check-mark { outline: 3px solid rgba(241,169,59,.3); outline-offset: 2px; }
.check-row strong { display: block; color: #765019; font-size: .76rem; }
.check-row small { margin-top: 2px; color: #927047; }

.helper-box {
  display: grid;
  grid-template-columns: 21px 1fr;
  gap: 9px;
  margin: 18px 0 0;
  padding: 12px 13px;
  border-radius: 10px;
  background: #f0f4f8;
  color: #607083;
  font-size: .7rem;
  line-height: 1.6;
}
.helper-box span { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid #9aa9b8; border-radius: 50%; font-family: serif; font-size: .68rem; font-weight: 700; }

.hidden { display: none !important; }
.is-disabled { opacity: .46; pointer-events: none; filter: grayscale(.25); }

.results-panel { min-width: 0; display: grid; gap: 18px; }

.result-hero {
  position: relative;
  overflow: hidden;
  padding: 30px 34px 26px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 12%, rgba(117, 226, 196, .18), transparent 17rem),
    linear-gradient(145deg, #0b3b36, #0d4a42 70%, #0b413b);
  color: var(--white);
  box-shadow: var(--shadow-lg) !important;
}

.result-hero::after {
  content: "";
  position: absolute;
  right: -72px;
  bottom: -135px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(255,255,255,.026), 0 0 0 88px rgba(255,255,255,.018);
  pointer-events: none;
}

.hero-topline { position: relative; z-index: 1; display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.step-label.light { margin-bottom: 1px; color: #80d9c1; }
.hero-topline h2 { margin: 0; color: #dceee9; font-size: .92rem; font-weight: 650; }
.period-badge { padding: 5px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 99px; background: rgba(255,255,255,.07); color: #c9e4dc; font-size: .68rem; font-weight: 700; white-space: nowrap; }

.total-value { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 8px; margin: 16px 0 21px; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.total-value span { font-size: clamp(2.6rem, 5vw, 4.35rem); font-weight: 750; letter-spacing: -.045em; line-height: 1; }
.total-value small { color: #b7d7cf; font-size: 1rem; font-weight: 700; }

.hero-substats { position: relative; z-index: 1; display: flex; gap: 34px; margin-bottom: 24px; }
.hero-substats > div { display: flex; flex-direction: column; gap: 1px; }
.hero-substats span { color: #9ec4ba; font-size: .68rem; }
.hero-substats strong { color: #effaf7; font-family: var(--font-num); font-size: .92rem; font-variant-numeric: tabular-nums; }

.allocation-bar { position: relative; z-index: 1; height: 8px; display: flex; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.1); }
.allocation-bar span { min-width: 0; transition: width .35s ease; }
.allocation-bar #nisaAllocation { background: #64ddbd; }
.allocation-bar #idecoAllocation { background: #ffc567; }
.allocation-labels { position: relative; z-index: 1; display: flex; gap: 22px; margin-top: 10px; color: #bcdbd3; font-size: .68rem; }
.allocation-labels span { display: flex; align-items: center; gap: 6px; }
.allocation-labels strong { margin-left: 2px; color: var(--white); font-family: var(--font-num); }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.nisa { background: #64ddbd; }
.legend-dot.ideco { background: #ffc567; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metric-card { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: var(--radius-md); background: var(--white); }
.metric-card.emphasis { border-color: #eddbbb; background: linear-gradient(140deg, #fff, #fffaf0); }
.metric-icon { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; font-family: var(--font-num); font-size: .84rem; font-weight: 850; }
.metric-icon.principal { background: #eef4f1; color: var(--forest-2); }
.metric-icon.gain { background: var(--mint-pale); color: #0b8365; }
.metric-icon.tax { background: var(--amber-pale); color: #b06e0c; }
.metric-card p { margin: 0 0 3px; color: #75847f; font-size: .68rem; }
.metric-card strong { display: block; overflow: hidden; color: var(--ink); font-family: var(--font-num); font-size: clamp(.92rem, 1.3vw, 1.12rem); line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }

.chart-card, .breakdown-card, .scenario-card, .yearly-card, .assumption-card {
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  background: var(--white);
}

.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.card-heading h3 { margin: 0; font-size: 1.03rem; letter-spacing: -.015em; }
.card-kicker { margin-bottom: 2px; font-size: .61rem; }
.card-heading > p { margin: 4px 0 0; color: #82908c; font-size: .66rem; }

.chart-legend { display: flex; align-items: center; gap: 12px; color: #72817c; font-size: .66rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-line { width: 15px; height: 3px; border-radius: 99px; background: var(--forest); }
.legend-line.nisa { background: var(--mint); }
.legend-line.ideco { background: var(--amber); }

.chart-wrap { position: relative; width: 100%; min-height: 260px; }
#assetChart { display: block; width: 100%; height: auto; overflow: visible; }
#assetChart text { fill: #81908b; font-family: var(--font-sans); font-size: 10px; }
#assetChart .grid-line { stroke: #e8eeeb; stroke-width: 1; }
#assetChart .axis-line { stroke: #cfdad6; stroke-width: 1; }
#assetChart .area-total { fill: url(#totalGradient); }
#assetChart .line-total, #assetChart .line-nisa, #assetChart .line-ideco { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#assetChart .line-total { stroke: var(--forest); stroke-width: 3.5; }
#assetChart .line-nisa { stroke: var(--mint); stroke-width: 2; stroke-dasharray: 4 4; }
#assetChart .line-ideco { stroke: var(--amber); stroke-width: 2; stroke-dasharray: 4 4; }
#assetChart .hover-line { stroke: #9aaca6; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
#assetChart .focus-point { fill: var(--white); stroke: var(--forest); stroke-width: 2.5; pointer-events: none; }
#assetChart .hit-area { fill: transparent; cursor: crosshair; }

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 154px;
  padding: 10px 12px;
  border: 1px solid rgba(12, 59, 53, .1);
  border-radius: 10px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 30px rgba(8, 49, 43, .14);
  color: #3e514c;
  font-size: .68rem;
  line-height: 1.65;
  pointer-events: none;
  transform: translate(-50%, -108%);
}
.chart-tooltip strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: .73rem; }
.chart-tooltip span { display: flex; justify-content: space-between; gap: 14px; }
.chart-tooltip b { color: var(--ink); font-family: var(--font-num); }

.notice-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 13px;
  padding: 18px 20px !important;
  border-color: #efd7d0 !important;
  border-radius: var(--radius-md) !important;
  background: var(--danger-pale) !important;
}
.notice-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #fbded6; color: var(--danger); font-family: serif; font-weight: 900; }
.notice-card h3 { margin: 1px 0 5px; color: #853f35; font-size: .8rem; }
.notice-card ul { margin: 0; padding-left: 1.2em; color: #85574f; font-size: .7rem; line-height: 1.65; }

.comparison-note { margin-top: 4px; padding: 4px 8px; border-radius: 99px; background: #f1f5f3; color: #6d7e79; font-size: .63rem; font-weight: 700; }
.breakdown-table-wrap, .yearly-table-wrap { overflow-x: auto; }
.breakdown-table, .yearly-table { width: 100%; border-collapse: collapse; font-size: .73rem; font-variant-numeric: tabular-nums; }
.breakdown-table th, .breakdown-table td { padding: 13px 9px; border-bottom: 1px solid #e8eeeb; text-align: right; white-space: nowrap; }
.breakdown-table thead th { padding-top: 0; color: #85938f; font-size: .63rem; font-weight: 650; }
.breakdown-table th:first-child { text-align: left; }
.breakdown-table tbody td { color: #334843; font-family: var(--font-num); font-weight: 650; }
.account-badge { display: inline-flex; align-items: center; min-width: 64px; padding: 5px 9px; border-radius: 8px; font-size: .68rem; font-weight: 850; }
.account-badge.nisa { background: var(--mint-pale); color: #08785e; }
.account-badge.ideco { background: var(--amber-pale); color: #9c6005; }
.benefit-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: #f5f8f6; }
.benefit-summary span { color: #677873; font-size: .7rem; }
.benefit-summary strong { color: var(--forest-2); font-family: var(--font-num); font-size: 1.06rem; }

.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.scenario-item { position: relative; overflow: hidden; padding: 17px 16px; border: 1px solid #dfe7e4; border-radius: 13px; background: #fbfdfc; }
.scenario-item.active { border-color: #7dd9c0; background: linear-gradient(145deg, #f8fffc, #edf9f5); box-shadow: inset 0 0 0 1px rgba(69,201,166,.18); }
.scenario-item.active::before { content: "入力値"; position: absolute; top: 8px; right: 8px; padding: 2px 6px; border-radius: 99px; background: var(--forest-2); color: white; font-size: .52rem; font-weight: 800; }
.scenario-item p { margin: 0 0 2px; color: #73827d; font-size: .65rem; }
.scenario-item .rate { color: var(--forest-2); font-family: var(--font-num); font-size: .72rem; font-weight: 800; }
.scenario-item strong { display: block; margin-top: 10px; font-family: var(--font-num); font-size: 1rem; font-variant-numeric: tabular-nums; }
.scenario-item small { display: block; margin-top: 3px; color: #8a9894; font-size: .6rem; }

.yearly-card { padding: 0; }
.yearly-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 26px; list-style: none; cursor: pointer; }
.yearly-card > summary::-webkit-details-marker { display: none; }
.yearly-card summary > span:first-child { display: flex; flex-direction: column; }
.yearly-card summary small { color: var(--forest-2); font-size: .58rem; font-weight: 850; letter-spacing: .18em; }
.yearly-card summary strong { font-size: .88rem; }
.summary-actions { display: flex; align-items: center; gap: 14px; }
.summary-actions button { position: relative; z-index: 2; padding: 5px 9px; border: 1px solid #d2ddd9; border-radius: 8px; background: #f8faf9; color: #61726d; font-size: .65rem; font-weight: 750; }
.summary-actions button:hover { border-color: var(--mint); color: var(--forest-2); }
.summary-actions i { width: 8px; height: 8px; border-right: 2px solid #6e7f79; border-bottom: 2px solid #6e7f79; transform: rotate(45deg); transition: transform .18s; }
.yearly-card[open] .summary-actions i { transform: rotate(225deg); }
.yearly-table-wrap { max-height: 420px; border-top: 1px solid var(--line); }
.yearly-table th, .yearly-table td { padding: 11px 13px; border-bottom: 1px solid #edf1ef; text-align: right; white-space: nowrap; }
.yearly-table thead th { position: sticky; top: 0; z-index: 1; background: #f5f8f6; color: #74837e; font-size: .62rem; }
.yearly-table th:first-child, .yearly-table td:first-child { text-align: left; }
.yearly-table tbody td { color: #3d514b; font-family: var(--font-num); }
.yearly-table tbody tr:hover td { background: #f8fbfa; }

.assumption-card { background: #f9fbfa !important; }
.assumption-card h3 { margin: 0 0 10px; font-size: .82rem; }
.assumption-card ul { margin: 0; padding-left: 1.3em; color: #697a75; font-size: .67rem; line-height: 1.75; }
.source-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 13px; margin-top: 14px; color: #788984; font-size: .65rem; }
.source-links a { color: var(--forest-2); font-weight: 700; text-underline-offset: 3px; }
.source-links a:hover { color: #08785e; }
.updated-date { margin: 10px 0 0; color: #98a5a1; font-size: .6rem; }

footer { padding: 0 24px 38px; color: #83918d; text-align: center; font-size: .66rem; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(12, 49, 44, .94);
  color: var(--white);
  box-shadow: 0 12px 36px rgba(8,49,43,.24);
  font-size: .76rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 3px solid rgba(69, 201, 166, .45); outline-offset: 2px; }

@media (max-width: 1120px) {
  .app-layout { grid-template-columns: minmax(380px, .82fr) minmax(0, 1.18fr); }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { padding: 14px 18px; }
  .intro { gap: 36px; }
  .total-value span { font-size: clamp(2.45rem, 5vw, 3.6rem); }
}

@media (max-width: 900px) {
  .header-inner, .page-wrap { width: min(100% - 28px, 720px); }
  .page-wrap { padding-top: 38px; }
  .intro { grid-template-columns: 1fr; gap: 25px; padding-bottom: 36px; }
  .intro-copy { max-width: 640px; }
  .app-layout { grid-template-columns: 1fr; }
  .results-panel { min-width: 0; }
  .header-actions .privacy-chip { display: none; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-card { padding: 16px 13px; }
  .metric-icon { display: none; }
}

@media (max-width: 620px) {
  .site-header { position: static; }
  .header-inner { min-height: 68px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand strong { font-size: .84rem; }
  .brand small { font-size: .62rem; }
  .header-actions { display: none; }
  .page-wrap { width: min(100% - 20px, 560px); padding: 29px 0 54px; }
  .intro { padding: 0 5px 28px; }
  .intro h1 { font-size: clamp(2.15rem, 11vw, 3.15rem); }
  .intro-copy { padding-left: 17px; font-size: .84rem; line-height: 1.8; }
  .input-panel, .result-hero, .chart-card, .breakdown-card, .scenario-card, .yearly-card, .assumption-card { border-radius: 18px; }
  .panel-heading, .form-section { padding-left: 19px; padding-right: 19px; }
  .panel-heading { padding-top: 20px; padding-bottom: 20px; }
  .field-grid.two-col { grid-template-columns: 1fr; gap: 0; }
  .form-section { padding-top: 24px; padding-bottom: 24px; }
  .section-title-row { margin-bottom: 20px; }
  .result-hero { padding: 24px 21px 22px; }
  .total-value { margin: 17px 0 20px; }
  .total-value span { font-size: clamp(2.35rem, 13vw, 3.45rem); }
  .hero-substats { flex-direction: column; gap: 9px; }
  .hero-substats > div { flex-direction: row; justify-content: space-between; gap: 15px; }
  .metric-grid { grid-template-columns: 1fr; gap: 9px; }
  .metric-card { justify-content: space-between; padding: 14px 16px; }
  .metric-card > div { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
  .metric-card p { margin: 0; }
  .metric-card strong { font-size: .97rem; }
  .chart-card, .breakdown-card, .scenario-card, .assumption-card { padding: 22px 18px; }
  .card-heading { align-items: center; }
  .chart-legend { display: none; }
  .chart-wrap { min-height: 220px; margin: 0 -5px; width: calc(100% + 10px); }
  #assetChart { min-height: 220px; }
  .scenario-grid { grid-template-columns: 1fr; }
  .scenario-item { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .scenario-item strong { margin: 0; font-size: .95rem; text-align: right; }
  .scenario-item small { grid-column: 1 / -1; }
  .benefit-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .yearly-card > summary { padding: 19px 18px; }
  .comparison-note { display: none; }
  .breakdown-table th, .breakdown-table td { padding-left: 8px; padding-right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  body { background: #fff; }
  .site-header, .input-panel, footer, .save-button, .summary-actions button, .toast { display: none !important; }
  .page-wrap { width: 100%; padding: 12px; }
  .intro { display: block; padding-bottom: 20px; }
  .intro h1 { font-size: 2rem; }
  .intro-copy { margin-top: 12px; }
  .app-layout { display: block; }
  .results-panel { gap: 10px; }
  .result-hero { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .chart-card, .breakdown-card, .scenario-card, .assumption-card { break-inside: avoid; box-shadow: none !important; }
}
