/* ============================================================
     Midnight ledger — a single, committed dark identity.
     Ground: deep indigo. Boldness spent in one place: the money
     numbers, which carry a violet→coral gradient. Everything else
     stays quiet so those numbers land.
     ============================================================ */
  :root {
    --bg:         #0A0D1C;
    --surface:    #161B33;
    --surface-2:  #1F2547;
    --surface-3:  #2A3160;
    --ink:        #EDEFFA;
    --ink-muted:  #99A1C9;
    --ink-faint:  #6E769F;
    --rule:       #272E55;
    --rule-soft:  #1E2444;

    --accent:     #7B61FF;
    --accent-hi:  #9B85FF;
    --accent-2:   #FF5C8A;
    --accent-3:   #2DE0A5;
    --accent-ink: #FFFFFF;
    --accent-wash:rgba(123,97,255,.14);
    --glow:       rgba(123,97,255,.45);

    --st-good:     #28c76f;
    --st-warning:  #ffc14d;
    --st-serious:  #ff9a62;
    --st-critical: #ff5c6c;

    /* categorical series — validated against this surface, fixed order */
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --grid: #232A4E;

    --f-display: system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
    --f-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --f-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;

    --r-sm: 10px; --r-md: 14px; --r-lg: 22px;
    --lift: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 40px -24px rgba(0,0,0,.9);
    --money: linear-gradient(96deg, #A78BFF 0%, #FF7AA2 62%, #FFB27A 100%);
  }

  * { box-sizing: border-box; }

  body {
    background: var(--bg);
    background-image:
      radial-gradient(900px 460px at 12% -8%,  rgba(123,97,255,.20), transparent 62%),
      radial-gradient(760px 420px at 96% 2%,   rgba(255,92,138,.13), transparent 60%),
      radial-gradient(700px 500px at 50% 108%, rgba(45,224,165,.07), transparent 65%);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
  }

  .app { max-width: 560px; margin: 0 auto; padding: 20px 15px 44px; }
  h1, h2, h3 { text-wrap: balance; }

  .money-text {
    background: var(--money);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }

  /* ---------- masthead + tabs ---------- */
  .masthead {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding-bottom: 15px;
    border-bottom: 1px solid var(--rule);
  }
  .wordmark {
    font-family: var(--f-display); font-weight: 700; font-size: 17px;
    letter-spacing: -.02em; margin: 0; line-height: 1.2; min-width: 0;
  }
  @media (min-width: 430px) { .wordmark { font-size: 19px; } }
  .sync {
    font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em;
    text-transform: uppercase; color: var(--ink-faint);
    display: flex; align-items: center; gap: 7px; white-space: nowrap;
    background: var(--surface); border: 1px solid var(--rule);
    padding: 5px 10px; border-radius: 999px;
  }
  .sync .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); flex: none; }
  .sync[data-state="live"]   .dot { background: var(--accent-3); box-shadow: 0 0 8px var(--accent-3); }
  .sync[data-state="saving"] .dot { background: var(--st-warning); box-shadow: 0 0 8px var(--st-warning); }
  .sync[data-state="off"]    .dot { background: var(--st-critical); box-shadow: 0 0 8px var(--st-critical); }

  .tabs {
    display: flex; gap: 5px; margin: 16px 0 2px;
    background: var(--surface); padding: 5px;
    border: 1px solid var(--rule); border-radius: var(--r-md);
  }
  .tab {
    appearance: none; border: 0; background: none; flex: 1;
    font-family: var(--f-body); font-size: 12.5px; font-weight: 600; letter-spacing: 0;
    color: var(--ink-muted); padding: 9px 5px; border-radius: var(--r-sm); cursor: pointer;
    transition: color .18s ease, background .18s ease;
    line-height: 1.2; white-space: normal; min-width: 0;
    display: flex; align-items: center; justify-content: center; text-align: center;
  }
  .tab[aria-selected="true"] {
    background: linear-gradient(180deg, var(--accent-hi), var(--accent));
    color: var(--accent-ink);
    box-shadow: 0 6px 18px -8px var(--glow);
  }

  /* ---------- surfaces ---------- */
  .card {
    background:
      linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.008)),
      var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--lift);
  }
  .stack { display: flex; flex-direction: column; gap: 16px; }
  .stack-sm { display: flex; flex-direction: column; gap: 10px; }

  .eyebrow {
    font-size: 10.5px; font-weight: 700; letter-spacing: .16em;
    text-transform: uppercase; color: var(--ink-faint); margin: 0;
  }
  .lede { font-size: 14.5px; color: var(--ink-muted); margin: 0; }
  .hint { font-size: 12.5px; color: var(--ink-faint); margin: 0; line-height: 1.55; }

  /* ---------- buttons ---------- */
  .btn {
    appearance: none; border: 1px solid transparent; cursor: pointer;
    font-family: var(--f-body); font-size: 15px; font-weight: 600; letter-spacing: .005em;
    padding: 14px 20px; border-radius: var(--r-md);
    background: linear-gradient(180deg, var(--accent-hi), var(--accent));
    color: var(--accent-ink);
    box-shadow: 0 10px 26px -12px var(--glow), 0 1px 0 rgba(255,255,255,.22) inset;
    transition: transform .12s ease, box-shadow .18s ease;
  }
  .btn:hover:not(:disabled) { box-shadow: 0 14px 32px -12px var(--glow), 0 1px 0 rgba(255,255,255,.28) inset; }
  .btn:active:not(:disabled) { transform: translateY(1px); }
  .btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
  .btn.ghost {
    background: var(--surface-2); color: var(--ink);
    border-color: var(--rule); box-shadow: none;
  }
  .btn.ghost:hover:not(:disabled) { border-color: var(--accent); box-shadow: none; }
  .btn.quiet { background: none; color: var(--ink-muted); border-color: transparent; padding: 11px 4px; font-weight: 500; box-shadow: none; }
  .btn.wide { width: 100%; }
  .btnrow { display: flex; gap: 10px; align-items: center; }
  .btnrow .btn { flex: 1; min-width: 0; }

  /* ---------- mode choice ---------- */
  .choice { display: flex; flex-direction: column; gap: 13px; }
  .choicecard {
    position: relative; text-align: left; cursor: pointer; width: 100%;
    background:
      linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01)),
      var(--surface);
    border: 1px solid var(--rule); border-radius: var(--r-lg);
    padding: 22px; box-shadow: var(--lift);
    display: flex; flex-direction: column; gap: 8px;
    font-family: var(--f-body); color: var(--ink);
    transition: border-color .18s ease, transform .12s ease;
    overflow: hidden;
  }
  .choicecard::after {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
    background: var(--money); opacity: .75;
  }
  .choicecard:hover { border-color: var(--accent); transform: translateY(-2px); }
  .choicecard .t { font-family: var(--f-display); font-size: 21px; font-weight: 700; letter-spacing: -.015em; }
  .choicecard .d { font-size: 14px; color: var(--ink-muted); line-height: 1.55; }
  .choicecard .m { font-size: 11px; color: var(--ink-faint); font-family: var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }

  /* ---------- wizard ---------- */
  .rail { display: flex; gap: 4px; margin: 18px 0 20px; }
  .rail span { height: 3px; flex: 1; border-radius: 2px; background: var(--rule); transition: background .25s ease; }
  .rail span.on { background: linear-gradient(90deg, var(--accent), var(--accent-hi)); box-shadow: 0 0 10px -2px var(--glow); }
  .qnum { font-family: var(--f-mono); font-size: 11px; color: var(--accent-hi); letter-spacing: .12em; text-transform: uppercase; }
  .qtitle {
    font-family: var(--f-display); font-size: 27px; font-weight: 700;
    margin: 8px 0 0; line-height: 1.15; letter-spacing: -.025em;
  }

  /* ---------- number field ---------- */
  .numfield { display: flex; flex-direction: column; gap: 11px; }
  .numtop { display: flex; align-items: center; gap: 10px; }
  .numbox {
    display: flex; align-items: center; gap: 9px;
    flex: 1 1 auto; min-width: 0;
    background: var(--surface-2); border: 1px solid var(--rule);
    border-radius: var(--r-md); padding: 0 14px; min-height: 54px;
    transition: border-color .16s ease, box-shadow .16s ease;
  }
  .numbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
  .numbox .pre { font-family: var(--f-mono); font-size: 16px; color: var(--ink-faint); flex: none; }
  .numbox input {
    flex: 1 1 auto; width: 100%; min-width: 0; border: 0; background: none; color: var(--ink);
    font-family: var(--f-mono); font-size: 20px; font-variant-numeric: tabular-nums;
    padding: 0; letter-spacing: -.01em;
  }
  .numbox input:focus { outline: none; }
  .numbox input::placeholder { color: var(--ink-faint); }
  .numbox .suf { font-size: 12.5px; color: var(--ink-faint); flex: none; }

  input[type="range"] {
    appearance: none; -webkit-appearance: none; width: 100%; height: 28px;
    background: none; cursor: pointer; margin: 0;
  }
  input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 4px; background: var(--surface-3); }
  input[type="range"]::-moz-range-track { height: 6px; border-radius: 4px; background: var(--surface-3); }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(180deg, var(--accent-hi), var(--accent));
    border: 3px solid var(--surface); margin-top: -10px;
    box-shadow: 0 0 0 1px var(--rule), 0 4px 14px -2px var(--glow);
  }
  input[type="range"]::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(180deg, var(--accent-hi), var(--accent));
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 1px var(--rule), 0 4px 14px -2px var(--glow);
  }
  .limits {
    display: flex; justify-content: space-between;
    font-family: var(--f-mono); font-size: 11px; color: var(--ink-faint);
    font-variant-numeric: tabular-nums; letter-spacing: .04em;
  }

  .readout {
    position: relative; background: var(--accent-wash);
    border: 1px solid rgba(123,97,255,.28); border-radius: var(--r-md);
    padding: 15px 17px; display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap;
  }
  .readout .big {
    font-family: var(--f-display); font-size: 30px; font-weight: 700;
    font-variant-numeric: tabular-nums; letter-spacing: -.03em;
    background: var(--money); -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
  }
  .readout .lbl { font-size: 13.5px; color: var(--ink-muted); flex: 1 1 140px; }

  .exclude {
    background: var(--surface-2); border: 1px solid var(--rule);
    border-radius: var(--r-md); padding: 15px 16px;
    font-size: 13px; color: var(--ink-muted); line-height: 1.6;
  }
  .exclude strong { color: var(--ink); font-weight: 700; }
  .exclude b { color: var(--accent-hi); font-weight: 600; }
  .exclude ul { margin: 9px 0 0; padding-left: 18px; }
  .exclude li { margin-bottom: 5px; }

  /* ---------- pickers ---------- */
  .radios { display: flex; gap: 10px; }
  .radios button {
    flex: 1; min-width: 0; appearance: none; cursor: pointer; font-family: var(--f-body);
    font-size: 14.5px; font-weight: 600; padding: 15px 12px; border-radius: var(--r-md);
    background: var(--surface-2); border: 1px solid var(--rule); color: var(--ink-muted);
    display: flex; align-items: center; justify-content: center; gap: 9px;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
  }
  .radios button .mark {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--surface-3); flex: none;
  }
  .radios button[aria-pressed="true"] {
    border-color: var(--accent); background: var(--accent-wash); color: var(--ink);
  }
  .radios button[aria-pressed="true"] .mark {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 3px var(--surface), 0 0 10px -1px var(--glow);
  }

  .chips { display: flex; flex-wrap: wrap; gap: 7px; }
  .chip {
    appearance: none; cursor: pointer; font-family: var(--f-body); font-size: 13px;
    padding: 8px 13px; border-radius: 999px; background: var(--surface-2);
    border: 1px solid var(--rule); color: var(--ink-muted);
    transition: border-color .14s ease, color .14s ease, background .14s ease;
  }
  .chip:hover { color: var(--ink); border-color: var(--surface-3); }
  .chip[aria-pressed="true"] {
    border-color: var(--accent); background: var(--accent-wash);
    color: var(--ink); font-weight: 600;
  }

  /* ---------- lists ---------- */
  .items {
    display: flex; flex-direction: column; gap: 0;
    border: 1px solid var(--rule); border-radius: var(--r-md);
    overflow: hidden; background: var(--surface-2);
  }
  .item {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 8px 13px 15px; border-bottom: 1px solid var(--rule-soft);
  }
  .item:last-child { border-bottom: 0; }
  .item .swatch {
    width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--ink-faint));
    flex: none; box-shadow: 0 0 9px -1px var(--c, transparent);
  }
  .item .txt { flex: 1; min-width: 0; }
  .item .txt .k { font-size: 14.5px; display: block; overflow-wrap: anywhere; }
  .item .txt .c { font-size: 11.5px; color: var(--ink-faint); letter-spacing: .02em; }
  .item .amt {
    font-family: var(--f-mono); font-size: 14px; font-variant-numeric: tabular-nums;
    white-space: nowrap; letter-spacing: -.02em;
  }
  .tickbox {
    appearance: none; width: 22px; height: 22px; flex: none; cursor: pointer;
    border: 2px solid var(--surface-3); border-radius: 7px; background: var(--surface);
    color: var(--accent-ink); font-size: 13px; line-height: 1; display: grid; place-items: center;
    padding: 0; font-weight: 700;
  }
  .tickbox:hover { border-color: var(--accent); }
  .tickbox.on {
    background: linear-gradient(180deg, var(--accent-hi), var(--accent));
    border-color: var(--accent); box-shadow: 0 0 12px -3px var(--glow);
  }
  .item.ticked { opacity: .58; }
  .item.ticked .amt { text-decoration: line-through; text-decoration-color: var(--ink-faint); }

  .payerlbl {
    font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink-faint); align-self: center; padding-right: 3px; flex: none; white-space: nowrap;
  }

  .coach {
    display: flex; align-items: flex-start; gap: 10px;
    background: linear-gradient(180deg, rgba(123,97,255,.16), rgba(123,97,255,.06));
    border: 1px solid rgba(123,97,255,.35); border-radius: var(--r-lg);
    padding: 16px 12px 16px 18px;
  }
  .coach .bullets { flex: 1; min-width: 0; gap: 12px; }
  .coach .bullets li { font-size: 13.5px; color: var(--ink); }

  .item.editable .txt { cursor: pointer; }
  .item.editable:hover { background: var(--surface-3); }
  .chev {
    appearance: none; border: 0; background: none; color: var(--ink-faint);
    font-size: 19px; line-height: 1; width: 20px; height: 32px;
    cursor: pointer; flex: none; padding: 0;
  }
  .chev:hover { color: var(--accent-hi); }

  .kill {
    appearance: none; border: 0; background: none; color: var(--ink-faint);
    font-size: 19px; line-height: 1; width: 32px; height: 32px;
    border-radius: var(--r-sm); cursor: pointer; flex: none;
  }
  .kill:hover { color: var(--st-critical); background: var(--surface-3); }

  .tally {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    font-size: 12.5px; color: var(--ink-muted); padding: 2px;
  }
  .tally b {
    font-family: var(--f-mono); font-variant-numeric: tabular-nums;
    font-weight: 500; color: var(--ink);
  }
  .tally.off b { color: var(--st-warning); }

  .emptybox {
    border: 1px dashed var(--rule); border-radius: var(--r-md);
    padding: 24px 14px; text-align: center; color: var(--ink-faint); font-size: 13.5px;
  }

  /* ---------- sheet ---------- */
  .scrim {
    position: fixed; inset: 0; background: rgba(4,6,14,.72);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    display: flex; align-items: flex-end; justify-content: center; z-index: 40;
  }
  .sheet {
    background: var(--surface); width: 100%; max-width: 560px;
    border: 1px solid var(--rule); border-bottom: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 20px 16px 26px;
    max-height: 88vh; overflow-y: auto;
    box-shadow: 0 -20px 60px -20px rgba(0,0,0,.9);
    display: flex; flex-direction: column; gap: 15px;
  }
  .sheethead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .sheethead h3 { margin: 0; font-family: var(--f-display); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }

  .textin {
    width: 100%; background: var(--surface-2); border: 1px solid var(--rule);
    border-radius: var(--r-md); padding: 14px; color: var(--ink);
    font-family: var(--f-body); font-size: 15px;
  }
  .textin::placeholder { color: var(--ink-faint); }
  .textin:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
  .textin.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
  .fieldlbl {
    font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--ink-faint); display: block; margin-bottom: 7px;
  }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

  /* ---------- results ---------- */
  .hero { display: flex; flex-direction: column; gap: 6px; }
  .hero .num {
    font-family: var(--f-display); font-weight: 700;
    font-size: clamp(38px, 12.5vw, 52px); line-height: 1;
    letter-spacing: -.045em; font-variant-numeric: tabular-nums;
    background: var(--money); -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
    padding-bottom: 4px;
  }
  .hero .cap { font-size: 13.5px; color: var(--ink-muted); line-height: 1.6; }

  .verdict {
    display: flex; gap: 13px; padding: 16px 17px; border-radius: var(--r-md);
    background: var(--surface-2); border: 1px solid var(--rule);
    border-left: 3px solid var(--rule);
  }
  .verdict[data-s="good"]     { border-left-color: var(--st-good); }
  .verdict[data-s="warning"]  { border-left-color: var(--st-warning); }
  .verdict[data-s="serious"]  { border-left-color: var(--st-serious); }
  .verdict[data-s="critical"] { border-left-color: var(--st-critical); }
  .verdict .icon { flex: none; width: 20px; height: 20px; margin-top: 2px; }
  .verdict .body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .verdict .head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
  .verdict .head b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
  .verdict .tag {
    font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 5px; background: var(--surface-3); color: var(--ink-muted);
  }
  .fixlink {
    appearance: none; border: 0; background: none; cursor: pointer;
    font-family: var(--f-body); font-size: 12px; font-weight: 600;
    color: var(--accent-hi); padding: 2px 0; text-decoration: underline;
    text-underline-offset: 3px; text-decoration-thickness: 1px;
  }
  .fixlink:hover { color: var(--ink); }

  .verdict p { margin: 0; font-size: 13.5px; color: var(--ink-muted); line-height: 1.62; }
  .verdict p b { color: var(--ink); font-weight: 700; }

  .metrics {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
    background: var(--rule); border: 1px solid var(--rule);
    border-radius: var(--r-md); overflow: hidden;
  }
  .metric { background: var(--surface-2); padding: 14px 15px; display: flex; flex-direction: column; gap: 3px; }
  .metric dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
  .metric dd {
    margin: 0; font-family: var(--f-mono); font-size: 16px;
    font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  }

  .legend { display: flex; flex-wrap: wrap; gap: 6px 15px; margin-top: 14px; }
  .legend .k { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-muted); }
  .legend .k i {
    width: 10px; height: 10px; border-radius: 3px; background: var(--c);
    display: block; flex: none; box-shadow: 0 0 8px -1px var(--c);
  }
  .legend .k b { font-family: var(--f-mono); font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

  .bullets { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 15px; }
  .bullets li { display: flex; gap: 12px; font-size: 14px; color: var(--ink-muted); line-height: 1.62; }
  .bullets li::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
    background: var(--t, var(--ink-faint)); margin-top: 8px;
    box-shadow: 0 0 9px -1px var(--t, transparent);
  }
  .bullets li b { color: var(--ink); font-weight: 700; }

  figure { margin: 0; }
  figcaption { font-size: 12.5px; color: var(--ink-faint); margin-top: 10px; line-height: 1.55; }
  .chartwrap { overflow-x: auto; }
  svg { display: block; max-width: 100%; height: auto; }
  .tip {
    position: fixed; z-index: 60; pointer-events: none;
    background: var(--surface-3); color: var(--ink); font-size: 11.5px;
    padding: 7px 10px; border-radius: 8px; font-family: var(--f-mono);
    white-space: nowrap; border: 1px solid var(--rule);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,.9);
  }

  table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  table.data th, table.data td { text-align: left; padding: 8px; border-bottom: 1px solid var(--rule-soft); }
  table.data th { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
  table.data td { color: var(--ink-muted); }
  table.data td.n { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; color: var(--ink); }

  details.assump summary {
    cursor: pointer; font-size: 12.5px; color: var(--accent-hi);
    padding: 6px 0; list-style: none; font-weight: 600;
  }
  details.assump summary::-webkit-details-marker { display: none; }
  details.assump summary::before { content: "▸ "; }
  details.assump[open] summary::before { content: "▾ "; }
  details.assump .grid2 { margin-top: 12px; }

  /* ---------- ledger ---------- */
  .ledgerhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
  .ledgerhead h2 {
    margin: 0; font-family: var(--f-body); font-size: 11px; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint);
  }
  .stepper { display: flex; gap: 7px; }
  .step {
    appearance: none; border: 1px solid var(--rule); background: var(--surface-2);
    color: var(--ink-muted); width: 32px; height: 32px; border-radius: var(--r-sm);
    font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  }
  .step:hover:not(:disabled) { color: var(--ink); border-color: var(--accent); }
  .step:disabled { opacity: .3; cursor: default; }

  .total {
    font-family: var(--f-display); font-weight: 700;
    font-size: clamp(38px, 12.5vw, 50px); line-height: 1;
    letter-spacing: -.045em; font-variant-numeric: tabular-nums; display: block;
    background: var(--money); -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
    padding-bottom: 3px;
  }
  .total .cur { font-size: .5em; margin-right: .1em; }
  .subtotals { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; gap: 24px; flex-wrap: wrap; }
  .sub { display: flex; flex-direction: column; gap: 3px; }
  .sub dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
  .sub dd { margin: 0; font-family: var(--f-mono); font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

  /* ---------- entry form ---------- */
  form.entry { display: flex; flex-direction: column; gap: 11px; }
  .amountrow { display: flex; gap: 9px; width: 100%; align-items: stretch; }
  .amountrow .numbox { flex: 1 1 auto; min-width: 0; }
  .amountrow .btn { flex: 0 0 auto; padding: 14px 18px; }

  .cats { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  .cats::-webkit-scrollbar { display: none; }
  .cat {
    appearance: none; flex: none; border: 1px solid var(--rule); background: var(--surface-2);
    color: var(--ink-muted); font-family: var(--f-body); font-size: 13px;
    padding: 8px 13px; border-radius: 999px; cursor: pointer;
    display: flex; align-items: center; gap: 7px; white-space: nowrap;
  }
  .cat .swatch {
    width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-faint));
    flex: none; box-shadow: 0 0 8px -1px var(--c, transparent);
  }
  .cat[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); font-weight: 600; }

  .dayhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 18px 3px 8px; }
  .dayhead .d { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
  .dayhead .t { font-family: var(--f-mono); font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
  .item.sample { opacity: .45; }
  .samplenote { font-size: 12px; color: var(--ink-faint); padding: 11px 3px 0; font-style: italic; }

  .notice {
    border: 1px solid var(--rule); border-left: 3px solid var(--st-warning);
    background: var(--surface-2); border-radius: var(--r-md);
    padding: 13px 15px; font-size: 13px; color: var(--ink-muted); margin-top: 15px; line-height: 1.6;
  }
  .notice strong { color: var(--ink); font-weight: 700; }

  footer {
    border-top: 1px solid var(--rule); margin-top: 30px; padding-top: 14px;
    font-size: 11px; color: var(--ink-faint); display: flex; justify-content: space-between;
    gap: 12px; letter-spacing: .04em; text-transform: uppercase; font-family: var(--f-mono);
  }

  :focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 4px; }

  @media (max-width: 360px) {
    .amountrow .btn { padding: 14px 14px; font-size: 14px; }
    .app { padding: 18px 12px 40px; }
    .card { padding: 17px; }
  }

  @media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
  }
