/* design-tokens.css */
/* Adopted design: 白い航海日誌. See ../docs/design-system.md.
   Load before application CSS. Experimental themes may override these tokens. */
:root {
  /* Page and controls */
  --ink: #243F4A;
  --accent: #07566D;
  --muted: #52656C;
  --paper: #FFFFFF;
  --line: #D1DFE3;

  /* The journal face is reserved for the brand; UI roles share one reading face. */
  --font-reading: "BIZ UDPGothic","Hiragino Sans","Yu Gothic",Meiryo,sans-serif;
  --font-journal: "Zen Old Mincho","Hiragino Mincho ProN","Yu Mincho",serif;
  --font-amount: var(--font-reading);
  --text-small: 12px;
  --text-body: 14px;
  --text-emphasis: 16px;
  --text-entry-heading: 20px;
  --text-heading: 18px;
  --text-subheading: 14px;
  --text-amount: 28px;
  --text-amount-secondary: 20px;
  --text-input: 28px;
  --text-dense: 11px;
  --text-card-value: 14px;
  --weight-regular: 400;
  --weight-strong: 700;
  --leading-heading: 1.5;
  --leading-reading: 1.7;
  --leading-amount: 1.3;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --control-min-height: 44px;
  --radius-control: 5px;
  --page-max-width: 1180px;

  /* Adopted saving palette B: marine, sky, turquoise. */
  --chart-asset: #07566D;
  --chart-boundary: #234D60;
  --capital-start: #7DA8C2;
  --capital-deposit: #D8EAF3;
  --chart-growth-high: #49BBA9;
  --chart-growth-low: #ADE6D8;
  --chart-gain-text: #216759;
  --chart-loss: #9B493F;
  --chart-goal: #845D1B;

  /* Adopted withdrawal concept C and the transition between phases. */
  --withdrawal-asset: #164F5D;
  --phase-surface: #F7F3E9;
  --phase-line: #95743B;
  --phase-badge: #80612F;
  --phase-point: #A58446;

  /* Compatibility with earlier component rules; not new chart roles. */
  --comparison: #976015;
  --principal: #76736E;
  --growth: #A0DDD3;
}

@media(max-width:760px){
  :root{--text-entry-heading:18px;--text-heading:16px;--text-amount:24px;--text-amount-secondary:18px;--text-input:28px;--text-card-value:12px}
}

