/* Design System: Minimalist Elegant (referensi: Atlassian Design System) */
:root {
  --bg: #f7f8f9;
  --surface: #ffffff;
  --surface-2: #f1f2f4;
  --text: #172b4d;
  --muted: #626f86;
  --border: #dcdfe4;
  --primary: #0c66e4;
  --primary-ink: #ffffff;
  --primary-soft: #e9f2ff;
  --good: #216e4e;
  --good-soft: #dcfff1;
  --warn: #974f0c;
  --warn-soft: #fff7d6;
  --bad: #c9372c;
  --bad-soft: #ffecEB;
  --c0: #0c66e4; --c1: #e56910; --c2: #1f845a; --c3: #6e5dc6;
  --c4: #b38600; --c5: #c9372c; --c6: #2c7bb6; --c7: #626f86;
  --shadow: 0 1px 1px rgba(9, 30, 66, .13), 0 0 1px rgba(9, 30, 66, .31);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d2125; --surface: #22272b; --surface-2: #2c333a; --text: #e6edfa; --muted: #9fadbc;
    --border: #38414a; --primary: #579dff; --primary-ink: #0d1117; --primary-soft: #1c2b41;
    --good: #7ee2b8; --good-soft: #1c3329; --warn: #f8e6a0; --warn-soft: #3a2d12;
    --bad: #fd9891; --bad-soft: #42241f;
    --c0: #579dff; --c1: #ff9a5a; --c2: #5fd6a8; --c3: #b8a4f0; --c4: #e5c35a; --c5: #f38aa9; --c6: #7fb6f5; --c7: #9fadbc;
    --shadow: 0 1px 1px rgba(0,0,0,.4), 0 0 1px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1d2125; --surface: #22272b; --surface-2: #2c333a; --text: #e6edfa; --muted: #9fadbc;
  --border: #38414a; --primary: #579dff; --primary-ink: #0d1117; --primary-soft: #1c2b41;
  --good: #7ee2b8; --good-soft: #1c3329; --warn: #f8e6a0; --warn-soft: #3a2d12;
  --bad: #fd9891; --bad-soft: #42241f;
  --c0: #579dff; --c1: #ff9a5a; --c2: #5fd6a8; --c3: #b8a4f0; --c4: #e5c35a; --c5: #f38aa9; --c6: #7fb6f5; --c7: #9fadbc;
  --shadow: 0 1px 1px rgba(0,0,0,.4), 0 0 1px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: 76px;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--primary-ink); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 70%, transparent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { font-size: 1.7rem; }
.brand h1 { font-size: 1.15rem; }
.brand p { color: var(--muted); font-size: .85rem; display: none; }
.top-actions { display: flex; gap: 8px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Language toggle (segmented control) */
.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.lang-toggle button { border: 0; background: transparent; padding: 5px 10px; font-size: .8rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.lang-toggle button:hover { background: var(--surface-2); }
.lang-toggle button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }

/*
 * Stepper: one continuous track behind all nodes, with a progress fill that animates between steps.
 * done = check, active = dot with halo, upcoming = outlined number.
 * Only the node and the step text are interactive (hover / pointer); the wrapper is not.
 */
.stepper-nav { padding-bottom: 6px; }
.stepper {
  --node: 36px; --pad: 10px; --track-h: 3px;
  --progress: 0;
  position: relative; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stepper::before, .stepper::after {
  content: ""; position: absolute; left: 12.5%; height: var(--track-h); border-radius: var(--track-h);
  top: calc(var(--pad) + var(--node) / 2 - var(--track-h) / 2);
}
.stepper::before { right: 12.5%; background: var(--border); }
.stepper::after {
  width: calc(75% * var(--progress)); background: var(--primary);
  transition: width .55s cubic-bezier(.4, 0, .2, 1);
}
.st { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: var(--pad); padding-bottom: 6px; }
.st-node {
  position: relative; z-index: 1; width: var(--node); height: var(--node); padding: 0; display: grid; place-items: center;
  border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--muted);
  font-weight: 700; font-size: .9rem; cursor: pointer;
  transition: background-color .3s, border-color .3s, color .3s, box-shadow .3s, transform .2s;
}
.st-node:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.08); }
.st.done .st-node, .st.active .st-node { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.st.active .st-node { box-shadow: 0 0 0 4px var(--primary-soft); animation: st-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
.st.done .st-node:hover, .st.active .st-node:hover { color: var(--primary-ink); filter: brightness(1.1); }
.st-node > * { grid-area: 1 / 1; transition: opacity .25s, transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.st-node .n { opacity: 1; transform: scale(1); }
.st-node .st-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--primary-ink); opacity: 0; transform: scale(.2); }
.st-node .ico { width: 16px; height: 16px; stroke-width: 2.5; vertical-align: 0; opacity: 0; transform: scale(.2) rotate(-30deg); }
.st.active .n, .st.done .n { opacity: 0; transform: scale(.2); }
.st.active .st-dot { opacity: 1; transform: scale(1); }
.st.done .st-node .ico { opacity: 1; transform: none; }
.st-text {
  display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 100%; padding: 2px 8px; border: 0; border-radius: 8px;
  background: transparent; text-align: center; cursor: pointer; color: inherit;
}
.st-title { font-weight: 700; font-size: .92rem; color: var(--text); transition: color .3s; }
.st-desc { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.st.todo .st-title { color: var(--muted); }
.st-text:hover .st-title { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
@keyframes st-pop { 0% { transform: scale(.85); } 100% { transform: scale(1); } }
@media (max-width: 640px) {
  .stepper { --node: 32px; --pad: 8px; }
  .st { gap: 6px; padding-bottom: 4px; }
  .st-text { padding: 2px 2px; }
  .st-title { font-size: .76rem; }
  .st-desc { display: none; }
  .btn-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .stepper::after, .st-node, .st-node > *, .st-title { transition: none; }
  .st.active .st-node { animation: none; }
}

/* Layout */
.layout { display: grid; gap: 16px; padding-top: 16px; padding-bottom: 24px; grid-template-columns: minmax(0, 860px); justify-content: center; }
.side-col { display: none; }
@media (min-width: 980px) {
  .brand p { display: block; }
  .layout.layout-results { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; justify-content: stretch; }
  .layout-results .side-col { display: block; position: sticky; top: calc(var(--header-h, 160px) + 16px); }
  .layout-results .own-inline { display: none; }
}

/* Cards & form */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card, .card + #resultBody, .card-group + .card { margin-top: 14px; }
/* Cards that form one unit: square the facing corners and share a single border (no gap) */
.card-group > .card:first-child { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.card-group > .card + .card { margin-top: -1px; border-top-left-radius: 0; border-top-right-radius: 0; }
.card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card > header p { color: var(--muted); font-size: .88rem; }
.sub { color: var(--muted); font-size: .88rem; }
.grid { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-row + .field-row { margin-top: 16px; }
.field-row > h4 { margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
/* Fields in the same grid row share label / control / hint rows, so a two-line label does not push the others out of line */
@supports (grid-template-rows: subgrid) {
  .field { display: grid; grid-template-rows: subgrid; grid-row: span 3; align-content: start; }
}
.field .ctl { min-width: 0; }
.field .hint:empty { display: none; }
.field .lbl { font-size: .85rem; font-weight: 600; }
.field .lbl .tip { margin-left: 6px; vertical-align: middle; }
.field .lbl .opt { font-size: .75rem; font-weight: 400; color: var(--muted); }
.field .hint { font-size: .78rem; color: var(--muted); }
.inp { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.inp:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.inp input, .inp select { border: 0; background: transparent; padding: 9px 10px; min-width: 0; flex: 1; outline: none; }
.inp .pre, .inp .suf { display: grid; place-items: center; padding: 0 10px; background: var(--surface-2); color: var(--muted); font-size: .85rem; white-space: nowrap; }
.inp .stp { appearance: none; border: 0; background: var(--surface-2); color: var(--muted); width: 36px; font: inherit; font-size: 1.15rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; transition: background .12s, color .12s; }
.inp .stp.minus { border-right: 1px solid var(--border); }
.inp .stp.plus { border-left: 1px solid var(--border); }
.inp .stp:hover { background: color-mix(in srgb, var(--primary) 14%, var(--surface-2)); color: var(--primary); }
.inp .stp:active { background: color-mix(in srgb, var(--primary) 26%, var(--surface-2)); }
.inp .stp:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
@media (pointer: coarse) { .inp .stp { width: 44px; } }
.inp.err, .inp.invalid { border-color: var(--bad); }
.choices.invalid { outline: 1.5px solid var(--bad); outline-offset: 3px; border-radius: 12px; }
select { cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: .9rem; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--primary); }
.tip {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); font-size: .7rem; font-weight: 700; line-height: 1; cursor: help; padding: 0; position: relative; flex-shrink: 0;
}
.tip:hover::after, .tip:focus::after {
  content: attr(data-tip); position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 8px); transform: translateX(-30%);
  width: 250px; max-width: 70vw; background: var(--text); color: var(--bg); padding: 9px 11px; border-radius: 9px;
  font-size: .78rem; font-weight: 400; line-height: 1.4; text-align: left; box-shadow: var(--shadow);
}

/* Choice cards */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choice {
  display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface); cursor: pointer;
}
.choice:hover { border-color: var(--primary); }
.choice[aria-pressed="true"], .choice.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice .t { font-weight: 600; }
.choice .h { color: var(--muted); font-size: .8rem; }
.choice .big { font-size: 1.6rem; line-height: 1; }
.choices.big { grid-template-columns: repeat(2, 1fr); }

/* Buttons */
.btn { border: 1px solid var(--border); background: var(--surface); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); background: var(--primary); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.icon { padding: 6px 10px; }
.btn.danger { color: var(--bad); }
.nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.nav .grow { flex: 1; }

/* Details */
details.sec { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-top: 12px; }
details.sec > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary .sec-tick { width: 18px; height: 18px; margin: 0 2px 0 0; accent-color: var(--primary); cursor: pointer; flex: none; }
details.sec > summary::after { content: "＋"; color: var(--muted); margin-left: auto; }
details.sec[open] > summary::after { content: "－"; }
details.sec > .body { padding: 2px 14px 14px; }
.r .r-note { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
.info-box { margin-top: 12px; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2); font-size: .85rem; }
.info-box > summary { cursor: pointer; padding: 9px 12px; font-weight: 600; color: var(--primary); }
.info-box ul { margin: 0; padding: 0 14px 12px 30px; display: grid; gap: 6px; color: var(--muted); }
.info-box li b { color: var(--text); }
.sec-note { color: var(--muted); font-size: .82rem; margin-bottom: 10px; }
.maint-list { display: grid; gap: 10px; }
.maint-row { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface); }
.maint-head { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 10px; }
.maint-head .field { flex: 1; min-width: 0; }
.maint-del { align-self: flex-end; display: inline-flex; align-items: center; gap: 6px; min-height: 41px; min-width: 44px; justify-content: center; padding: 0 12px; background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.maint-del:hover { background: var(--bad-soft); border-color: var(--bad); }
.maint-del .ico { margin: 0; }
.maint-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Notices & pills */
.note { padding: 10px 12px; border-radius: 10px; font-size: .86rem; background: var(--surface-2); color: var(--text); margin-top: 10px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.good { background: var(--good-soft); color: var(--good); }
.note.info { background: var(--primary-soft); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill.safe, .pill.ok { background: var(--good-soft); color: var(--good); }
.pill.warning { background: var(--warn-soft); color: var(--warn); }
.pill.risky, .pill.no { background: var(--bad-soft); color: var(--bad); }

/* KPIs */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.kpi .k { font-size: .78rem; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.kpi .v { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .s { font-size: .76rem; color: var(--muted); }
.kpi.hero { background: var(--primary); color: var(--primary-ink); }
.kpi.hero .k, .kpi.hero .s { color: inherit; opacity: .85; }
.kpi.hero .v { font-size: 1.5rem; }
/* Step 2 result panels: one hero figure next to a list of the supporting amounts */
.res { display: grid; grid-template-columns: minmax(230px, 2fr) 3fr; gap: 14px; }
.res-hero { background: var(--primary); color: var(--primary-ink); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.res-hero .k { font-size: .82rem; opacity: .88; display: flex; gap: 6px; align-items: center; }
.res-hero .v { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.15; }
.res-hero .s { font-size: .8rem; opacity: .88; }
.res-list { background: var(--surface-2); border-radius: 14px; padding: 2px 16px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.res-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; }
.res-row + .res-row { border-top: 1px solid var(--border); }
.res-row .l { font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.res-row small { display: block; color: var(--muted); font-size: .75rem; margin-top: 1px; }
.res-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-row.em b { color: var(--primary); }
@media (max-width: 640px) { .res { grid-template-columns: 1fr; } }
.field input[type=range] { width: 100%; margin: 4px 0 0; accent-color: var(--primary); cursor: pointer; }
.card.picked { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

/* Tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { background: var(--surface-2); position: sticky; top: 0; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; background: var(--surface-2); }
/* Cost table with years as columns: the component names stay visible while scrolling sideways */
table.t-rows td:first-child, table.t-rows th:first-child { position: sticky; left: 0; background: var(--surface); }
table.t-rows thead th:first-child, table.t-rows tfoot td:first-child { background: var(--surface-2); }
table.t-rows .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
table.t-rows tfoot tr.sub-row td { font-weight: 500; color: var(--muted); border-top: 0; }
.chart .bar-total { font-size: 10.5px; fill: var(--muted); font-weight: 600; }
.tbl-scroll { max-height: 360px; overflow: auto; }
.rows-kv { display: grid; gap: 6px; }
.rows-kv .r { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.rows-kv .r:last-child { border-bottom: 0; }
.rows-kv .r b { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rows-kv .r.total { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; margin-top: 4px; padding-top: 8px; }
.rows-kv .r.sub-r { color: var(--muted); padding-left: 12px; font-size: .84rem; }

/* Charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .ct-small { fill: var(--muted); font-size: 11px; }
.chart .ct-big { fill: var(--text); font-size: 15px; font-weight: 700; }
.donut-wrap { display: grid; gap: 14px; align-items: center; grid-template-columns: minmax(0, 190px) minmax(0, 1fr); }
@media (max-width: 560px) { .donut-wrap { grid-template-columns: 1fr; } .donut-wrap .chart { max-width: 220px; margin: 0 auto; } }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 40px; gap: 8px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.legend .lg-v { font-variant-numeric: tabular-nums; font-weight: 600; }
.legend .lg-p { color: var(--muted); text-align: right; }
.legend.inline { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.legend.inline li { display: flex; gap: 6px; }

/* Summary panel */
.side-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.side-actions .btn { flex: 1 1 auto; justify-content: center; white-space: nowrap; }
.actions-inline { margin-top: 14px; }
@media (min-width: 980px) { .actions-inline { display: none; } }

/* Mobile menu: burger button in the header and a collapsible sidebar (drawer) */
.menu-btn, .drawer, .drawer-backdrop { display: none; }
@media (max-width: 640px) {
  .top-actions { display: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .menu-btn .ico { width: 22px; height: 22px; }
  .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8, 12, 24, .55); opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .25s; }
  .drawer {
    display: flex; flex-direction: column; position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(320px, 86vw);
    background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow);
    transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility 0s .25s;
  }
  .menu-open { overflow: hidden; }
  .menu-open .drawer-backdrop { opacity: 1; visibility: visible; transition: opacity .2s; }
  .menu-open .drawer { transform: none; visibility: visible; transition: transform .25s ease; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .drawer-body { padding: 16px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
  .drawer-sec { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
  .drawer-sec:first-child { padding-top: 0; border-top: 0; }
  .drawer .btn { justify-content: center; }
  .drawer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
}
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-backdrop { transition: none !important; } }

/* Checklist */
.hc { display: grid; gap: 8px; }
.hc .item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.hc .ic { font-size: 1.05rem; line-height: 1.4; }
.hc .tt { font-weight: 600; font-size: .9rem; }
.hc .dd { color: var(--muted); font-size: .82rem; }
.hc .am { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .88rem; text-align: right; }

.afford-income { grid-template-columns: minmax(210px, 320px); }

/* Meter */
.meter { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); margin: 4px 0 6px; overflow: visible; }
.meter span { display: block; height: 100%; border-radius: 999px; }
.meter span.good { background: var(--good); }
.meter span.warn { background: var(--warn); }
.meter span.bad { background: var(--bad); }
.meter i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .55; }

/* Dialog */
dialog.dlg { border: 1px solid var(--border); border-radius: 16px; padding: 0; width: min(720px, 94vw); max-height: 88vh; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog.dlg::backdrop { background: rgba(8, 12, 24, .55); }
#dlgBody { padding: 18px; overflow: auto; max-height: 86vh; }
.scn { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.scn .nm { flex: 1; min-width: 140px; }
.scn .nm small { display: block; color: var(--muted); }

.info-btn { width: 18px; height: 18px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: .7rem; font-weight: 700; font-style: italic; font-family: Georgia, serif; line-height: 1; padding: 0; cursor: pointer; vertical-align: middle; transition: background .12s, color .12s, border-color .12s; }
.info-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.info-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 10px; }
table.t-info td, table.t-info th { vertical-align: top; }
table.t-info .num { text-align: right; white-space: nowrap; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; font-size: .88rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.foot { color: var(--muted); font-size: .8rem; padding-bottom: 28px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs .tab { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .85rem; }
.tabs .tab[aria-selected="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.cmp { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cmp .col { border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.cmp .col.win { border-color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.cmp .col h4 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* Print */
@media print {
  body { background: #fff; color: #000; padding: 0; font-size: 12px; }
  .drawer, .drawer-backdrop, .menu-btn { display: none !important; }
  .top, .nav, .toast, .no-print, .side-col, .skip, .foot .no-print { display: none !important; }
  .layout { display: block; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; border-color: #bbb; }
  .tbl-scroll { max-height: none; overflow: visible; }
  .print-head { display: block !important; }
  details.sec > .body { display: block; }
}
.print-head { display: none; margin-bottom: 10px; }

/* Lucide icons (see js/icons.js): outline, stroke 2, currentColor */
.ico {
  width: 1.1em; height: 1.1em; display: inline-block; flex-shrink: 0; vertical-align: -0.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.btn .ico, .tabs .ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
.choice .big { color: var(--primary); }
.choice .big .ico { width: 28px; height: 28px; stroke-width: 1.75; }
.brand .logo { color: var(--primary); display: inline-flex; }
.brand .logo .ico { width: 26px; height: 26px; }
.top-actions .icon .ico { width: 18px; height: 18px; vertical-align: -4px; }
.hc .ic { color: var(--muted); }
.hc .ic .ico { width: 18px; height: 18px; vertical-align: -4px; }
details.sec > summary .ico { width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; color: var(--muted); }
.cmp .col h4 .ico { width: 16px; height: 16px; vertical-align: -3px; }
.pill .ico { width: 12px; height: 12px; vertical-align: -2px; }