/* style.css */
:root{font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic",sans-serif;color:var(--ink);background:#eeeae4;font-variant-numeric:tabular-nums}
.experiment{padding-top:14px}#pinScenario{width:100%;padding:10px 12px;background:white;border:1px solid var(--comparison);border-radius:3px;color:var(--comparison);font-size:var(--text-body);font-weight:var(--weight-strong)}.experiment #experimentStatus{font-size:var(--text-body);font-weight:400;margin:10px 0;line-height:1.7}#baselineSummary{padding:10px 12px;border-left:3px solid var(--comparison);background:#faf3e6;font-size:var(--text-small);line-height:1.8;color:var(--muted);overflow-wrap:anywhere}#comparisonControls .compare-actions button{font-size:var(--text-body);flex:1 1 auto}.comparison-result{line-height:1.6}#comparisonConditions{margin-top:6px}#comparisonLabel{font-size:var(--text-body)}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a{cursor:pointer}button,a,input{touch-action:manipulation}button:focus-visible,a:focus-visible,input:not([type="text"]):not([type="number"]):focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #976015;outline-offset:3px}[hidden]{display:none!important}h1,h2,p,dl,dd{margin:0}h1{font-size:22px;letter-spacing:.06em}h2{font-size:var(--text-heading)}button{min-height:var(--control-min-height);color:var(--ink)}button:disabled{opacity:.4;cursor:default}.shell{max-width:var(--page-max-width);margin:auto;padding:env(safe-area-inset-top) 24px calc(32px + env(safe-area-inset-bottom))}header{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);padding:23px 0}.brand{display:flex;align-items:center;gap:var(--space-3)}.brand-mark{display:grid;place-items:center;width:44px;height:44px;background:var(--ink);color:#d8bd8e;font:bold italic 36px Georgia,serif;border-radius:12px 12px 3px 12px}.brand p{font-size:var(--text-small);color:var(--muted);margin-top:4px}.session-status{font-size:var(--text-small);color:var(--muted);max-width:150px;text-align:right}.opening{padding:4px 0 20px}.opening h2{font-size:clamp(20px,3vw,30px);letter-spacing:-.04em}.opening p{font-size:var(--text-body);color:var(--muted);margin-top:8px;line-height:1.6}.summary{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:20px 24px;background:var(--ink);color:white;border-radius:16px 16px 0 0;border-bottom:4px solid #d8bd8e;position:sticky;top:0;z-index:5}.summary p{font-size:var(--text-small);color:#dfebee}.summary strong{display:block;font-size:var(--text-amount);line-height:1.25;letter-spacing:0;overflow-wrap:anywhere}.summary-details{display:grid;gap:var(--space-2);font-size:var(--text-small);color:#dfebee;flex-shrink:0}.summary-details b{color:white;margin-left:8px}.workspace{display:grid;grid-template-columns:320px minmax(0,1fr);gap:24px;align-items:start;background:white;padding:24px;border:1px solid var(--line);border-top:0;border-radius:0 0 16px 16px}.conditions{padding-right:24px;border-right:1px solid var(--line);min-width:0}.section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}.section-number{font:11px ui-monospace,monospace;letter-spacing:.12em;color:var(--muted)}.reset{font-size:var(--text-small);padding:5px 0;border:0;background:transparent;color:var(--muted)}.condition-intro{font-size:var(--text-small);color:var(--muted);margin:-10px 0 18px}.fields{display:grid;gap:18px}label{display:block;font-size:var(--text-body);color:var(--muted);min-width:0}.input-wrap{display:flex;align-items:center;background:#faf8f3;border:1px solid #b1c0c3;border-radius:8px;padding:4px 10px;gap:var(--space-2);margin-top:6px}.input-wrap:focus-within{border:1px solid var(--accent);box-shadow:0 0 0 2px #166c8620;background:white}.input-wrap input{width:100%;min-width:0;border:0;background:transparent;font-size:24px;font-weight:var(--weight-strong);color:var(--ink);min-height:42px;outline:0}.input-wrap span{font-size:var(--text-small);white-space:nowrap}.hint{font-size:var(--text-small);color:var(--muted);line-height:1.7;margin-top:10px}.monthly-rate-hint{display:block;margin-top:5px}.experiment{margin-top:24px}.experiment>p{font-size:var(--text-body);font-weight:var(--weight-strong);margin-bottom:10px}.quick-actions{display:grid;gap:var(--space-2)}.quick-actions button{background:#eaf3f4;border:1px solid #bcd2d8;border-radius:7px;padding:10px 12px;display:flex;justify-content:space-between;align-items:center;gap:10px;font-weight:var(--weight-strong);font-size:var(--text-body);text-align:left}.quick-actions span{font-weight:400;font-size:var(--text-small);color:var(--muted)}.compare-actions{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:14px}.compare-actions button{font-size:var(--text-small);padding:8px 10px;border:1px solid var(--line);background:white;border-radius:6px}#restoreScenario{color:var(--comparison)}.chart-panel{min-width:0}.comparison-panel{background:#faf3e6;border-left:3px solid var(--comparison);border-radius:4px;padding:12px 14px;margin-bottom:20px;font-size:var(--text-small)}.comparison-title{display:flex;justify-content:space-between;align-items:center}.comparison-title button{background:transparent;border:0;color:var(--comparison);font-size:var(--text-small);min-height:32px}.comparison-panel p{color:var(--muted);line-height:1.7}.comparison-result{display:flex;flex-wrap:wrap;gap:6px 16px;justify-content:space-between;align-items:center;margin-top:8px}.comparison-result strong{font-size:22px;overflow-wrap:anywhere}.chart-toolbar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;margin-bottom:18px}.mode-switch{display:flex;gap:3px;background:#e8eff0;padding:3px;border-radius:8px}.mode-switch button{padding:8px 16px;background:transparent;border:0;border-radius:var(--radius-control);font-size:var(--text-body)}.mode-switch button[aria-pressed="true"]{background:var(--ink);color:#fff}select{font-size:var(--text-body);min-height:var(--control-min-height);max-width:100%;padding:6px 10px;border:1px solid var(--line);border-radius:6px;background:white;color:var(--ink)}.readout{display:flex;flex-wrap:wrap;gap:10px 24px;align-items:center;padding:12px 0;border-block:1px solid var(--line)}.readout>div{flex:1 1 220px;min-width:0}.readout>div>span{font-size:var(--text-body);font-weight:var(--weight-strong);color:var(--accent)}.readout strong{display:block;font-size:clamp(24px,3vw,32px);overflow-wrap:anywhere;line-height:1.45}.readout dl{display:flex;gap:12px 24px;flex-wrap:wrap;font-size:var(--text-small)}.readout dt{color:var(--muted)}.readout dd{margin-top:4px;font-weight:var(--weight-strong);overflow-wrap:anywhere}.selected-comparison{font-size:var(--text-small);color:var(--comparison);margin-top:8px;line-height:1.6}.legend{display:flex;gap:var(--space-4);flex-wrap:wrap;font-size:var(--text-small);color:var(--muted);margin:18px 0 3px}.key{display:inline-block;width:14px;height:3px;background:var(--accent);vertical-align:middle;margin-right:5px}.key.principal{background:var(--principal)}.key.comparison{background:var(--comparison)}#chart{display:block;width:100%;height:340px;touch-action:pan-y;user-select:none;-webkit-user-select:none;cursor:crosshair;overflow:visible}.axis-label{fill:var(--muted);font-size:var(--text-small);font-family:var(--font-reading)}.grid-line{stroke:#e2dcd5;stroke-width:1}.asset-line{fill:none;stroke:var(--accent);stroke-width:3;stroke-linejoin:round;stroke-linecap:round}.principal-line{fill:none;stroke:var(--principal);stroke-width:2;stroke-dasharray:5 5}.comparison-line{fill:none;stroke:var(--comparison);stroke-width:2;stroke-dasharray:2 5}.area{fill:var(--accent);fill-opacity:.07}.focus-line{stroke:var(--ink);stroke-width:1;stroke-dasharray:3 4}.focus-asset{fill:white;stroke:var(--accent);stroke-width:3}.focus-principal{fill:white;stroke:var(--principal);stroke-width:2}.year-control{display:flex;align-items:center;gap:14px}.year-control button{flex-shrink:0;width:44px;height:44px;border:1px solid var(--line);border-radius:50%;background:white;font-size:23px}.year-control input{width:100%;min-width:0;height:44px;accent-color:var(--accent)}.differences{display:grid;grid-template-columns:1fr 1fr;border-top:1px solid var(--line);margin-top:20px}.differences section{padding:16px 12px 0 0;min-width:0}.differences section+section{border-left:1px solid var(--line);padding-left:14px}.differences h3{font-size:var(--text-subheading);font-weight:var(--weight-strong);margin:0 0 8px;color:var(--muted)}.differences strong{font-size:17px;overflow-wrap:anywhere}.differences small{display:block;font-size:var(--text-small);line-height:1.9;color:var(--muted);margin-top:6px;overflow-wrap:anywhere}.negative{color:#b33645!important}.summary .negative{color:#ffb8c1!important}.goal-panel{background:white;border:1px solid var(--line);border-radius:12px;padding:24px;margin-top:22px}.goal-layout{display:grid;grid-template-columns:240px 1fr;gap:28px;align-items:center}#goalResult{font-size:24px}#goalDetail{font-size:var(--text-body);line-height:1.8;color:var(--muted);margin-top:8px}.jump-goal{background:var(--ink);color:white;border:0;border-radius:7px;padding:8px 14px;margin-top:12px;font-size:var(--text-body)}.milestones{border-block:1px solid var(--line);margin-top:22px}summary{padding:18px 0;font-weight:var(--weight-strong);cursor:pointer}.milestone-row{display:flex;justify-content:space-between;gap:20px;border-top:1px solid var(--line);padding:13px 0;font-size:var(--text-body)}footer{font-size:var(--text-small);line-height:1.8;color:var(--muted);margin-top:24px;max-width:850px}
@media(max-width:760px){.shell{padding-inline:14px}header{padding-block:16px}.brand{gap:var(--space-2)}.brand h1{font-size:20px}.brand-mark{width:38px;height:38px;font-size:31px}.session-status{max-width:100px;font-size:var(--text-small)}.opening{padding-bottom:15px}.opening h2{font-size:20px}.opening p{font-size:var(--text-small)}.summary{padding:12px 14px;gap:var(--space-2)}.summary strong{font-size:var(--text-amount)}.summary-details{font-size:var(--text-small);gap:6px}.summary-details b{display:block;margin-left:0;font-size:var(--text-small)}.summary>div:first-child{min-width:0}.workspace{grid-template-columns:1fr;padding:16px 12px;gap:24px}.conditions{padding:0 0 20px;border-right:0;border-bottom:1px solid var(--line)}.section-title{margin-bottom:12px}.fields{grid-template-columns:1fr 1fr;gap:var(--space-3)}.input-wrap input{font-size:22px;min-height:38px}.condition-intro{margin:0 0 12px}.experiment{margin-top:16px}.quick-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.quick-actions button{display:block;text-align:center;padding:10px 3px;font-size:var(--text-small)}.quick-actions span{display:block;font-size:var(--text-small);margin-top:5px}.compare-actions{margin-top:10px}.chart-toolbar{margin-top:14px}.readout strong{font-size:26px}#chart{height:320px}.goal-panel{padding:18px 14px}.goal-layout{grid-template-columns:1fr;gap:20px}.goal-layout label{max-width:280px}.goal-panel h2{font-size:var(--text-heading)}}
@media(prefers-reduced-motion:no-preference){button{transition:background .15s,transform .15s}button:active:not(:disabled){transform:translateY(1px)}.summary strong{transition:color .15s}}

.chart-panel{scroll-margin-top:150px} @media(max-width:360px){.summary{flex-wrap:wrap}.summary-details{display:flex;gap:18px}.quick-actions span{display:none}}

/* Voyage journal: sea-blue route, charcoal ink, brass reference marks. */
header{border-bottom:1px solid #c3cfd0}.brand h1{font-family:"Hiragino Mincho ProN","Yu Mincho",serif;letter-spacing:.1em}.brand-mark{background:transparent;color:var(--ink);border:1.5px solid var(--ink);border-radius:50%;font:var(--weight-strong) 22px "Hiragino Mincho ProN","Yu Mincho",serif;transform:rotate(-7deg)}.opening{padding-top:18px}.opening h2{font-family:var(--font-reading);font-weight:var(--weight-strong);letter-spacing:0}.summary{border-radius:5px 5px 0 0;border-bottom:3px solid var(--accent)}.summary strong{font-family:var(--font-reading);font-weight:400}.workspace{border-radius:0 0 5px 5px;box-shadow:4px 5px 0 #e2dcd5}.section-title{border-bottom:1px solid var(--line);padding-bottom:10px}.section-number{color:var(--comparison);letter-spacing:.03em}.quick-actions button{border-radius:3px;border-left:3px solid var(--accent)}.comparison-panel{border-radius:2px}.goal-panel{border-radius:4px;border-top:3px solid var(--comparison)}.goal-panel h2{font-family:var(--font-reading)}.input-wrap{border-radius:4px}.mode-switch{border-radius:4px}.mode-switch button{border-radius:2px}.brand p{letter-spacing:.03em}

/* Progressive disclosure: inputs and chart first; comparisons and detail on demand. */
header{padding-top:8px;padding-bottom:14px;margin-bottom:14px}.shell{padding-top:env(safe-area-inset-top)}.brand h1{line-height:1.35}.session-status{font-size:var(--text-small)}.section-title{margin-bottom:12px}.experiment{margin-top:14px;border-top:1px solid var(--line)}.experiment>summary{font-size:var(--text-body);padding:12px 0;font-weight:var(--weight-strong)}.quick-actions{margin-top:3px}.quick-actions button{font-size:var(--text-small)}.chart-details{border-top:1px solid var(--line);margin-top:14px}.chart-details>summary{font-size:var(--text-body);padding:14px 0}.chart-details dl{display:flex;flex-wrap:wrap;gap:12px 26px;font-size:var(--text-body);margin:4px 0 14px}.chart-details dt{color:var(--muted);font-size:var(--text-small)}.chart-details dd{font-weight:var(--weight-strong);margin-top:4px;overflow-wrap:anywhere}.chart-details .differences{margin-top:10px}.goal-panel{padding:0 20px}.goal-panel>summary{font-size:var(--text-emphasis);padding:18px 0}.goal-panel .goal-layout{padding:0 0 20px}.readout{padding:8px 0;border-bottom:0}.legend{margin-top:8px}.conditions{padding-bottom:0}footer summary{font-size:var(--text-small);padding:0 0 10px;font-weight:400}.chart-toolbar{margin-bottom:10px}.summary{border-radius:4px 4px 0 0}@media(max-width:760px){header{padding-top:8px;padding-bottom:12px;margin-bottom:12px}.conditions{padding-bottom:12px}.workspace{gap:18px}.readout strong{font-size:26px}.chart-panel .section-title{padding-bottom:8px}.goal-panel{padding:0 14px}.experiment{margin-top:12px}}

/* Brand keeps the journal voice; UI headings and amounts share the reading face. */
:root{font-family:var(--font-reading)}
body{font-size:var(--text-body);line-height:var(--leading-reading)}.workspace,.goal-panel{background:var(--paper)}.brand h1{font-family:var(--font-journal);font-weight:600;letter-spacing:.045em}
h2,.goal-panel>summary{font-family:var(--font-reading);font-weight:var(--weight-strong);letter-spacing:0;line-height:var(--leading-heading)}.brand-mark{font-family:var(--font-journal);color:var(--accent);border-color:var(--accent);transform:none}.summary{background:#eaf3f4;color:var(--ink);border:1px solid #bcd2d8;border-bottom:2px solid var(--accent)}.summary p,.summary-details{color:#52656c}.summary-details b{color:var(--ink)}.summary strong,.readout strong,.input-wrap input,.comparison-result strong,.chart-details dd,.differences strong,.milestone-row strong{font-family:var(--font-amount);font-variant-numeric:lining-nums tabular-nums;letter-spacing:0;font-weight:var(--weight-strong)}.summary strong{font-size:var(--text-amount);line-height:1.35}.summary .negative{color:#a32f45!important}.workspace{box-shadow:3px 4px 0 #e1d9d1}.section-title{border-bottom-style:solid}.input-wrap{background:#fff;border-color:#99afb5}.input-wrap input{font-weight:var(--weight-strong)}.input-wrap:focus-within{background:#fff;box-shadow:0 0 0 2px #166c8625}.key.comparison{height:0;background:none;border-top:3px dotted var(--comparison);width:18px}.key.principal{height:0;background:none;border-top:3px dashed var(--principal);width:18px}.comparison-line{stroke-width:2.5}.comparison-panel,#baselineSummary{background:#faf3e6}.comparison-result strong{color:#794b0e}.selected-comparison{color:#794b0e}.legend{font-size:var(--text-body);gap:10px 16px}.reset{font-size:var(--text-body)}.session-status{font-size:var(--text-small)}.summary-details{font-size:var(--text-body)}.summary p{font-size:var(--text-body)}.goal-panel{border-top-color:#b28a4e}.mode-switch button[aria-pressed="true"]{background:var(--accent)}.chart-panel .section-title h2{color:var(--ink)}
@media(max-width:760px){.summary{padding:12px 14px}.summary strong{font-size:var(--text-amount)}.summary-details{font-size:var(--text-small)}.summary-details b{font-size:var(--text-small)}.summary p{font-size:var(--text-small)}.brand h1{font-size:21px}.session-status{font-size:var(--text-small)}.readout strong{font-size:26px}}@media(max-width:390px){.summary{flex-wrap:wrap}.summary-details{display:flex;flex-wrap:wrap;gap:8px 18px}.summary-details b{display:inline;margin-left:6px}}

.goal-layout{align-items:start}#goalResult{display:block;font-size:20px;line-height:1.6;overflow-wrap:anywhere}.goal-facts{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-3);margin:14px 0 18px}.goal-facts dt{font-size:var(--text-body);color:var(--muted)}.goal-facts dd{font-family:var(--font-amount);font-size:var(--text-amount-secondary);font-weight:var(--weight-strong);color:var(--ink);overflow-wrap:anywhere}.goal-next{border-top:1px solid var(--line);padding-top:14px}.goal-next h3{font-size:var(--text-subheading);color:var(--ink);margin:0 0 6px}.goal-next strong{font-size:22px;color:var(--accent);font-family:var(--font-amount)}#applyGoal{background:var(--accent);max-width:100%;white-space:normal;line-height:1.6;padding:10px 14px}#goalActionStatus:empty{display:none}.goal-next .hint{font-size:var(--text-body)}#goalDetail>p{line-height:1.8}@media(max-width:360px){.goal-facts{grid-template-columns:1fr}}

.goal-progress{display:block;width:100%;height:10px;margin-top:16px;appearance:none;border:0;background:#e8eff0;border-radius:var(--radius-control);overflow:hidden}.goal-progress::-webkit-meter-bar{background:#e8eff0;border:0;border-radius:var(--radius-control)}.goal-progress::-webkit-meter-optimum-value{background:var(--accent);border-radius:var(--radius-control)}.goal-progress::-moz-meter-bar{background:var(--accent)}.goal-arrival{display:flex;align-items:baseline;flex-wrap:wrap;gap:var(--space-2);margin:12px 0}.goal-arrival strong{font-family:var(--font-amount);font-size:32px;line-height:1.3;color:var(--accent);font-weight:var(--weight-strong)}.goal-arrival span{font-size:var(--text-body)}.goal-invitation{font-size:var(--text-body);color:var(--ink);margin-top:12px;line-height:1.7}.goal-next{padding:16px;background:#eaf3f4;border:0;border-left:3px solid var(--accent)}.goal-next h3{margin-bottom:10px}.goal-next .hint{margin-top:8px}

/* A dated-entry feel: editorial headline, stamped state, oversized forecast. */
.goal-entry{padding:20px;background:#fffdf8;border:1px solid #d9d8ce;border-radius:3px;box-shadow:3px 3px 0 #e8e5db;min-width:0}.goal-stamp{display:inline-block;padding:4px 10px;margin:0 0 16px;border:2px solid #976015;border-radius:3px;color:#794b0e;font-size:var(--text-small);font-weight:var(--weight-strong);letter-spacing:.08em;transform:rotate(-3deg);background:#faf3e6}.goal-stamp[data-state="on-course"]{border-color:var(--accent);color:var(--accent);background:#eaf3f4}.goal-stamp[data-state="reached"]{border-style:double;border-width:4px;background:#faf3e6}#goalResult{font-family:var(--font-reading);font-size:23px;line-height:1.6;letter-spacing:.02em;font-weight:var(--weight-strong)}.goal-horizon{display:block;font:var(--weight-strong) 14px var(--font-reading);color:var(--muted);letter-spacing:0}.goal-percent{display:block;font:var(--weight-strong) clamp(52px,7vw,76px)/1.15 var(--font-amount);letter-spacing:-.04em;color:var(--accent);margin:6px 0}.goal-percent small{font-size:.4em;letter-spacing:0;margin-left:5px}.goal-caption{display:block;font-size:21px}.goal-invitation{border-left:2px solid #b28a4e;padding-left:12px;font-weight:var(--weight-strong);color:var(--ink)}.goal-arrival strong{font-size:clamp(34px,5vw,48px)}.goal-next{border-radius:0 8px 8px 0}.goal-next h3{font-family:var(--font-reading);font-size:var(--text-subheading)}#applyGoal{width:100%;font-weight:var(--weight-strong);box-shadow:0 3px 0 #114e61;margin-top:16px}#jumpGoal{background:var(--accent)}@media(max-width:760px){.goal-entry{padding:16px}#goalResult{font-size:21px}.goal-caption{font-size:20px}.goal-layout{gap:var(--space-4)}}@media(prefers-reduced-motion:no-preference){.goal-panel[open] .goal-entry{animation:journal-appear .25s ease-out}@keyframes journal-appear{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}}

section.goal-panel{padding:20px}#goalTitle{font-size:var(--text-heading);margin:0 0 18px}.goal-input{min-width:0}#showGoal{background:var(--accent);width:100%;margin-top:14px}#hideGoal{display:block;margin-top:6px;color:var(--muted)}section.goal-panel .goal-layout{padding:0}section.goal-panel .goal-layout:has(#goalEntry[hidden]){grid-template-columns:minmax(0,320px)}@media(max-width:760px){section.goal-panel{padding:18px 14px}.goal-input label{max-width:none}section.goal-panel .goal-layout:has(#goalEntry[hidden]){grid-template-columns:1fr}}

.readout .readout-breakdown{flex:0 0 100%;display:flex;flex-wrap:wrap;gap:6px 20px;margin:0 0 6px;font-size:var(--text-body)}.readout-breakdown>div{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;min-width:0}.readout .readout-breakdown dd{margin:0;font-family:var(--font-amount);font-weight:var(--weight-strong);overflow-wrap:anywhere}.readout-breakdown dt{color:var(--muted)}.readout{row-gap:4px}

.brand-logo{display:block;width:44px;height:44px;object-fit:contain;flex-shrink:0}@media(max-width:760px){.brand-logo{width:38px;height:38px}}

/* Open journal: white paper, ocean rules, directly placed figures. */
:root{background:#fff}body{background:#fff}.shell{max-width:var(--page-max-width)}header{border-bottom:2px solid var(--accent);margin-bottom:0}.summary{background:#fff;color:var(--ink);border:0;border-bottom:1px solid var(--line);border-radius:0;padding:20px 0;gap:var(--space-4)}.summary p{color:var(--ink)}.summary strong{color:var(--accent);font-size:var(--text-amount);letter-spacing:0}.summary-details,.summary-details b{color:var(--ink)}.workspace{background:#fff;border:0;border-radius:0;box-shadow:none;padding:28px 0;gap:30px}.conditions{padding-right:24px}.section-title{border:0;padding-bottom:0;gap:14px}.section-title h2{flex-shrink:0}.section-title::after{content:"";height:1px;background:var(--accent);flex:1;min-width:16px}.section-title .reset{order:2}.input-wrap{background:#fff;border:1px solid #668996;border-radius:var(--radius-control);padding:6px 10px}.input-wrap:focus-within{background:#fff}.experiment{border-top:0;padding-top:4px}#pinScenario{border:0;border-radius:0;border-bottom:1px solid var(--accent);color:var(--accent);padding:8px 0;text-align:left;background:#fff}.mode-switch{background:#fff;border:1px solid var(--accent);border-radius:var(--radius-control);padding:0;gap:0;overflow:hidden}.mode-switch button{border-radius:0;padding:9px 18px;color:var(--accent)}.mode-switch button[aria-pressed="true"]{background:var(--accent);color:#fff}.readout{border:0;text-align:center;padding:12px 0 4px}.readout strong{color:var(--accent);font-size:clamp(30px,4vw,42px)}.readout .readout-breakdown{justify-content:center}.legend{justify-content:center;margin-top:14px}.selected-comparison{text-align:center}#chart{height:360px}.chart-toolbar{margin-top:16px}.grid-line{stroke:#d8e3e7;stroke-dasharray:2 4}.year-control button{border-color:#668996;color:var(--accent)}section.goal-panel{background:#fff;border:0;border-radius:0;padding:22px 0;margin-top:8px;box-shadow:none}#goalTitle{display:flex;align-items:center;gap:var(--space-4);line-height:1.6}#goalTitle::after{content:"";height:1px;background:var(--accent);flex:1;min-width:18px}.goal-entry{padding:4px 0;background:#fff;border:0;border-radius:0;box-shadow:none}.goal-stamp,.goal-stamp[data-state="on-course"],.goal-stamp[data-state="reached"]{background:#fff;border-color:var(--accent);color:var(--accent)}.goal-next{padding:16px 0 0;border:0;border-top:1px solid var(--line);border-radius:0;background:#fff}.goal-invitation{border:0;padding-left:0;font-weight:400}.goal-facts{padding-bottom:8px}.goal-progress{height:7px}.goal-percent{font-size:clamp(60px,8vw,88px)}#applyGoal{box-shadow:none;border-radius:var(--radius-control)}#showGoal,#jumpGoal{border-radius:var(--radius-control)}.comparison-panel,#baselineSummary{background:#fff;border-left-color:var(--comparison)}.comparison-panel{border-block:1px solid #d5c7b0;border-radius:0}.milestones{margin-top:12px}footer{margin-top:18px}
@media(max-width:760px){.shell{padding-inline:18px}.summary{padding:12px 0;flex-wrap:wrap;gap:6px}.summary strong{font-size:var(--text-amount)}.summary-details{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:var(--text-small)}.summary-details b{display:inline;margin-left:5px}.workspace{padding:24px 0 12px;gap:28px}.conditions{padding:0;border:0}.section-title h2{font-size:var(--text-heading)}.fields{gap:16px 12px}.input-wrap input{font-size:22px}.chart-toolbar{justify-content:center}.readout strong{font-size:32px}.readout .readout-breakdown{font-size:var(--text-small);gap:6px 14px}#chart{height:340px}section.goal-panel{padding:22px 0}.goal-entry{padding:10px 0}.goal-layout{gap:24px}#goalTitle{font-size:var(--text-heading)}.goal-caption{font-size:20px}.chart-panel{scroll-margin-top:170px}}
@media(max-width:360px){.shell{padding-inline:12px}.summary strong{font-size:var(--text-amount)}.section-title{gap:var(--space-2)}.section-title h2{font-size:var(--text-heading)}.reset{font-size:var(--text-small)}#goalTitle{font-size:var(--text-heading)}}

.extend-goal{margin-top:18px;border-top:1px solid var(--line);padding-bottom:4px}.extend-goal summary{font-size:var(--text-body);line-height:1.7;padding:14px 0;color:var(--accent)}#extendedResult{font-size:17px;line-height:1.7;font-weight:var(--weight-strong)}#applyDuration{background:#fff;color:var(--accent);border:1px solid var(--accent);max-width:100%;white-space:normal;line-height:1.6}

.reset-controls{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:18px}.reset-controls button{background:#fff;border:1px solid #668996;border-radius:var(--radius-control);padding:9px 14px;font-size:var(--text-body)}.reset-controls span{font-size:var(--text-small);color:var(--muted)}.reset-feedback{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;font-size:var(--text-body);margin-top:10px}.reset-feedback button{background:#fff;border:0;text-decoration:underline;text-underline-offset:4px;color:var(--accent);padding:6px 4px;font-size:var(--text-body)}

/* Group results and next actions; reserve amber for resetting inputs. */
.reset-controls{justify-content:flex-end;margin-top:20px;margin-bottom:22px}.reset-controls #reset{background:#fff0d6;color:#78400c;border:1.5px solid #b56a18;font-weight:var(--weight-strong);padding:10px 16px}.reset-controls #reset span{color:inherit;font-size:23px;vertical-align:middle;line-height:1;margin-right:4px}.reset-controls #reset:hover{background:#ffe3b3}.reset-controls #reset:focus-visible{outline-color:#78400c}.reset-feedback{justify-content:flex-end}.goal-outcome{border:1px solid #8faeb9;border-top:3px solid var(--accent);border-radius:4px;padding:22px;min-width:0}.goal-outcome .goal-stamp{margin-bottom:18px}.goal-options{margin-top:30px}#goalOptionsTitle{font-family:var(--font-reading);font-size:var(--text-heading);line-height:1.5;margin:0 0 16px}.goal-option{padding:0 0 20px;border-bottom:1px solid var(--line)}.goal-option .goal-next{padding:0;border:0}.goal-option .goal-next h3{font-family:var(--font-reading);font-size:var(--text-subheading);font-weight:var(--weight-strong)}.goal-option .goal-next strong{font-size:24px}.goal-options .extend-goal{margin-top:0;border-top:0}.goal-options .extend-goal summary{font-weight:var(--weight-strong);padding:18px 0}.goal-facts{margin-bottom:0}.goal-caption{font-family:var(--font-reading);font-size:var(--text-emphasis);font-weight:400}.goal-outcome .goal-invitation{font-size:var(--text-body)}.goal-panel{margin-bottom:24px}section.goal-panel{margin-top:28px}.milestones{margin-top:24px}.workspace{row-gap:34px}@media(max-width:760px){.goal-outcome{padding:18px 16px}.goal-options{margin-top:26px}#goalResult{font-size:19px}.goal-caption{font-size:var(--text-emphasis)}.reset-controls{margin-bottom:20px}.workspace{gap:34px}section.goal-panel{margin-top:26px}}

/* Keep reset beside the conditions heading without a dedicated row. */
.conditions>.section-title{gap:10px;justify-content:space-between;align-items:center}.conditions>.section-title::after{display:none}.conditions>.section-title .reset-controls{margin:0;flex:0 0 auto}.conditions>.section-title #reset{padding:6px 10px;min-height:var(--control-min-height);font-size:var(--text-small);white-space:nowrap}.conditions>.section-title #reset span{font-size:19px;margin-right:2px}.conditions>.section-title h2{flex:1 1 auto;min-width:0}.conditions .reset-feedback{margin-top:10px}@media(max-width:360px){.conditions>.section-title{gap:6px}.conditions>.section-title #reset{padding-inline:8px;font-size:var(--text-small)}}

/* Use one section gap instead of stacking chart and goal spacing. */
.workspace{padding-bottom:0}section.goal-panel{margin-top:16px;padding-top:0}

/* Principal forms the foundation; investment change occupies the gap. */
.capital-area{fill:#d6e3ed}.gain-area{fill:#94dfd0;fill-opacity:.72}.loss-area{fill:#f2b4bd;fill-opacity:.7}.asset-line{stroke:#12647d;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round}.principal-line{stroke:#667f94;stroke-width:1.8;stroke-dasharray:none;stroke-linejoin:round;stroke-linecap:round}.comparison-line{stroke:#976015;stroke-width:2.2;stroke-dasharray:8 6;stroke-linecap:round;stroke-linejoin:round}.focus-line{stroke:#385e6c;stroke-dasharray:3 5;opacity:.7}.focus-asset{fill:#12647d;stroke:#fff;stroke-width:2.5}.focus-principal{fill:#fff;stroke:#667f94;stroke-width:2}.legend .key.principal{height:10px;width:15px;border:1px solid #667f94;background:#d6e3ed;border-radius:2px}.key.gain{height:10px;width:15px;background:#b2e8dd;border:1px solid #288574;border-radius:2px}.key.gain.loss{background:#f2b4bd;border-color:#a32f45}.key.comparison{border-top-style:dashed}.legend{font-size:var(--text-small);gap:8px 14px}#selectedPrincipal{color:#536c80}#selectedGain{color:#176e60}#selectedGain.negative{color:#a32f45}.readout-breakdown>div{min-height:24px}.readout .readout-breakdown dd{min-width:7ch}.grid-line{stroke:#829aa7;stroke-opacity:.3}.readout>div>strong{min-height:1.45em}#chartLossNote{text-align:center;font-size:var(--text-small);margin-top:8px}

/* Shared blue family for invested capital; turquoise for growth. */

.initial-area{fill:var(--capital-start)}.contribution-area{fill:var(--capital-deposit)}.initial-line{fill:none;stroke:#fff;stroke-width:1.5}.gain-area{fill:var(--growth);fill-opacity:1}.loss-area{fill-opacity:1}.key.initial,.key.contribution{height:10px;width:15px;border:1px solid;border-radius:2px}.key.initial{background:var(--capital-start);border-color:var(--capital-start)}.key.contribution{background:var(--capital-deposit);border-color:#86ADC4}.key.gain{background:var(--growth);border-color:#358C7A}#selectedInitial,#selectedContribution{color:#355F79}.asset-line,.principal-line{stroke-linecap:butt}.principal-line{stroke:#6B9CAF;stroke-width:1.3}.initial-caption{fill:#fff;font-size:var(--text-small);font-family:var(--font-reading)}.initial-line{stroke-linecap:butt}

/* Quiet capital layers, with growth carrying the color. */
.initial-line{stroke:none}.initial-caption{display:none}.principal-line{stroke:#8EAABD;stroke-width:1}.key.initial{border-color:#7B85AA}.key.contribution{border-color:#B1BAD7}.key.gain{border-color:#6BAEA4}#selectedInitial,#selectedContribution{color:#596789}

.axis-tick{fill:none;stroke:#92A7B2;stroke-width:1;stroke-linecap:butt}.grid-line{stroke:#92A7B2;stroke-opacity:.25;stroke-dasharray:2 5}

.goal-outcome #goalResult{display:block;font-family:var(--font-reading);font-size:var(--text-emphasis);font-weight:400;line-height:1.8}.goal-extension{margin-top:14px;font-size:20px;line-height:1.7;color:var(--accent);font-weight:var(--weight-strong)}.goal-extension strong{font-size:1.25em}

/* An expressive stamp, distinct from the surrounding result text. */
.goal-stamp[data-state="planning"]{color:#A0473D;background:#FFF5F1;border:2.5px solid #A0473D;border-radius:3px;padding:6px 13px;font-family:var(--font-reading);font-size:var(--text-emphasis);font-weight:var(--weight-strong);letter-spacing:.14em;transform:rotate(-4deg);box-shadow:none}
/* Status stamps share a silhouette, with distinct forecast and achievement marks. */
.goal-stamp[data-state="on-course"],.goal-stamp[data-state="reached"]{border-radius:3px;padding:6px 13px;font-family:var(--font-reading);font-size:var(--text-emphasis);font-weight:var(--weight-strong);letter-spacing:.14em;transform:rotate(-4deg);box-shadow:none}
.goal-stamp[data-state="on-course"]{color:#8B5A12;background:#FFF4D9;border:4px double #A47120;padding:5px 12px}
.goal-stamp[data-state="reached"]{color:#fff;background:#276F69;border:2.5px solid #276F69;border-radius:6px;padding:6px 13px;transform:none}.goal-stamp[data-state="reached"]::before{content:"✓";margin-right:7px;font-weight:var(--weight-strong)}

/* Restored book recommendations. */
.books{margin-top:32px;padding:28px 0;border-top:1px solid var(--line)}.books-heading{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);flex-wrap:wrap}.books-ad{font-size:var(--text-small);color:var(--muted);border:1px solid var(--line);padding:4px 8px}.books-intro{margin-top:10px;font-size:var(--text-body);color:var(--muted)}.books-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px;margin-top:28px}.book{display:flex;flex-direction:column;border-top:3px solid var(--accent);padding:18px 0 0;min-width:0}.book-number{font-size:var(--text-small);letter-spacing:.06em;color:var(--accent)}.book h3{font-family:var(--font-reading);font-size:var(--text-emphasis);line-height:1.7;margin:12px 0}.book-author{font-size:var(--text-body);color:var(--muted);line-height:1.8}.book-description{font-size:var(--text-body);line-height:1.9;margin:14px 0 22px}.book a{display:flex;justify-content:space-between;align-items:center;margin-top:auto;min-height:48px;padding:10px 14px;border:1px solid var(--accent);color:var(--accent);text-decoration:none;font-size:var(--text-body)}.book a:hover{background:#eef7f9}.books-disclosure{font-size:var(--text-small);line-height:1.9;color:var(--muted);margin-top:24px;max-width:900px}@media(max-width:700px){.books-grid{grid-template-columns:1fr;gap:28px}.book h3{font-size:var(--text-emphasis)}.book-description{margin-bottom:16px}}

.goal-extension .goal-phrase{display:inline-block;max-width:100%;word-break:keep-all;overflow-wrap:anywhere;vertical-align:baseline}
/* Keep book recommendations close to the end of the goal flow. */
section.goal-panel{padding-bottom:0;margin-bottom:0}
.goal-entry{padding-bottom:0}
#goalActionStatus:empty{margin:0}
.goal-panel + .books{margin-top:8px;padding-top:12px}

/* Books: quiet paper cards, recognizable covers and explicit destinations. */
.books{padding:28px 0 20px}.books-intro{line-height:1.8;max-width:42em}.books-ad{border-radius:4px}
.books-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:22px}
.book{padding:22px;background:#fffdf9;border:1px solid var(--line);border-radius:12px;gap:0}
.book-featured{background:#f4f8f7;border-color:#b4cbce}
.book a{margin:0}.book .book-identity{display:grid;grid-template-columns:96px minmax(0,1fr);align-items:start;gap:20px;border:0;padding:0;background:transparent;color:var(--ink);text-decoration:none}
.book-cover{display:block;position:relative;width:96px;height:136px;background:#e7eeed;border-radius:2px 5px 5px 2px;box-shadow:2px 3px 6px #233c471a;overflow:hidden}
.book-cover-placeholder{position:absolute;inset:0;display:grid;place-items:center;border-left:5px solid #b6c7c9;font-family:var(--font-reading);font-size:15px;color:var(--muted)}
.book-cover img{position:relative;display:block;width:100%;height:100%;object-fit:contain;background:#fff}
.book-meta{min-width:0}.book-topic{font-size:var(--text-small);color:var(--accent);line-height:1.6;margin-bottom:6px}
.book h3{font-size:var(--text-emphasis);line-height:1.55;margin:0 0 10px;overflow-wrap:anywhere}
.book-author{font-size:var(--text-small);line-height:1.7}.book-description{font-size:var(--text-body);margin:18px 0;line-height:1.8}
.book-actions{display:grid;gap:var(--space-2);margin-top:auto}.book-free-note{font-size:var(--text-small);line-height:1.7;color:var(--muted)}
.book .book-action{display:flex;justify-content:space-between;gap:var(--space-2);min-height:46px;padding:10px 14px;border:1px solid #9ab4bd;border-radius:7px;font-size:var(--text-body);background:#fff;color:var(--accent);line-height:1.6}
.book .book-action-primary{background:var(--accent);border-color:var(--accent);color:#fff}
@media(hover:hover){.book .book-identity:hover h3{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px}.book .book-action:hover{background:#eaf3f4;border-color:var(--accent)}.book .book-action-primary:hover{background:#10566b;color:#fff}.book-cover{transition:transform .16s ease,box-shadow .16s ease}.book-identity:hover .book-cover{transform:translateY(-2px);box-shadow:2px 5px 9px #233c4726}}
@media(prefers-reduced-motion:reduce){.book-cover{transition:none}.book-identity:hover .book-cover{transform:none}}
@media(max-width:700px){.books-grid{grid-template-columns:1fr;gap:14px}.book{padding:18px}.book .book-identity{grid-template-columns:76px minmax(0,1fr);gap:14px}.book-cover{width:76px;height:108px}.book h3{font-size:var(--text-emphasis)}.books-intro{font-size:var(--text-small)}.book-description{margin:16px 0}}
/* Keep the reading section free of the simulator's sticky result. */
body.books-reading .summary{visibility:hidden;pointer-events:none}
@media(min-width:1000px){.book-featured .book-actions{grid-template-columns:1fr 1fr}.book-free-note{grid-column:1/-1}.book .book-action{font-size:var(--text-small)}}
@media(max-width:360px){.book .book-identity{grid-template-columns:64px minmax(0,1fr);gap:var(--space-3)}.book-cover{width:64px;height:92px}}
.book a{scroll-margin-block:24px 90px}
body.books-reading .mobile-nav a:nth-child(2){background:transparent;color:var(--accent)}
body.books-reading .mobile-nav a[href="#books"]{background:var(--accent);color:#fff}

/* Keep long goal amounts readable and expose their interpreted unit. */
.goal-input #target{font-size:18px}
.target-amount{display:block;margin-top:5px;font-size:var(--text-small);color:var(--muted);overflow-wrap:anywhere;font-variant-numeric:tabular-nums}

/* Text entry keeps its caret and field styling without an outer focus rectangle. */
input:is([type="text"],[type="number"]):focus-visible{outline:none}

/* Do not draw operation focus rings; text selection remains native. */
:focus{outline:none!important}

/* graph.css */
/* Interactive chart: a clear route, readable amounts, reversible exploration. */
.chart-panel{min-width:0}.chart-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin:0 0 18px}.chart-assumption{font-size:var(--text-small);color:var(--muted)}.chart-toolbar select{min-height:var(--control-min-height);max-width:100%}
.readout{display:block;padding:0;margin:0}.readout-primary{text-align:left;display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 10px}.readout-primary #selectedYear{font-size:var(--text-body);font-weight:var(--weight-strong);color:var(--accent);background:#edf6f7;padding:3px 9px;border-radius:3px}.readout-primary .readout-label{font-size:var(--text-small);color:var(--muted)}.readout-primary #selectedAssets{flex-basis:100%;font-size:var(--text-amount);line-height:1.4;min-height:1.4em;letter-spacing:0;text-align:left;overflow-wrap:anywhere;color:#16637a}.readout .readout-breakdown{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-4);margin:12px 0 14px;padding:12px 0;border-top:1px solid #dce7eb;border-bottom:1px solid #dce7eb}.readout-breakdown>div{display:block;border-left:2px solid var(--capital-start);padding-left:10px}.readout-breakdown>div:nth-child(2){border-left-color:#bac7da}.readout-breakdown>div:nth-child(3){border-left-color:#339e89}.readout-breakdown dt{font-size:var(--text-small);line-height:1.6}.readout-breakdown .key{display:none}.readout .readout-breakdown dd{font-size:var(--text-emphasis);line-height:1.6;margin-top:5px;min-width:0}.chart-caption{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:6px 12px;font-size:var(--text-small);color:var(--muted)}.chart-caption>span:first-child{display:flex;align-items:center;gap:6px;color:var(--accent);font-weight:var(--weight-strong)}.chart-caption .key.asset{width:20px;height:0;border-top:3px solid var(--accent)}
#chart{height:330px;width:100%;display:block;touch-action:pinch-zoom;cursor:crosshair;user-select:none;margin-top:3px}.grid-line{stroke:#91aab3;stroke-opacity:.24;stroke-dasharray:2 5}.axis-label,.axis-unit{font-family:var(--font-reading);font-size:11px;fill:#52656c}.axis-unit{font-size:11px}.asset-line{fill:none;stroke:#146c85;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.principal-line{fill:none;stroke:#879fbb;stroke-width:1.25}.principal-line.is-loss{stroke:#977c7b;stroke-dasharray:5 4}.initial-area{fill:#9babc8}.contribution-area{fill:#e0e8f3}.gain-area{fill:url(#growthFill)}.loss-area{fill:url(#lossHatch);fill-opacity:1}.focus-line{stroke:#397887;stroke-width:1;stroke-dasharray:3 4;opacity:.65}.focus-halo{fill:#16748a;fill-opacity:.12}.focus-asset{fill:#146c85;stroke:#fff;stroke-width:2.5}.focus-principal{fill:#fff;stroke:#879fbb;stroke-width:1.5}.end-dot{fill:#fff;stroke:#146c85;stroke-width:2}.chart-target{stroke:#9a7429;stroke-width:1.3;stroke-dasharray:6 5}.target-label{font-size:11px;fill:#805a16;paint-order:stroke;stroke:#fff;stroke-width:4px;stroke-linejoin:round}.year-control{display:flex;align-items:center;gap:14px;margin:0}.year-control button{width:44px;height:44px;border:1px solid #b9cdd5;background:#fff;color:var(--accent);border-radius:50%;flex-shrink:0;font-size:20px}.year-control input{flex:1;min-width:0;width:auto;accent-color:#16748a;min-height:var(--control-min-height)}.chart-stops{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:5px}.chart-stops button{border:1px solid transparent;border-radius:3px;background:transparent;color:var(--muted);font-size:var(--text-small);min-height:var(--control-min-height);padding:6px 12px}.chart-stops button[aria-pressed=true]{border-color:#b9d7dd;background:#f0f8f8;color:#12647d}.chart-stops button:hover{background:#edf6f7}.chart-hint{text-align:center;margin:3px 0 12px;font-size:var(--text-small)}.chart-discovery{padding:12px 0 12px 13px;border-left:3px solid #89b5b5;font-size:var(--text-body);line-height:1.9;min-height:60px}.chart-discovery .hint{display:block}.explore{margin-top:22px}.explore-heading{display:flex;justify-content:space-between;align-items:center;gap:var(--space-2)}.explore h3{font-family:var(--font-reading);font-size:var(--text-subheading);font-weight:var(--weight-strong);margin:0}.explore-heading button{background:none;border:0;color:var(--accent);font-size:var(--text-small);text-decoration:underline;text-underline-offset:4px}.explore-actions{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-3);margin-top:12px}.explore-actions button{background:#fff;border:1px solid #b3cbd2;border-radius:4px;text-align:left;padding:13px 15px;color:var(--ink);min-width:0;line-height:1.7}.explore-actions button span{display:block;font-size:var(--text-small)}.explore-actions button strong{display:block;font-size:var(--text-emphasis);font-weight:var(--weight-strong);color:var(--accent);margin-top:4px;overflow-wrap:anywhere}.explore-actions button:hover:not(:disabled){border-color:var(--accent);background:#f1f9f9}.explore-actions button:disabled{opacity:.55}.explore #exploreStatus:empty{display:none}.input-feedback{border-left:3px solid #a86b20;padding:10px 12px;color:#805515;font-size:var(--text-small);line-height:1.8;margin-top:12px}input[aria-invalid=true]{color:#985725}.input-wrap:has([aria-invalid=true]){border-color:#ba7929}.chart-panel.is-editing .chart-assumption{color:#985725}.summary strong{overflow-wrap:anywhere}.summary-details{min-width:0}.summary-details b{overflow-wrap:anywhere}#chartLossNote{text-align:left;color:#905c56;margin:7px 0 0;line-height:1.8}
@media(max-width:760px){.chart-toolbar{justify-content:flex-start;margin-bottom:16px}.chart-assumption{margin-left:auto;font-size:var(--text-small)}.readout-primary #selectedAssets{font-size:var(--text-amount)}.readout .readout-breakdown{gap:var(--space-2);margin-top:10px;padding:10px 0}.readout-breakdown>div{padding-left:7px}.readout-breakdown dt{font-size:var(--text-small)}.readout .readout-breakdown dd{font-size:var(--text-small);line-height:1.7}#chart{height:290px}.chart-caption{font-size:var(--text-small)}.chart-discovery{font-size:var(--text-small)}.explore h3{font-size:var(--text-subheading)}.explore-actions{gap:var(--space-2)}.explore-actions button{padding:10px}.explore-actions button span{font-size:var(--text-small)}.explore-actions button strong{font-size:var(--text-body)}.chart-hint{font-size:var(--text-small)}.chart-panel{scroll-margin-top:150px}}
@media(max-width:360px){.readout .readout-breakdown{grid-template-columns:1fr;gap:7px}.readout-breakdown>div{display:flex;justify-content:space-between;align-items:baseline;gap:var(--space-2)}.readout .readout-breakdown dd{margin:0}.chart-assumption{margin-left:0}.explore-actions{grid-template-columns:1fr}.readout-primary #selectedAssets{font-size:var(--text-amount)}.chart-stops button{padding-inline:10px}}
@media(prefers-reduced-motion:no-preference){.focus-halo{transition:r .15s}.explore-actions button{transition:background .15s,border-color .15s}.explore-actions button:active{transform:translateY(1px)}}
.readout .readout-breakdown{text-align:left}.readout-breakdown:has(.negative)>div:nth-child(3){border-left-color:#b36b64}
.summary{position:sticky;top:0;z-index:5}.chart-panel{scroll-margin-top:20px}.focus-callout{pointer-events:none}.focus-callout rect{fill:#fff;fill-opacity:.96;stroke:#bdd4db;stroke-width:1}.focus-date{font-family:var(--font-reading);font-size:11px;fill:#52656c}.focus-money{font-family:var(--font-amount);font-size:var(--text-small);font-weight:var(--weight-strong);fill:#146c85}
#chart[data-loss=true] .initial-area,#chart[data-loss=true] .contribution-area{display:none}.remaining-area{fill:#d8e9ee}
.summary-details{max-width:100%;flex-shrink:1}

/* Marine palette lives in design-tokens.css; rules below apply it. */

.summary{padding-block:16px}.summary strong{font-size:var(--text-amount);color:var(--chart-asset)}
.chart-toolbar{margin-bottom:12px}.chart-toolbar .mode-switch{border:1px solid var(--accent);background:#fff;overflow:hidden;border-radius:6px}.chart-toolbar .mode-switch button{font-weight:var(--weight-strong);min-width:76px;border-radius:0;color:var(--accent)}.chart-toolbar .mode-switch button[aria-pressed=true]{color:#fff;background:var(--accent)}
.readout-primary #selectedYear{background:#e9f4f6;color:var(--accent);font-size:var(--text-small);border-radius:3px}.readout-primary #selectedAssets{color:var(--chart-asset);line-height:1.2;min-height:1.2em;font-size:var(--text-amount)}
.readout .readout-breakdown{margin:12px 0;padding:10px 0;gap:var(--space-3)}.readout-breakdown>div{border-left:0;padding-left:0}.readout-breakdown dt{font-size:var(--text-small);display:flex;align-items:center;gap:6px}.readout-breakdown dt .key{display:inline-block;width:10px;height:10px;flex-shrink:0;border:1px solid var(--chart-boundary);border-radius:2px}.readout-breakdown dt .key.initial{background:var(--capital-start)}.readout-breakdown dt .key.contribution{background:var(--capital-deposit)}.readout-breakdown dt .key.gain{background:var(--chart-growth-high);border-color:var(--chart-gain-text)}.readout-breakdown dt .key.gain.loss{background:repeating-linear-gradient(135deg,#fff 0 3px,var(--chart-loss) 3px 4px,#fff 4px 7px);border-color:var(--chart-loss)}.readout .readout-breakdown dd{font-size:var(--text-emphasis);font-weight:var(--weight-strong);color:var(--chart-boundary)}#selectedGain{color:var(--chart-gain-text)}#selectedGain.negative,.summary .negative{color:var(--chart-loss)!important}
.initial-area{fill:var(--capital-start)}.contribution-area{fill:var(--capital-deposit)}.growth-high{stop-color:var(--chart-growth-high)}.growth-low{stop-color:var(--chart-growth-low)}.initial-separator{fill:none;stroke:var(--chart-boundary);stroke-width:1}.principal-line{stroke:var(--chart-boundary);stroke-width:1.25;stroke-dasharray:5 4}.principal-line.is-loss{stroke:var(--chart-boundary)}.asset-line{stroke:var(--chart-asset);stroke-width:3.25}.remaining-area{fill:#D8E9EE}.loss-hatch-line{stroke:var(--chart-loss)}#chart[data-loss=true] .initial-separator{display:none}
.chart-target-underlay{stroke:#fff;stroke-width:4;stroke-dasharray:6 5}.chart-target{stroke:var(--chart-goal);stroke-width:1.5}.target-label{fill:var(--chart-goal);font-size:var(--text-small)}.axis-label,.axis-unit{fill:var(--muted);font-size:var(--text-small)}.grid-line{stroke:#98b0bb;stroke-opacity:.3;stroke-dasharray:2 6}
.focus-asset,.focus-halo{fill:var(--chart-asset)}.focus-line{stroke:var(--chart-asset);stroke-opacity:.7}.focus-principal{stroke:var(--chart-boundary)}.end-dot{stroke:var(--chart-asset)}.focus-callout rect{fill:var(--chart-asset);fill-opacity:1;stroke:#fff;stroke-width:1.5}.focus-date{fill:#fff;font-size:11px}.focus-money{fill:#fff;font-size:var(--text-small);font-weight:var(--weight-strong)}
#chartLossNote{color:var(--chart-loss);font-size:var(--text-small)}.chart-caption{font-size:var(--text-small)}.chart-discovery{border-left:3px solid var(--accent);background:linear-gradient(90deg,#f0f8fa,transparent);padding:12px 16px;font-size:var(--text-body)}.chart-discovery p{color:var(--ink)}
.year-control button{border:1px solid #668997;color:var(--accent);background:#fff}.year-control input{accent-color:var(--accent)}.chart-stops button{font-size:var(--text-small)}.chart-stops button[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:#fff}
.explore{padding:18px 0 0;border-top:1px solid #cddde3;margin-top:20px}.explore h3{font-size:var(--text-subheading)}.explore-actions button{display:flex;flex-direction:column;align-items:flex-start;gap:5px;border:1px solid #668997;border-radius:6px;padding:14px 16px;background:#fff}.explore-actions button strong{font-size:17px;margin-top:0;color:var(--accent)}.explore-actions button::after{content:'この条件で試す →';font-size:var(--text-small);color:var(--accent);margin-top:4px}.explore-actions button:disabled::after{content:'上限に達しています'}.explore-actions button:hover:not(:disabled){background:#eef8fa;border-color:var(--accent);box-shadow:0 2px 0 #c7e1e8}.explore-actions button:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
@media(min-width:761px) and (max-width:980px){.workspace{grid-template-columns:1fr}.conditions{padding:0 0 18px;border-right:0;border-bottom:1px solid var(--line)}.fields{grid-template-columns:repeat(4,minmax(0,1fr))}.fields .input-wrap input{font-size:20px}.chart-panel{max-width:100%}}
@media(max-width:760px){.summary{padding-block:12px}.summary strong{font-size:var(--text-amount)}.readout-primary #selectedAssets{font-size:var(--text-amount)}.readout .readout-breakdown{gap:var(--space-2)}.readout .readout-breakdown dd{font-size:var(--text-body)}.readout-breakdown dt{font-size:var(--text-small)}.readout-breakdown dt .key{width:8px;height:8px}.chart-assumption{font-size:var(--text-small)}.chart-caption{font-size:var(--text-small)}.chart-hint{font-size:var(--text-small)}.explore-actions button{padding:12px;gap:4px}.explore-actions button span{font-size:var(--text-small)}.explore-actions button strong{font-size:15px}.explore h3{font-size:var(--text-subheading)}.chart-discovery{font-size:var(--text-body)}.chart-stops button{font-size:var(--text-small)}.readout .readout-breakdown{grid-template-columns:1fr}.readout-breakdown>div{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-3)}.readout .readout-breakdown dd{margin:0}}
@media(max-width:360px){.readout-primary #selectedAssets{font-size:var(--text-amount)}.chart-toolbar .mode-switch button{min-width:72px}.chart-toolbar{gap:var(--space-2)}.explore-actions button strong{font-size:var(--text-emphasis)}}
@media(prefers-reduced-motion:no-preference){.focus-callout rect{transition:fill .12s}.chart-stops button{transition:background .12s,color .12s}.year-control button:hover:not(:disabled){background:#edf7f9}}
@media(prefers-contrast:more){.grid-line{stroke:#52656c;stroke-opacity:.6}.initial-separator,.principal-line{stroke-width:2}.asset-line{stroke-width:4}.chart-caption,.axis-label,.axis-unit,.chart-hint{color:#243F4A;fill:#243F4A}}
@media(forced-colors:active){.asset-line,.principal-line,.initial-separator,.chart-target,.focus-line{stroke:CanvasText}.initial-area,.contribution-area,.gain-area,.remaining-area{fill:Canvas}.loss-hatch-line{stroke:CanvasText}.focus-callout rect{fill:Canvas;stroke:CanvasText}.focus-date,.focus-money,.axis-label,.axis-unit,.target-label{fill:CanvasText}.focus-asset{fill:Highlight;stroke:Canvas}.end-dot{stroke:CanvasText;fill:Canvas}.initial-separator{stroke-dasharray:2 2}}

/* Short mobile sessions: reachable navigation, readable inputs, no scroll trap. */
.mobile-nav{display:none}
.books-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.book-free{background:#f0f8fa;border-left:3px solid var(--accent);padding:14px;margin-bottom:16px;font-size:var(--text-body);line-height:1.9}
.book .book-free a{margin-top:12px;background:#fff}
#conditions,#books{scroll-margin-top:16px}
@media(max-width:760px){
 .shell{padding-bottom:calc(92px + env(safe-area-inset-bottom))}
 .mobile-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));position:fixed;bottom:0;left:0;right:0;z-index:10;gap:4px;padding:8px max(8px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));background:#fff;border-top:1px solid #b9cdd5;box-shadow:0 -2px 10px #243f4a0a}
 .mobile-nav a{display:flex;justify-content:center;align-items:center;min-height:var(--control-min-height);min-width:44px;text-decoration:none;color:var(--accent);font-size:var(--text-small);font-weight:var(--weight-strong);border-radius:var(--radius-control)}
 .mobile-nav a:nth-child(2){background:var(--accent);color:#fff}
 body:has(input[data-numeric]:focus) .mobile-nav{display:none}
 .input-wrap input{min-height:var(--control-min-height)}
 select{font-size:var(--text-emphasis)}
 button,summary{min-height:var(--control-min-height);min-width:44px}
 footer summary{padding-block:12px}
 .workspace{gap:14px}.conditions{padding-bottom:10px}.fields{gap:10px 12px}
 .chart-toolbar{gap:var(--space-2);margin-bottom:10px}
 .chart-assumption{flex-basis:100%;margin-left:0}
 .books-grid{grid-template-columns:1fr;gap:24px}
 .book h3{font-size:var(--text-emphasis);line-height:1.65}
 .book-free{font-size:var(--text-body);padding:12px}
}
@media(max-height:500px) and (max-width:760px){.mobile-nav{position:static}.shell{padding-bottom:24px}}

/* Two equally visible choices for reaching a goal. */
.goal-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-4)}
.goal-cards .goal-option{display:flex;flex-direction:column;min-width:0;padding:20px;border:1px solid #668997;border-radius:6px;background:#fff;margin:0}
.goal-cards h3,.goal-cards .goal-next h3{font-family:var(--font-reading);font-size:var(--text-subheading);margin:0 0 18px;line-height:1.6}
.goal-cards .goal-next{background:none;padding:0;border:0}
.goal-cards .goal-card-result strong,.goal-cards #extendedResult strong{display:block;font-size:var(--text-amount-secondary);line-height:1.5;color:var(--accent);overflow-wrap:anywhere}
.goal-cards .goal-card-result span,.goal-cards #extendedResult span{display:block;font-size:15px;font-weight:400;line-height:1.8;margin-top:8px}
.goal-cards .hint{font-size:var(--text-small);line-height:1.8;margin:12px 0 18px}
.goal-cards #applyGoal,.goal-cards #applyDuration,.goal-cards #applyRate{width:100%;margin-top:auto;box-shadow:none;background:var(--accent);color:#fff;border:1px solid var(--accent);min-height:48px;font-size:var(--text-body);font-weight:var(--weight-strong);padding:12px;line-height:1.6}
.goal-cards #goalDepositDetail{margin-bottom:0}
@media(max-width:760px){.goal-cards{grid-template-columns:1fr;gap:var(--space-3)}.goal-cards .goal-option{padding:18px}.goal-cards h3,.goal-cards .goal-next h3{margin-bottom:12px}}

/* Selected values stay in one place, outside the plotted data. */
.readout{padding:0;border:0;border-radius:0;background:transparent;margin-bottom:12px}
.readout-primary{gap:6px 10px}
.readout-primary #selectedAssets{flex-basis:auto;font-size:var(--text-amount);margin-left:auto;line-height:1.4}
.readout .readout-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;margin-top:12px}
.readout-totals dt{font-size:var(--text-small);color:var(--muted)}
.readout-totals dd{font-size:var(--text-amount-secondary);font-weight:var(--weight-strong);overflow-wrap:anywhere;margin-top:4px}
.principal-details{margin-top:8px;border-top:1px solid #dce7eb}
.principal-details-title{font-size:var(--text-small);font-weight:400;padding:10px 0;color:var(--muted)}
.principal-details .readout-breakdown{margin:0;padding:0 0 12px;border:0;grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:760px){.readout-primary #selectedAssets{font-size:var(--text-amount);flex-basis:100%;margin-left:0}.readout-totals dd{font-size:var(--text-amount-secondary)}.principal-details .readout-breakdown{grid-template-columns:1fr}.readout{padding:0}}

/* Keep the forecast visible while editing; reserve space for scroll targets. */
html{scroll-padding-top:calc(var(--forecast-height,150px) + 12px)}
/* The saving forecast is hidden immediately on mode change, before its ResizeObserver runs. */
@media(min-width:761px){html:has(body.withdrawal-active){scroll-padding-top:12px}}
@media(max-height:500px){.summary{position:static}html{scroll-padding-top:12px}}

@media(max-width:760px){.goal-panel .goal-layout{row-gap:8px}.goal-panel .goal-entry{padding-top:0}.goal-input #hideGoal{margin-top:4px}}

/* Compact reading label adopted from the touch prototype. Details stay below. */
#chart{height:400px}
.focus-callout{pointer-events:none}
.focus-callout rect{fill:var(--paper);fill-opacity:1;stroke:var(--line);stroke-width:1;filter:drop-shadow(0 2px 4px #183e4612)}
.focus-callout text{font-family:var(--font-reading)}
.focus-callout .callout-date{fill:var(--muted);font-size:12px;font-weight:400}
.focus-callout .callout-total{fill:var(--chart-asset);font-size:17px;font-weight:var(--weight-strong)}
.saving-previous-line{fill:none;stroke:var(--chart-asset);stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.saving-previous-label{font-family:var(--font-reading);font-size:var(--text-small);fill:var(--muted)}
@media(max-width:760px){#chart{height:400px}}
@media(forced-colors:active){.focus-callout rect{fill:Canvas;stroke:CanvasText;filter:none}.focus-callout .callout-date,.focus-callout .callout-total,.saving-previous-label{fill:CanvasText}.saving-previous-line{stroke:CanvasText}}

/* Desktop: keep the inputs and the complete chart in the first working view. */
@media(min-width:981px){
 header{padding-block:8px}
 .brand-logo{width:36px;height:36px}
 .summary{padding-block:10px}
 .summary strong{font-size:var(--text-amount);line-height:1.2}
 .workspace{grid-template-columns:280px minmax(0,1fr);gap:24px;padding-top:16px}
 .conditions{padding-right:20px}
 .section-title,.chart-panel .section-title{margin-bottom:8px;padding-bottom:0;min-height:var(--control-min-height)}
 .section-title h2{font-size:var(--text-heading)}
 .fields{gap:var(--space-3)}
 .input-wrap{padding-block:3px}
 .input-wrap input{font-size:24px;min-height:42px}
 .chart-toolbar{margin-top:0;margin-bottom:8px}
 .readout{display:grid;grid-template-columns:1fr 1fr;gap:6px 18px;margin-bottom:8px;text-align:left}
 .readout-primary{grid-column:1/-1}
 .readout-primary #selectedAssets{font-size:var(--text-amount);line-height:1.2}
 .readout .readout-totals{margin:0;gap:6px 12px;align-self:end}
 .readout-totals dd{margin-top:2px}
 .principal-details{margin:0;border-top:0;border-left:1px solid var(--line);padding-left:16px}
 .principal-details-title{padding:0 0 2px;font-size:var(--text-small)}
 .principal-details .readout-breakdown{padding:0;gap:6px 12px}
 .principal-details .readout-breakdown dd{margin-top:2px}
}
@media(min-width:981px) and (max-height:850px){
 .summary{padding-block:6px}
 .workspace{padding-top:12px}
 #chart{height:320px}
}

/* Short, interruptible motion keeps discrete dates easy to follow with a mouse. */
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
 .focus-line{transition:transform 50ms linear}
 .focus-asset,.focus-halo,.focus-principal{transition:cx 50ms linear,cy 50ms linear}
}

/* Keep the mouse label shadow clear of the SVG edge. */
@media(hover:hover) and (pointer:fine){#chart{overflow:visible}}

/* Headline amounts stay above the plot; the expandable section holds details. */
#savingChart .readout{grid-template-columns:minmax(0,1fr) auto}
#savingChart .readout-totals{grid-template-columns:1fr}
#savingChart .chart-caption{display:flex;flex-wrap:wrap;gap:8px 18px;line-height:1.7}
@media(max-width:760px){#savingChart .readout{grid-template-columns:1fr}}

.selected-details{padding:16px 0;border-bottom:1px solid var(--line);margin-bottom:16px}.selected-details h3{font-size:var(--text-subheading);margin:0 0 12px}.selected-details h3 span{display:inline-block;margin-left:12px;color:var(--muted);font-size:var(--text-subheading);font-weight:400}.selected-details-values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-3)}.selected-details-values dt{font-size:var(--text-small);color:var(--muted);line-height:1.7}.selected-details-values dd{font-size:var(--text-emphasis);font-weight:var(--weight-strong);margin-top:4px;overflow-wrap:anywhere}@media(max-width:760px){.selected-details-values{grid-template-columns:1fr}.selected-details-values>div{display:flex;justify-content:space-between;align-items:baseline;gap:var(--space-3)}.selected-details-values dd{margin:0;text-align:right}}

/* Two amounts share a baseline; all visual keys form a separate legend. */
#savingChart .readout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:8px 20px;align-items:end;margin-bottom:14px}
#savingChart .readout-time{grid-column:1/-1;font-size:var(--text-small);color:var(--muted)}
#savingChart .readout-primary{display:block;grid-column:auto;min-width:0}
#savingChart .readout-label,#savingChart .readout-totals dt{display:block;font-size:var(--text-small);line-height:1.6;color:var(--muted);margin:0}
#savingChart .readout-primary #selectedAssets{display:block;font-size:var(--text-amount);line-height:1.3;margin:4px 0 0;overflow-wrap:anywhere}
#savingChart .readout-totals{display:block;margin:0;min-width:0}
#savingChart #selectedGain{font-size:var(--text-amount-secondary);line-height:1.4;margin:4px 0 1px;overflow-wrap:anywhere}
#savingChart .chart-caption{padding:12px 0;border-top:1px solid var(--line);gap:8px 18px;font-size:var(--text-small);color:var(--muted)}
#savingChart .chart-caption>span{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
#savingChart .chart-caption .key{flex-shrink:0;margin:0}
#savingChart .chart-caption .principal-key{width:16px;height:0;border:0;border-top:2px dashed #76736e;background:transparent}
@media(max-width:360px){#savingChart .readout{gap:8px 12px}#savingChart .readout-primary #selectedAssets{font-size:var(--text-amount)}#savingChart #selectedGain{font-size:var(--text-amount-secondary)}}
@media(min-width:761px){#savingChart .readout{grid-template-columns:minmax(0,max-content) minmax(0,1fr);column-gap:32px}}
#savingChart .chart-caption{justify-content:flex-start}
@media(min-width:981px) and (max-height:850px){#savingChart .readout{margin-bottom:6px;row-gap:4px}#savingChart .chart-caption{padding-block:8px}}

/* Place the selected time in the amount label, without a separate row. */
#savingChart .readout-heading{display:flex;flex-wrap:wrap;align-items:baseline;gap:0;font-size:var(--text-small);line-height:1.6;color:var(--muted)}
#savingChart .readout-heading #selectedYear{grid-column:auto;background:none;padding:0;margin:0;border-radius:0;font-size:var(--text-small);font-weight:400;line-height:1.6;color:var(--muted)}
#savingChart .readout-heading .readout-label{display:inline}

/* Focus markers appear with the finished plot; touching the chart finishes immediately. */
#chart[data-drawing] #chartFocus,#withdrawalChart[data-drawing] #withdrawalFocusLine,#withdrawalChart[data-drawing] #withdrawalFocusDot {visibility:hidden}

/* Mark the first projected month reaching the goal, without requiring hover. */
.goal-arrival-dot{fill:var(--chart-goal);stroke:var(--paper);stroke-width:2.5}
.goal-arrival-leader{fill:none;stroke:var(--chart-goal);stroke-width:1}
.goal-arrival-label{fill:var(--paper);stroke:var(--chart-goal);stroke-width:1}
.goal-arrival-amount{fill:var(--muted);font-size:11px}
.goal-arrival-time{fill:var(--ink);font-size:12px;font-weight:600}

/* withdrawal.css */
.withdrawal-link{border:0;background:transparent;color:var(--accent);padding:8px 0;font-size:var(--text-small);text-align:left}
.condition-actions{display:grid;grid-template-columns:.8fr 1.2fr;gap:var(--space-2);margin-bottom:16px}
.condition-actions #reset,.condition-actions #openWithdrawal{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:var(--control-min-height);margin:0;padding:8px 6px;border:1px solid #668996;border-radius:var(--radius-control);font-size:var(--text-body);font-weight:var(--weight-strong);line-height:1.5;white-space:nowrap}
.condition-actions #reset{background:#fff;color:var(--ink);border-color:#668996}
.condition-actions #reset span{font-size:19px;line-height:1;margin:0}
.condition-actions #openWithdrawal{background:var(--accent);color:#fff}
.condition-actions #reset:hover:not(:disabled){background:#f4f7f8;border-color:#668996}
.condition-actions #openWithdrawal:hover:not(:disabled){background:#06465a;border-color:#06465a}
.withdrawal-active .condition-actions{grid-template-columns:1fr 1fr;margin-bottom:8px}
.withdrawal-active .condition-actions #reset span{display:none}
.withdrawal-time-label{display:flex;justify-content:space-between;flex-wrap:wrap;gap:4px 12px;font-size:var(--text-small);color:var(--muted);margin-top:8px}
.withdrawal-time-label #withdrawalDate{color:var(--ink)}
.withdrawal-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.condition-actions + .reset-feedback{margin:0 0 12px;justify-content:flex-start;font-size:var(--text-small)}
.withdrawal-entry{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-3);border-top:1px solid var(--line);padding-top:16px;margin-top:18px}
.withdrawal-entry h2{font-family:var(--font-reading);font-size:var(--text-heading)}
.withdrawal-entry button{border:1px solid var(--accent);border-radius:var(--radius-control);background:var(--accent);color:white;padding:10px 16px;font-size:var(--text-body)}
.withdrawal-compact{color:var(--muted);font-size:var(--text-small);line-height:1.8;overflow-wrap:anywhere}
.withdrawal-edit{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3)}
.withdrawal-edit h2{font-size:18px}
.withdrawal-start{border-block:1px solid var(--line);padding:12px 0;margin:14px 0}
.withdrawal-start span{display:block;font-size:var(--text-small);color:var(--muted)}
.withdrawal-start strong{display:block;font-size:24px;color:var(--accent);overflow-wrap:anywhere}
/* One quiet journal block connects the saving plan to its resulting capital.
   Sea blue matches the asset line; orange remains reserved for decreases. */
#withdrawalSavingHeader{background:#edf5f7;border-left:3px solid #37778a;border-radius:0 5px 5px 0;padding:10px 14px 14px;margin:12px 0 22px}
#withdrawalSavingHeader .withdrawal-edit{gap:var(--space-2)}
#withdrawalSavingHeader h2{font-family:var(--font-reading);font-size:15px;font-weight:var(--weight-strong);color:var(--accent);line-height:1.6}
#withdrawalSavingHeader #editSaving{min-width:44px;flex-shrink:0;text-align:center;text-decoration:underline;text-underline-offset:4px}
#withdrawalSavingHeader .saving-main{font-size:var(--text-emphasis);font-weight:var(--weight-strong);color:var(--ink);line-height:1.65;margin:2px 0 4px}
#withdrawalSavingHeader .withdrawal-start{border:0;border-top:1px solid #c3dbe2;margin:12px 0 0;padding:12px 0 0}
#withdrawalSavingHeader .withdrawal-start span{color:#425f6b}
#withdrawalSavingHeader .withdrawal-start strong{font-size:26px;line-height:1.45;margin-top:4px}
#withdrawalSavingHeader #savingInputs{margin-top:8px}
#withdrawalSavingHeader #savingSecondary{font-size:var(--text-small);color:#425f6b;line-height:1.8}
#withdrawalInputs h2{font-size:var(--text-heading);margin-bottom:14px}
#withdrawalInputs .fields{grid-template-columns:1fr 1fr;margin-top:12px}
#withdrawalInputs label{display:block;font-size:var(--text-small)}
#withdrawalAmount{font-size:32px}
.withdrawal-amount-controls{display:flex;align-items:center;gap:10px;margin-top:5px}
.withdrawal-amount-controls button{flex:0 0 44px;border:1px solid #668997;border-radius:50%;background:white;font-size:20px}
.withdrawal-amount-controls input{width:100%;min-width:0;min-height:var(--control-min-height);accent-color:var(--accent)}
.withdrawal-summary{width:100%;display:flex;align-items:center;justify-content:space-between;gap:var(--space-3)}
.withdrawal-summary .withdrawal-end{font-size:var(--text-small);line-height:1.8;text-align:right;overflow-wrap:anywhere;color:var(--ink)}
.summary .withdrawal-summary strong{font-size:clamp(22px,2.7vw,32px);line-height:1.4}
.withdrawal-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.withdrawal-toolbar .mode-switch{display:flex;gap:4px}
.withdrawal-toolbar button{border:0;background:transparent;font-size:var(--text-small);padding:6px 8px;color:var(--muted)}
.withdrawal-toolbar button[aria-pressed=true]{color:var(--accent);box-shadow:inset 0 -2px var(--accent)}
.withdrawal-toolbar .mode-switch button[aria-pressed=true]{color:#fff;background:var(--accent);box-shadow:none}
#withdrawalAdjustLabel{font-size:var(--text-small);color:var(--accent);margin-top:10px}
.withdrawal-caption{font-size:var(--text-small);line-height:1.8;display:flex;flex-wrap:wrap;gap:4px 14px;color:var(--muted);margin-top:8px}
.withdrawal-caption span{display:flex;align-items:center;gap:6px}
.withdrawal-swatch{width:12px;height:12px;background:#d8e9ee;border:1px solid #07566d}
.withdrawal-swatch.decrease{background:#f6dfc4;border-color:#a36724}
#withdrawalChart{width:100%;height:320px;display:block;touch-action:pinch-zoom;user-select:none;cursor:crosshair}
.withdrawal-area{fill:#d8e9ee}.withdrawal-decrease{fill:#f6dfc4}.withdrawal-reference{stroke:#9a672c;stroke-width:1.2;stroke-dasharray:5 4;fill:none}
.withdrawal-phase{stroke:var(--muted);stroke-width:1;stroke-dasharray:3 5}
#withdrawalFocusDot,#withdrawalFocusLine{transition:none}
.withdrawal-principal-line{fill:none;stroke:#53607b;stroke-width:1.7;stroke-dasharray:8 5}
.withdrawal-principal-key{width:18px;border-top:2px dashed #53607b}
.withdrawal-crossing{border-top:1px solid var(--line);margin-top:14px;padding-top:12px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 12px;font-size:var(--text-small);line-height:1.7}
.withdrawal-crossing .withdrawal-link{text-decoration:underline;text-underline-offset:4px}
@media(forced-colors:active){.withdrawal-principal-line{stroke:CanvasText}}
.withdrawal-reference{stroke:#37778a}
.withdrawal-reference-before{stroke-opacity:.45}
.withdrawal-start-dot{fill:#fff;stroke:var(--chart-asset);stroke-width:2.5}
.withdrawal-start-label{fill:var(--accent);font-family:var(--font-reading);font-size:var(--text-small);font-weight:var(--weight-strong);paint-order:stroke;stroke:#fff;stroke-width:5px;stroke-linejoin:round;pointer-events:none}
@media(forced-colors:active){.withdrawal-start-dot{fill:Canvas;stroke:CanvasText}.withdrawal-start-label{fill:CanvasText;stroke:Canvas}}
.withdrawal-readout{margin:14px 0 6px;border-top:1px solid var(--line);padding-top:12px}
.withdrawal-readout .withdrawal-selected{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:var(--text-small)}
.withdrawal-selected strong{font-size:22px;color:var(--accent);overflow-wrap:anywhere}
.withdrawal-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 14px;margin-top:12px}
.withdrawal-facts dt{font-size:var(--text-small);color:var(--muted);line-height:1.6}
.withdrawal-facts dd{font-size:15px;margin-top:5px;overflow-wrap:anywhere}
.withdrawal-totals{display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px 14px;margin-top:12px;font-size:var(--text-small);line-height:1.8;color:var(--muted)}
.withdrawal-totals b{color:var(--ink)}
.withdrawal-time-control{display:flex;align-items:center;gap:14px}
.withdrawal-time-control button{width:44px;height:44px;flex-shrink:0;border:1px solid #668997;border-radius:50%;background:#fff;color:var(--accent);font-size:20px}
.withdrawal-time-control input{flex:1;min-width:0;width:auto;min-height:var(--control-min-height);accent-color:var(--accent)}
.withdrawal-assumption{font-size:var(--text-small);color:var(--muted);margin-top:10px;line-height:1.7}
.withdrawal-active #chartPanel{min-width:0}
@media(min-width:981px){.withdrawal-active .conditions.withdrawal-can-stick{align-self:start;position:sticky;top:calc(var(--forecast-height,100px) + 12px)}}
@media(max-width:980px){#withdrawalInputs .fields{grid-template-columns:1fr 1fr}}
@media(max-width:760px){
 body.withdrawal-active:has(input[data-numeric]:focus) .mobile-nav{display:grid}
 html:has(.withdrawal-active){scroll-padding-top:0;scroll-padding-bottom:90px}
 .withdrawal-summary{align-items:flex-start;flex-direction:column;gap:3px}
 .withdrawal-summary .withdrawal-end{text-align:left}
 .withdrawal-start{margin:8px 0;padding:8px 0}
 .withdrawal-start strong{font-size:21px}
 #withdrawalInputs h2{margin-bottom:8px}
 #withdrawalInputs .fields{margin-top:6px}
 #withdrawalChart{height:280px}
 #withdrawalMobileAdjust{border-block:1px solid var(--line);margin-block:8px;padding-bottom:6px}
 #withdrawalMobileAdjust:empty{display:none}
 .withdrawal-facts{gap:var(--space-2)}.withdrawal-facts dd{font-size:var(--text-body)}
 .withdrawal-toolbar{margin-bottom:4px}
 .withdrawal-active .summary{padding-block:8px}
}
@media(max-height:600px){.withdrawal-active .conditions{position:static}}
@media(prefers-reduced-motion:no-preference){.withdrawal-amount-controls button:active{transform:scale(.95)}}
@media(forced-colors:active){.withdrawal-area{fill:Canvas}.withdrawal-decrease{fill:Canvas;stroke:Highlight}.withdrawal-reference,.withdrawal-phase{stroke:CanvasText}.withdrawal-swatch{background:Canvas;border-color:CanvasText}}

.withdrawal-guide{display:flex;justify-content:flex-end;margin:0 0 4px}
.withdrawal-guide .withdrawal-link{min-height:var(--control-min-height);padding:6px 0 6px 12px;font-size:var(--text-small);color:var(--muted)}

/* Read in the same order as the calculation: capital, inputs, result, graph. */
.withdrawal-active .workspace{grid-template-columns:minmax(0,1fr);max-width:820px;margin-inline:auto;gap:20px}
.withdrawal-active .conditions,.withdrawal-active .conditions.withdrawal-can-stick{position:static;border:0;padding:0}
#withdrawalSavingHeader .withdrawal-start{border:0;border-bottom:1px solid #c3dbe2;margin:0 0 10px;padding:0 0 12px}
#withdrawalSavingHeader .withdrawal-start strong{font-size:32px}
#withdrawalSavingHeader .saving-main{font-size:var(--text-body);font-weight:400}
#withdrawalSummary{display:flex;flex-direction:column;align-items:flex-start;gap:6px;border-block:1px solid var(--line);padding:16px 0;margin-bottom:22px}
#withdrawalSummary strong{display:block;font-size:var(--text-amount-secondary);line-height:1.5;color:var(--accent);overflow-wrap:anywhere}
#withdrawalSummary .withdrawal-end{text-align:left}
#withdrawalSummaryLabel{font-size:var(--text-small);color:var(--muted)}
.withdrawal-active #chartPanel{scroll-margin-top:16px}

.withdrawal-slider-track{position:relative;flex:1;min-width:0;display:flex;align-items:center}
#withdrawalGuideTick{position:absolute;top:3px;width:1px;height:7px;background:var(--accent);pointer-events:none;transform:translateX(-.5px)}
.withdrawal-range-note{font-size:var(--text-small);color:var(--muted);line-height:1.6;margin-top:4px}

.withdrawal-swatch.initial{background:var(--capital-start);border-color:var(--chart-boundary)}
.withdrawal-swatch.deposit{background:var(--capital-deposit);border-color:var(--chart-boundary)}
.withdrawal-swatch.growth{background:var(--chart-growth-high);border-color:var(--chart-boundary)}
@media(forced-colors:active){.withdrawal-growth-area{fill:Canvas}.withdrawal-swatch.initial,.withdrawal-swatch.deposit,.withdrawal-swatch.growth{background:Canvas;border-color:CanvasText}}

/* withdrawal-detail.css */
/* Adopted C: a precise reading guide, a small tactile handle, and quiet material. */
.withdrawal-refined #withdrawalChart{--chart-asset:var(--withdrawal-asset)}
.withdrawal-refined #withdrawalChart .asset-line{stroke:var(--chart-asset);stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
.withdrawal-refined #withdrawalChart .concept-line-underlay{fill:none;stroke:#fff;stroke-width:5.5;stroke-linejoin:round;stroke-linecap:round;pointer-events:none}
.withdrawal-refined #withdrawalChart .grid-line{stroke:#a8bec6;stroke-opacity:.26;stroke-width:1;stroke-dasharray:none}
.withdrawal-refined #withdrawalChart .withdrawal-principal-line{stroke:#59727e;stroke-width:1.25;stroke-dasharray:8 5}
.withdrawal-refined #withdrawalChart .withdrawal-reference{stroke:#7095a0;stroke-width:1;stroke-dasharray:3 6;stroke-opacity:.65}
.withdrawal-refined #withdrawalChart .withdrawal-phase{stroke:#809ca4;stroke-width:1;stroke-dasharray:2 5}
.withdrawal-refined #withdrawalChart .initial-separator{stroke:#557786;stroke-opacity:.5;stroke-width:.8}
.withdrawal-refined #withdrawalChart .initial-area{fill:url(#withdrawalCapitalWash)}
.withdrawal-refined #withdrawalChart .contribution-area{fill:url(#withdrawalDepositWash)}
.withdrawal-refined #withdrawalChart .withdrawal-decrease{fill:url(#withdrawalDecreaseWeave);fill-opacity:1}
.withdrawal-refined #withdrawalChart .concept-horizontal{stroke:var(--withdrawal-asset);stroke-opacity:.45;stroke-width:.85;pointer-events:none}
.withdrawal-refined #withdrawalChart #withdrawalFocusLine{stroke:var(--withdrawal-asset);stroke-opacity:.26;stroke-dasharray:2 5}
.withdrawal-refined #withdrawalChart .concept-axis-value{display:block;pointer-events:none}
.withdrawal-refined #withdrawalChart .concept-axis-value rect{fill:var(--withdrawal-asset);stroke:#fff;stroke-width:1.5}
.withdrawal-refined #withdrawalChart .concept-axis-value text{fill:#fff;font-size:var(--text-small);font-weight:var(--weight-strong);font-variant-numeric:tabular-nums}
.withdrawal-refined #withdrawalChart #withdrawalFocusDot{r:5;fill:var(--withdrawal-asset);stroke:#fff;stroke-width:2.5;pointer-events:none}
.withdrawal-refined #withdrawalChart .concept-halo{display:block;fill:var(--withdrawal-asset);fill-opacity:.07;stroke:none;pointer-events:none}
.withdrawal-refined #withdrawalChart .concept-pin{fill:white;stroke:var(--withdrawal-asset);stroke-width:2;pointer-events:none}
.withdrawal-refined #withdrawalChart .withdrawal-start-dot{fill:#fff;stroke:var(--withdrawal-asset);stroke-width:2}
.withdrawal-refined #withdrawalChart .withdrawal-start-label{fill:var(--withdrawal-asset);stroke-width:6;stroke-linejoin:round}
.withdrawal-refined #withdrawalChart .axis-label,.withdrawal-refined #withdrawalChart .axis-unit{fill:#516972;font-size:var(--text-small);font-variant-numeric:tabular-nums}
@media(forced-colors:active){
 .withdrawal-refined #withdrawalChart .initial-area,.withdrawal-refined #withdrawalChart .contribution-area,.withdrawal-refined #withdrawalChart .withdrawal-decrease{fill:Canvas}
 .withdrawal-refined #withdrawalChart .asset-line,.withdrawal-refined #withdrawalChart .concept-horizontal{stroke:CanvasText}
 .withdrawal-refined #withdrawalChart .concept-line-underlay{stroke:Canvas}
 .withdrawal-refined #withdrawalChart #withdrawalFocusDot{fill:Highlight;stroke:Canvas}
 .withdrawal-refined #withdrawalChart .concept-axis-value rect{fill:Highlight;stroke:Canvas}
 .withdrawal-refined #withdrawalChart .concept-axis-value text{fill:HighlightText}
}
/* One painted hit surface for blank space, wash, grid and comparison layers.
   The HTML ancestor also declares gesture ownership for mobile WebKit. */
.withdrawal-chart-wrap{position:relative;touch-action:pinch-zoom;-webkit-user-select:none;user-select:none}
.withdrawal-touch-surface{fill:transparent;pointer-events:all;touch-action:pinch-zoom;-webkit-touch-callout:none}
.withdrawal-tooltip{position:absolute;z-index:2;pointer-events:none;max-width:190px;padding:9px 12px;background:#fff;border:1px solid #8eabb4;border-radius:8px;box-shadow:0 3px 10px #163c4717;color:#233c47;line-height:1.5}
.withdrawal-tooltip span{display:block;font-size:var(--text-small);color:#526975}
.withdrawal-tooltip strong{display:block;font-size:var(--text-emphasis);font-weight:var(--weight-strong);color:var(--withdrawal-asset);overflow-wrap:anywhere}
.withdrawal-refined #withdrawalChart .concept-axis-value{display:none}
.withdrawal-detail-heading{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-2);flex-wrap:wrap;margin-bottom:10px}
.withdrawal-detail-heading h3{font-size:var(--text-subheading);margin:0;font-weight:var(--weight-strong)}
#withdrawalDetailDate{font-size:var(--text-small);color:var(--muted)}
.withdrawal-readout .withdrawal-selected{padding:10px 0 14px}
.withdrawal-readout .withdrawal-facts{gap:var(--space-2);margin-top:0}
.withdrawal-facts>div{padding:12px;border:1px solid #d2e0e5;border-radius:6px;background:#fff}
.withdrawal-facts dt{display:flex;align-items:center;gap:6px;font-size:var(--text-small);color:#425e6a}
.withdrawal-fact-icon{font-size:var(--text-emphasis);line-height:1;color:#487789}
.withdrawal-facts dd:not(.withdrawal-fact-hint){font-size:var(--text-amount-secondary);font-weight:var(--weight-strong);color:#233c47;line-height:1.4;margin-top:8px}
.withdrawal-facts .negative{color:#a33a47!important}
.withdrawal-facts .withdrawal-fact-hint{font-size:var(--text-small);font-weight:400;color:#657b84;margin-top:5px}
.withdrawal-facts .withdrawal-net-fact{background:#edf5f7;border-color:#bfd5dd}
.withdrawal-equation{font-size:var(--text-small);line-height:1.7;color:#526975;margin:8px 0 16px}
.withdrawal-total-title{font-size:var(--text-small);font-weight:var(--weight-strong);color:#526975;border-top:1px solid var(--line);padding-top:14px;margin:0 0 4px}
.withdrawal-totals{margin-top:6px;gap:6px 20px}
@media(max-width:600px){
 .withdrawal-readout .withdrawal-facts{grid-template-columns:1fr}
 .withdrawal-facts>div{display:grid;grid-template-columns:1fr auto;gap:2px 8px;padding:10px 12px}
 .withdrawal-facts dd:not(.withdrawal-fact-hint){margin:0;font-size:var(--text-amount-secondary);text-align:right}
 .withdrawal-facts .withdrawal-fact-hint{grid-column:1/-1;margin:0}
 .withdrawal-tooltip{max-width:165px;padding:8px 10px}
 .withdrawal-tooltip strong{font-size:15px}
 .withdrawal-totals{display:grid;grid-template-columns:1fr}
 .withdrawal-totals>span{display:flex;justify-content:space-between;gap:10px}
}
@media(forced-colors:active){.withdrawal-tooltip,.withdrawal-facts>div{background:Canvas;color:CanvasText;border-color:CanvasText}}

.withdrawal-tooltip-comparison{border-top:1px solid #d9e5e9;margin-top:6px;padding-top:5px}
.withdrawal-tooltip #withdrawalTooltipDifference{color:#233c47;font-weight:var(--weight-strong);margin-top:2px;overflow-wrap:anywhere}
.withdrawal-tooltip{max-width:220px}
@media(max-width:600px){.withdrawal-tooltip{max-width:190px}}

.withdrawal-tooltip.is-touch{width:224px;max-width:calc(100% - 16px)}
.withdrawal-tooltip.is-touch #withdrawalTooltipDate{font-size:var(--text-small);line-height:1.5;min-height:3em}
.withdrawal-tooltip.is-touch strong{font-size:16px}

/* Keep condition changes together; the graph controls only the selected time. */
.withdrawal-organized .withdrawal-selected,.withdrawal-organized .withdrawal-fact-hint,.withdrawal-organized .withdrawal-equation,.withdrawal-organized .withdrawal-journey{display:none}
.withdrawal-organized .withdrawal-time-label>span:last-child{display:none}
.withdrawal-organized .withdrawal-readout{margin-top:12px;padding-top:14px}
.withdrawal-organized .withdrawal-facts{gap:10px}
.withdrawal-organized .withdrawal-detail-heading{margin-bottom:12px}
.withdrawal-organized #withdrawalAmountAdjust{margin:6px 0 14px}
.withdrawal-organized #withdrawalSummary{margin-bottom:16px}
.withdrawal-organized .withdrawal-facts[hidden]{display:none}

/* Try a spending amount, inspect the curve, then revise return or saving. */
.withdrawal-organized.withdrawal-active .workspace{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px;align-items:start}
.withdrawal-organized.withdrawal-active #chartPanel{grid-column:1;grid-row:1;min-width:0}
.withdrawal-organized.withdrawal-active #conditions{grid-column:2;grid-row:1;position:static;padding:0 0 0 20px;border:0;border-left:1px solid var(--line);min-width:0}
.withdrawal-organized.withdrawal-active .workspace>.withdrawal-readout{grid-column:1/-1;grid-row:2;width:100%;box-sizing:border-box}
.withdrawal-organized #withdrawalSavingHeader{margin:18px 0 0;padding:14px 0 0;background:transparent;border:0;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:8px}
.withdrawal-organized #withdrawalSavingHeader[hidden]{display:none}
.withdrawal-organized #withdrawalSavingHeader .withdrawal-edit h2{display:none}
.withdrawal-organized #withdrawalSavingHeader .withdrawal-edit{order:1}
.withdrawal-organized #withdrawalSavingHeader #savingCompact{border:0;margin:0;padding:0;font-size:var(--text-small)}
.withdrawal-organized #withdrawalSavingHeader #savingInputs{order:2}
.withdrawal-organized #withdrawalSavingHeader .withdrawal-start{margin:0;padding:0;border:0}
.withdrawal-organized #withdrawalSavingHeader .withdrawal-start strong{font-size:20px}
.withdrawal-organized #editSaving{font-size:var(--text-small);min-height:44px;text-decoration:underline;text-underline-offset:4px}
.withdrawal-organized #withdrawalInputs h2{font-size:var(--text-heading);margin:10px 0}
.withdrawal-organized #withdrawalInputs .fields{gap:10px}
.withdrawal-organized #withdrawalAmount{font-size:26px;font-weight:var(--weight-strong)}
.withdrawal-organized .withdrawal-facts{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:980px){
 .withdrawal-organized.withdrawal-active .workspace{grid-template-columns:minmax(0,1fr);gap:16px}
 .withdrawal-organized.withdrawal-active #conditions{grid-column:1;grid-row:2;padding:12px 0 0;border-left:0;border-top:1px solid var(--line)}
 .withdrawal-organized.withdrawal-active .workspace>.withdrawal-readout{grid-column:1;grid-row:3}
 .withdrawal-organized.withdrawal-active .condition-actions{margin-bottom:4px}
 .withdrawal-organized .withdrawal-facts{grid-template-columns:1fr}
 .withdrawal-organized #withdrawalChart{height:300px}
}
.withdrawal-condition-cards,#withdrawalConditionEditor{display:none}
.withdrawal-organized #withdrawalInputs>.withdrawal-amount-field,.withdrawal-organized #withdrawalInputs>.fields,.withdrawal-organized #withdrawalAmountAdjust{display:none}
.withdrawal-organized .withdrawal-condition-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.withdrawal-organized #withdrawalConditionEditor{display:block}
.withdrawal-condition-card{border:1px solid var(--line);border-radius:5px;padding:6px;min-width:0}
.withdrawal-condition-card.is-selected{background:#edf5f5;border-color:var(--chart-asset);box-shadow:inset 0 -2px var(--chart-asset)}
.withdrawal-condition-card>button{display:block;width:100%;min-height:28px;text-align:left;padding:0;border:0;background:transparent;font-size:var(--text-small);color:var(--muted)}
.withdrawal-condition-card .input-wrap{border:0;background:transparent;margin:0;padding:0;gap:2px;min-width:0}
.withdrawal-condition-card input,.withdrawal-organized .withdrawal-condition-card #withdrawalAmount{font-size:var(--text-small);font-weight:var(--weight-strong);min-width:0;width:100%;height:28px;min-height:28px;padding:0;background:transparent}
.withdrawal-condition-card input:focus{font-size:16px}
.withdrawal-condition-card .input-wrap>span{font-size:var(--text-small);white-space:nowrap}
#withdrawalConditionValue{font:var(--weight-regular) var(--text-input)/var(--leading-amount) var(--font-amount);border:0;background:transparent;width:100%;min-width:0;height:46px;padding:4px 0;text-align:center}
#withdrawalConditionUnit{font-size:var(--text-small);white-space:nowrap}
#withdrawalConditionRange{width:100%;height:36px;accent-color:var(--chart-asset);margin-top:4px}
#withdrawalConditionEditor>#withdrawalUseGuide{display:block;margin-left:auto;min-height:32px;font-size:var(--text-small)}
#withdrawalConditionEditor>#withdrawalUseGuide[hidden]{display:none}
#withdrawalConditionEditor .condition-value>label{display:flex;align-items:baseline;gap:4px;min-width:0;flex:1;margin:0 auto}
#withdrawalInputs .withdrawal-condition-card .input-wrap{border:0;box-shadow:none;background:transparent;padding:0}

.withdrawal-active .condition-actions #reset{display:none}
.withdrawal-guide-actions{display:flex;align-items:center;justify-content:flex-end;position:relative;gap:2px}
.withdrawal-guide-actions[hidden]{display:none}
.withdrawal-guide-actions #withdrawalUseGuide{min-height:44px;font-size:var(--text-small)}
.withdrawal-guide-help summary{display:flex;align-items:center;justify-content:center;list-style:none;cursor:pointer;width:44px;height:44px;color:var(--accent);font-size:18px;border-radius:4px}
.withdrawal-guide-help summary::-webkit-details-marker{display:none}
.withdrawal-guide-help summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.withdrawal-guide-help[open] summary{background:#edf5f5}
.withdrawal-guide-popover{position:absolute;right:0;bottom:100%;z-index:10;width:280px;max-width:100%;box-sizing:border-box;padding:12px 14px;border:1px solid var(--line);border-radius:6px;background:#fff;box-shadow:0 4px 16px #163c4820;color:var(--ink);font-size:var(--text-small);line-height:1.7;text-align:left}
.withdrawal-guide-popover strong{font-size:var(--text-small)}
.withdrawal-guide-popover p{margin:6px 0 0}

.condition-actions #editSaving[hidden]{display:none}
.withdrawal-active .condition-actions{display:flex;align-items:center;justify-content:space-between}
.withdrawal-active .condition-actions #editSaving{font-size:var(--text-small);min-height:44px;padding:4px 7px;text-decoration:underline;text-underline-offset:4px}
.withdrawal-active #conditions>#savingInputs:not([hidden]){margin:8px 0 16px;padding:12px 0;border-bottom:1px solid var(--line)}
#withdrawalSavingHeader .withdrawal-edit{display:none}

.withdrawal-active #conditions>.condition-actions{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px;margin:12px 0 0;padding-top:8px;border-top:1px solid var(--line)}
.withdrawal-active #conditions>.condition-actions #openWithdrawal{border-color:transparent;background:transparent;color:var(--muted);font-size:var(--text-small);font-weight:400;text-decoration:underline;text-underline-offset:4px}

html[data-graph-concept] .withdrawal-organized #withdrawalInputs{display:block}

/* A single balance wash keeps the curve primary until comparison is requested. */
#withdrawalPanel:not(.show-graph-comparison) :is(.withdrawal-saving-fill,.withdrawal-balance-fill,.withdrawal-decrease,.withdrawal-reference,.withdrawal-principal-line,.withdrawal-tooltip-comparison,.withdrawal-crossing){display:none}
.withdrawal-balance-wash{fill:var(--withdrawal-asset);fill-opacity:.09;pointer-events:none}
.show-graph-comparison .withdrawal-balance-wash{display:none}
.withdrawal-graph-comparison{font-size:var(--text-small);color:var(--muted);margin:4px 0 0}
.withdrawal-graph-comparison>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:8px;list-style:none}
.withdrawal-graph-comparison>summary::before{content:'＋';font-size:16px}
.withdrawal-graph-comparison[open]>summary::before{content:'−'}
.withdrawal-graph-comparison>summary::-webkit-details-marker{display:none}
.withdrawal-graph-comparison>summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.withdrawal-notes{scroll-margin-top:16px;scroll-margin-bottom:80px}
.withdrawal-notes>p{font-size:var(--text-small);line-height:1.8;color:var(--muted)}
@media(forced-colors:active){.withdrawal-balance-wash{fill:Canvas}}

/* layout.css */
/* A compact working surface. Shared values live in design-tokens.css. */
.shell {max-width:var(--page-max-width)}
header {padding-block:12px}
.brand-logo {width:34px;height:34px}
.brand h1 {font-size:21px}
.summary {padding-block:10px}
.summary strong {font-size:var(--text-amount);line-height:1.25}
.workspace {padding-block:18px;gap:24px;grid-template-columns:290px minmax(0,1fr)}
.conditions {padding-right:22px}
.conditions>.section-title {margin-bottom:10px}
.section-title h2,.withdrawal-toolbar h2 {font-size:var(--text-heading)}
.fields {gap:var(--space-3)}
.input-wrap {padding:0 10px;margin-top:4px}
.input-wrap input {min-height:var(--control-min-height);font-size:22px}
.condition-actions {margin-bottom:12px}
.condition-actions #reset,.condition-actions #openWithdrawal {padding:6px;font-size:var(--text-small);white-space:normal}
#savingChart {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:12px}
#savingChart>.section-title {grid-column:1;margin:0;padding:0}
#savingChart>.section-title::after {display:none}
#savingChart>.chart-toolbar {grid-column:2;justify-content:flex-end;margin:0}
#savingChart>*:not(.section-title):not(.chart-toolbar) {grid-column:1/-1}
.chart-toolbar .mode-switch button {min-height:var(--control-min-height);padding:6px 12px;font-size:var(--text-body)}
#savingChart .readout {padding-block:8px;margin-bottom:4px}
#savingChart .chart-caption {padding-block:6px;gap:4px 12px;line-height:1.65}
#chart {height:clamp(230px,34vh,330px)}
.chart-details {margin-top:6px}
.chart-details>summary {padding-block:10px}
section.goal-panel {margin-top:16px;padding:18px 0}
.goal-input {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;align-items:end}
.goal-input>label {grid-column:1;grid-row:1}
.goal-input>.target-amount {grid-column:1/-1;grid-row:2;margin:0}
#showGoal {grid-column:2;grid-row:1;width:auto;margin:0;min-height:var(--control-min-height);padding:8px 12px}
#hideGoal {grid-column:2;grid-row:1;margin:0;min-height:var(--control-min-height)}
section.goal-panel .goal-layout:has(#goalEntry[hidden]) {grid-template-columns:minmax(0,450px)}
.goal-layout:has(#goalEntry:not([hidden])) {grid-template-columns:minmax(200px,240px) minmax(0,1fr)}
.goal-layout:has(#goalEntry:not([hidden])) .goal-input {grid-template-columns:1fr}
.withdrawal-entry {margin-top:12px;padding-top:12px;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap}
.withdrawal-entry h2 {font-size:var(--text-heading)}
/* Saving context remains visible; the large explanation is a disclosure. */
#withdrawalSavingHeader {padding:10px 12px;margin:0 0 12px}
#withdrawalSavingHeader .withdrawal-start {padding-bottom:8px;margin-bottom:4px}
#withdrawalSavingHeader .withdrawal-start strong {font-size:24px;line-height:1.3}
#withdrawalSavingHeader .saving-main {margin:0;font-size:var(--text-small)}
#withdrawalSavingHeader #savingSecondary {line-height:1.6}
#withdrawalSavingHeader h2 {font-size:var(--text-body)}
#withdrawalInputs h2 {font-size:var(--text-heading);margin-bottom:8px}
#withdrawalInputs label {font-size:var(--text-body)}
#withdrawalAmount {font-size:24px}
.withdrawal-guide {margin:0}
.withdrawal-guide .withdrawal-link {padding-block:4px}
#withdrawalSummary {padding:10px 0;margin-bottom:12px;gap:4px}
#withdrawalSummary strong {font-size:var(--text-amount-secondary);line-height:1.4}
#withdrawalSummary .withdrawal-end {line-height:1.6}
#withdrawalChart {height:clamp(280px,40vh,400px)}
.withdrawal-toolbar {gap:var(--space-2)}
.withdrawal-toolbar button {font-size:var(--text-body);min-height:var(--control-min-height)}
.withdrawal-caption {gap:3px 12px;margin-top:4px;line-height:1.6}
.withdrawal-readout {margin-top:8px;padding-top:8px}
.withdrawal-detail-heading {margin-bottom:4px}
.withdrawal-readout .withdrawal-selected {padding:4px 0 8px}
.withdrawal-facts>div {padding:8px}
.withdrawal-facts dd:not(.withdrawal-fact-hint) {font-size:var(--text-amount-secondary);margin-top:4px}
.withdrawal-extra {margin-top:8px;border-top:1px solid var(--line)}
.withdrawal-extra>summary {font-size:var(--text-body);padding:10px 0;min-height:var(--control-min-height)}
.withdrawal-extra .withdrawal-total-title {border:0;padding-top:0}
.withdrawal-notes>summary {font-size:var(--text-body);min-height:var(--control-min-height);padding:10px 0}
.withdrawal-notes .withdrawal-assumption {margin:0 0 12px}
/* Both modes use the same desktop comparison arrangement. */
@media(min-width:981px) {
 .withdrawal-active .workspace {grid-template-columns:290px minmax(0,1fr);max-width:none;gap:24px}
 .withdrawal-active .conditions,.withdrawal-active .conditions.withdrawal-can-stick {padding-right:22px;border-right:1px solid var(--line);position:static}
 #withdrawalInputs .fields {gap:10px}
 #withdrawalInputs .input-wrap {padding-inline:8px}
 .withdrawal-active .conditions:not(:has(input:focus)) {align-self:start}
}
@media(min-width:761px) and (max-width:980px) {
 .workspace,.withdrawal-active .workspace {grid-template-columns:1fr;max-width:none}
 .conditions {padding:0 0 14px}
 #savingInputs>.fields {grid-template-columns:repeat(4,minmax(0,1fr))}
 .condition-actions {max-width:340px}
 #withdrawalInputs {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 20px}
 #withdrawalInputs h2,#withdrawalFeedback {grid-column:1/-1}
 #withdrawalInputs>.fields {grid-column:2;grid-row:2/5;align-self:start;margin:0}
}
@media(max-width:760px) {
 .shell {padding-inline:12px;padding-bottom:calc(68px + env(safe-area-inset-bottom))}
 header {padding-block:8px;gap:var(--space-3)}
 .brand {gap:7px}.brand-logo {width:28px;height:28px}.brand h1 {font-size:19px}
 .session-status {font-size:var(--text-small);max-width:130px}
 .summary {padding:8px 0;min-height:0}
 .summary>div:first-child {display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-2);flex-wrap:wrap;width:100%}
 .summary p {font-size:var(--text-small);line-height:1.5}
 .summary strong {font-size:var(--text-amount);line-height:1.35;max-width:100%}
 .workspace {display:grid;grid-template-columns:1fr;padding-block:10px;gap:var(--space-3)}
 .conditions {display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;padding:0 0 10px}
 .conditions>.section-title {margin:0;align-self:center;grid-column:1}
 .conditions>.section-title h2 {font-size:var(--text-heading)}
 .condition-actions {grid-column:2;display:flex;gap:6px;margin:0}
 .condition-actions #reset,.condition-actions #openWithdrawal {font-size:var(--text-small);min-height:var(--control-min-height);padding:4px 7px}
 .conditions>#savingInputs,.conditions>#resetFeedback,.conditions>#withdrawalSavingHeader,.conditions>#withdrawalInputs,.conditions>#withdrawalStatus {grid-column:1/-1}
 #savingInputs {margin-top:8px}
 .fields {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px}
 label {font-size:var(--text-body);line-height:1.5}
 .input-wrap {padding:0 8px;margin-top:3px}
 .input-wrap input {font-size:20px;min-height:var(--control-min-height);line-height:1.4}
 .input-wrap span {font-size:var(--text-small)}
 .monthly-rate-hint {font-size:var(--text-small);line-height:1.5;margin-top:3px}
 .section-title h2,.withdrawal-toolbar h2 {font-size:var(--text-heading)}
 #savingChart {column-gap:8px}
 .chart-toolbar .mode-switch button {min-width:60px;padding:5px 8px}
 #savingChart .readout {gap:4px 12px;padding:6px 0;margin:0}
 #savingChart .readout-primary #selectedAssets {font-size:var(--text-amount);line-height:1.3;margin-top:2px}
 #savingChart #selectedGain {font-size:var(--text-amount-secondary);line-height:1.4;margin-top:2px}
 #savingChart .chart-caption {gap:3px 10px;padding:5px 0;font-size:var(--text-small);line-height:1.5}
 #chart {height:200px}
 .year-control,.withdrawal-time-control {gap:10px}
 .chart-details {margin-top:4px}.chart-details>summary {font-size:var(--text-body);padding:9px 0}
 .mobile-nav {padding-top:4px;padding-bottom:calc(4px + env(safe-area-inset-bottom))}
 .mobile-nav a {font-size:var(--text-small);min-height:var(--control-min-height)}
 section.goal-panel {padding:14px 0;margin-top:8px}
 #goalTitle {font-size:var(--text-heading);margin-bottom:10px}
 section.goal-panel .goal-layout,section.goal-panel .goal-layout:has(#goalEntry[hidden]) {grid-template-columns:1fr;gap:var(--space-3)}
 .goal-layout:has(#goalEntry:not([hidden])) .goal-input {grid-template-columns:minmax(0,1fr) auto}
 .goal-entry {padding:12px}
 .goal-facts {gap:var(--space-2);margin-block:10px}
 .goal-facts dt {font-size:var(--text-small)}.goal-facts dd {font-size:var(--text-amount-secondary)}
 .withdrawal-active .workspace {max-width:none;gap:var(--space-3);padding-block:10px}
 .withdrawal-active .conditions {display:block;padding-bottom:10px;border-bottom:1px solid var(--line)}
 .withdrawal-active .condition-actions {display:flex;justify-content:space-between;margin-bottom:8px}
 .withdrawal-active .condition-actions #reset {order:2}
 #withdrawalSavingHeader {padding:8px 10px;margin-bottom:10px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 10px}
 #withdrawalSavingHeader .withdrawal-start {grid-column:1;grid-row:1/3;border:0;padding:0;margin:0}
 #withdrawalSavingHeader .withdrawal-start strong {font-size:22px;line-height:1.4;margin:0}
 #withdrawalSavingHeader .withdrawal-edit {grid-column:2;align-self:start;gap:4px}
 #withdrawalSavingHeader .withdrawal-edit h2 {font-size:var(--text-small);max-width:5em}
 #withdrawalSavingHeader #savingCompact {grid-column:1/-1;border-top:1px solid #c3dbe2;margin-top:6px;padding-top:4px;display:flex;flex-wrap:wrap;gap:2px 12px}
 #withdrawalSavingHeader .saving-main {font-size:var(--text-small);line-height:1.6}
 #withdrawalSavingHeader #savingInputs {grid-column:1/-1}
 #withdrawalInputs h2 {font-size:var(--text-heading);margin-bottom:6px}
 #withdrawalInputs>.fields {margin-top:4px;gap:8px 12px}
 #withdrawalAmount {font-size:22px}
 .withdrawal-guide {margin-top:0}
 #withdrawalSummary {padding:8px 0;margin-bottom:8px}
 #withdrawalSummary strong {font-size:var(--text-amount-secondary);line-height:1.5}
 #withdrawalSummary .withdrawal-end {font-size:var(--text-small)}
 .withdrawal-toolbar {margin-bottom:4px;flex-wrap:wrap}
 .withdrawal-toolbar .mode-switch {gap:0}.withdrawal-toolbar button {padding:6px 8px;font-size:var(--text-small)}
 .withdrawal-readout .withdrawal-facts {grid-template-columns:1fr;gap:4px}
 .withdrawal-facts>div {padding:6px 8px;grid-template-columns:minmax(0,1fr) auto;align-items:center}
 .withdrawal-facts dd:not(.withdrawal-fact-hint) {font-size:var(--text-amount-secondary);margin:0}
 .withdrawal-facts .withdrawal-fact-hint {font-size:var(--text-small);margin:0}
 .withdrawal-readout .withdrawal-selected {padding-bottom:6px}
 .withdrawal-selected strong {font-size:22px}
 #withdrawalMobileAdjust {margin-block:4px;padding-bottom:2px}
 .books {padding-top:18px}.books-grid {gap:var(--space-3);margin-top:14px}
 .book {padding:14px}.book h3 {font-size:var(--text-emphasis);line-height:1.5}.book-description {margin-block:12px}
}
@media(max-width:360px) {
 .conditions {grid-template-columns:1fr}
 .conditions>.section-title {grid-column:1;margin-bottom:4px}
 .condition-actions {grid-column:1;display:grid;grid-template-columns:1fr 1fr}
 .summary strong {font-size:var(--text-amount)}
 #savingChart .readout-primary #selectedAssets {font-size:var(--text-amount)}
 #savingChart #selectedGain {font-size:var(--text-amount-secondary)}
}
@media(max-height:600px) {
 .summary {position:static}
 .withdrawal-active .conditions.withdrawal-can-stick {position:static}
}
@media(max-width:760px) {
 section.goal-panel .goal-layout:has(#goalEntry:not([hidden])) {grid-template-columns:minmax(0,1fr)}
 .goal-layout:has(#goalEntry:not([hidden])) .goal-input {min-width:0}
}
@media(min-width:981px) and (min-height:601px) {
 .withdrawal-active .conditions.withdrawal-can-stick {position:sticky;top:12px}
}
/* Scroll positions are reading states, not reasons to rescale the page. */
body.reading-detail .summary {visibility:hidden;pointer-events:none}
html:has(body.reading-detail),html:has(body.keyboard-open) {scroll-padding-top:12px}
#conditions,#chartPanel,.goal-panel,.chart-details,.withdrawal-readout {scroll-margin-top:12px}
.goal-panel,.chart-details,.withdrawal-readout {scroll-margin-bottom:80px}
@media(max-width:760px) {
 /* Reserve breathing room above the home indicator, including scrolled controls. */
 html {scroll-padding-bottom:calc(68px + env(safe-area-inset-bottom))}
 #chart {height:clamp(180px,25svh,210px)}
 #withdrawalChart {height:clamp(280px,42svh,360px)}
 .chart-details .selected-details {padding:10px 0;margin-bottom:10px}
 .selected-details-values>div {padding-block:3px}
 .differences {margin-top:10px}
 .differences section {padding-top:10px}
 .withdrawal-detail-heading {row-gap:4px}
 .withdrawal-selected {row-gap:4px}
 .goal-cards .goal-option {padding:16px}
 .goal-cards h3,.goal-cards .goal-next h3 {margin-bottom:10px}
 .goal-cards .goal-card-result strong,.goal-cards #extendedResult strong {font-size:var(--text-amount-secondary)}
 .goal-cards .hint {margin-block:8px 14px}
 body .mobile-nav a,body.books-reading .mobile-nav a {background:transparent;color:var(--accent)}
 body .mobile-nav a[aria-current=location] {background:var(--accent);color:#fff}
 body.keyboard-open .mobile-nav,body:has(:is(#target,#conditionValue,#withdrawalConditionValue):focus) .mobile-nav,body.withdrawal-active:has(input[data-numeric]:focus) .mobile-nav {display:none}
 body.keyboard-open .summary {position:static}
}
@media(max-height:600px) {
 html {scroll-padding-top:12px}
}

/* Detail values are a table, not wrapping flex items inherited from disclosures. */
.chart-details .selected-details {padding:2px 0 6px;margin:0}
.chart-details .selected-details h3 {margin:0 0 4px;line-height:1.5}
.chart-details .selected-details-values {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 16px;margin:0}
.chart-details .selected-details-values>div {padding:1px 0;min-width:0}
.chart-details .selected-details-values dd {margin:0;line-height:1.4;font-size:var(--text-emphasis)}
.chart-details .differences {margin-top:0}
.chart-details .differences section {padding-top:6px}
.chart-details .differences h3 {margin-bottom:2px}
.chart-details .differences small {margin-top:2px;line-height:1.5}
@media(max-width:760px) {
 header {margin-bottom:0;padding-block:6px}
 .workspace {padding-top:6px;row-gap:6px}
 .conditions {padding-bottom:2px}
 .fields {row-gap:6px}
 #savingChart .chart-caption {column-gap:8px;font-size:var(--text-small);padding-block:3px}
 #savingChart .readout {padding-block:4px}
 .chart-details .selected-details-values {grid-template-columns:1fr;gap:0}
 .chart-details .selected-details-values>div {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:var(--space-2)}
 .chart-details .selected-details-values dt {font-size:var(--text-small);line-height:1.5}
 .chart-details .selected-details-values dd {text-align:right}

}
@media(max-width:760px) {
 .session-status {max-width:none;font-size:var(--text-small);white-space:nowrap}
 .summary {padding-block:4px}
 .summary strong {font-size:var(--text-amount);line-height:1.2}
 #savingChart .readout-primary #selectedAssets {font-size:var(--text-amount)}
 #chart {height:clamp(192px,calc(100svh - 496px),280px)}
 /* Capital color keys are already repeated beside their detail values. */
 #savingChart .chart-caption>span:nth-child(-n+3) {display:none}
 #savingChart .readout-totals dt::before {content:"";display:inline-block;width:10px;height:8px;margin-right:4px;background:var(--chart-growth-high);border:1px solid var(--chart-gain-text);border-radius:2px}
 header {padding-block:4px}
}
@media(max-width:360px) {
 .session-status {white-space:normal;max-width:110px}
}
@media(max-width:760px) {
 #savingInputs {margin-top:4px}
 .workspace {row-gap:4px}
 .monthly-rate-hint {font-size:var(--text-small);line-height:1.4;margin-top:2px}
 .input-wrap {margin-top:2px}
}

@media(max-width:760px) {
 #savingInputs label,#withdrawalInputs label {font-size:var(--text-small);line-height:1.5}
 #savingInputs .input-wrap input,#withdrawalInputs .input-wrap input {min-height:40px;font-size:18px}
 #savingInputs .fields,#withdrawalInputs .fields {row-gap:4px}
}
@media(max-width:760px) {
 .chart-details .selected-details h3 {font-size:var(--text-subheading);line-height:1.5;margin-bottom:0}
 .chart-details .selected-details {padding-bottom:2px}
}

/* Month range occupies the heading slot so changing modes never adds a row. */
#savingChart>.section-title,#savingChart>.chart-toolbar {grid-row:1}
#savingChart:has(#monthWindow:not([hidden]))>.section-title {visibility:hidden}
#savingChart>#monthRange {grid-column:1;grid-row:1;justify-self:start;align-self:center;position:relative;width:100%;max-width:170px;min-width:0;height:36px}
#monthRange:has(#monthWindow[hidden]) {display:none}
#monthRange label {position:absolute;top:1px;left:6px;font-size:var(--text-small);line-height:12px;color:var(--muted);pointer-events:none}
#monthRange #monthWindow {margin:0;min-width:0;width:100%;min-height:36px;height:36px;padding:12px 20px 0 5px;font-size:var(--text-emphasis);line-height:20px;border:1px solid var(--line);border-radius:4px;background-color:transparent;color:var(--ink)}
#monthRange #monthWindow:hover {border-color:var(--accent)}
/* Secondary controls share a quiet 36px rhythm beside 40px inputs. */
.condition-actions #reset,.condition-actions #openWithdrawal,
.chart-toolbar .mode-switch button,.withdrawal-toolbar .mode-switch button {
 min-height:36px;padding:5px 10px;font-size:var(--text-small);line-height:1.5;font-weight:var(--weight-strong);
}
.condition-actions #reset {border-color:transparent;background:transparent;color:var(--muted)}
.condition-actions #reset span {font-size:var(--text-emphasis)}
.condition-actions #reset:hover:not(:disabled) {background:#f0f8fa;border-color:transparent;color:var(--accent)}
.condition-actions #openWithdrawal {background:#f0f8fa;color:var(--accent);border-color:var(--line)}
.condition-actions #openWithdrawal:hover:not(:disabled) {background:#e9f4f6;color:var(--accent);border-color:var(--accent)}
.chart-toolbar .mode-switch,.withdrawal-toolbar .mode-switch {border-color:var(--line);border-radius:4px}
.chart-toolbar .mode-switch button,.withdrawal-toolbar .mode-switch button {min-width:60px;color:var(--muted)}
.chart-toolbar .mode-switch button[aria-pressed=true],.withdrawal-toolbar .mode-switch button[aria-pressed=true] {
 background:#e9f4f6;color:var(--accent);box-shadow:inset 0 -2px var(--accent);
}
.year-control button,.withdrawal-time-control button {width:36px;height:36px;min-height:36px;min-width:36px;font-size:20px}
@media(max-width:760px) {
 .condition-actions #reset,.condition-actions #openWithdrawal {font-size:var(--text-small);padding-inline:7px}
}
/* Keep the two withdrawal sliders compact and aligned. */
.withdrawal-amount-controls {margin-top:0;gap:10px}
.withdrawal-amount-controls button {flex:0 0 36px;width:36px;min-width:36px;height:36px;min-height:36px;padding:0;font-size:20px}
.withdrawal-amount-controls input,.withdrawal-time-control input {height:40px;min-height:40px;margin:0}
.withdrawal-time-label {margin-top:4px;line-height:1.5}
#withdrawalAdjustLabel {margin-top:0;font-size:var(--text-small);line-height:1.5}
@media(max-width:760px) {
 #withdrawalMobileAdjust {margin-block:2px;padding-block:4px 2px}
 .withdrawal-time-label {gap:0 8px}
 .withdrawal-readout {margin-top:4px;padding-top:6px}
}

/* Keep the amount's reset action beside its label instead of a separate row. */
.withdrawal-amount-heading {display:flex;align-items:center;justify-content:space-between;gap:var(--space-2)}
.withdrawal-amount-heading label {min-width:0}
.withdrawal-amount-heading .withdrawal-link {min-height:32px;padding:4px 0 4px 8px;font-size:var(--text-small);line-height:1.5;color:var(--muted);white-space:nowrap}
#withdrawalInputs .withdrawal-amount-field .input-wrap {margin-top:0}
@media(max-width:760px) {
 #withdrawalInputs>.fields {margin-top:8px}
 #withdrawalInputs h2 {margin-bottom:2px}
}

/* Make the phase and time origin explicit beside the withdrawal chart. */
.withdrawal-journey {display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:12px 0 8px;font-size:var(--text-small);color:var(--muted)}
.withdrawal-journey strong {padding:3px 8px;background:#e9f4f6;color:var(--accent);border-radius:4px;font-weight:var(--weight-strong)}
.withdrawal-chart-value {display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:2px 12px;margin:8px 0 2px}
.withdrawal-chart-value span {font-size:var(--text-small);color:var(--muted)}
.withdrawal-chart-value strong {font-size:var(--text-amount);line-height:1.3;color:var(--accent);font-variant-numeric:tabular-nums;overflow-wrap:anywhere;max-width:100%}
.withdrawal-origin-label {font-size:var(--text-small);font-weight:var(--weight-strong);fill:var(--accent)}
.withdrawal-axis-context {font-size:var(--text-small);fill:var(--muted)}
@media(max-width:360px) {
 .withdrawal-toolbar {gap:4px}
 .withdrawal-toolbar h2 {font-size:var(--text-heading);letter-spacing:0}
 .withdrawal-chart-value {gap:2px 6px}
 .withdrawal-chart-value span {font-size:var(--text-small)}
 .withdrawal-chart-value strong {font-size:var(--text-amount)}
}

.withdrawal-phase-wash {fill:var(--phase-surface)}
.withdrawal-refined #withdrawalChart .withdrawal-transition .withdrawal-phase {stroke:var(--phase-line);stroke-width:2;stroke-dasharray:5 4;opacity:.85}
.withdrawal-transition-leader {fill:none;stroke:var(--phase-line);stroke-width:1.5}
.withdrawal-transition-badge {fill:var(--phase-badge)}
.withdrawal-transition-time {fill:#fff;font-size:var(--text-small)}
.withdrawal-transition-name {fill:#fff;font-size:var(--text-small);font-weight:var(--weight-strong)}
.withdrawal-transition-ring {fill:none;stroke:var(--phase-line);stroke-width:2;pointer-events:none}
.withdrawal-transition-point {fill:var(--phase-point);stroke:#fff;stroke-width:2}
@media(forced-colors:active){.withdrawal-phase-wash{fill:Canvas}.withdrawal-transition-badge{fill:Highlight}.withdrawal-transition-time,.withdrawal-transition-name{fill:HighlightText}.withdrawal-transition-point{fill:Highlight;stroke:Canvas}.withdrawal-transition-ring{stroke:Highlight}}

.goal-outcome {scroll-margin-top:var(--space-3)}
/* Keep a proposal's change and undo together, directly below its result. */
.goal-action-feedback {display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin-top:var(--space-4);padding-block:var(--space-3);border-block:1px solid var(--line)}
.goal-action-feedback[hidden] {display:none}
.goal-action-feedback p {flex:1 1 200px;min-width:0;margin:0;font-size:var(--text-body);line-height:1.7;overflow-wrap:anywhere}
#undoGoal {flex:0 0 auto;min-height:var(--control-min-height);padding:var(--space-2) 14px;background:var(--paper);border:1px solid var(--accent);border-radius:var(--radius-control);color:var(--accent);font-weight:var(--weight-strong)}

/* Keep the graph stationary while the selected date and balance change. */
@media(max-width:760px){
 .withdrawal-chart-value{display:grid;grid-template-columns:minmax(0,1fr);gap:2px}
 .withdrawal-chart-value span{min-height:2.8em;line-height:1.4}
 .withdrawal-chart-value strong{justify-self:end}
}

/* Calendar month view: compact months, separate years, visible selection. */
#chart .calendar-month{font-size:11px;font-variant-numeric:tabular-nums}
#chart .calendar-month.is-selected{fill:#fff;font-weight:var(--weight-strong)}
#calendarMonthHighlight{fill:var(--accent);pointer-events:none}
#chart .calendar-year{font-size:11px}
#chart .calendar-year.is-selected{fill:var(--accent);font-weight:var(--weight-strong)}
#chart .calendar-month-unit{font-size:10px}
.calendar-year-span{stroke:var(--muted);stroke-opacity:.3;pointer-events:none}
.calendar-month-tick{stroke:var(--muted);stroke-opacity:.45;pointer-events:none}
.calendar-year-boundary{stroke:var(--muted);stroke-opacity:.65;stroke-dasharray:2 2;pointer-events:none}

@media(forced-colors:active){#calendarMonthHighlight{fill:Highlight}#chart .calendar-month.is-selected{fill:HighlightText}}

@media(max-width:350px){#chart .calendar-month{font-size:10px}}

/* saving-experience.css */
/* Graph-first surface, adapted from the approved graph experience prototype. */
.saving-experience:not(.withdrawal-active) .summary{position:static}
.saving-experience:not(.withdrawal-active) .summary>div:first-child{display:flex;justify-content:space-between;align-items:baseline;gap:12px;width:100%}
.saving-experience:not(.withdrawal-active) .summary strong{font-size:var(--text-amount);line-height:1.3}
/* Dynamic chart details must not pull the viewport toward later conditions or goals. */
.saving-experience:not(.withdrawal-active){overflow-anchor:none}
.saving-experience:not(.withdrawal-active) .workspace{grid-template-columns:minmax(0,1fr) 280px;gap:30px;align-items:start;padding-block:24px}
.saving-experience:not(.withdrawal-active) #chartPanel{grid-column:1;grid-row:1;min-width:0}
.saving-experience:not(.withdrawal-active) #conditions{grid-column:2;grid-row:1;border:0;border-left:1px solid var(--line);padding:4px 0 0 22px;position:static;min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
.saving-experience:not(.withdrawal-active) #conditions>.section-title{grid-column:1;grid-row:1}
.saving-experience:not(.withdrawal-active) #savingInputs{grid-column:1/-1;grid-row:2}
.saving-experience:not(.withdrawal-active) #resetFeedback{grid-column:1/-1;grid-row:3;margin:0}
.saving-experience:not(.withdrawal-active) .condition-actions{display:contents!important}
.saving-experience:not(.withdrawal-active) .condition-actions #reset{grid-column:2;grid-row:1;font-size:var(--text-small);padding:0;border:0;background:transparent;min-height:32px}
.saving-experience:not(.withdrawal-active) .condition-actions #openWithdrawal{grid-column:1/-1;grid-row:4;justify-self:end;border:0;background:transparent;font-size:var(--text-small);padding:0;min-height:28px}
.saving-experience:not(.withdrawal-active) #conditions>.section-title{margin-bottom:14px}
.saving-experience:not(.withdrawal-active) #conditionsTitle{font:var(--weight-strong) var(--text-heading) var(--font-reading);letter-spacing:0}
.saving-experience:not(.withdrawal-active) #conditions>.section-title::after{display:none}
.saving-experience:not(.withdrawal-active) .condition-actions{display:flex;gap:12px;margin:0 0 14px;flex-wrap:wrap}
.saving-experience:not(.withdrawal-active) .condition-actions button{font-size:var(--text-small);min-height:32px;padding:0;background:transparent;border:0;color:var(--muted)}
#savingInputs .condition-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
#savingInputs .condition-card{border:1px solid var(--line);border-radius:5px;padding:6px 8px;min-width:0;background:var(--paper)}
#savingInputs .condition-card.is-selected{background:#edf5f5;border-color:var(--chart-asset);box-shadow:inset 0 -2px var(--chart-asset)}
#savingInputs .condition-card>button{display:block;text-align:left;width:100%;border:0;background:transparent;min-height:22px;padding:0;font-size:var(--text-small);color:var(--muted)}
#savingInputs .condition-card .input-wrap{border:0;border-radius:0;background:transparent;padding:0;margin:0;min-width:0;gap:2px}
#savingInputs .condition-card input{font:var(--weight-strong) 13px var(--font-amount);padding:0;width:100%;min-width:0;min-height:24px;height:24px;text-align:left;background:transparent}
#savingInputs .condition-card input:focus{font-size:16px}
#savingInputs .condition-card .input-wrap>span{font-size:var(--text-small);white-space:nowrap}
#savingInputs .condition-card #monthlyRateHint{font-size:var(--text-dense);line-height:1.5;margin:2px 0 0;white-space:normal}
.condition-value{display:flex;gap:12px;align-items:center;margin-top:18px}
.condition-value>button{border:1px solid var(--line);background:var(--paper);color:var(--chart-asset);border-radius:50%;width:44px;height:44px;flex:0 0 44px;font-size:22px;padding:0}
.condition-value>label{display:flex;align-items:baseline;gap:4px;min-width:0;flex:1;border-bottom:1px solid var(--chart-asset);margin:0}
#conditionValue{font:var(--weight-regular) var(--text-input)/var(--leading-amount) var(--font-amount);border:0;background:transparent;color:var(--ink);min-width:0;width:100%;height:46px;min-height:46px;padding:4px 0;text-align:center}
#conditionUnit{font-size:var(--text-small);white-space:nowrap;color:var(--muted)}
#conditionRange{width:100%;height:36px;margin:4px 0 0;accent-color:var(--chart-asset)}
.condition-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#conditionDone{width:100%;min-height:40px;background:var(--chart-asset);color:var(--paper);border:0;border-radius:5px;margin-top:8px}
.saving-experience #savingChart .readout{border:0;padding:14px 0 4px;gap:12px;align-items:baseline}
.saving-experience #savingChart .readout-primary #selectedAssets{font:var(--weight-strong) var(--text-amount)/1.5 var(--font-amount);letter-spacing:0}
.saving-experience #savingChart .readout-totals dd{font:var(--weight-strong) var(--text-amount-secondary)/1.5 var(--font-amount)}
.saving-experience #savingChart .readout-totals{border:0;padding:0;text-align:right}
.saving-experience #chart{height:340px}
.saving-experience #savingChart .chart-caption{font-size:var(--text-small);gap:6px 14px;padding:10px 0 4px;margin:0;border:0}
.saving-experience #savingChart .chart-caption>span:nth-child(-n+3){display:inline-flex;align-items:center;gap:4px}
.saving-experience #savingChart .chart-caption>span:nth-child(n+4){display:none}
.saving-experience #savingChart .year-control{margin-top:0;padding-block:0;border:0}
.saving-experience #savingChart .year-control button{border:0;background:transparent;width:36px;height:40px}
.saving-experience #savingChart .chart-details{margin-top:14px;border-top:1px solid var(--line)}
.saving-experience #savingChart .chart-details>summary{padding-block:14px;font-size:var(--text-small)}
.saving-experience .workspace+.chart-details{border-top:1px solid var(--line);margin-top:0}
.saving-experience .workspace+.chart-details>summary{font-size:var(--text-small);padding-block:14px}
@media(max-width:760px){
 .saving-experience:not(.withdrawal-active) .shell{padding-inline:16px}
 .saving-experience:not(.withdrawal-active) .workspace{display:flex;flex-direction:column;gap:14px;padding-block:14px}
 .saving-experience:not(.withdrawal-active) #chartPanel{order:0;width:100%}
 .saving-experience:not(.withdrawal-active) #conditions{order:1;width:100%;border:0;border-top:1px solid var(--line);padding:14px 0 0}
 .saving-experience:not(.withdrawal-active) #conditions>.section-title{margin-bottom:4px}
 .saving-experience:not(.withdrawal-active) .condition-actions{margin-bottom:8px;justify-content:space-between}
 #savingInputs .condition-cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
 #savingInputs .condition-card{padding:4px 5px}
 #savingInputs .condition-card>button{font-size:var(--text-small)}
 #savingInputs .condition-card input{font-size:var(--text-small)}
 .condition-value{margin-top:12px}
 .condition-value>label{max-width:190px;margin-inline:auto}
 .saving-experience #chart{height:clamp(180px,calc(100svh - 560px),290px)}
 .saving-experience #savingChart .readout-primary #selectedAssets{font-size:var(--text-amount)}
 .saving-experience #savingChart .readout-totals dd{font-size:var(--text-amount-secondary)}
 .saving-experience #savingChart .readout-heading,.saving-experience #savingChart .readout-heading #selectedYear,.saving-experience #savingChart .readout-totals dt{font-size:var(--text-small)}
 .saving-experience #savingChart .chart-caption{font-size:var(--text-small);gap:5px 10px}
 .saving-experience #savingChart .chart-details{margin-top:6px}
}
@media(forced-colors:active){#savingInputs .condition-card.is-selected{border-color:Highlight;box-shadow:none}.condition-value>button{border-color:ButtonText}}

body[data-callout=details] #chart{height:372px}
body[data-callout=details] .callout-date{font-size:10px}
body[data-callout=details] .callout-total{font-size:16px}
.focus-callout .callout-label,.focus-callout .callout-value{font-size:11px;fill:var(--ink)}
.focus-callout .callout-value{font-weight:var(--weight-strong);font-variant-numeric:tabular-nums}
.callout-key.initial{fill:var(--capital-start)}
.callout-key.contribution{fill:var(--capital-deposit);stroke:var(--chart-boundary);stroke-width:.5}
.callout-key.gain{fill:var(--chart-growth-high)}
.callout-key.loss{fill:var(--chart-loss)}
.focus-callout .callout-value.gain{fill:var(--chart-gain-text)}
.focus-callout .callout-value.loss{fill:var(--chart-loss)}
@media(max-width:760px){body[data-callout=details] #chart{height:clamp(212px,calc(100svh - 528px),322px)}}
@media(forced-colors:active){.focus-callout .callout-label,.focus-callout .callout-value{fill:CanvasText}.callout-key{fill:CanvasText!important}}

@media(min-width:761px) and (max-height:760px){body[data-callout=details] #chart{height:340px}}
/* Reserve room for the page header, chart readout, and time controls on laptops. */
@media(min-width:981px){
 body[data-callout=details] #chart{height:clamp(240px,calc(100svh - 480px),372px)}
}

.monthly-change{margin-top:12px;padding:16px 0 4px;border-top:1px solid var(--line)}
.monthly-change-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 12px}
.monthly-change h3{margin:0;font-size:var(--text-subheading);font-weight:var(--weight-strong)}
#monthlyChangeTotal{display:block;font-size:var(--text-amount-secondary);color:var(--chart-asset);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#monthlyChangeTotal.negative{color:var(--chart-loss)}
#monthlyChangeBreakdown{display:flex;flex-wrap:wrap;gap:8px 24px;margin:10px 0 0;font-size:var(--text-small)}
#monthlyChangeBreakdown[hidden]{display:none}
#monthlyChangeBreakdown div{display:flex;gap:12px}
#monthlyChangeBreakdown dt{color:var(--muted)}
#monthlyChangeBreakdown dd{margin:0;font-variant-numeric:tabular-nums}
.monthly-change-band{fill:var(--chart-asset);fill-opacity:.07;pointer-events:none}
.saving-experience .differences>section:first-child{display:none}
@media(max-width:760px){.monthly-change-heading{display:block}#monthlyChangePeriod{display:block;margin-top:6px}.monthly-change{padding-top:12px}}

.monthly-change[hidden]{display:none}
#monthlyChangePeriod{font-size:var(--text-small);font-variant-numeric:tabular-nums;color:var(--muted)}

/* Cards select a field; values are edited only in the shared form. */
#savingInputs .condition-card{padding:0}
#savingInputs .condition-card>button{padding:6px 8px;min-height:64px;height:100%;font-size:var(--text-small);cursor:pointer}
#savingInputs .condition-card>.input-wrap[hidden]{display:none!important}
.condition-name,.condition-display{display:block;overflow-wrap:anywhere}
#savingInputs .condition-display{font:var(--weight-strong) var(--text-card-value) var(--font-amount);color:var(--ink);margin-top:4px}
#savingInputs .condition-card>button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:760px){#savingInputs .condition-card>button{padding:5px;font-size:var(--text-small)}#savingInputs .condition-display{font-size:var(--text-card-value)}}

/* Center the value and its unit together between symmetric step buttons. */
.condition-value>label{justify-content:center}
#conditionValue,#withdrawalConditionValue{width:calc(var(--value-length,4)*1ch + .5ch);max-width:calc(100% - 2em);flex:0 1 auto}

/* Adopted growth comparison B: compact headroom, moderate chart height. */
body.saving-experience #chart{height:360px}
@media(max-width:760px){body.saving-experience #chart{height:clamp(270px,38svh,320px)}}

@media(min-width:981px){body.saving-experience #chart{height:clamp(240px,calc(100svh - 480px),360px)}}

/* Quick amounts add to the selected capital field; rate and period replace it. */
#conditionPresets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:8px}
#conditionPresets button{min-width:0;min-height:44px;padding:4px 2px;border:1px solid var(--line);border-radius:5px;background:var(--paper);color:var(--chart-asset);font-size:12px;white-space:nowrap}
#conditionActions{display:flex;align-items:center;justify-content:flex-end;gap:12px;min-width:0}
#conditionActions>button{min-height:44px;padding:4px 2px;border:0;background:transparent;color:var(--muted);font-size:12px}

/* Yen has four more digits than the model's unit; keep the entire amount readable. */
#conditionAdjust .condition-value>label{container-type:inline-size}
#conditionValue{font-size:clamp(10px,calc((120cqw - 64px) / var(--value-length,1)),28px);max-width:calc(100% - 48px)}

/* Keep a full touch target while separating the visible zero action from the amount row. */
#conditionActions>#conditionZero{position:relative;isolation:isolate;padding-inline:12px;color:var(--chart-asset);font-weight:600;white-space:nowrap}
#conditionZero::before{content:"";position:absolute;inset:4px 0;z-index:-1;border:1px solid var(--line);border-radius:5px;background:var(--soft,#eef5f7);pointer-events:none}

/* Keep amount labels comfortably inside the narrow desktop condition column. */
@media(min-width:761px){#conditionPresets button{font-size:11px}}
#defaultControls{display:flex;align-items:center;gap:4px;position:relative;grid-column:2;grid-row:1;justify-self:end;align-self:start}
body.saving-experience.saving-entry-first #conditions #defaultControls{grid-row:2}
.withdrawal-active #defaultControls{display:none}
#defaultHelp summary{padding:0;display:flex;align-items:center;justify-content:center;min-height:44px;width:28px;cursor:pointer;list-style:none;color:var(--muted)}
#defaultHelp summary::-webkit-details-marker{display:none}
#defaultDescription{position:absolute;right:0;top:100%;z-index:110;width:260px;max-width:calc(100vw - 32px);padding:12px;border:1px solid var(--line);border-radius:5px;background:var(--paper);box-shadow:0 3px 12px #163b4514;color:var(--ink);font-size:12px;line-height:1.7}
#defaultDescription p{margin:6px 0 0}

/* A quiet unit control beside the amount, with a full touch target. */
#conditionUnit{border:0;background:transparent;padding:0;min-width:0;min-height:0;font-weight:400;flex-shrink:0;position:relative}
#conditionUnit.is-switchable{width:44px}
#conditionUnit.is-switchable::after{content:"";position:absolute;width:44px;height:44px;left:50%;top:50%;transform:translate(-50%,-50%)}
#conditionUnit.is-switchable{text-decoration:underline;text-decoration-style:dotted;text-underline-offset:4px;cursor:pointer}
#conditionUnit:disabled{opacity:1;cursor:default}
#conditionUnit:focus-visible{outline:2px solid var(--chart-asset);outline-offset:2px}

/* withdrawal-comparison.css */
.withdrawal-comparison{position:sticky;top:0;z-index:20;background:var(--paper);display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid var(--line);font-size:var(--text-small)}
.withdrawal-comparison button{min-height:40px;border:1px solid var(--line);border-radius:4px;background:var(--paper);color:var(--chart-asset);padding:6px 14px;font:inherit}
.withdrawal-comparison button[aria-pressed=true]{background:var(--chart-asset);color:white}

.withdrawal-amount-first{padding:4px 0 8px;border:0;margin-bottom:4px}
.withdrawal-amount-first[hidden]{display:none}
.withdrawal-amount-first h2{font-size:var(--text-entry-heading);margin:0 0 10px}
.withdrawal-amount-first>.input-wrap{max-width:320px}
#withdrawalFirstGuide{display:block;min-height:44px;padding:4px 0;font-size:var(--text-small)}
#withdrawalFirstAmount,#withdrawalFirstAmountYen{font-size:var(--text-input);font-weight:var(--weight-regular)}
#withdrawalFirstFeedback{font-size:var(--text-small);color:var(--chart-loss);margin:8px 0 0}

.withdrawal-amount-first-view #withdrawalSavingHeader{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 6px;margin:-6px 0 6px;padding:0;border:0;border-radius:0;background:transparent}
.withdrawal-amount-first-view #withdrawalSavingHeader[hidden]{display:none}
.withdrawal-amount-first-view #withdrawalSavingHeader .withdrawal-start{grid-column:1;grid-row:1;display:flex;align-items:baseline;justify-content:flex-start;flex-wrap:wrap;gap:2px 6px;align-self:center}
.withdrawal-amount-first-view #withdrawalSavingHeader .withdrawal-start>span{font-size:var(--text-small);color:var(--muted)}
.withdrawal-amount-first-view #withdrawalSavingHeader .withdrawal-start strong{font-size:var(--text-small);line-height:1.5}
.withdrawal-amount-first-view #withdrawalSavingHeader .withdrawal-edit{grid-column:2;grid-row:1;order:0;align-self:center}
.withdrawal-amount-first-view #withdrawalSavingHeader #savingCompact{display:none}
.withdrawal-amount-first-view #editSaving{min-height:40px;min-width:44px;font-size:var(--text-small);padding:0 4px}
.withdrawal-amount-first-view #withdrawalSavingHeader #savingInputs{grid-column:1/-1;grid-row:3;padding-top:8px}


.withdrawal-organized .withdrawal-condition-card{padding:0}
.withdrawal-organized .withdrawal-condition-card>button{padding:8px;min-height:64px;height:100%;width:100%;cursor:pointer}
.withdrawal-organized .withdrawal-condition-card>.input-wrap[hidden]{display:none!important}
.withdrawal-organized .condition-display{font:var(--weight-strong) var(--text-card-value) var(--font-amount);color:var(--ink);margin-top:4px}
.withdrawal-organized .withdrawal-condition-card>button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.withdrawal-first-guide-actions{justify-content:flex-start}
.withdrawal-first-guide-actions .withdrawal-guide-popover{left:0;right:auto}

.withdrawal-month-unit{white-space:nowrap;flex-shrink:0}

/* withdrawal-start-assets.css */
/* Choose the source without adding another large condition panel. */
.withdrawal-start-source { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; grid-column:1/-1; margin:2px 0 8px; }
#withdrawalManualWrap { max-width:180px; margin:0; }
#withdrawalManualWrap .input-wrap { display:flex; align-items:baseline; gap:5px; }
#withdrawalManualAssets { width:125px; min-width:0; font-size:16px; }
#withdrawalManualWrap .input-wrap>span { font-size:var(--text-small); }
#withdrawalAssetFeedback { width:100%; margin:0; }
body.withdrawal-manual-assets .withdrawal-journey { display:none; }
.withdrawal-start-source .sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

.withdrawal-source-options { display:flex; align-items:center; gap:4px; }
.withdrawal-source-options label { position:relative; margin:0; cursor:pointer; }
.withdrawal-source-options input { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.withdrawal-source-options span { display:flex; align-items:center; justify-content:center; box-sizing:border-box; min-height:44px; padding:8px 10px; border:1px solid transparent; border-radius:5px; color:var(--muted); font-size:var(--text-small); white-space:nowrap; }
.withdrawal-source-options input:checked + span { color:var(--accent); border-color:var(--line); background:var(--soft,#eef5f7); font-weight:var(--weight-strong); }
.withdrawal-source-options input:focus-visible + span { outline:2px solid var(--accent); outline-offset:2px; }

/* simulation-mode.css */
.simulation-mode {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 4px;
}
.simulation-mode button {
  min-height: 44px;
  padding: 10px 8px 8px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-body);
  font-weight:var(--weight-strong);
}
.simulation-mode button[aria-pressed="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
@media (max-width: 760px) {
  .simulation-mode { gap: 0; }
  .simulation-mode button { flex: 1; }
}

/* time-context.css */
/* Blend the time selector into the graph; show stronger controls only while editing. */
.time-axis-controls{margin:0 0 8px;font-size:var(--text-small);color:var(--muted)}
.time-axis-row{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;min-height:40px}
.time-axis-row label{margin:0;font:inherit;font-size:var(--text-small)}
.time-axis-row select{min-height:40px;border:0;background:transparent;color:var(--muted);font:inherit;padding:5px 20px 5px 6px;max-width:100%;cursor:pointer}
.time-axis-row select:hover{color:var(--ink)}
#editTimeAge{min-height:40px;padding:4px 0 4px 4px;border:0;background:transparent;color:var(--muted);font-size:var(--text-small);display:flex;align-items:center;gap:8px}
#editTimeAge span{color:inherit;text-decoration:underline;text-underline-offset:3px}
#chart .time-axis-tick{font-variant-numeric:tabular-nums}
#timeAgeForm{padding:12px 0 8px;margin-top:4px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
#timeAgeForm label{display:flex;align-items:center;gap:8px;margin:0;font-size:var(--text-small);color:var(--ink)}
#timeAgeForm input{width:72px;min-height:44px;border:1px solid var(--line);border-radius:4px;padding:4px 6px;font-size:18px;color:var(--ink);background:var(--paper)}
#timeAgeForm button{min-height:44px;padding:6px 12px;font-size:var(--text-small);border:1px solid var(--accent);border-radius:5px;background:var(--accent);color:white}
#timeAgeForm button[type=button]{border-color:transparent;background:transparent;color:var(--muted)}
@media(max-width:380px){.time-axis-row{column-gap:6px}#editTimeAge{gap:5px}}

/* operation-start.css */
.plan-start-controls{margin:2px 0 0;font-size:var(--text-small);color:var(--ink)}
#editPlanStart{display:flex;align-items:center;gap:5px;min-height:44px;padding:4px 0;border:0;background:transparent;font:inherit;color:var(--ink);cursor:pointer}
#editPlanStart>span:first-child{color:var(--muted)}
#editPlanStart svg{margin-left:3px;color:var(--accent)}
#editPlanStart:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#planStartForm{padding:12px 0;margin-bottom:8px;border-block:1px solid var(--line);display:grid;gap:12px;max-width:100%}
#planStartForm[hidden]{display:none}
.plan-start-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:var(--text-small)}
#planStartForm button{min-height:44px;padding:6px 10px;font:inherit;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--accent);cursor:pointer}
#planStartForm button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#planStartForm button:disabled{opacity:.35;cursor:default}
#planStartForm #planStartToday{font-size:var(--text-small);padding-inline:4px;text-decoration:underline;text-underline-offset:3px}
.plan-start-year{display:flex;align-items:center;justify-content:space-between;gap:12px}
#planStartForm .plan-start-year>button{font-size:22px;width:44px;border-color:var(--line);border-radius:50%}
#planStartForm .plan-start-year label{display:flex;align-items:baseline;justify-content:center;gap:4px;margin:0;font-size:14px}
#planStartYear{width:90px;min-height:44px;padding:0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;color:var(--ink);font:var(--weight-strong) 22px var(--font-amount);text-align:center;appearance:textfield}
#planStartYear::-webkit-inner-spin-button,#planStartYear::-webkit-outer-spin-button{appearance:none;margin:0}
.plan-start-months{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
#planStartForm .plan-start-months button{border-color:var(--line);color:var(--ink)}
#planStartForm .plan-start-months button[aria-pressed=true]{background:var(--accent);color:var(--paper);border-color:var(--accent);font-weight:var(--weight-strong)}
#planStartForm p{font-size:var(--text-small);line-height:1.6;color:var(--muted);margin:0}
.plan-start-actions{display:flex;justify-content:flex-end;gap:8px}
#planStartForm button[type=submit]{background:var(--accent);color:var(--paper);padding-inline:20px}
#planNowMarker line{stroke:var(--muted);stroke-width:1;stroke-dasharray:3 5;opacity:.55}
#planNowMarker circle{fill:var(--paper);stroke:var(--accent);stroke-width:1.5}
#planNowMarker text{fill:var(--muted);font-size:11px}

/* withdrawal-duration.css */
.withdrawal-duration-proposal{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;margin:0 0 12px;padding:10px 0;border-block:1px solid var(--line);overflow-wrap:anywhere}
.withdrawal-duration-proposal h3{margin:0;font-size:var(--text-body);color:var(--ink);line-height:1.5}
.withdrawal-duration-proposal p{font-size:var(--text-small);line-height:1.6;margin:2px 0}
.withdrawal-duration-proposal h3,.withdrawal-duration-proposal #withdrawalDurationText{grid-column:1}
.withdrawal-duration-proposal button{min-height:44px;max-width:100%;padding:6px 10px;border:1px solid var(--accent);border-radius:var(--radius-control);background:#fff;color:var(--accent);font-size:var(--text-small)}
.withdrawal-duration-proposal #applyWithdrawalDuration{grid-column:2;grid-row:1/3;align-self:center}
.withdrawal-duration-proposal #undoWithdrawalDuration{grid-column:1/-1;justify-self:start}
#withdrawalDurationStatus{grid-column:1/-1}
#withdrawalDurationStatus:empty{display:none}
.withdrawal-duration-notes{grid-column:1/-1;font-size:var(--text-small);color:var(--muted)}
.withdrawal-duration-notes summary{cursor:pointer;min-height:32px;display:flex;align-items:center}
.withdrawal-duration-notes summary::before{content:'＋';margin-right:6px}
.withdrawal-duration-notes[open] summary::before{content:'−'}
.withdrawal-duration-proposal:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.withdrawal-duration-proposal [hidden],.withdrawal-duration-proposal[hidden]{display:none}

/* saving-entry.css */
/* Adopted conditions-first entry, isolated from the withdrawal layout. */
body.saving-experience.saving-entry-first #conditions{width:100%;max-width:720px;margin:0 auto;padding:8px 0 12px;border:0;position:static;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px}
body.saving-experience.saving-entry-first #conditionsTitle{font-size:var(--text-entry-heading);line-height:1.5}
body.saving-experience.saving-entry-first #conditions>.section-title{margin-bottom:4px}
body.saving-experience.saving-entry-first #savingInputs .condition-cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
body.saving-experience.saving-entry-first #savingInputs .condition-card>button{min-height:62px;padding:6px}
body.saving-experience.saving-entry-first #conditionAdjust{margin-top:4px;padding:18px 0 0;position:relative}
body.saving-experience.saving-entry-first #conditionLabel{position:absolute;top:0;left:0;width:auto;height:auto;overflow:visible;clip-path:none;font-size:var(--text-small);color:var(--muted)}
body.saving-experience.saving-entry-first .condition-value{padding:4px 0}
body.saving-experience.saving-entry-first .plan-start-controls{grid-column:1/-1;grid-row:2;margin:0}
body.saving-experience.saving-entry-first .workspace{display:block;max-width:720px;margin:auto;width:100%;padding:8px 0 16px;border:0}
body.saving-experience.saving-entry-first .summary{max-width:720px;margin:auto;padding:10px 0;width:100%;position:static}
@media(max-width:760px){
 body.saving-experience.saving-entry-first #conditionsTitle{font-size:var(--text-entry-heading)}
 body.saving-experience.saving-entry-first #savingInputs .condition-name{font-size:var(--text-small)}
 body.saving-experience.saving-entry-first #savingInputs .condition-display{font-size:var(--text-card-value)}
}

body.saving-experience.saving-entry-first #conditions>.section-title{grid-column:1/-1;grid-row:1}
body.saving-experience.saving-entry-first #conditions #reset{grid-column:2;grid-row:2;align-self:start;min-height:44px}
body.saving-experience.saving-entry-first #conditions #openWithdrawal{display:none}
body.saving-experience.saving-entry-first #savingInputs{grid-column:1/-1;grid-row:3}
body.saving-experience.saving-entry-first #resetFeedback{grid-row:4}

body.saving-experience.saving-entry-first .condition-value{margin-top:0}
body.saving-experience.saving-entry-first #editPlanStart{width:fit-content;max-width:calc(100% - 80px)}

@media(max-width:760px) and (max-height:640px){
 body.saving-experience.saving-entry-first #conditions{padding-bottom:4px}
 body.saving-experience.saving-entry-first .summary{padding-top:4px}
}

/* Compact cards keep the graph within reach on narrow screens. */
@media(max-width:360px){
 body.saving-experience.saving-entry-first #conditions{padding-bottom:0;row-gap:2px}
 body.saving-experience.saving-entry-first .condition-value{padding-block:0}
 body.saving-experience.saving-entry-first #savingInputs{margin-top:4px}
 body.saving-experience.saving-entry-first .summary{padding-block:4px}
 body.saving-experience.saving-entry-first .workspace{padding-top:4px}
 body.saving-experience.saving-entry-first #savingInputs .condition-cards{grid-template-columns:1.2fr 1.1fr .85fr .85fr}
 body.saving-experience.saving-entry-first #savingInputs .condition-card>button{padding:2px}
 body.saving-experience.saving-entry-first #savingInputs .condition-name{font-size:var(--text-dense)}
 body.saving-experience.saving-entry-first #savingInputs .condition-display{font-size:var(--text-card-value)}
 body.saving-experience.saving-entry-first #savingInputs #monthlyRateHint{font-size:10px}
}

/* time-jump.css */
.time-jump-trigger>span{text-decoration-line:underline;text-decoration-style:dotted;text-decoration-color:var(--muted);text-underline-offset:4px;text-decoration-thickness:1px;}
.time-jump-trigger{display:inline-flex;align-items:center;min-height:32px;margin:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;white-space:nowrap}
.time-jump-trigger:hover,.time-jump-trigger[aria-expanded=true]{color:var(--accent)}
.time-jump-trigger:hover>span,.time-jump-trigger[aria-expanded=true]>span{text-decoration-style:solid;text-decoration-color:var(--accent)}
.time-jump-trigger:focus-visible,.time-jump :focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.time-jump{padding:8px 0 10px;color:var(--ink);border-bottom:1px solid var(--line);margin:0 0 8px}
.time-jump[hidden]{display:none}
.time-jump-fields{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.time-jump label{display:flex;align-items:center;gap:4px;margin:0;font-size:var(--text-small)}
.time-jump input,.time-jump select{min-height:40px;min-width:0;padding:6px;border:1px solid var(--line);border-radius:4px;background:var(--paper);color:var(--ink);font:inherit}
.time-jump input{width:76px}
.time-jump select{width:55px}
.time-jump button{min-height:40px;padding:6px 8px;border:1px solid var(--line);border-radius:4px;background:var(--paper);color:var(--accent);font:inherit;font-size:var(--text-small);cursor:pointer}
#timeJumpCancel{min-width:32px;padding:4px;border-color:transparent;color:var(--muted);font-size:20px}
.time-jump p{margin:5px 0 0;font-size:var(--text-small);line-height:1.5;color:var(--muted)}
#timeJumpError{color:var(--chart-loss)}

.readout>.time-jump-host,.withdrawal-chart-value>.time-jump-host{flex:0 0 100%;width:100%;min-width:0;text-align:left;grid-column:1/-1}
.time-jump-host:not(:has(form:not([hidden]))){display:none}
@media(max-width:360px){.time-jump-fields{gap:3px}.time-jump label{gap:3px}.time-jump input{width:64px}.time-jump select{width:55px}#timeJumpCancel{min-width:24px;padding-inline:0}}
.time-jump-anchor{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 12px;min-width:0}
.time-jump-trigger.is-age{min-height:44px;padding:6px 10px;border:1px solid var(--line);border-radius:6px;font-size:var(--text-small);font-weight:400;color:var(--accent)}
.time-jump label[hidden]{display:none}
.time-jump.is-age .time-jump-fields{gap:8px}
.time-jump.is-age #timeJumpAgeLabel{flex-basis:100%}
.time-jump.is-age button{min-height:44px}
.time-jump.is-age #timeJumpCancel{font-size:var(--text-small);padding:6px 8px}

.time-jump-notice{position:fixed;z-index:110;top:calc(var(--notice-top,0px) + max(12px,env(safe-area-inset-top)));left:var(--notice-center,50%);display:flex;align-items:center;gap:10px;width:max-content;max-width:var(--notice-width,calc(100vw - 24px));padding:12px 16px 12px 12px;border:1px solid #ffffff29;border-radius:12px;background:var(--accent);color:#fff;box-shadow:0 6px 20px #163b4533;font-size:var(--text-body);line-height:1.5;pointer-events:none;opacity:0;transform:translate(-50%,-8px);transition:opacity .16s ease,transform .16s ease}
.time-jump-notice[hidden]{display:none}
.time-jump-notice-icon{display:grid;place-items:center;flex:none;width:24px;height:24px;border-radius:50%;background:var(--chart-growth-low);color:var(--chart-boundary)}
.time-jump-notice-message{min-width:0;overflow-wrap:anywhere}
.time-jump-notice-message>span:last-child{white-space:nowrap}
.time-jump-notice-message strong{font-weight:var(--weight-strong);white-space:nowrap}
.time-jump-notice.is-visible{opacity:1;transform:translate(-50%,0);animation:time-jump-notice-enter .22s cubic-bezier(.2,.8,.2,1)}
@keyframes time-jump-notice-enter{from{opacity:0;transform:translate(-50%,-24px)}to{opacity:1;transform:translate(-50%,0)}}
@media(prefers-reduced-motion:reduce){.time-jump-notice{transition:none}.time-jump-notice.is-visible{animation:none}}

.time-jump-status{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

@media(max-width:360px){.time-jump-notice{font-size:var(--text-small);gap:8px;padding:12px}}

/* goal-options.css */
.goal-outcome{padding:14px 16px;border:1px solid var(--line);display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 14px;align-items:start}
.goal-outcome #goalResult{font-size:var(--text-emphasis);font-weight:var(--weight-strong);line-height:1.5}
/* An ink stamp occupies its own grid cell so it never covers the result. */
.goal-outcome #goalResult{grid-column:1;grid-row:1;min-width:0}
.goal-outcome #goalDetail{grid-column:1/-1;min-width:0}
.goal-outcome .goal-stamp{grid-column:2;grid-row:1;align-self:start;justify-self:end;transform:rotate(-7deg);border:4px double currentColor;border-radius:5px 3px 6px 3px;background:#fff5df;color:#875414;padding:7px 10px;margin:3px 2px 4px;font-family:var(--font-amount);font-size:20px;line-height:1;font-weight:700;letter-spacing:.08em;white-space:nowrap;box-shadow:none}
.goal-outcome .goal-stamp[data-state="on-course"]{color:#246c64;background:#edf7f2;transform:rotate(5deg)}
.goal-outcome .goal-stamp[data-state="reached"]{color:#a34534;background:#fff1eb;transform:rotate(-6deg)}
.goal-outcome .goal-stamp::before{content:none}
.goal-outcome .goal-stamp[hidden]{display:none}

.goal-distance{font-size:var(--text-body);line-height:1.6;color:var(--muted)}
.goal-distance strong{color:var(--ink);font-weight:var(--weight-strong)}
.goal-options{margin-top:16px}
#goalOptionsTitle{font-size:var(--text-body);margin:0 0 10px}
.goal-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:stretch}
.goal-cards>.goal-option{min-width:0;padding:10px;border:1px solid var(--line);border-radius:4px;display:flex;flex-direction:column}
.goal-cards h3,.goal-option .goal-next h3{font-size:var(--text-body);margin:0 0 6px}
.goal-option .goal-next strong,.goal-cards #extendedResult strong{font-size:var(--text-emphasis);line-height:1.5}
.goal-cards p,.goal-cards .hint{font-size:var(--text-small);line-height:1.6;margin:4px 0}
.goal-cards #applyGoal,.goal-cards #applyDuration,.goal-cards #applyRate{width:100%;min-height:44px;font-size:var(--text-small);padding:6px;margin-top:auto;box-shadow:none}
.goal-cards .goal-card-result span,.goal-cards #extendedResult span{display:block;margin-top:4px}
.goal-cards #goalDepositDetail{margin-bottom:8px}
@media(max-width:360px){.goal-cards{gap:8px}.goal-cards>.goal-option{padding:8px}.goal-option .goal-next strong,.goal-cards #extendedResult strong{font-size:16px}}

.goal-cards #requiredRateResult strong{font-size:var(--text-emphasis);line-height:1.5}
.goal-cards #requiredRateHint{margin-bottom:8px}
@media(max-width:760px){.goal-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.goal-cards>.rate-goal{grid-column:1/-1}}
@media(max-width:360px){.goal-outcome{column-gap:10px}.goal-outcome .goal-stamp{font-size:16px;padding:6px 8px;letter-spacing:.06em}}
/* Keep the forecast and shortfall together; the stamp spans both text rows. */
.goal-outcome:has(.goal-stamp[data-state="planning"]:not([hidden])){row-gap:6px}
.goal-outcome:has(.goal-stamp[data-state="planning"]:not([hidden])) #goalDetail{grid-column:1;grid-row:2;margin-top:0}
.goal-outcome .goal-stamp[data-state="planning"]{grid-row:1/3}

/* plan-comparison-entry.css */
.plan-comparison-entry{margin-top:24px;padding:22px 0;border-top:1px solid var(--line)}
.plan-comparison-entry h2{font-size:var(--text-heading);margin:0 0 8px}
.plan-comparison-entry p{font-size:var(--text-small);color:var(--muted);margin:8px 0}
#openPlanComparison{min-height:44px;padding:10px 16px;border:1px solid var(--accent);border-radius:var(--radius-control);background:#fff;color:var(--accent);font-size:var(--text-body)}
.withdrawal-active .plan-comparison-entry{display:none}
.comparison-return{max-width:var(--page-max-width);margin:12px auto;padding:12px 0;border-bottom:1px solid var(--line);font-size:var(--text-small)}
.comparison-return p{margin:0 0 8px}.comparison-return button{min-height:44px}

/* desktop-workspace.css */
/* Adopted PC layout: conditions on the left, live amounts and curves on the right. */
@media(min-width:1000px){
 html:root body.desktop-workspace .shell{max-width:1320px;display:grid;grid-template-columns:300px minmax(0,1fr);column-gap:40px;align-items:start;padding-inline:32px}
 html:root body.desktop-workspace .shell>*{grid-column:1/-1;min-width:0}
 html:root body.desktop-workspace .shell>header{grid-row:1}
 html:root body.desktop-workspace .simulation-mode{grid-row:2}
 html:root body.desktop-workspace .workspace{display:contents}
 html:root body.desktop-workspace .desktop-condition-rail{grid-column:1;grid-row:3/7;min-width:0;align-self:stretch}
 html:root body.desktop-workspace.withdrawal-active .desktop-condition-rail{grid-row:3/5}
 html:root body.desktop-workspace #conditions{grid-column:1;grid-row:3/7;width:100%;max-width:none;padding:24px 24px 20px 0;margin:0;border:0;border-right:1px solid var(--line);align-self:start;position:sticky;top:16px}
 html:root body.desktop-workspace.saving-entry-first #conditionsTitle{font-family:var(--font-journal);font-size:21px;line-height:1.65}
 html:root body.desktop-workspace.saving-entry-first #savingInputs .condition-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 html:root body.desktop-workspace.saving-entry-first #savingInputs .condition-card>button{min-height:68px;padding:4px}
 html:root body.desktop-workspace.saving-entry-first #conditionAdjust{margin-top:22px}
 html:root body.desktop-workspace #chartPanel{grid-column:2;grid-row:3/5;min-width:0;padding:24px 0 0}
 html:root body.desktop-workspace #chart{height:clamp(260px,36vh,370px)}
 html:root body.desktop-workspace .shell>.chart-details{grid-column:2;grid-row:5}
 html:root body.desktop-workspace #goalPanel{grid-column:2;grid-row:6;margin-top:16px}
 html:root body.desktop-workspace #goalPanel .goal-layout{grid-template-columns:1fr}
 html:root body.desktop-workspace .goal-input{max-width:420px}
 html:root body.desktop-workspace.withdrawal-active #chartPanel{grid-row:3/5;padding-top:24px}
 html:root body.desktop-workspace.withdrawal-active #conditions{display:block;grid-row:3/5}
 html:root body.desktop-workspace.withdrawal-active .withdrawal-amount-first{margin-bottom:20px;padding:0 0 16px;border-bottom:1px solid var(--line)}
 html:root body.desktop-workspace.withdrawal-active #withdrawalSavingHeader{display:block;margin:0 0 12px}
 html:root body.desktop-workspace.withdrawal-active #withdrawalSavingHeader .withdrawal-start strong{font-size:20px}
 html:root body.desktop-workspace.withdrawal-active #withdrawalSummary{margin:0 0 14px;padding:0 0 14px}
 html:root body.desktop-workspace.withdrawal-active #withdrawalSummary strong{font-size:26px;line-height:1.6}
 html:root body.desktop-workspace.withdrawal-active #withdrawalChart{height:clamp(270px,39vh,390px)}
 html:root body.desktop-workspace.withdrawal-active .workspace>.withdrawal-readout{grid-column:2;grid-row:5}
 html:root body.desktop-workspace .condition-card:hover,html:root body.desktop-workspace .withdrawal-condition-card:hover{border-color:var(--accent);background:#f2f7f7}
 html:root body.desktop-workspace button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
}
@media(min-width:1000px) and (max-height:700px){html:root body.desktop-workspace #conditions{position:static}html:root body.desktop-workspace #chart,html:root body.desktop-workspace #withdrawalChart{height:240px}}

@media(min-width:1000px){
 html:root body.desktop-workspace:not(.withdrawal-active) .summary{display:none}
 html:root body.desktop-workspace #savingChart .readout{grid-column:1/-1;grid-row:2;margin:8px 0 12px;padding:4px 0 10px;border-bottom:1px solid var(--line)}
 html:root body.desktop-workspace #savingChart #selectedAssets{font-size:42px;line-height:1.3}
}
@media(min-width:1000px){
 html:root body.desktop-workspace.withdrawal-active .withdrawal-amount-first>:not(#withdrawalSavingHeader){display:none}
 html:root body.desktop-workspace.withdrawal-active #withdrawalInputsTitle{font-size:20px;margin-bottom:16px}
}

/* thumb-input.css */
/* Keep the same four-column summary in both resting and editing states. */
@media(max-width:760px){
 html:root body.saving-experience #savingInputs .condition-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;padding:4px;margin:0;background:#f2f6f6;border:1px solid #e2ebed;border-radius:12px}
 html:root body.saving-experience #savingInputs .condition-card{border:0;border-radius:7px;padding:0;background:transparent;box-shadow:none;min-width:0}
 html:root body.saving-experience #savingInputs .condition-card+.condition-card{border-left:1px solid #dce6e8}
 html:root body.saving-experience #savingInputs .condition-card>button{min-height:58px;padding:7px 4px;border-radius:7px;width:100%;text-align:left}
 html:root body.saving-experience #savingInputs .condition-name{font-size:11px;line-height:1.4}
 html:root body.saving-experience #savingInputs .condition-display{display:flex;align-items:baseline;flex-wrap:wrap;column-gap:1px;font-size:17px;line-height:1.4;margin-top:3px;font-variant-numeric:tabular-nums}
 html:root body.saving-experience #savingInputs .condition-unit{font-size:10px;font-weight:400;color:var(--muted);white-space:nowrap}
 html:root body.saving-experience #savingInputs:not(.thumb-input-active) #monthlyRateHint{display:none}
 html:root body.saving-experience:not(.withdrawal-active) #savingInputs:not(.thumb-input-active) #conditionAdjust{display:none}
 html:root body.saving-experience #savingInputs:not(.thumb-input-active) .condition-card>button:active{background:#dcebed}
 @media(hover:hover){html:root body.saving-experience #savingInputs:not(.thumb-input-active) .condition-card>button:hover{background:#e5eff0}}
 html:root body.saving-experience #savingInputs.thumb-input-active{position:fixed;z-index:100;left:var(--editor-left,0px);right:auto;bottom:var(--keyboard-bottom,0px);width:var(--editor-width,100%);max-width:760px;margin:0;padding:8px 12px max(8px,env(safe-area-inset-bottom));background:var(--paper);border-top:1px solid var(--line);border-radius:16px 16px 0 0;box-shadow:0 -6px 24px #163b4514;display:flex;flex-direction:column;gap:6px;height:auto;max-height:var(--editor-height);overflow:auto;overscroll-behavior:contain}
 html:root body.saving-experience #savingInputs.thumb-input-active>*{flex-shrink:0}
 html:root body.saving-experience #savingInputs.thumb-input-active .thumb-input-forecast{order:0;display:flex;align-items:baseline;justify-content:space-between;flex-wrap:nowrap;gap:2px 8px;padding:0 4px 6px}
 html:root body.saving-experience #savingInputs.thumb-input-active .thumb-input-forecast p{margin:0;font-size:12px;color:var(--muted)}
 html:root body.saving-experience #savingInputs.thumb-input-active .thumb-input-forecast strong{font:700 25px/1.3 var(--font-amount);color:var(--chart-asset);overflow-wrap:anywhere;font-variant-numeric:tabular-nums;flex-shrink:0}
 html:root body.saving-experience #savingInputs.thumb-input-active .condition-cards{order:1}
 html:root body.saving-experience #savingInputs.thumb-input-active .condition-display{display:flex;justify-content:center;flex-wrap:wrap;white-space:nowrap}
 html:root body.saving-experience #savingInputs.thumb-input-active .condition-card>button{min-height:48px;text-align:center}
 html:root body.saving-experience #savingInputs.thumb-input-active .condition-card.is-selected{background:var(--chart-asset)}
 html:root body.saving-experience #savingInputs.thumb-input-active .is-selected .condition-name,
 html:root body.saving-experience #savingInputs.thumb-input-active .is-selected .condition-display,
 html:root body.saving-experience #savingInputs.thumb-input-active .is-selected .condition-unit{color:var(--paper)}
 html:root body.saving-experience #savingInputs.thumb-input-active #conditionAdjust{order:2;padding:44px 0 0;margin:0;position:relative}
 html:root body.saving-experience #savingInputs.thumb-input-active .condition-value{margin:0;padding:0}
 html:root body.saving-experience #savingInputs.thumb-input-active .condition-value>button,
 html:root body.saving-experience #savingInputs.thumb-input-active #conditionRange,
 html:root body.saving-experience #savingInputs.thumb-input-active #conditionDone{display:none}
 html:root body.saving-experience #savingInputs.thumb-input-active .condition-value>label{max-width:none;margin:0;border:0;padding:0 4px;justify-content:center}
 html:root body.saving-experience #savingInputs.thumb-input-active #conditionValue{text-align:center;flex:0 1 auto;width:calc(var(--value-length,1)*1ch + 12px);max-width:calc(100% - 40px);font-size:30px}
 html:root body.saving-experience #savingInputs.thumb-input-active #conditionLabel{position:absolute;top:0;left:4px;clip-path:none;width:calc(100% - 84px);height:44px;display:flex;align-items:center;font-size:12px}
 html:root body.saving-experience #savingInputs.thumb-input-active .thumb-input-close{position:absolute;right:0;top:0;min-height:44px;min-width:72px;border:1px solid var(--chart-asset);border-radius:8px;background:var(--chart-asset);color:var(--paper);font-size:14px;font-weight:700;padding:8px 16px;z-index:1}
 html:root body.saving-experience #savingInputs.thumb-input-active #monthlyRateHint:not([hidden]){display:block;margin:4px 0 0;text-align:center;font-size:12px;line-height:1.5;color:var(--muted)}
 html:root body.saving-experience #savingInputs.thumb-input-active #inputFeedback{margin:4px 0 0;padding:4px 8px;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
 html:root body.saving-experience #savingInputs.thumb-input-active .thumb-input-mode{order:3;align-self:center;min-height:44px;padding:4px;border:0;background:transparent;color:var(--chart-asset);font-size:12px;text-decoration:underline;text-underline-offset:3px}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-adjusting .condition-value>button{display:block}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-adjusting #conditionRange{display:block;margin:6px 0 0}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact{gap:2px;padding:4px 10px}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact .thumb-input-forecast{padding:0 4px 2px}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact .thumb-input-forecast strong{font-size:21px}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact .condition-cards{padding:2px}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact .condition-card>button{min-height:44px;padding:0 2px}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact #conditionValue{font-size:26px;min-height:36px;height:36px}
 @media(max-width:350px){html:root body.saving-experience #savingInputs.thumb-input-active .condition-display{font-size:12px}html:root body.saving-experience #savingInputs.thumb-input-active .condition-card>button{padding-left:0;padding-right:0}html:root body.saving-experience #savingInputs .condition-display{font-size:14px}html:root body.saving-experience #savingInputs .condition-card>button{padding-left:1px;padding-right:1px}}
}

/* Direct entry belongs to the condition list; sliders dock below the graph. */
@media(max-width:760px){
 html:root body.saving-experience #savingInputs.thumb-input-active:not(.thumb-input-docked){position:relative;left:auto;right:auto;bottom:auto;width:auto;max-height:none;margin:0;padding:8px;background:var(--paper);border:1px solid var(--line);border-radius:12px;box-shadow:none;overflow:visible}
 html:root body.saving-experience #savingInputs.thumb-input-active .condition-name{color:var(--ink)}
 html:root body.saving-experience #savingInputs.thumb-input-active .condition-card.is-selected>button{background:var(--chart-asset);color:var(--paper)}
 html:root body.saving-experience #savingInputs.thumb-input-active .condition-card.is-selected .condition-name{color:var(--paper)}
 html:root body.saving-experience #savingInputs.thumb-input-active:not(.thumb-input-adjusting) .condition-value>label{padding:4px 12px;border:1px solid var(--chart-asset);border-radius:8px;background:var(--soft);min-height:48px}
 html:root body.saving-experience #savingInputs.thumb-input-active:not(.thumb-input-adjusting) #conditionValue{width:100%;max-width:none;flex:1;text-align:right;font-size:28px}
 html:root body.condition-adjusting .mobile-nav{display:none}
 html:root body.condition-adjusting #chart{height:clamp(140px,calc(var(--condition-view-height,100dvh) - var(--condition-dock-height,280px) - 80px),320px)}
 html:root body.condition-adjusting #chartPanel{padding-top:0}
 html:root body.condition-adjusting .shell{padding-bottom:calc(var(--condition-dock-height,280px) + 32px)}
 html:root body.condition-adjusting #savingInputs.thumb-input-adjusting{border-radius:12px 12px 0 0;box-shadow:0 -2px 8px #163b450a}
}

@media(max-width:760px){
 html:root body.saving-experience #savingInputs.thumb-input-active #conditionActions{gap:12px;justify-content:flex-end}
 html:root body.saving-experience #savingInputs.thumb-input-active #conditionActions .thumb-input-mode{order:0;margin-left:0;margin-right:auto;padding-inline:0;white-space:nowrap}
 html:root body.saving-experience #savingInputs.thumb-input-adjusting #conditionPresets{display:none}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact #conditionAdjust{padding-top:44px}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact #conditionPresets{margin-top:4px;gap:4px}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact .condition-value>label{min-height:40px;padding-block:0}
 @media(max-width:350px){#conditionPresets button{font-size:11px}}
}

@media(max-width:760px){html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact:not(.thumb-input-adjusting){padding:4px 8px}}

@media(max-width:760px){
 html:root body.saving-experience #savingInputs.thumb-input-active:not(.thumb-input-adjusting) #conditionValue{font-size:clamp(16px,calc(120cqw / var(--value-length,1)),28px)}
 html:root body.saving-experience #savingInputs.thumb-input-adjusting #conditionValue{font-size:clamp(12px,calc(120cqw / var(--value-length,1)),28px);max-width:calc(100% - 20px)}
}

/* Repeat edits keep the chart above the same dock, with direct amount entry. */
@media(max-width:760px){
 html:root body.saving-experience #savingInputs.thumb-input-docked:not(.thumb-input-adjusting) #conditionPresets{display:none}
 html:root body.saving-experience #savingInputs.thumb-input-docked:not(.thumb-input-adjusting) .condition-value>label{padding:0 8px;min-height:40px}
 html:root body.condition-numeric-docked #chart{height:clamp(100px,calc(var(--condition-view-height,100dvh) - var(--condition-dock-height,240px) - 64px),320px)}
 html:root body.saving-experience #savingInputs.thumb-input-navigation:not(.thumb-input-adjusting){max-height:calc(var(--editor-height) - 48px)}
 html:root body.saving-experience #savingInputs.thumb-input-navigation.thumb-input-compact .thumb-input-forecast{display:none}
}

@media(max-width:760px){
 html:root body.condition-numeric-docked:has(.thumb-input-compact) #savingChart>.section-title,
 html:root body.condition-numeric-docked:has(.thumb-input-compact) #savingChart>.chart-toolbar,
 html:root body.condition-numeric-docked .chart-assumption{display:none}
 html:root body.condition-numeric-docked:has(.thumb-input-compact) #chart{height:clamp(48px,calc(var(--condition-view-height) - var(--condition-dock-height) - 16px),320px)}
}
@media(max-width:760px){
}

/* Navigation starts numeric entry with buttons; touching the amount opens the keyboard. */
@media(max-width:760px){
 html:root body.saving-experience #savingInputs.thumb-input-button-entry .condition-value>button{display:block}
 html:root body.saving-experience #savingInputs.thumb-input-docked.thumb-input-button-entry #conditionPresets{display:grid}
}

/* Inline entry expands beneath the existing cards without resizing or recentering them. */
@media(max-width:760px){
 html:root body.saving-experience #savingInputs.thumb-input-active:not(.thumb-input-docked){padding:0;border:0;border-radius:0;margin-top:4px}
 html:root body.saving-experience #savingInputs.thumb-input-active:not(.thumb-input-docked) .condition-card>button{min-height:58px;padding:7px 4px;text-align:left}
 html:root body.saving-experience #savingInputs.thumb-input-active:not(.thumb-input-docked) .condition-display{justify-content:flex-start}
 @media(max-width:350px){
  html:root body.saving-experience #savingInputs.thumb-input-active:not(.thumb-input-docked) .condition-card>button{padding-left:1px;padding-right:1px}
  html:root body.saving-experience #savingInputs.thumb-input-active:not(.thumb-input-docked) .condition-display{font-size:14px}
 }
}

@media(max-width:760px){
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact:not(.thumb-input-docked) .condition-card>button{min-height:44px;padding:0 2px}
}

@media(max-width:350px){html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact:not(.thumb-input-docked) .condition-display{font-size:12px}}

@media(max-width:760px){
 html:root body.saving-experience #savingInputs.thumb-input-active .thumb-input-close:focus-visible{outline:2px solid var(--accent)!important;outline-offset:2px}
}
@media(max-width:760px){
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact:not(.thumb-input-docked){gap:0;padding-block:2px}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact #inputFeedback{margin-top:0;padding-block:2px;line-height:16px}
 html:root body.saving-experience #savingInputs.thumb-input-active.thumb-input-compact #conditionPresets{margin-top:0}
}

/* month-period.css */
/* Period controls stay in the existing heading row. */
#monthRange.month-period-ready{max-width:188px}
#monthRange.month-period-ready>label,#monthRange.month-period-ready>#monthWindow{display:none}
.month-period-controls{display:grid;grid-template-columns:30px minmax(0,1fr) 30px;align-items:stretch;height:36px;border-radius:8px;background:#f2f6f6}
#monthRange .month-period-controls button{min-width:0;min-height:36px;margin:0;padding:0;border:0;border-radius:6px;color:var(--accent);background:transparent;box-shadow:none}
#monthRange .month-period-controls button:hover:not(:disabled){background:#e3eeee}
#monthRange .month-period-controls button:disabled{opacity:.25;cursor:default}
#monthRange #previousPeriod,#monthRange #nextPeriod{font-size:25px;font-weight:400;line-height:1}
#monthRange #choosePeriod{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;white-space:nowrap}
.period-caption{font-size:9px;line-height:10px;color:var(--muted);font-weight:400}
.period-current{font-size:12px;line-height:16px;font-weight:var(--weight-strong);font-variant-numeric:tabular-nums;text-decoration:underline;text-underline-offset:3px;text-decoration-color:#b0c8cd}
.period-picker{position:fixed;inset:auto;margin:0;width:min(320px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:14px;box-sizing:border-box;overflow:auto;border:1px solid var(--line);border-radius:14px;background:var(--paper);color:var(--ink);box-shadow:0 12px 40px #143c4a26}
.period-picker::backdrop{background:#102f3814}
.period-picker-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.period-picker-heading h2{margin:0;font-size:14px;font-weight:var(--weight-strong)}
.period-picker button{min-height:40px;min-width:0;padding:6px 2px;margin:0;border:0;box-shadow:none;color:var(--ink);background:transparent;border-radius:7px;font-size:13px}
.period-picker #closePeriodPicker{width:32px;min-height:32px;font-size:22px;color:var(--muted)}
.period-pages{display:flex;gap:4px;margin-bottom:12px;padding:3px;background:#f2f6f6;border-radius:8px}
.period-pages[hidden]{display:none}
.period-pages button{flex:1;min-height:32px;font-size:11px;color:var(--muted)}
.period-pages button[aria-pressed=true]{color:var(--accent);background:var(--paper);box-shadow:0 1px 4px #183c4512}
.period-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.period-grid button{font-variant-numeric:tabular-nums;background:#f5f7f7;white-space:nowrap}
.period-grid button small{font-size:10px;margin-left:1px}
.period-grid button[aria-pressed=true]{background:var(--accent);color:white}
.period-picker button:hover:not([aria-pressed=true]){background:#e3eeee}
.period-picker button:focus-visible,#monthRange button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(forced-colors:active){.period-grid button[aria-pressed=true]{border:2px solid Highlight}.month-period-controls{border:1px solid ButtonText}}

/* money-entry.css */
.money-entry-unit{min-width:44px;min-height:44px;padding:4px;border:0;background:transparent;color:var(--muted);font-size:var(--text-small);text-decoration:underline;text-decoration-style:dotted;text-underline-offset:4px;white-space:nowrap;cursor:pointer;flex-shrink:0}
.money-entry-unit:focus-visible{outline:2px solid var(--accent)!important;outline-offset:2px}
.money-entry-yen{min-width:0;width:100%;font:inherit;font-variant-numeric:tabular-nums}
#withdrawalConditionValueYen{font-size:clamp(10px,calc((120cqw - 64px) / var(--value-length,1)),28px);max-width:calc(100% - 48px);flex:1 1 auto;border:0;background:transparent;text-align:center}
.money-entry-yen[hidden]{display:none!important}
.money-entry-yen{padding-inline:2px}

/* selected-details.css */
/* Detail-only styles: preserve the compact chart overview and mobile condition editor. */
.chart-details .selected-detail-panel{max-width:640px;padding:8px 0 22px;container-type:inline-size}
.chart-details .selected-details{padding:0;margin:0;border:0}
.chart-details .selected-details h3{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin:0 0 22px;line-height:1.6;font-size:var(--text-subheading)}
.chart-details .selected-details h3 span{margin:0;font-size:var(--text-small);font-weight:400;text-align:right}
.selected-detail-total-label{font-size:var(--text-small);color:var(--muted)}
.selected-detail-total{display:block;font-family:var(--font-amount);font-variant-numeric:tabular-nums;font-size:var(--text-amount);line-height:1.5;overflow-wrap:anywhere;margin:3px 0 20px}
.chart-details .selected-details-values{display:block;margin:0;font-size:var(--text-body)}
.chart-details .selected-details-values>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);align-items:baseline;gap:12px;padding:6px 0;min-width:0}
.chart-details .selected-details-values dt{color:var(--ink);font-size:var(--text-body);line-height:1.6}
.chart-details .selected-details-values dd{margin:0;text-align:right;font-size:var(--text-body);line-height:1.6;font-weight:400;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.chart-details .selected-details-values .selected-detail-sub{padding:3px 0 3px 12px}
.chart-details .selected-detail-sub dt,.chart-details .selected-detail-sub dd{color:var(--muted);font-size:var(--text-small)}
.chart-details .selected-details-values .selected-detail-gain{grid-template-columns:minmax(0,1fr) minmax(0,1fr);border-top:1px solid var(--line);margin-top:12px;padding-top:14px}
.selected-detail-ratio{display:block;color:var(--muted);font-size:var(--text-small);font-weight:400}
.selected-detail-period{margin-top:26px;padding-top:22px;border-top:1px solid var(--line)}
.selected-detail-period-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.selected-detail-period-heading h3{margin:0;font-size:var(--text-subheading)}
.selected-detail-switch{display:flex;padding:3px;gap:3px;background:#edf3f4;border-radius:8px}
.selected-detail-switch button{min-height:44px;padding:6px 12px;border:0;background:transparent;color:var(--muted);font-size:var(--text-small);border-radius:5px}
.selected-detail-switch button[aria-pressed="true"]{background:var(--ink);color:#fff}
.selected-detail-transition{display:grid;grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr);gap:8px;align-items:end;margin:22px 0 15px}
.selected-detail-transition>div:last-child{text-align:right}
.selected-detail-transition small{display:block;font-size:var(--text-small);color:var(--muted)}
.selected-detail-transition strong{display:block;font-size:var(--text-emphasis);font-weight:400;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;line-height:1.7}
.selected-detail-arrow{color:var(--muted);text-align:center;padding-bottom:3px}
.selected-detail-change{display:flex;align-items:baseline;justify-content:space-between;gap:8px 16px;flex-wrap:wrap;padding:14px 16px;background:#edf3f4;border-radius:8px}
.selected-detail-change strong{font-size:var(--text-amount-secondary);font-variant-numeric:tabular-nums;overflow-wrap:anywhere;max-width:100%}
.selected-detail-change span{font-size:var(--text-emphasis);font-variant-numeric:tabular-nums;overflow-wrap:anywhere;max-width:100%}
.selected-detail-breakdown{margin-top:18px}
.selected-detail-breakdown h4{font-size:var(--text-small);font-weight:400;color:var(--muted);margin:0 0 10px;overflow-wrap:anywhere}
.chart-details .selected-detail-breakdown dl,.chart-details .selected-detail-help dl{display:block;margin:0}
.selected-detail-breakdown dl>div,.selected-detail-help dl>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);gap:12px;padding:5px 0;align-items:baseline}
.chart-details .selected-detail-breakdown dt{font-size:var(--text-body);color:var(--ink)}
.chart-details .selected-detail-breakdown dd,.chart-details .selected-detail-help dd{margin:0;font-size:var(--text-body);font-weight:400;text-align:right;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.selected-detail-help{margin-top:22px;padding-top:4px;border-top:1px solid var(--line);color:var(--muted);font-size:var(--text-small)}
.selected-detail-help>summary{padding:12px 0;font-size:var(--text-small);font-weight:400}
.selected-detail-help p{margin-top:10px;line-height:1.7}
.chart-details .selected-detail-help dd{font-size:var(--text-small)}
.selected-detail-empty{padding:18px 0 0;color:var(--muted);font-size:var(--text-small);line-height:1.7}
.selected-detail-zero{font-size:var(--text-small);color:var(--muted);margin-top:8px;line-height:1.7}
/* Reuse the graph palette; labels and signs carry the meaning without color. */
.selected-detail-key{display:inline-block;width:10px;height:10px;margin-right:6px;vertical-align:baseline;border:1px solid var(--chart-boundary);border-radius:2px}
.selected-detail-key.asset{height:3px;width:16px;vertical-align:middle;background:var(--chart-asset);border:0;border-radius:0}
.selected-detail-key.initial{background:var(--capital-start)}
.selected-detail-key.contribution{background:var(--capital-deposit)}
.selected-detail-key.gain{background:linear-gradient(var(--chart-growth-high),var(--chart-growth-low));border-color:var(--chart-gain-text)}
.selected-detail-key.is-loss{background:repeating-linear-gradient(135deg,var(--paper) 0 3px,var(--chart-loss) 3px 4px,var(--paper) 4px 7px);border-color:var(--chart-loss)}
#selectedDetailAssets{color:var(--chart-asset)}
#selectedDetailGain,#detailsInvestment{color:var(--chart-gain-text)}
#selectedDetailsPanel .negative{color:var(--chart-loss)!important}
#selectedDetailsPanel #selectedInitial,#selectedDetailsPanel #selectedContribution{color:var(--chart-boundary)}
@container(max-width:350px){
 .selected-detail-period-heading{display:block}
 .selected-detail-switch{width:fit-content;margin-top:12px}
 .selected-detail-transition strong{font-size:var(--text-body)}
 .selected-detail-change{padding:12px}
}
/* Keep selection and period changes beside the tracing controls; expand only the breakdown. */
#selectedDetailsPanel{width:100%;min-width:0;container-type:inline-size;padding-bottom:12px}
#savingChart .superseded-by-summary{display:none}
html:root body #savingChart #selectedDetailsPanel>.readout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:10px 16px;align-items:start;margin:8px 0 0;padding:12px 0;border:0;border-top:1px solid var(--line)}
html:root body #savingChart #selectedDetailsPanel #selectedAssets{font-size:clamp(20px,5.6cqi,32px);line-height:1.5}
html:root body #savingChart #selectedDetailsPanel #selectedGain{display:block;font-size:clamp(18px,4.8cqi,26px);line-height:1.5;overflow-wrap:anywhere}
html:root body #savingChart #selectedGainRatio{font-family:var(--font-reading);font-size:var(--text-small);line-height:1.6;font-weight:400;overflow-wrap:anywhere}
#selectedPeriodSummary{padding:4px 0 0}
#selectedPeriodSummary h3{font-size:var(--text-small);font-weight:400;color:var(--muted)}
#selectedPeriodSummary .selected-detail-switch{background:transparent;padding:0}
#selectedPeriodSummary .selected-detail-switch button[aria-pressed="true"]{background:#edf3f4;color:var(--ink)}
#selectedPeriodSummary .selected-detail-change{padding:8px 0;background:transparent;border-radius:0;justify-content:flex-start}
#selectedPeriodSummary .selected-detail-change strong{font-size:var(--text-amount-secondary)}
html:root body #savingChart #selectedDetailsPanel>.chart-details{margin-top:4px;border-top:0}
html:root body #savingChart #selectedDetailsPanel>.chart-details>summary{padding:10px 0;color:var(--chart-asset);font-size:var(--text-small)}
#selectedDetailsPanel .selected-detail-period>h3{font-size:var(--text-subheading);margin:0}
#selectedDetailsPanel .selected-detail-empty{padding-top:8px}
@container(max-width:350px){#selectedPeriodSummary .selected-detail-switch{margin-top:4px}#selectedPeriodSummary .selected-detail-period-heading{display:flex;gap:4px 10px}}
#savingChart .readout-totals.is-loss dt::before{background:repeating-linear-gradient(135deg,var(--paper) 0 3px,var(--chart-loss) 3px 4px,var(--paper) 4px 7px);border-color:var(--chart-loss)}

/* Read top to bottom: selected time, aligned amounts, then the separate period comparison. */
html:root body #savingChart #selectedDetailsPanel>.readout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);row-gap:4px;column-gap:20px;padding:0 0 8px;margin-top:4px}
html:root body #savingChart #selectedDetailsPanel .readout-heading{grid-column:1/-1;min-width:0}
html:root body #savingChart #selectedDetailsPanel .readout-heading #selectedYear{font-size:var(--text-body);font-weight:var(--weight-strong);color:var(--ink)}
html:root body #savingChart #selectedDetailsPanel .readout-primary,
html:root body #savingChart #selectedDetailsPanel .readout-totals{align-self:start;text-align:left}
html:root body #savingChart #selectedDetailsPanel .readout-label,
html:root body #savingChart #selectedDetailsPanel .readout-totals dt{min-height:20px;line-height:20px}
html:root body #savingChart #selectedDetailsPanel #selectedAssets,
html:root body #savingChart #selectedDetailsPanel #selectedGain{font-size:clamp(18px,5.2cqi,30px);line-height:1.5;margin:4px 0 0;font-weight:var(--weight-strong)}
html:root body #savingChart #selectedDetailsPanel #selectedGainRatio{display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 6px;margin-top:4px}
html:root body #savingChart #selectedGainRatioValue{font-size:var(--text-emphasis);font-weight:var(--weight-strong);color:var(--chart-gain-text);line-height:1.5}
#selectedPeriodSummary{border-top:1px solid var(--line);padding-top:12px}
#selectedPeriodSummary .selected-detail-period-heading{display:flex;justify-content:flex-start;gap:8px 16px}
#selectedPeriodSummary h3{width:auto;margin:0;font-weight:var(--weight-strong);color:var(--ink)}
#selectedPeriodSummary .selected-detail-switch{margin:0;background:#f1f5f5;padding:3px;gap:4px}
#selectedPeriodSummary .selected-detail-switch button{min-height:36px;padding:5px 12px}
#selectedPeriodSummary .selected-detail-switch button[aria-pressed="true"]{background:var(--paper);color:var(--ink);box-shadow:0 1px 3px #243f4a18;font-weight:var(--weight-strong)}
#selectedPeriodSummary .selected-detail-change{gap:8px 12px;padding:10px 0 4px}
#selectedPeriodSummary .selected-detail-change span{font-size:var(--text-emphasis);font-weight:var(--weight-strong)}
@media(min-width:761px){#selectedPeriodSummary h3{width:auto}}

/* Expanded reading follows the comparison above, then the composition of all assets. */
#selectedDetailsPanel>.chart-details[open]>summary{margin-bottom:8px}
#selectedDetailsPanel .selected-detail-period{margin:0;padding:16px 0 20px;border-top:1px solid var(--line)}
#selectedDetailsPanel .selected-detail-transition{margin:12px 0 16px;padding:12px;background:#f2f6f7;border-radius:6px;gap:8px}
#selectedDetailsPanel .selected-detail-transition strong{font-size:var(--text-body);font-weight:var(--weight-strong)}
#selectedDetailsPanel .selected-detail-breakdown{margin-top:0}
#selectedDetailsPanel .selected-detail-breakdown h4{margin-bottom:8px}
#selectedDetailsPanel .selected-detail-breakdown dl>div{padding:9px 0;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr)}
#selectedDetailsPanel .selected-detail-breakdown dd{font-size:var(--text-emphasis);font-weight:var(--weight-strong)}
#selectedDetailsPanel .selected-details{border-top:1px solid var(--line);padding:20px 0 0}
#selectedDetailsPanel .selected-details h3{margin:0 0 14px;flex-wrap:wrap;gap:4px 12px}
#selectedDetailsPanel .selected-details-values>div{padding:8px 0;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr)}
#selectedDetailsPanel .selected-details-values>div:first-child dd{font-weight:var(--weight-strong)}
#selectedDetailsPanel .selected-details-values .selected-detail-sub{margin-left:4px;padding:5px 0 5px 12px;border-left:2px solid var(--line)}
#selectedDetailsPanel .selected-details-values .selected-detail-gain{margin-top:10px;padding:10px 0;border-top:0}
#selectedDetailsPanel .selected-detail-gain dd{font-size:var(--text-emphasis);font-weight:var(--weight-strong)}
#selectedDetailsPanel .selected-details-values .selected-detail-sum{border-top:1px solid var(--line);padding:12px 0 4px;margin-top:4px}
#selectedDetailsPanel .selected-detail-sum dt,#selectedDetailsPanel .selected-detail-sum dd{font-weight:var(--weight-strong)}
#selectedDetailsPanel .selected-detail-sum dd{font-size:var(--text-emphasis)}
#selectedDetailsPanel .selected-detail-help{margin-top:16px}

/* Keep each amount intact; move whole groups to the next row when space runs out. */
html:root body #savingChart #selectedDetailsPanel>.readout{display:flex;flex-wrap:wrap}
html:root body #savingChart #selectedDetailsPanel .readout-heading{flex-basis:100%}
html:root body #savingChart #selectedDetailsPanel .readout-primary,
html:root body #savingChart #selectedDetailsPanel .readout-totals{flex:1 1 0;min-width:max-content}
html:root body #savingChart #selectedDetailsPanel #selectedAssets,
html:root body #savingChart #selectedDetailsPanel #selectedGain{white-space:nowrap;overflow-wrap:normal;letter-spacing:-.02em}
#selectedDetailsPanel .selected-details-values>div,
#selectedDetailsPanel .selected-detail-breakdown dl>div,
#selectedDetailsPanel .selected-detail-help dl>div{display:flex;flex-wrap:wrap;gap:4px 12px}
#selectedDetailsPanel dt{flex:1}
#selectedDetailsPanel dd{margin-left:auto;white-space:nowrap;overflow-wrap:normal}
#selectedDetailsPanel .selected-detail-transition strong,
#selectedDetailsPanel .selected-detail-change strong,
#selectedDetailsPanel .selected-detail-change span{white-space:nowrap;overflow-wrap:normal}
@container(max-width:520px){
 #selectedDetailsPanel .selected-detail-transition{grid-template-columns:1fr;gap:4px}
 #selectedDetailsPanel .selected-detail-transition>div:last-child{text-align:left}
 #selectedDetailsPanel .selected-detail-arrow{justify-self:start;transform:rotate(90deg);padding:0}
}
