  /* ── Savee: the Horizon system ─────────────────────────────────────────────────────────────
     Rebuilt from DESIGN.md (v3, Horizon). Dark is the design; light is derived from it and is
     opt-in through the theme button. Every colour is a token below; component rules never hold a
     literal colour. The role tokens (--ground … --on-accent) are the system; the older names the
     app's own markup and scripts still read (--blue, --text-primary, --bar-ok …) are aliases of
     those roles, so nothing outside this file has to know the palette changed.

     The values are the hex rendering of the prototype's oklch roles (design/dashboard.html), so
     Chart.js, which reads --text-secondary and --border for its axes, gets colours it can parse.
     Light surfaces are chosen in hex rather than derived in oklch: very light oklch tints fall
     outside sRGB and render faintly cyan. */
  :root, body {
    color-scheme: light;
    --ground: #E9EDF1; --s1: #FFFFFF; --s2: #F5F7F9; --s3: #E7EBEF; --track: #DCE2E7;
    --ink: #12171A; --ink-2: #465258; --ink-3: #58646B; --bar: #4E5A61;
    --mint: #008056; --crit: #BC332E; --warn: #8F5400; --warn-fill: #D99A2B; --on-accent: #FFFFFF;
    --day-gone: #D3DAE0; --day-left: #5B656A; --day-today: #12171A;
    --num-gone: #4C575E; --num-left: #FFFFFF; --num-today: #FFFFFF;
    --edge: rgba(255, 255, 255, 0.9); --shadow: rgba(30, 44, 58, 0.18); --scrim: rgba(18, 23, 26, 0.55);
    --tint: 11%;
    /* category icon tints (food, shopping, leisure, health): a quiet hue each, readable on both themes */
    --ic-rose: #A84858; --ic-warm: #B0602A; --ic-plum: #7A5068; --ic-sage: #5E7038;
  }
  body.dark-mode {
    color-scheme: dark;
    --ground: #040B10; --s1: #0B151A; --s2: #121C21; --s3: #1C262C; --track: #232E33;
    --ink: #EEF5F9; --ink-2: #B0BDC4; --ink-3: #8E9BA2; --bar: #88949B;
    --mint: #55D9AA; --crit: #FC6F63; --warn: #FBBA4A; --warn-fill: #FBBA4A; --on-accent: #071116;
    --day-gone: #1E282E; --day-left: #788287; --day-today: #EFF6FA;
    --num-gone: #94A1A8; --num-left: #040D11; --num-today: #040D11;
    --edge: rgba(255, 255, 255, 0.07); --shadow: rgba(0, 0, 0, 0.6); --scrim: rgba(0, 0, 0, 0.6);
    --tint: 14%;
    --ic-rose: #E8909C; --ic-warm: #F0AE84; --ic-plum: #C9A0BA; --ic-sage: #B6C68C;
  }
  :root, body {
    --mint-soft: color-mix(in srgb, var(--mint) var(--tint), transparent);
    --crit-soft: color-mix(in srgb, var(--crit) var(--tint), transparent);
    --warn-soft: color-mix(in srgb, var(--warn) var(--tint), transparent);

    /* aliases the app's markup and scripts still read */
    --blue: var(--mint); --blue-hover: color-mix(in srgb, var(--mint) 88%, var(--ink)); --blue-ink: var(--on-accent);
    --accent-in: var(--mint); --accent-out: var(--crit); --accent-key: var(--mint);
    --select: var(--mint-soft);
    --bg-page: var(--ground); --bg-surface: var(--s1); --bg-subtle: var(--s2); --bg-track: var(--track); --bg-tabs: var(--s2);
    --border: var(--track); --border-input: var(--s3);
    --text-primary: var(--ink); --text-secondary: var(--ink-2); --text-tertiary: var(--ink-3);
    --hover-bg: var(--s2); --hover-border: var(--mint);
    --bar-ok: var(--bar); --bar-warn: var(--warn-fill); --bar-over: var(--crit);
    --chart-gap: var(--s1); --spark-bar: var(--track); --spark-line: var(--mint);

    /* data series: mirrors CHART_PALETTE_LIGHT / _DARK in app.js (validated; change only with a re-check) */
    --s1c: #2f9e57; --s2c: #7a5ad8; --s3c: #e04b6b; --s4c: #c08a10; --s5c: #12a3ad; --s6c: #ef8320; --s7c: #b0568f; --s8c: #2f7fd4;

    --font: Heebo, 'Segoe UI', Arial, sans-serif;
    /* corner radii: one scale. Each step is a size the app already used, so moving to the names changed no pixel
       (2026-11-08, before/after compared); joining neighbouring steps would be a visible change, for Yonatan. */
    --r-2xs: 3px; --r-bar: 5px; --r-xs: 6px; --r-sm: 8px; --r-control: 10px; --r-md: 12px; --r-lg: 14px; --r-row: 16px;
    --r-xl: 20px; --r-surface: 22px; --r-pill: 999px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --plate-shadow: inset 0 1px 0 var(--edge), 0 24px 48px -28px var(--shadow), 0 2px 6px -2px var(--shadow);
  }
  body.dark-mode { --s1c: #35ad68; --s2c: #8a68dc; --s3c: #e8607f; --s4c: #b0871a; --s5c: #1ba7b5; --s6c: #d4761c; --s7c: #c96aa2; --s8c: #3b8fd8; }
  /* the old series names (--s1..--s8) collided with the new surface names; they live on as --sNc */
  .essential-fill-essential, .essential-dot-essential { --series: var(--s1c); }
  .essential-fill-nonessential, .essential-dot-nonessential { --series: var(--s5c); }

  @property --w { syntax: '<percentage>'; inherits: true; initial-value: 0%; }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  /* the hidden attribute always wins over a component's own display (e.g. an empty "needs attention" heading) */
  [hidden] { display: none !important; }
  html { scrollbar-color: var(--s3) var(--ground); }
  body {
    font-family: var(--font); font-size: 16px; line-height: 1.5;
    font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
    background: var(--ground); color: var(--ink);
    min-height: 100vh; direction: rtl; caret-color: var(--mint);
  }
  ::selection { background: var(--mint); color: var(--on-accent); }
  button, input, select, textarea { font-family: inherit; }
  .brand { font-weight: 900; font-size: 22px; line-height: 1; letter-spacing: -0.03em; direction: ltr; color: var(--ink); }

  /* The old cobalt plane is gone: the shell and the hero sit on the ground like everything else. */
  .plane { background: transparent; color: var(--ink); }
  .plane-brand { display: flex; align-items: baseline; gap: 12px; padding: 16px 20px; width: 100%; max-width: 452px; margin: 0 auto; }
  .plane-brand .brand-sub { font-size: 14px; color: var(--ink-2); }

  /* ── Auth: one centred column (max 420px): the top bar, the month arc as the mark, the title, one plate ── */
  #authScreen { min-height: 100vh; display: flex; flex-direction: column; width: 100%; max-width: 452px; margin: 0 auto;
                padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: env(safe-area-inset-top, 0px) 40px; }
  .auth-bar { display: flex; align-items: center; justify-content: space-between; padding-block: 12px; }
  .auth-tools { display: flex; gap: 2px; }
  svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .auth-look { min-width: 40px; padding: 0 6px; }
  .auth-look .sun { display: none; }
  body.dark-mode .auth-look .sun { display: block; }
  body.dark-mode .auth-look .moon { display: none; }
  .auth-mark { display: block; width: 168px; max-width: 100%; margin: 8px auto 0; }
  .auth-mark .cell.gone { fill: var(--day-gone); }
  .auth-mark .cell.left { fill: var(--day-left); }
  .auth-mark .cell.today { fill: var(--day-today); }
  .auth-mark .money { fill: none; stroke: var(--mint); stroke-width: 6; stroke-linecap: round; }
  .auth-mark .track { fill: none; stroke: var(--track); stroke-width: 6; stroke-linecap: round; }
  .auth-head { text-align: center; margin-top: 4px; }
  .auth-title { font-size: 26px; font-weight: 800; text-align: center; letter-spacing: -0.01em; text-wrap: balance; line-height: 1.25; }
  .auth-sub { font-size: 15px; color: var(--ink-2); text-align: center; margin-top: 4px; text-wrap: balance; }
  .auth-box, .onboard-box {
    background: var(--s1); border-radius: var(--r-surface); padding: 24px 20px; width: 100%; max-width: 420px; box-shadow: var(--plate-shadow);
  }
  #authScreen .auth-box { margin-top: 20px; max-width: none; padding: 16px; display: grid; gap: 14px; align-content: start; }
  #authScreen .auth-box > * { margin: 0; }
  .auth-group-label { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
  #authScreen .profile-list { margin-bottom: 0; }
  #authScreen .profile-btn { width: 100%; }
  .auth-demo { width: 100%; min-height: 48px; border-radius: var(--r-lg); background: none; border: 1.5px dashed color-mix(in oklch, var(--mint) 45%, transparent);
               color: var(--mint); font-size: 15px; font-weight: 700; cursor: pointer; }
  .auth-demo:active { transform: scale(0.98); }
  /* in cloud mode the demo button is hidden, and the "or" under it goes with it */
  #viewDemoAccountBtn[style*="none"] + .divider { display: none; }
  #authScreen .divider { margin: 0; }
  #authScreen .auth-tabs { position: relative; margin: 0; }
  #authScreen .auth-tabs::before { content: ""; position: absolute; top: 4px; bottom: 4px; inset-inline-start: 4px; width: calc(50% - 4px); border-radius: 9px;
               background: var(--s3); box-shadow: inset 0 1px 0 var(--edge); transition: transform 0.3s var(--ease-out); }
  #authScreen .auth-tabs:has(#tabSignup.active)::before { transform: translateX(-100%); }
  html[dir="ltr"] #authScreen .auth-tabs:has(#tabSignup.active)::before { transform: translateX(100%); }
  #authScreen .auth-tab { position: relative; z-index: 1; transition: color 0.2s; }
  #authScreen .auth-tab.active { background: none; box-shadow: none; }
  #authScreen .auth-tab:focus-visible { outline: 2px solid var(--mint); outline-offset: -2px; }
  #authScreen .auth-error:empty { display: none; }
  #authScreen .auth-error { text-align: start; }
  /* switchAuthTab sets these to display:block inline, so the rhythm comes from margins, not a grid gap */
  #authScreen #loginForm > * + *, #authScreen #signupForm > * + * { margin-top: 14px; }
  #authScreen #loginForm > .btn-link { margin-top: 6px; }
  #authScreen .field { margin: 0; }
  #authScreen .btn-link { margin: 0 auto; }
  .auth-hint { margin-top: 6px; }
  #authScreen .auth-hint .btn-link { margin: 0; padding: 4px 0; font-size: 14px; unicode-bidi: plaintext; }
  .pass-control { position: relative; }
  .pass-control input { padding-inline-end: 50px; }
  .pass-reveal { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: var(--r-control);
                 display: grid; place-items: center; color: var(--ink-3); background: none; border: 0; cursor: pointer; }
  .pass-reveal .hide, .pass-reveal[aria-pressed="true"] .show { display: none; }
  .pass-reveal[aria-pressed="true"] .hide { display: block; }
  #authScreen input[type="email"] { direction: ltr; text-align: right; }
  html[dir="ltr"] #authScreen input[type="email"] { text-align: left; }
  .auth-note { padding: 12px 14px; border-radius: var(--r-md); background: var(--s2); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
  .auth-note strong { display: block; color: var(--ink); margin-bottom: 2px; }
  .auth-quiet-danger { display: block; margin: 8px auto 0; padding: 8px 12px; background: none; border: 0; font-size: 13px; color: var(--crit); border-radius: var(--r-sm); cursor: pointer; }
  #confirmEmailPanel:not([style*="none"]) { display: grid !important; gap: 14px; }
  .confirm-center { text-align: center; display: grid; gap: 10px; justify-items: center; }
  .confirm-env { width: 64px; height: 64px; border-radius: var(--r-xl); background: var(--mint-soft); color: var(--mint); display: grid; place-items: center; }
  .confirm-env svg.i { width: 30px; height: 30px; }
  .confirm-center h2 { font-size: 20px; font-weight: 800; text-wrap: balance; }
  .confirm-center p { font-size: 14px; color: var(--ink-2); text-wrap: balance; }
  .confirm-center p:empty { display: none; }
  .confirm-addr { direction: ltr; font-weight: 700; font-size: 15px; padding: 6px 12px; border-radius: var(--r-control); background: var(--s2); word-break: break-all; }
  .confirm-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; text-align: start; width: 100%; counter-reset: s; }
  .confirm-steps li { display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--ink-2); counter-increment: s; }
  .confirm-steps li::before { content: counter(s); width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--s3); color: var(--ink); font-weight: 800; font-size: 14px; display: grid; place-items: center; }
  #confirmEmailPanel .btn-link { margin: 0 auto; }
  #confirmEmailPanel .btn-outline { margin-top: 0; }
  .confirm-code { display: grid; gap: 8px; padding: 14px; border-radius: var(--r-md); background: var(--s2); }
  .confirm-code label { font-size: 14px; font-weight: 700; color: var(--ink); }
  .confirm-code-row { display: flex; gap: 8px; }
  .confirm-code-row input { flex: 1; min-width: 0; direction: ltr; text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 0.3em;
                            font-variant-numeric: tabular-nums; padding: 10px 8px; background: var(--s1); }
  .confirm-code-row input[aria-invalid="true"] { border-color: var(--crit); }
  .confirm-code-row .btn-primary { width: auto; flex: none; padding-inline: 20px; margin: 0; }
  .confirm-code-error { font-size: 14px; color: var(--crit); }
  .confirm-code-error:empty, .confirm-note:empty { display: none; }
  .fp-code { margin-top: 14px; }
  .fp-spam, #fpResendNote { margin-top: 12px; }
  .fp-close { display: block; margin: 8px auto 0; }
  .confirm-spam, .confirm-note { font-size: 14px; color: var(--ink-2); text-align: center; text-wrap: balance; }
  @media (prefers-reduced-motion: no-preference) {
    #authScreen .auth-mark .cell { animation: auth-cell-in 0.32s var(--ease-out) both; animation-delay: calc(var(--i) * 18ms); transform-box: fill-box; transform-origin: center; }
    #authScreen .auth-mark .money { stroke-dasharray: 1; stroke-dashoffset: 1; animation: auth-draw 0.9s var(--ease-out) 0.35s forwards; }
    #authScreen .auth-head, #authScreen .auth-box { animation: auth-rise 0.5s var(--ease-out) both; }
    #authScreen .auth-head { animation-delay: 0.25s; }
    #authScreen .auth-box { animation-delay: 0.4s; }
  }
  @media (prefers-reduced-motion: reduce) { #authScreen .auth-tabs::before { transition: none; } }
  @keyframes auth-cell-in { from { opacity: 0; transform: scale(0.6); } }
  @keyframes auth-draw { to { stroke-dashoffset: 0; } }
  @keyframes auth-rise { from { opacity: 0; transform: translateY(10px); } }
  .profile-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
  .profile-btn {
    display: flex; align-items: center; gap: 12px; background: var(--s2); border: 0; border-radius: var(--r-lg);
    padding: 10px 12px; cursor: pointer; text-align: start; font-size: 16px; font-weight: 700; color: var(--ink);
  }
  .profile-btn:hover { background: var(--s3); }
  .profile-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--s3); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
  .divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--ink-3); font-size: 13px; }
  .divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--track); }
  .auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; background: var(--s2); border-radius: var(--r-md); padding: 4px; }
  /* three choices (expense / debt / income) stay on one row */
  .auth-tabs:has(> .auth-tab:nth-child(3)) { grid-template-columns: repeat(3, 1fr); }
  .auth-tab { text-align: center; padding: 10px 6px; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink-2); border-radius: 9px; transition: background 0.2s, color 0.2s; }
  .auth-tab.active, #panel-addExpense .auth-tab.active { background: var(--s3); color: var(--ink); box-shadow: inset 0 1px 0 var(--edge); }

  .field-mode-toggle { display: inline-flex; background: var(--s2); border-radius: var(--r-sm); padding: 2px; }
  .field-mode-btn { border: none; background: none; cursor: pointer; padding: 4px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-radius: var(--r-xs); }
  .field-mode-btn.active { background: var(--s3); color: var(--ink); }

  .field { margin-bottom: 14px; }
  .field label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
  .field input, .field select {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--track); border-radius: var(--r-md);
    font-size: 16px; background: var(--s2); color: var(--ink); direction: rtl;
  }
  .field input:focus, .field select:focus { outline: none; border-color: var(--mint); }
  .check-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 14px; color: var(--ink-2); }
  .check-row input { width: 20px; height: 20px; accent-color: var(--mint); cursor: pointer; }

  .btn-primary, .btn-add {
    width: 100%; min-height: 52px; padding: 12px; background: var(--mint); color: var(--on-accent); border: none;
    border-radius: var(--r-lg); font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px -12px var(--mint);
    transition: transform 0.12s var(--ease-out), background 0.2s;
  }
  .btn-add { margin-top: 14px; }
  .btn-primary:hover, .btn-add:hover { background: var(--blue-hover); }
  .btn-link { background: none; border: none; color: var(--mint); font-size: 14px; font-weight: 600; cursor: pointer; display: block; text-align: center; margin: 12px auto 0; padding: 8px 12px; border-radius: var(--r-sm); }
  .auth-error { color: var(--crit); font-size: 14px; font-weight: 600; text-align: center; margin-bottom: 10px; }
  .auth-error:not(:empty) { background: var(--crit-soft); border-radius: var(--r-md); padding: 10px 12px; }

  /* ── Onboarding ── */
  #onboardScreen { display: none; min-height: 100vh; flex-direction: column; width: 100%; max-width: 452px; margin: 0 auto;
                   padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: env(safe-area-inset-top, 0px) 32px; }
  #onboardScreen .onboard-box { margin: 8px 0 24px; max-width: none; }
  /* ── First-run setup: two questions, then the first look at the month ── */
  .quick-setup { display: none; }
  #onboardScreen.quick .quick-setup { display: block; }
  #onboardScreen.quick .onboard-box { display: none; }
  #onboardScreen:not(.quick) .q-saved { display: none; }
  .q-saved { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--mint); font-weight: 600; opacity: 0; transition: opacity 0.3s; margin-inline-end: 4px; }
  .q-saved.on { opacity: 1; }
  .q-saved svg.i { width: 14px; height: 14px; }
  .flip { transform: scaleX(-1); }
  html[dir="ltr"] .flip { transform: none; }
  .q-progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
  .q-progress .bars { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .q-progress .bars i { height: 6px; border-radius: var(--r-2xs); background: var(--track); position: relative; overflow: hidden; }
  .q-progress .bars i::after { content: ""; position: absolute; inset: 0; background: var(--mint); transform: scaleX(var(--p, 0)); transform-origin: right center; transition: transform 0.45s var(--ease-out); }
  html[dir="ltr"] .q-progress .bars i::after { transform-origin: left center; }
  .q-progress .count { font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
  .q-step { margin-top: 28px; display: grid; gap: 16px; }
  .q-step.enter { animation: q-step-in 0.4s var(--ease-out) both; }
  .q-step.back-in { animation: q-step-back 0.4s var(--ease-out) both; }
  html[dir="ltr"] .q-step.enter { animation-name: q-step-back; }
  html[dir="ltr"] .q-step.back-in { animation-name: q-step-in; }
  .q-head h1 { font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
  .q-head p { margin-top: 8px; font-size: 15px; color: var(--ink-2); text-wrap: balance; }
  .q-plate { background: var(--s1); border-radius: var(--r-surface); padding: 16px; box-shadow: var(--plate-shadow); display: grid; gap: 14px; }
  .q-amount { display: flex; align-items: baseline; gap: 6px; direction: ltr; justify-content: center; padding: 14px 12px; border-radius: var(--r-row); background: var(--s2);
              border: 1.5px solid var(--track); transition: border-color 0.15s; cursor: text; }
  .q-amount:focus-within { border-color: var(--mint); }
  .q-amount[data-invalid="true"] { border-color: var(--crit); }
  .q-amount input { font: inherit; font-size: 48px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); background: none; border: 0; outline: none;
                    width: 7ch; min-width: 0; text-align: center; padding: 0; font-variant-numeric: tabular-nums; direction: ltr; }
  .q-amount input::placeholder { color: var(--ink-3); opacity: 0.6; }
  .q-amount .cur { font-size: 22px; font-weight: 700; color: var(--ink-2); }
  .q-hint { font-size: 13px; color: var(--ink-3); text-align: center; }
  .q-err { font-size: 14px; font-weight: 600; color: var(--crit); text-align: center; }
  .q-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
  .q-choice legend { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
  .q-choice label { display: block; position: relative; }
  .q-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .q-choice span { display: grid; gap: 6px; justify-items: center; padding: 14px 6px; border-radius: var(--r-lg); background: var(--s2); border: 1.5px solid transparent; height: 100%;
                   font-size: 14px; font-weight: 700; color: var(--ink-2); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
  .q-choice span svg.i { width: 26px; height: 26px; }
  .q-choice input:checked + span { border-color: var(--mint); background: var(--mint-soft); color: var(--ink); }
  .q-choice input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 2px; }
  .q-reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s var(--ease-out); }
  .q-reveal[data-open="true"] { grid-template-rows: 1fr; }
  .q-reveal > div { overflow: hidden; display: grid; gap: 8px; }
  .q-bills { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
  .q-bills legend { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; padding: 0; }
  .q-bills .q-hint { margin-bottom: 4px; }
  .q-bill { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: var(--r-lg); background: var(--s2);
            border: 1.5px solid transparent; cursor: text; transition: border-color 0.15s; }
  .q-bill:focus-within { border-color: var(--mint); }
  .q-bill .nm { display: grid; font-size: 15px; font-weight: 700; color: var(--ink); }
  .q-bill .nm .s { font-size: 12px; font-weight: 500; color: var(--ink-3); }
  .q-bill .amt { display: flex; align-items: baseline; gap: 4px; direction: ltr; }
  .q-bill input { font: inherit; font-size: 20px; font-weight: 700; color: var(--ink); background: none; border: 0; outline: none; width: 6ch; min-width: 0;
                  text-align: right; padding: 4px 0; font-variant-numeric: tabular-nums; direction: ltr; }
  .q-bill input::placeholder { color: var(--ink-3); opacity: 0.6; }
  .q-bill .cur { font-size: 15px; font-weight: 600; color: var(--ink-2); }
  .q-bill .amt.range input { width: 4.5ch; font-size: 18px; text-align: center; }
  .q-bill .dash { color: var(--ink-3); font-weight: 600; }
  .q-seg { display: inline-flex; gap: 2px; margin-top: 6px; padding: 2px; border-radius: var(--r-control); background: var(--s3); justify-self: start; }
  .q-seg button { font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2); background: none; border: 0; border-radius: var(--r-sm); padding: 6px 10px; cursor: pointer; }
  .q-seg button[aria-pressed="true"] { background: var(--s1); color: var(--ink); box-shadow: var(--plate-shadow); }
  .q-seg button:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
  .q-row { display: flex; justify-content: space-between; align-items: center; }
  .q-quiet { padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); border-radius: var(--r-control); display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; }
  .q-quiet:active, .q-quiet:hover { background: var(--s2); }
  .q-quiet svg.i { width: 18px; height: 18px; }
  .q-add { justify-self: center; padding: 8px 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--mint); background: none; border: 0; border-radius: 10px;
           display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
  .q-add:hover, .q-add:active { background: var(--s2); }
  .q-add svg.i { width: 16px; height: 16px; }
  .q-plate { grid-template-columns: minmax(0, 1fr); }
  .q-incs { display: grid; gap: 6px; min-width: 0; }
  .q-inc { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--s2); border: 1.5px solid transparent; transition: border-color 0.15s; }
  .q-inc:focus-within { border-color: var(--mint); }
  .q-inc[data-invalid="true"] { border-color: var(--crit); }
  .q-inc .nm { flex: 1; width: 0; min-width: 0; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); background: none; border: 0; outline: none; padding: 6px 0; }
  .q-inc .nm::placeholder { color: var(--ink-3); font-weight: 500; }
  .q-inc .amt { display: flex; align-items: baseline; gap: 4px; direction: ltr; cursor: text; }
  .q-inc .amt input { font: inherit; font-size: 20px; font-weight: 700; color: var(--ink); background: none; border: 0; outline: none; width: 6ch; min-width: 0;
                      text-align: right; padding: 4px 0; font-variant-numeric: tabular-nums; direction: ltr; }
  .q-inc .amt input::placeholder { color: var(--ink-3); opacity: 0.6; }
  .q-inc .cur { font-size: 15px; font-weight: 600; color: var(--ink-2); }
  .q-inc .x { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink-3); font-size: 20px; cursor: pointer; }
  .q-inc button.x:hover { background: var(--s3); color: var(--ink); }
  .q-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 12px 0; border-top: 1px solid var(--track); }
  .q-total .lbl { font-size: 15px; font-weight: 600; color: var(--ink-2); }
  .q-total .n { display: inline-flex; align-items: baseline; gap: 4px; direction: ltr; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .q-total .cur { font-size: 16px; font-weight: 700; color: var(--ink-2); letter-spacing: 0; }
  .q-arcwrap { position: relative; }
  svg.q-arc { display: block; width: 100%; height: auto; }
  .q-arc .cell.gone { fill: var(--day-gone); }
  .q-arc .cell.left { fill: var(--day-left); }
  .q-arc .cell.today { fill: var(--day-today); }
  .q-arc .money { fill: none; stroke: var(--mint); stroke-width: 8; stroke-linecap: round; }
  .q-arc .track { fill: none; stroke: var(--track); stroke-width: 8; stroke-linecap: round; }
  .q-fig { position: absolute; left: 0; right: 0; top: 46%; transform: translateY(-50%); text-align: center; display: grid; justify-items: center; }
  .q-fig .lbl { font-size: 15px; font-weight: 600; color: var(--ink-2); }
  .q-fig .n { display: inline-flex; align-items: flex-start; gap: 2px; direction: ltr; font-size: 60px; font-weight: 800; letter-spacing: -0.05em; line-height: 0.85; margin-top: 4px; }
  .q-fig .cur { font-size: 18px; font-weight: 700; color: var(--ink-2); margin-top: 6px; letter-spacing: 0; }
  .q-fig .sub { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
  .q-later h2 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
  .q-later ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .q-later li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-lg); background: var(--s2); font-size: 14px; }
  .q-later li .ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--s3); color: var(--ink-2); flex: none; }
  .q-later li b { display: block; font-size: 15px; }
  .q-later li span.s { color: var(--ink-3); font-size: 13px; }
  @media (prefers-reduced-motion: no-preference) {
    .q-done .q-arc .cell { animation: auth-cell-in 0.34s var(--ease-out) both; animation-delay: calc(var(--i) * 22ms); transform-box: fill-box; transform-origin: center; }
    .q-done .q-arc .money { stroke-dasharray: 1; stroke-dashoffset: 1; animation: auth-draw 1s var(--ease-out) 0.3s forwards; }
    .q-later li { animation: auth-rise 0.45s var(--ease-out) both; animation-delay: calc(1s + var(--k) * 80ms); }
  }
  @media (prefers-reduced-motion: reduce) {
    .q-step.enter, .q-step.back-in { animation: none; }
    .q-progress .bars i::after, .q-reveal, .q-saved, .q-amount, .q-choice span, .q-bill { transition: none; }
  }
  @keyframes q-step-in { from { opacity: 0; transform: translateX(-16px); } }
  @keyframes q-step-back { from { opacity: 0; transform: translateX(16px); } }
  .onboard-step { font-size: 13px; color: var(--ink-3); text-align: center; margin-bottom: 6px; font-weight: 600; }
  .onboard-title { font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 6px; line-height: 1.2; text-wrap: balance; }
  .onboard-sub { font-size: 15px; color: var(--ink-2); text-align: center; margin-bottom: 22px; text-wrap: balance; }
  .housing-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
  .housing-card { border: 1.5px solid transparent; border-radius: var(--r-lg); padding: 18px 12px; text-align: center; cursor: pointer; background: var(--s2); transition: border-color 0.15s, background 0.15s; }
  .housing-card:hover { background: var(--s3); }
  .housing-card.selected { border-color: var(--mint); background: var(--mint-soft); }
  .housing-card .h-icon { font-size: 28px; margin-bottom: 6px; }
  .housing-card .h-label { font-weight: 700; font-size: 15px; }
  .onboard-skip { background: none; border: none; color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; display: block; text-align: center; margin-top: 8px; width: 100%; padding: 10px; border-radius: var(--r-control); }
  .onboard-step-topic { display: inline-block; background: var(--mint-soft); color: var(--mint); font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill); margin-bottom: 8px; }
  .presetq-name { font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 22px; }
  .presetq-buttons { display: flex; gap: 10px; margin-bottom: 6px; }
  .presetq-buttons button { flex: 1; margin-top: 0; }
  .presetq-skip { text-align: center; margin-top: 10px; }
  .onboard-progress-bg, .onboard-overall-progress-bg { background: var(--track); height: 6px; border-radius: var(--r-2xs); overflow: hidden; margin-bottom: 18px; }
  .onboard-overall-progress-bg { margin-bottom: 8px; }
  .onboard-progress-fill, .onboard-overall-progress-fill { height: 100%; background: var(--mint); border-radius: var(--r-2xs); transition: width 0.3s var(--ease-out); }
  .onboard-cat-counter { font-size: 12.5px; color: var(--ink-3); text-align: center; margin-bottom: 14px; }
  .veh-stepper { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 22px; }
  .veh-stepper button { width: 48px; height: 48px; border-radius: var(--r-lg); border: 0; background: var(--s2); font-size: 22px; font-weight: 700; color: var(--ink); cursor: pointer; }
  .veh-stepper button:hover { background: var(--s3); }
  .veh-stepper span { font-size: 32px; font-weight: 800; min-width: 40px; text-align: center; }

  .veh-card { background: var(--s2); border-radius: var(--r-row); padding: 12px 14px; margin-bottom: 10px; }
  .veh-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .veh-card-head input.veh-label { font-weight: 700; font-size: 15px; border: none; background: transparent; padding: 2px 4px; width: auto; flex: 1; color: var(--ink); }
  .veh-card-head input.veh-label:focus { outline: none; background: var(--s1); border-radius: var(--r-xs); }
  .veh-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .veh-field label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 3px; }
  .veh-field input { padding: 8px 10px; font-size: 15px; }
  .veh-total { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-top: 8px; text-align: end; }
  @media (max-width: 640px) { .veh-fields { grid-template-columns: repeat(2, 1fr); } }

  /* ── App shell ── */
  #appScreen { display: none; padding: 0 max(20px, env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); max-width: 1080px; margin: 0 auto; }
  /* The header (Savee, the account, the build) scrolls away with the page: the tabs live in the bottom
     bar now, so nothing up here needs to stay pinned over the content. It pads itself below the iPhone
     status bar, and a fixed strip the height of that bar keeps scrolled content from showing behind the
     clock (the page draws under it: black-translucent + viewport-fit=cover). */
  .plane-top { position: relative; z-index: 5; background: var(--ground); padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  body::before { content: ""; position: fixed; inset-inline: 0; top: 0; height: env(safe-area-inset-top, 0px); background: var(--ground); z-index: 60; pointer-events: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 8px; }
  .topbar-user { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
  .topbar-user > div { min-width: 0; }
  .topbar > div:last-child { flex: none; }
  .topbar-user .brand { margin-inline-end: 4px; }
  .topbar-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--s3); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
  .topbar-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
  .topbar-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
  #buildStamp { white-space: nowrap; }
  .btn-logout {
    background: transparent; color: var(--ink-2); border: 0; border-radius: var(--r-control);
    padding: 0 10px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
    white-space: nowrap; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.15s;
  }
  .btn-logout:hover, .btn-logout:active { background: var(--s2); }
  .auth-box .btn-logout, .onboard-box .btn-logout { color: var(--ink-2); }
  @media (max-width: 560px) {
    .topbar-name, .topbar-avatar { display: none; }
    /* the build stamp and sync state sit under the wordmark: the household reads them to know an update landed */
    .topbar-user { flex-direction: column; align-items: flex-start; gap: 2px; overflow: visible; }
    .btn-logout { padding: 0 8px; font-size: 12.5px; }
  }

  /* Tabs: a segmented control under the top bar. */
  .tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--s1); padding: 4px; border-radius: var(--r-lg); box-shadow: inset 0 1px 0 var(--edge); margin-bottom: 4px; }
  .tab-btn {
    min-width: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px 6px; line-height: 1.2;
    border-radius: var(--r-control); cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink-3); transition: background 0.2s, color 0.2s;
  }
  .tab-btn:hover { color: var(--ink-2); }
  .tab-btn.active { background: var(--s3); color: var(--ink); box-shadow: inset 0 1px 0 var(--edge); }
  /* The tabs are the prototype's bottom bar on every screen size (owner's choice): a wide green
     "+ הוספה" and two icon tabs with short labels; the row is at most 520px wide, centred. */
  .tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 50; margin: 0; border-radius: 0; gap: 8px; align-items: center;
          grid-template-columns: 1.3fr 1fr 1fr 1fr; background: color-mix(in srgb, var(--s1) 90%, transparent);
          backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 1px 0 var(--edge), 0 -10px 30px -18px var(--shadow);
          padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
          padding-inline: max(16px, env(safe-area-inset-left, 0px), calc((100% - 520px) / 2)); }
  .tab-btn { height: 52px; border-radius: var(--r-lg); flex-direction: column; gap: 2px; padding: 0 4px; font-size: 12.5px; font-weight: 600; }
  .tab-btn.active { background: none; box-shadow: none; color: var(--ink); }
  .tab-btn svg.i { width: 20px; height: 20px; }
  .tab-btn.tab-add, .tab-btn.tab-add.active { flex-direction: row; gap: 8px; font-size: 16px; font-weight: 800; background: var(--mint); color: var(--on-accent);
    box-shadow: 0 10px 24px -12px var(--mint); }
  .tab-btn.tab-add:hover { color: var(--on-accent); }
  .tab-btn.tab-add:active { transform: scale(0.96); }
  .tab-btn.tab-add svg.i { stroke-width: 2.4; }
  /* the same green button opens the Add screen and, once there, saves it */
  .tab-btn.tab-add .tab-add-save, .tab-btn.tab-add.active .tab-add-open { display: none; }
  .tab-btn.tab-add.active .tab-add-save { display: inline; }
  /* room for the bar under the last card, and the toast floats above it */
  #appScreen { padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }
  body #toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .tab-panel { display: none; }
  .tab-panel.active { display: block; padding-top: 12px; }

  /* A plate: lifted off the ground by a top light and a soft offset shadow. Nested plates drop to
     the next surface step so the nesting reads without borders. */
  .card { position: relative; background: var(--s1); border-radius: var(--r-surface); padding: 18px; margin-bottom: 16px; box-shadow: var(--plate-shadow); }
  .card .card { background: var(--s2); box-shadow: none; border-radius: var(--r-row); padding: 14px; }
  .card .card .card { background: var(--s3); }
  .section-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; color: var(--ink); line-height: 1.3; }
  .section-hint { font-size: 13px; color: var(--ink-3); margin-bottom: 12px; margin-top: -4px; line-height: 1.5; }

  /* ── The dashboard hero: the Horizon arc ── */
  .plane-hero { background: linear-gradient(180deg, var(--s2), var(--s1) 70%); border-radius: var(--r-surface); box-shadow: var(--plate-shadow); padding: 8px 8px 18px; margin-bottom: 16px; }
  .month-row { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 4px auto 0; }
  .month-row button { background: transparent; border: 0; border-radius: var(--r-control); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; color: var(--ink-2); }
  .month-row button:hover { background: var(--s3); }
  /* the arrows are drawn for right-to-left (previous = →); English mirrors them */
  html[dir="ltr"] .month-row button { transform: scaleX(-1); }
  .month-label { font-size: 16px; font-weight: 700; min-width: 0; text-align: center; color: var(--ink); padding: 0 4px; white-space: nowrap; }
  .hero-grid { display: block; }
  .arc-box { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
  .arc-box svg.arc { display: block; width: 100%; height: auto; overflow: visible; }
  .arc .cell.gone { fill: var(--day-gone); }
  .arc .cell.left { fill: var(--day-left); }
  .arc .cell.today { fill: var(--day-today); }
  .arc .num { font-family: var(--font); font-weight: 700; text-anchor: middle; dominant-baseline: central; }
  .arc .num.gone { fill: var(--num-gone); }
  .arc .num.left { fill: var(--num-left); }
  .arc .num.today { fill: var(--num-today); font-weight: 800; }
  .arc .today-lbl { font-family: var(--font); font-weight: 700; font-size: 13px; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
  .arc .money-track { fill: none; stroke: var(--track); stroke-width: 8; stroke-linecap: round; }
  .arc .money { fill: none; stroke: var(--mint); stroke-width: 8; stroke-linecap: round; }
  .arc-fig { position: absolute; left: 0; right: 0; display: grid; justify-items: center; text-align: center; }
  .hero-left { display: grid; justify-items: center; }
  .hero-left.stat-card, .arc-fig.stat-card { position: absolute; display: grid; justify-items: center; background: none; padding: 0; border-radius: 0; }
  .hero-number .hero-cur { font-size: 0.32em; font-weight: 700; color: var(--ink-2); margin-top: 0.14em; letter-spacing: 0; }
  .hero-left .hero-number { display: flex; align-items: flex-start; gap: 3px; }
  .hero-label { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; color: var(--ink-2); }
  .hero-label .stat-label { font-size: inherit; margin: 0; color: inherit; }
  .hero-left .hero-number { font-size: 72px; font-weight: 800; letter-spacing: -0.05em; line-height: 0.85; margin: 4px 0 0; color: var(--ink); white-space: nowrap; direction: ltr; }
  .stat-card.left.danger .hero-number { color: var(--crit); }
  .hero-left .stat-delta, .hero-spark { display: none; }
  .hero-under { text-align: center; margin-top: 6px; padding: 0 10px; }
  .hero-under .days-line { display: block; font-size: 21px; font-weight: 700; line-height: 1.3; color: var(--ink); text-wrap: balance; }
  .hero-under .denom { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
  .pace { display: none; }

  /* the three figures under the arc: income, expected and actual, quiet and side by side */
  .cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 6px 0; }
  .stat-card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--s2); border-radius: var(--r-lg); padding: 10px 12px; }
  .stat-card[onclick], .stat-card[data-on] { cursor: pointer; }
  .stat-card[onclick]:hover, .stat-card[data-on]:hover { background: var(--s3); }
  .stat-label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; font-weight: 600; }
  .stat-value { font-size: 18px; font-weight: 800; line-height: 1.2; white-space: nowrap; color: var(--ink); }
  /* a seven-figure amount may put its ₪ on a second line rather than spill out of its box */
  .cards-grid .stat-value { white-space: normal; overflow-wrap: anywhere; }
  .stat-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
  .stat-delta { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; margin-top: 4px; color: var(--ink-2); }
  .stat-delta:empty { display: none; }
  .stat-delta svg { width: 0.9em; height: 0.9em; flex-shrink: 0; }
  .stat-card .stat-spark { display: none; }
  .stat-warn-icon svg { width: 0.95em; height: 0.95em; vertical-align: -0.15em; }

  .dash-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
  .dash-main, .dash-side { min-width: 0; }
  .bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (min-width: 900px) {
    #panel-dashboard.active { display: grid; grid-template-columns: 440px 1fr; gap: 24px; align-items: start; }
    #panel-dashboard > .plane-hero { position: sticky; top: 120px; margin-bottom: 0; grid-column: 1; grid-row: 1 / span 3; }
    /* everything else (upcoming payments, month close, the lists) stacks in the wide column beside the hero */
    #panel-dashboard > :not(.plane-hero) { grid-column: 2; }
  }

  /* ── Controls ── */
  select, input[type="number"], input[type="text"], input[type="month"], input[type="date"], input[type="email"], input[type="password"], textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--track); border-radius: var(--r-control);
    font-size: 16px; color: var(--ink); background: var(--s2); direction: rtl;
  }
  select:focus, input:focus, textarea:focus { outline: none; border-color: var(--mint); }
  input::placeholder, textarea::placeholder { color: var(--ink-3); }
  input[type="range"] { accent-color: var(--mint); }
  label.f-label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 12px 0 6px; }
  /* every label keeps its top gap from the field above; only one that opens a card or a modal sits flush */
  .card > label.f-label:first-child, .modal-head + label.f-label { margin-top: 0; }
  .btn-outline {
    background: transparent; border: 1.5px solid var(--s3); border-radius: var(--r-md); padding: 10px; min-height: 44px;
    font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; width: 100%; margin-top: 10px;
  }
  .btn-outline:hover { background: var(--s2); border-color: var(--mint); }
  .path-choice { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: stretch; }
  /* the assistant's option (💬 למלא בשיחה): a full row under the two, icon beside the words */
  .path-card.as-path { flex: 1 1 100%; flex-direction: row; align-items: center; gap: 14px; text-align: start; padding: 14px 16px; }
  .path-card.as-path .path-icon { margin: 0; }
  .as-path-t { display: flex; flex-direction: column; }
  .path-card {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--s2);
    border: 1.5px solid transparent; border-radius: var(--r-row); padding: 18px 10px 15px; cursor: pointer; position: relative; font: inherit; color: var(--ink);
  }
  .path-card:hover { background: var(--s3); }
  .path-card.is-primary { border-color: var(--mint); }
  .path-icon { font-size: 28px; line-height: 1; margin-bottom: 8px; }
  .path-name { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
  .path-why { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
  .path-tag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--mint); color: var(--on-accent); font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: var(--r-pill); white-space: nowrap; }

  /* ── the assistant (💬 עוזר): a full-screen chat over the app ── */
  .as-sheet { position: fixed; inset: 0; z-index: 1000; background: var(--ground); flex-direction: column; }
  .as-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); background: var(--s1); box-shadow: 0 1px 0 var(--s3); }
  .as-head h2 { margin: 0; font-size: 17px; color: var(--ink); }
  .as-head small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
  .as-x { width: 44px; height: 44px; border: 0; border-radius: var(--r-pill); background: var(--s2); color: var(--ink); font-size: 18px; cursor: pointer; }
  .as-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto; }
  .as-msg { max-width: 86%; padding: 10px 14px; border-radius: var(--r-row); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
  .as-bot { align-self: flex-start; background: var(--s2); color: var(--ink); border-end-start-radius: var(--r-xs); }
  .as-me { align-self: flex-end; background: var(--mint); color: var(--on-accent); font-weight: 600; border-end-end-radius: var(--r-xs); unicode-bidi: plaintext; } /* dir="auto" sets the bubble by its first letter; this lets each line of a longer message (to Yonatan) take its own */
  .as-note { align-self: center; font-size: 12px; color: var(--ink-3); text-align: center; max-width: 90%; line-height: 1.45; margin: 0; }
  .as-chips { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 100%; }
  .as-chips .trip-chip { min-height: 40px; padding: 8px 12px; font-size: 13.5px; }
  .as-card { align-self: flex-start; width: 92%; background: var(--s1); box-shadow: inset 0 0 0 1px var(--s3); border-radius: var(--r-row); padding: 12px 14px; }
  .as-card h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
  .as-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14.5px; }
  .as-card dt { color: var(--ink-2); }
  .as-card dd { margin: 0; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
  .as-card dd s { color: var(--ink-3); font-weight: 500; }
  .as-card .as-ask { margin: 0 0 8px; font-size: 14.5px; color: var(--ink); line-height: 1.45; }
  .as-card .as-big { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0; }
  .as-card .as-big.is-over { color: var(--crit); }
  .as-card .as-sub { font-size: 13.5px; color: var(--ink-2); margin: 4px 0 0; line-height: 1.45; }
  .as-card .as-quote { margin: 0; padding: 8px 12px; border-inline-start: 3px solid var(--s3); color: var(--ink); font-size: 14.5px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
  .as-card .as-fine { font-size: 12px; color: var(--ink-3); margin: 8px 0 0; line-height: 1.45; }
  .as-card .trip-acts { margin-top: 12px; display: flex; gap: 8px; }
  .as-card .trip-acts .trip-btn { flex: 1; }
  .as-tip + .as-tip { border-top: 1px solid var(--s3); padding-top: 10px; margin-top: 10px; }
  .as-tip b { display: block; font-size: 14.5px; color: var(--ink); }
  .as-tip-who { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
  .as-tip p { margin: 2px 0 6px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
  .as-tip .mr-tip-do { margin: 0 0 6px; }
  .as-tip .as-tip-said { color: var(--mint); font-weight: 700; margin: 4px 0 0; }
  .as-nw { white-space: nowrap; }
  .as-bar { display: flex; gap: 8px; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--s1); box-shadow: 0 -1px 0 var(--s3); }
  .as-bar input { flex: 1; min-width: 0; height: 44px; border-radius: var(--r-pill); padding: 0 16px; }
  .as-send { flex: none; width: 44px; height: 44px; border: 0; border-radius: var(--r-pill); background: var(--mint); color: var(--on-accent); cursor: pointer; display: grid; place-items: center; }
  .as-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  [dir="rtl"] .as-send svg { transform: scaleX(-1); }

  canvas { max-height: 220px; }
  table { width: 100%; border-collapse: collapse; font-size: 14px; }
  /* a wide table (big amounts on a phone) scrolls inside its own card, never the page */
  .table-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--s3) transparent; }
  .table-scroll td { white-space: nowrap; }
  th { text-align: start; padding: 8px 10px; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--track); font-size: 12.5px; }
  td { padding: 9px 10px; border-bottom: 1px solid var(--track); color: var(--ink); }
  tr:last-child td { border-bottom: none; }
  .btn-del { background: none; border: none; color: var(--ink-3); cursor: pointer; font-size: 16px; min-width: 40px; min-height: 40px; flex-shrink: 0; border-radius: var(--r-control); display: inline-flex; align-items: center; justify-content: center; }
  .btn-del:hover { color: var(--crit); background: var(--crit-soft); }
  .btn-edit-row { background: none; border: none; color: var(--ink-2); cursor: pointer; font-size: 15px; min-width: 40px; min-height: 40px; flex-shrink: 0; border-radius: var(--r-control); display: inline-flex; align-items: center; justify-content: center; }
  .btn-edit-row:hover { color: var(--ink); background: var(--s3); }
  .modal-monthly-hint { font-size: 13px; color: var(--ink-3); margin-top: 6px; min-height: 1em; }
  .empty-state { text-align: center; padding: 26px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .empty-state-icon { font-size: 28px; opacity: 0.6; margin-bottom: 2px; }
  .empty-state-text { font-size: 15px; color: var(--ink-2); font-weight: 700; }
  .empty-state-hint { font-size: 13px; color: var(--ink-3); max-width: 320px; }
  .list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--s2); border-radius: var(--r-md); margin-bottom: 8px; }
  .list-row .lr-main { font-size: 15px; font-weight: 600; }
  .list-row .lr-sub { font-size: 13px; color: var(--ink-3); }
  .list-row .lr-amt { font-weight: 700; color: var(--ink); white-space: nowrap; }
  .preset-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .preset-chip { background: var(--s2); border: 1.5px solid transparent; color: var(--ink-2); border-radius: var(--r-pill); padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
  .preset-chip:hover { background: var(--s3); }
  .preset-chip.selected { border-color: var(--mint); background: var(--mint-soft); color: var(--ink); }
  .fixed-item-row { background: var(--s2); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .fixed-item-row input.fi-name { flex: 1; min-width: 100px; font-weight: 600; font-size: 15px; border: none; background: transparent; padding: 4px; }
  .fixed-item-row input.fi-name:focus { background: var(--s1); }
  .fixed-item-row input.fi-amount { width: 100px; }
  .fixed-item-row select.fi-person { width: 130px; }
  .fixed-item-row select.fi-cur { width: 80px; flex: none; }
  /* a fixed expense row (name, amount, currency, delete): on a phone, the name on its own line with
     delete, then amount and currency, instead of wrapping into a cut-off currency box */
  @media (max-width: 560px) {
    .fixed-item-row:has(> .fi-name):has(> .fi-amount) { display: grid; grid-template-columns: minmax(0, 1fr) 96px 40px; grid-template-areas: "name name del" "amount cur cur"; }
    .fixed-item-row:has(> .fi-name) > .fi-name { grid-area: name; }
    .fixed-item-row:has(> .fi-name) > .fi-amount { grid-area: amount; width: 100%; }
    .fixed-item-row:has(> .fi-name) > .fi-cur { grid-area: cur; width: 100% !important; }
    .fixed-item-row:has(> .fi-name) > .btn-del { grid-area: del; }
  }
  .budget-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .budget-row .b-label { flex: 1; font-size: 15px; font-weight: 600; }
  .budget-row input { width: 110px; }

  /* ── Meters: the limit is a line the fill crosses ──
     The track runs to 125% of the limit; the limit is a tick at 80%; the fill is neutral up to the
     limit, amber within 10% of it, and an overrun beyond the tick is coral. The renderer sets --w
     (the filled share of the track) and --tick (the limit's position). */
  .progress-bar-bg { --bar: var(--bar-ok); --w: 0%; position: relative; height: 10px; margin-top: 8px; background: var(--track); border-radius: var(--r-bar); overflow: hidden; }
  .progress-bar-bg::before, .progress-bar-bg::after {
    content: ''; position: absolute; top: 0; bottom: 0; inset-inline-start: 0; border-radius: var(--r-bar); transition: width 0.6s var(--ease-out);
  }
  /* the fill up to the limit, then (for an overrun) the part past the limit in coral */
  .progress-bar-bg::before { width: min(var(--w), var(--tick, 100%)); background: var(--bar); }
  .progress-bar-bg::after { inset-inline-start: var(--tick, 100%); width: max(0%, calc(var(--w) - var(--tick, 100%))); background: var(--crit);
                            border-start-start-radius: 0; border-end-start-radius: 0; }
  .progress-bar-bg.fill-over::before { background: var(--bar-ok); border-start-end-radius: 0; border-end-end-radius: 0; }
  .progress-bar-bg.fill-warn { --bar: var(--bar-warn); }
  .progress-bar-bg.fill-over { --bar: var(--bar-over); }
  .progress-bar-fill { display: none; }
  .progress-bar-tick { position: absolute; top: 0; bottom: 0; width: 2.5px; background: var(--ink); inset-inline-start: var(--tick, 100%); border-radius: 1px; }
  .over-stamp { display: none; }
  .fill-ok { --bar: var(--bar-ok); } .fill-warn { --bar: var(--bar-warn); } .fill-over { --bar: var(--bar-over); }

  .review-box { background: var(--s2); border-radius: var(--r-lg); padding: 14px 16px; font-size: 14px; line-height: 1.8; color: var(--ink); }
  .review-box b { color: var(--ink); }
  .review-flag { color: var(--crit); font-weight: 700; }

  #toast {
    position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; margin-inline: auto; width: max-content; transform: translateY(60px); /* centred without translateX, so a hidden toast never widens the page */
    background: var(--s3); color: var(--ink); padding: 10px 18px; border-radius: var(--r-md); box-shadow: 0 12px 30px -12px var(--shadow);
    font-size: 14px; font-weight: 600; opacity: 0; transition: opacity 0.25s, transform 0.3s var(--ease-out); z-index: 1100; /* above .modal-overlay (1000): a form's own "please fill in" must be seen */ pointer-events: none;
    display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  }
  #toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
  #toast .toast-action { background: none; border: none; color: var(--mint); font-weight: 700; font-size: 14px; cursor: pointer; padding: 4px; white-space: nowrap; }

  @media (max-width: 640px) {
    .bottom-grid { grid-template-columns: 1fr; }
    /* the bottom keeps the room for the fixed tab bar (set above); 40px let the bar cover the last card */
    #appScreen { padding: 0 16px calc(108px + env(safe-area-inset-bottom, 0px)); }
    .cards-grid { gap: 6px; margin-inline: 2px; }
    .stat-card { padding: 8px 10px; }
    .stat-value { font-size: 16px; }
  }

  .welcome-list { text-align: start; margin: 14px 0; font-size: 15px; }
  .welcome-list .wl-step { display: flex; align-items: baseline; gap: 10px; line-height: 2.1; }
  .welcome-list .wl-when { flex: 0 0 56px; font-size: 13px; color: var(--ink-3); }
  .welcome-list .wl-what { font-weight: 600; }
  .welcome-list .wl-note { padding-inline-start: 66px; margin: 4px 0 2px; font-size: 13px; color: var(--ink-3); }
  body.lang-en .welcome-list .wl-when { flex-basis: 76px; }
  body.lang-en .welcome-list .wl-note { padding-inline-start: 86px; }

  .bills-glance-heading { font-weight: 700; font-size: 15px; color: var(--ink); margin: 6px 0 10px; }
  /* as many months per row as the column has room for (it sits in a ~576px column on desktop) */
  .bills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; margin-bottom: 4px; }
  .bills-grid .bill-card { min-width: 0; }
  .bills-grid .bill-card { background: var(--s3); border-radius: var(--r-md); padding: 10px 12px; }
  .bills-grid .bill-card-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
  .bills-mini-table { width: 100%; border-collapse: collapse; }
  .bills-mini-table th, .bills-mini-table td { font-size: 12.5px; padding: 4px 5px; text-align: start; border-bottom: 1px solid var(--track); }
  .bills-mini-table thead th { font-weight: 700; color: var(--ink-2); }
  .bills-mini-table td.bills-mini-table-empty { text-align: center; color: var(--ink-3); }
  .bill-card-total { font-size: 13px; font-weight: 700; color: var(--ink); text-align: center; margin-top: 8px; }
  .bill-card-edit-btn { display: block; width: 100%; margin-top: 8px; padding: 8px 0; font-size: 13px; font-weight: 600; background: var(--s2); color: var(--ink); border: 0; border-radius: var(--r-control); cursor: pointer; }
  .bill-card-edit-btn:hover { background: var(--s1); }
  .overview-group-label { font-size: 13px; font-weight: 700; color: var(--ink-3); margin: 12px 0 6px; }
  .overview-group-label:first-child { margin-top: 0; }

  .hero-stat { text-align: center; background: var(--s2); border-radius: var(--r-row); padding: 16px 14px; margin: 4px 0 14px; }
  .hero-stat + .hero-stat { margin-top: 12px; }
  .hero-stat-label { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
  .hero-stat-value { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--ink); }
  .hero-stat-value.is-in { color: var(--mint); }
  .hero-stat-value.is-out { color: var(--crit); }
  .hero-stat.is-small .hero-stat-value { font-size: 24px; }

  .alert-box { background: var(--crit-soft); border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 14px; }

  .upcoming-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .upcoming-row:last-child { border-bottom: none; }
  .upcoming-text { flex: 1; min-width: 0; }
  .upcoming-name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
  .upcoming-when { font-size: 13px; color: var(--ink-3); }
  .upcoming-amt { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .upcoming-edit { background: none; border: none; cursor: pointer; padding: 4px; line-height: 0; }
  .upcoming-total { margin-top: 8px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-3); font-size: 14px; }
  /* the month close entry: a card early in the month, a single tappable row the rest of it */
  .month-close-entry .section-hint { margin-bottom: 12px; }
  .month-close-entry.is-row { padding: 0; }
  .month-close-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 0 18px;
                     background: none; border: none; color: var(--ink-2); font: inherit; font-weight: 600; font-size: 15px; text-align: start; cursor: pointer; }
  .month-close-row .face-chev { transform: rotate(90deg); }
  [dir="ltr"] .month-close-row .face-chev { transform: rotate(-90deg); }
  /* the first month: what setup left for later, in place of closing a month (renderFirstMonthTodo) */
  .todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .todo-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--s2);
              border: 0; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
  .todo-row:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
  .todo-tick { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 1.5px solid var(--track); display: grid; place-items: center; }
  .todo-tick svg.i { width: 16px; height: 16px; }
  .todo-row.done .todo-tick { background: var(--mint); border-color: var(--mint); color: var(--on-accent); }
  .todo-text { flex: 1; display: grid; gap: 2px; }
  .todo-text b { font-size: 15px; }
  .todo-text .s { font-size: 13px; color: var(--ink-3); }
  .todo-row.done .todo-text b { color: var(--ink-2); }
  .todo-row .face-chev { transform: rotate(90deg); }
  [dir="ltr"] .todo-row .face-chev { transform: rotate(-90deg); }
  .month-close-entry .todo-hide { margin: 10px auto 0; display: block; }
  /* the partner's phone (renderPartnerCard, openAccount) */
  .partner-card[hidden] { display: none; }
  .partner-email { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 12px 0; padding: 10px 12px;
                   border-radius: var(--r-lg); background: var(--s2); }
  .partner-email span { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
  .partner-email .btn-outline { margin: 0; flex: none; }
  .partner-share { width: 100%; }
  .partner-note { margin-top: 8px; font-size: 13px; color: var(--ink-3); text-align: center; }
  .partner-card .partner-hide { display: block; margin: 8px auto 0; }
  .account-sub { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
  .account-logout { width: 100%; margin-top: 18px; }

  /* ── Monthly review (panel-monthClose; design/monthly-review-2026-11-06.html, month-close-uploads-2026-11-06.html).
     Same three numbered sections every month. Red only for overrun figures, mint for tip amounts and actions. ── */
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mr-num { font-variant-numeric: tabular-nums; }
  /* which month: the month itself is the button; until the script has drawn it, the plain select shows */
  .mr-month { display: flex; align-items: center; gap: 8px; }
  .mr-pick:not(.ready) .mr-month, .mr-pick.ready .mr-month-select { display: none; }
  .mr-month-arrow { flex: none; width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink-2); font-size: 20px; border-radius: var(--r-control); cursor: pointer; }
  .mr-month-arrow:disabled { color: var(--track); cursor: default; }
  [dir="ltr"] .mr-month-arrow { transform: scaleX(-1); }   /* the glyphs are written for right-to-left */
  #mrWhatBody > .mr-warn { margin: 0 0 14px; }
  .mr-month-btn { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); text-align: center; cursor: pointer;
                  border-radius: var(--r-row); padding: 12px 14px; box-shadow: inset 0 0 0 1.5px var(--s3); }
  .mr-month-btn b { display: block; font-size: 18px; }
  .mr-month-btn span { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
  .mr-month-list { margin-top: 12px; }
  .mr-mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--s3); }
  .mr-mrow:first-child { border-top: 0; }
  .mr-mrow b { font-size: 15px; }
  .mr-mrow small { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
  .mr-mrow.is-current b, .mr-mrow.is-current small { color: var(--ink-3); }
  .mr-pill { flex: none; border: 0; border-radius: var(--r-pill); padding: 9px 14px; min-height: 40px; font-size: 13px; font-weight: 700; cursor: pointer;
             background: transparent; color: var(--mint); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--mint) 55%, transparent); }
  .mr-pill.is-go { background: var(--mint); color: var(--on-accent); box-shadow: none; }
  .mr-mrow small.is-closed { color: var(--mint); }
  .mr-mrow.is-sel { margin: 0 -14px; padding: 12px 14px; border-radius: var(--r-control); border-top-color: transparent;
                    background: color-mix(in srgb, var(--mint) 10%, transparent); }
  .mr-mrow.is-sel + .mr-mrow { border-top-color: transparent; }
  .mr-note.mr-saved-note { margin: 0 0 12px; }
  /* what has been uploaded: one row per file */
  .mr-file { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--s3); }
  .mr-file:first-child { border-top: 0; padding-top: 0; }
  .mr-file-ic { flex: none; width: 36px; height: 36px; border-radius: var(--r-control); background: var(--s2); display: grid; place-items: center; font-size: 18px; }
  .mr-file-t { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
  .mr-file-t small { display: block; font-size: 13px; font-weight: 500; color: var(--ink-3); }
  .mr-file-ok { flex: none; color: var(--mint); font-weight: 800; }
  /* which account a bank file is (mock-up E), and each account's balance (mock-up D) */
  .mr-inline-btn { border: 0; background: transparent; padding: 6px 2px; min-height: 32px; font: inherit; font-weight: 700; color: var(--mint); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  .mr-acct { margin: 0 0 12px; padding: 14px; border-radius: var(--r-row); background: var(--s2); }
  .mr-acct h3 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
  .mr-acct p { font-size: 13px; color: var(--ink-3); margin: 0 0 10px; line-height: 1.5; }
  .mr-acct-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
  .mr-acct-input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px; border-radius: var(--r-control); border: 1px solid var(--s3); background: var(--s1); color: var(--ink); font: inherit; font-size: 16px; }
  .mr-acct-input[aria-invalid="true"] { border-color: var(--crit); }
  .mr-acct p.mr-acct-err { color: var(--crit); margin: 6px 0 0; }
  .mr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
  .mr-chip { border: 0; border-radius: var(--r-pill); padding: 8px 14px; min-height: 40px; font: inherit; font-size: 14px; font-weight: 600; background: var(--s3); color: var(--ink); cursor: pointer; }
  .mr-chip[aria-pressed="true"] { background: var(--mint); color: var(--on-accent); }
  .mr-chip.is-quiet { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--s3); }
  .mr-acct-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
  .mr-bal { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; font-size: 15px; font-weight: 700; }
  .mr-bal + .mr-bal { border-top: 1px solid var(--s3); }
  .mr-bal small { display: block; font-size: 13px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
  .mr-bal b { flex: none; font-size: 17px; }
  .mr-bal b.is-neg { color: var(--crit); }
  .mr-note.mr-bal-note { margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--s3); }
  .mr-file-flag { color: var(--warn); font-weight: 600; }
  .mr-file.is-bad .mr-file-ic { background: transparent; box-shadow: inset 0 0 0 1.5px var(--warn-fill); }
  .mr-file.is-bad .mr-file-ok, .mr-file.is-bad small { color: var(--warn); }
  .mr-add { display: block; text-align: center; margin-top: 12px; padding: 12px; min-height: 48px; border-radius: var(--r-row); cursor: pointer;
            font-weight: 700; color: var(--mint); border: 1.5px dashed color-mix(in srgb, var(--mint) 55%, transparent); }
  .mr-warn { margin-top: 12px; padding: 14px 16px; border-radius: var(--r-row); font-size: 14px; line-height: 1.5;
             background: color-mix(in srgb, var(--warn-fill) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn-fill) 45%, transparent); }
  /* the dashboard's transfer banner (rule 13): a warning tint, in either theme, from tokens only */
  /* a big charge ahead (big-charge-warning-mock-2026-11-09) */
  .bc-line { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 12px 14px; margin-bottom: 12px;
    border-radius: var(--r-lg); background: color-mix(in srgb, var(--warn-fill) 12%, var(--s1));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn-fill) 40%, transparent); }
  .bc-line[hidden] { display: none; }
  .bc-ico { width: 22px; height: 22px; color: var(--warn-fill); margin-top: 1px; }
  .bc-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
  .bc-text b { font-weight: 800; }
  .bc-more { display: inline-block; margin-top: 4px; border: 0; background: none; padding: 4px 0; min-height: 32px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
  .bc-list { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
  .bc-list li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
  .bc-seen { border: 0; border-radius: var(--r-control); background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); font: inherit;
    font-size: 13px; font-weight: 700; padding: 8px 12px; min-height: 36px; cursor: pointer; white-space: nowrap; }
  .xfer-banner { background: color-mix(in srgb, var(--warn-fill) 14%, var(--s1)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn-fill) 45%, transparent); }
  .xfer-banner.is-short { background: color-mix(in srgb, var(--crit) 10%, var(--s1)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--crit) 40%, transparent); }
  .xfer-title { font-size: 16px; font-weight: 800; color: var(--ink); margin: 0 0 6px; }
  .xfer-text { font-size: 14px; line-height: 1.55; color: var(--ink); margin: 0; overflow-wrap: anywhere; }
  .xfer-asof { font-size: 12px; color: var(--ink-3); margin: 8px 0 12px; }
  .xfer-do { border: 0; border-radius: var(--r-control); background: var(--mint); color: var(--on-accent); font-weight: 700; font-size: 14px; padding: 10px 16px; min-height: 44px; cursor: pointer; }
  /* trips (design/vacation-months-2026-11-08.html): the question after statements, the trip card, a trip
     month on the dashboard, the vacation fund. A vacation month is not an overrun: no coral, no amber. */
  .trip-ask { margin: 0 0 14px; }
  .trip-kicker { font-size: 13px; color: var(--ink-3); margin: 0 0 4px; }
  .trip-q { font-size: 20px; font-weight: 800; line-height: 1.3; margin: 0 0 8px; color: var(--ink); }
  .trip-why { font-size: 14px; color: var(--ink-2); line-height: 1.5; margin: 0; }
  .trip-seen { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
  .trip-seen li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--ink-2); }
  .trip-seen li .ic { flex: none; width: 20px; text-align: center; }
  .trip-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
  .trip-btn { border: 0; border-radius: var(--r-control); font: inherit; font-weight: 700; font-size: 15px; min-height: 48px; padding: 10px 14px; cursor: pointer; }
  .trip-btn.primary { background: var(--mint); color: var(--on-accent); flex: 1.3 1 0; }
  .trip-btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--s3); flex: 1 1 0; }
  .trip-link { display: block; margin: 6px auto 0; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; min-height: 40px; cursor: pointer; }
  .trip-fix { display: flex; gap: 10px; margin-top: 12px; }
  .trip-fix label { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); }
  .trip-fix input { width: 100%; margin-top: 6px; }
  /* trips booked ahead: the month asked on the question, and the "בדרך" lines in the fund */
  .trip-fix select { width: 100%; margin-top: 6px; }
  .trip-fix-month { flex-direction: column; gap: 6px; }
  .trip-hint { font-size: 12.5px; color: var(--ink-3); }
  .trip-fund-kicker { margin: 12px 0 0; }
  .trip-fund-open { display: flex; justify-content: space-between; gap: 10px; width: 100%; min-height: 32px; align-items: center; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
  .trip-next { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: var(--r-row); background: var(--s2); }
  .trip-next .t { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
  .trip-next .t b { display: block; color: var(--ink); font-size: 15px; }
  .trip-pill { border: 0; border-radius: var(--r-pill); font: inherit; font-size: 13px; font-weight: 700; padding: 8px 12px; min-height: 40px; color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1.5px var(--s3); white-space: nowrap; cursor: pointer; }
  .trip-compare { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 14px; margin: 12px 0 0; align-items: baseline; }
  .trip-compare .k { color: var(--ink-2); }
  .trip-compare .v { font-weight: 700; text-align: end; }
  .trip-compare .v.big { font-size: 18px; font-weight: 800; }
  .trip-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
  .trip-chip { border: 0; font: inherit; color: var(--ink); border-radius: var(--r-pill); padding: 10px 14px; font-size: 14px; font-weight: 600; min-height: 42px; background: var(--s2); box-shadow: inset 0 0 0 1px var(--s3); cursor: pointer; }
  .trip-chip.on { background: color-mix(in srgb, var(--mint) 14%, var(--s1)); box-shadow: inset 0 0 0 1.5px var(--mint); }
  .trip-chip.plain { background: transparent; color: var(--ink-2); }
  .trip-after { font-size: 13px; color: var(--ink-3); margin: 12px 0 0; line-height: 1.5; }
  /* irregular expenses (unusual-expenses-mock-2026-11-08): the question's "every N" chips, the put-aside
     box and the sign-up note (the dashboard card is numbers', below). */
  .irr-every { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
  .irr-every > span { font-size: 13px; color: var(--ink-2); flex: 0 0 100%; }
  .irr-normal { margin-top: 10px; }
  .irr-aside { border-radius: var(--r-row); background: var(--s2); padding: 12px 14px; margin-top: 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
  .irr-aside b { display: block; color: var(--ink); font-size: 15px; }
  .irr-built { margin: 0 0 14px; }
  .irr-card .irr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .irr-card h3 { margin: 0; font-size: 16px; color: var(--ink); }
  .irr-total { font-size: 20px; font-weight: 800; white-space: nowrap; }
  .irr-items { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
  .irr-items li { display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 10px; align-items: baseline; font-size: 14.5px; }
  .irr-items .ic { text-align: center; }
  .irr-items .a { font-weight: 700; white-space: nowrap; }
  .irr-items .s { grid-column: 2 / 4; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
  .irr-foot { font-size: 12.5px; color: var(--ink-3); margin: 12px 0 0; line-height: 1.45; }
  .trip-name { display: block; font-size: 13px; color: var(--ink-2); margin-top: 12px; }
  .trip-name input { width: 100%; margin-top: 6px; }
  .trip-card { margin: 14px 0 0; }
  .trip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .trip-head h3 { margin: 0; font-size: 17px; color: var(--ink); min-width: 0; }
  .trip-total { font-size: 22px; font-weight: 800; white-space: nowrap; }
  .trip-sub { font-size: 13px; color: var(--ink-3); margin: 2px 0 14px; }
  .trip-bar { display: flex; height: 10px; border-radius: var(--r-bar); overflow: hidden; background: var(--track); margin: 4px 0 14px; gap: 2px; }
  .trip-bar i { display: block; background: var(--ink-2); }
  .trip-split { display: grid; gap: 10px; }
  .trip-srow { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 10px; align-items: baseline; font-size: 15px; }
  .trip-srow .ic { text-align: center; }
  .trip-srow .a { font-weight: 700; }
  .trip-srow.rest { padding-top: 10px; border-top: 1px solid var(--s3); color: var(--ink-2); }
  .trip-vs { border-radius: var(--r-row); background: var(--s2); padding: 12px 14px; margin-top: 14px; font-size: 14px; line-height: 1.55; }
  .trip-vs b { font-size: 15px; }
  .trip-vs .added { display: block; font-size: 17px; font-weight: 800; margin-top: 2px; }
  .trip-vs .why { display: block; color: var(--ink-3); font-size: 13px; }
  .trip-fundnote { font-size: 14px; color: var(--ink-2); line-height: 1.45; margin: 12px 0 0; }
  .trip-fundnote b { display: block; color: var(--ink); font-size: 15px; }
  .trip-month-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 10px; }
  .trip-tag { border-radius: var(--r-pill); padding: 5px 11px; font-size: 13px; font-weight: 700; background: var(--s3); color: var(--ink); white-space: nowrap; }
  .trip-month-big { font-size: 13px; color: var(--ink-3); }
  .trip-month-fig { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 2px 0 10px; }
  .trip-lines { display: grid; gap: 10px; font-size: 14.5px; }
  .trip-line { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
  .trip-line > span { color: var(--ink-2); }
  .trip-line b { white-space: nowrap; }
  .trip-line b.money { color: var(--mint); }
  .trip-line small { color: var(--ink-3); font-weight: 400; }
  .trip-open { margin-top: 12px; width: 100%; }
  .trip-catline { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
  .trip-fund-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
  .trip-fund-list li { display: flex; justify-content: space-between; gap: 10px; }
  .trip-fund-list li b { color: var(--ink); font-weight: 600; }
  .trip-fund-list .sum { border-top: 1px solid var(--s3); padding-top: 6px; }
  .trip-fund-edit { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
  .trip-fund-edit input { flex: 1; min-width: 0; }
  .trip-built { border-radius: var(--r-row); background: var(--s2); padding: 12px 14px; font-size: 14px; line-height: 1.55; margin: 0 0 14px; }
  .trip-built b { font-size: 15px; }
  .trip-months { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 120px; margin: 6px 0 4px; }
  .trip-mcol { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; }
  .trip-mcol .b { border-radius: var(--r-xs) var(--r-xs) var(--r-2xs) var(--r-2xs); background: color-mix(in srgb, var(--ink-3) 55%, transparent); }
  .trip-mcol .bt { border-radius: var(--r-xs) var(--r-xs) 0 0; background: repeating-linear-gradient(135deg, var(--ink-2) 0 4px, transparent 4px 8px); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
  .trip-mcol.has-trip .b { border-radius: 0 0 var(--r-2xs) var(--r-2xs); }
  .trip-mlabels { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; font-size: 12.5px; color: var(--ink-3); text-align: center; }
  .trip-mlabels b { display: block; color: var(--ink); font-size: 12.5px; }
  .trip-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }
  .trip-legend i { display: inline-block; width: 12px; height: 12px; border-radius: var(--r-2xs); vertical-align: -1px; margin-inline-end: 6px; }
  .trip-legend .n { background: color-mix(in srgb, var(--ink-3) 55%, transparent); }
  .trip-legend .t { background: repeating-linear-gradient(135deg, var(--ink-2) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
  .trip-note { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.5; }
  /* 1 · what happened */
  .mr-hero-line { font-size: 14px; color: var(--ink-3); }
  .mr-hero-big { font-size: 28px; font-weight: 800; margin: 2px 0 12px; line-height: 1.2; }
  .mr-hero-big.is-over { color: var(--crit); }
  .mr-hero-big.is-under { color: var(--mint); }
  .mr-hero-known { display: block; font-size: 14px; font-weight: 600; color: var(--ink-3); }
  .mr-hero-lump { font-size: 15px; color: var(--ink-2); line-height: 1.5; margin: -4px 0 14px; }
  .mr-hero-irr { font-size: 17px; font-weight: 600; color: var(--ink-2); line-height: 1.4; margin: -6px 0 14px; }
  .mr-hero-irr b { color: var(--ink); font-weight: 800; }
  .mr-hero-fund { display: block; font-size: 14px; color: var(--mint); margin-top: 2px; }
  /* funds for unusual expenses (funds-mock-2026-11-08) */
  .fund-offer { border-top: 1px solid var(--s3); margin-top: 12px; padding-top: 12px; }
  .fund-offer-q { margin: 0 0 8px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
  .fund-offer-q b { color: var(--ink); }
  .fund-offer .trip-chips { margin-top: 0; }
  .fund-amt { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
  .fund-amt input { width: 96px; flex: 0 0 auto; }
  .fund-basis { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; margin: 8px 0 0; }
  .irr-items .fund-link { grid-column: 2 / 4; justify-self: start; margin-top: 4px; padding: 6px 0; min-height: 36px; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--mint); cursor: pointer; }
  .irr-items .fund-inline { display: block; border-radius: var(--r-row); background: var(--s2); padding: 12px 14px; margin-top: -4px; }
  .irr-items .fund-inline .fund-offer-q { margin: 0; }
  .irr-items .fund-inline .trip-acts { margin-top: 10px; }
  .irr-items .s .from { color: var(--mint); }
  .fund-list { display: grid; gap: 12px; margin-top: 12px; }
  .fund-box { border-radius: var(--r-row); background: var(--s2); padding: 12px 14px; }
  .fund-box.off { background: none; border: 1px dashed var(--s3); }
  .fund-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .fund-top h4 { margin: 0; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
  .fund-bal { text-align: end; }
  .fund-bal b { display: block; font-size: 19px; color: var(--ink); }
  .fund-bal span { font-size: 12px; color: var(--ink-3); }
  .fund-box .trip-fund-list { margin-top: 8px; }
  .fund-box .trip-note { margin: 8px 0 0; }
  .fund-box .trip-acts { margin-top: 10px; display: grid; gap: 2px; justify-items: start; }
  .fund-box .trip-acts .trip-btn { width: 100%; }
  .fund-end-link { padding: 8px 2px; min-height: 36px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  .fund-end { border-top: 1px solid var(--s3); margin-top: 12px; padding-top: 12px; }
  .fund-end p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
  .fund-end p b { color: var(--ink); }
  .fund-end .trip-acts { display: grid; gap: 8px; }
  .fund-mark { display: inline-block; margin-inline-start: 6px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--s3); color: var(--ink-2); font-size: 11.5px; font-weight: 700; vertical-align: 1px; }
  .mr-link { display: inline-block; padding: 8px 2px; color: var(--mint); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  .mr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mr-stat { border-inline-start: 1px solid var(--s3); padding-inline-start: 10px; }
  .mr-stat:first-child { border-inline-start: 0; padding-inline-start: 0; }
  .mr-stat span { display: block; font-size: 12px; color: var(--ink-3); }
  .mr-stat b { font-size: 16px; }
  .mr-note { font-size: 13px; color: var(--ink-3); margin: 12px 0 0; line-height: 1.5; }
  /* 2 · where it went over */
  .mr-cat { padding: 12px 0; border-top: 1px solid var(--s3); }
  .mr-cat:first-child { border-top: 0; padding-top: 0; }
  .mr-cat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; font-size: 15px; }
  .mr-cat-gap { color: var(--crit); font-size: 14px; white-space: nowrap; }
  .mr-cat-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
  .mr-bar { height: 6px; border-radius: var(--r-2xs); background: var(--crit); margin: 8px 0 6px; }
  .mr-why { font-size: 14px; line-height: 1.45; }
  .mr-txs { margin-top: 8px; padding-inline-start: 10px; border-inline-start: 2px solid var(--s3); }
  .mr-txs summary { font-size: 13px; color: var(--ink-2); cursor: pointer; padding: 4px 0; }
  .mr-tx { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); padding: 3px 0; }
  .mr-ok-line { font-size: 14px; color: var(--ink-2); }
  .mr-all { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--s3); }
  .mr-all > summary { font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; padding: 4px 0; }
  /* 3 · what to do */
  .mr-since { font-size: 14px; color: var(--ink-2); line-height: 1.45; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--s3); }
  .mr-tip { padding: 14px 0; border-top: 1px solid var(--s3); }
  .mr-tip:first-child { border-top: 0; padding-top: 0; }
  .mr-who { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; }
  /* A long saving figure goes under the title instead of past the screen's edge (release pass, 2026-11-06) */
  .mr-tip-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 8px; }
  .mr-tip-head b { font-size: 15px; }
  .mr-tip-amt { color: var(--mint); font-weight: 800; font-size: 14px; min-width: 0; }
  .mr-tip p { margin: 4px 0 10px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
  .mr-tip-do { border: 0; border-radius: var(--r-control); background: var(--mint); color: var(--on-accent); font-weight: 700; font-size: 14px; padding: 10px 14px; min-height: 44px; cursor: pointer; }
  .mr-tip-fb { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .mr-tip-fb button { border: 1px solid var(--s3); background: transparent; color: var(--ink-2); border-radius: var(--r-pill); font-size: 13px; font-weight: 600; padding: 8px 12px; min-height: 40px; cursor: pointer; }
  .mr-tip.is-answered { padding: 10px 0; }
  .mr-tip-done { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
  .mr-tip-done button { border: 0; background: transparent; color: var(--mint); font-weight: 700; font-size: 13px; cursor: pointer; min-height: 40px; }
  .mr-empty { font-size: 14px; color: var(--ink-3); }
  .mr-unrec { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--s3); }
  .mr-sub-title { font-size: 15px; font-weight: 700; margin: 0 0 8px; color: var(--ink); }

  .essential-split-bar { display: flex; height: 12px; border-radius: var(--r-xs); overflow: hidden; background: var(--track); margin-bottom: 14px; gap: 2px; }
  .essential-fill-essential, .essential-fill-nonessential { background: var(--series); height: 100%; transition: width 0.4s var(--ease-out); }
  .essential-stats { display: flex; gap: 10px; }
  .essential-stat { flex: 1; text-align: center; background: var(--s2); border-radius: var(--r-lg); padding: 12px 8px; }
  .essential-dot { width: 10px; height: 10px; border-radius: var(--r-2xs); display: inline-block; margin-bottom: 6px; background: var(--series); }
  .essential-stat-label { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
  .essential-stat-value { font-size: 20px; font-weight: 800; color: var(--ink); }
  .essential-stat-pct { font-size: 12.5px; color: var(--ink-3); }

  /* side-by-side fields (inline flex rows in cards and modals) may shrink: a date input's own width
     must never push the row, and the window, wider than the screen */
  .modal-box [style*="display:flex"] > :not(button), .card [style*="display:flex"] > :not(button) { min-width: 0; }
  .modal-box input, .modal-box select { max-width: 100%; }
  /* fields side by side line up on their boxes even when one label wraps to more lines */
  .modal-box [style*="display:flex"]:has(> div > .f-label) { align-items: flex-end; }
  input[type="file"] { font: inherit; font-size: 13px; color: var(--ink-3); max-width: 100%; }
  input[type="file"]::file-selector-button { font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); background: var(--s2); border: 1.5px solid var(--s3);
    border-radius: var(--r-md); padding: 10px 14px; margin-inline-end: 10px; cursor: pointer; }
  .modal-box { scrollbar-width: thin; scrollbar-color: var(--s3) transparent; }
  .modal-overlay { position: fixed; inset: 0; background: var(--scrim); z-index: 1000; display: flex; align-items: center; justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .modal-box { background: var(--s1); border-radius: var(--r-surface); width: 100%; max-width: 460px; max-height: 88vh; max-height: 88dvh; overflow-y: auto; padding: 18px; box-shadow: var(--plate-shadow); }
  .modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .modal-title { font-size: 18px; font-weight: 800; color: var(--ink); }
  .modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink-2); min-width: 40px; min-height: 40px; border-radius: var(--r-control); }
  .modal-close:hover { background: var(--s2); color: var(--ink); }
  /* one expense per row, on two lines: what and how much (and delete), then category, currency, date */
  .modal-edit-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 1fr) 40px; grid-template-areas: "desc desc amount del" "cat currency date date";
                    gap: 6px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--track); }
  .modal-edit-row input, .modal-edit-row select { padding: 8px 10px; font-size: 14px; min-width: 0; width: 100%; margin: 0; }
  .modal-edit-row .me-desc { grid-area: desc; font-weight: 600; }
  .modal-edit-row .me-amount { grid-area: amount; }
  .modal-edit-row .btn-del { grid-area: del; }
  .modal-edit-row .me-cat { grid-area: cat; }
  .modal-edit-row .me-currency { grid-area: currency; }
  .modal-edit-row .me-date { grid-area: date; }
  .modal-add-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--track); }
  .modal-add-row .f-label { margin-top: 0; }

  .collapsible-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; gap: 10px; min-height: 40px; }
  .collapsible-arrow {
    font-size: 0; line-height: 1; color: var(--ink-3); flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--r-control); background: transparent;
    display: inline-flex; align-items: center; justify-content: center; transition: transform 0.28s var(--ease-out), background 0.15s;
  }
  .collapsible-arrow::before { content: ''; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
  .collapsible-head:hover .collapsible-arrow { background: var(--s3); color: var(--ink); }
  .collapsible-arrow.open { transform: rotate(180deg); }
  .collapsible-body { margin-top: 12px; }

  .donut-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
  .donut-deco { display: none; }
  .donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
  .donut-center-value { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.05; margin-top: 2px; letter-spacing: -0.02em; }
  .donut-center-label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
  .donut-center-left { font-size: 13px; font-weight: 700; color: var(--mint); margin-top: 5px; white-space: nowrap; }
  .donut-center-left.is-over { color: var(--crit); }
  .chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin-top: 14px; width: 100%; }
  .legend-item { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--s2); border-radius: var(--r-pill); padding-block: 3px; padding-inline-start: 3px; padding-inline-end: 10px; }
  .legend-icon-badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; background: var(--pill, var(--s6c)); }
  .legend-icon-badge svg { display: block; filter: brightness(0) invert(1); }

  /* ── Add tab ── */
  .form-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
  .form-sub { font-size: 14px; color: var(--ink-3); margin-bottom: 16px; line-height: 1.5; }
  .action-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
  .btn-quiet { padding: 10px; min-height: 44px; border-radius: var(--r-md); border: 0; background: var(--s2); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
  .btn-quiet:hover { background: var(--s3); }
  .btn-submit-lg { min-height: 56px; font-size: 17px; margin-top: 20px; }
  .cat-chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
  .cat-chip { display: flex; align-items: center; gap: 6px; padding: 10px 14px; min-height: 44px; border-radius: var(--r-pill); border: 1.5px solid transparent; background: var(--s2); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background 0.15s, border-color 0.15s, color 0.15s; }
  .cat-chip:hover { background: var(--s3); }
  .cat-chip.active { border-color: var(--mint); background: var(--mint-soft); color: var(--ink); }
  .ess-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .ess-row .b-label { flex: 1; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
  .ess-toggle-group { display: flex; border-radius: var(--r-control); overflow: hidden; background: var(--s2); padding: 2px; gap: 2px; }
  .ess-toggle-btn { padding: 7px 12px; font-size: 13px; font-weight: 700; border: none; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: var(--r-sm); }
  .ess-toggle-btn.active.ess-yes { background: var(--mint-soft); color: var(--mint); }
  .ess-toggle-btn.active.ess-no { background: var(--crit-soft); color: var(--crit); }

  /* ── English (LTR) ── */
  body.lang-en { direction: ltr; }
  body.lang-en .welcome-list { text-align: left; }
  body.lang-en input, body.lang-en select, body.lang-en textarea { direction: ltr; text-align: left; }
  body.lang-en th, body.lang-en td { text-align: left; }

  /* ── Focus, press, reduced motion ── */
  a:focus-visible, button:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--mint); outline-offset: 2px; border-radius: var(--r-xs);
  }
  .btn-primary:active, .btn-add:active, .btn-outline:active, .btn-quiet:active, .cat-chip:active, .preset-chip:active, .path-card:active { transform: scale(0.98); }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  }

  /* ── The three tiers and the card faces (DESIGN.md, Three-Tier Rule) ── */
  .tier-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; margin: 4px 0 10px; }
  .tier-head .section-title { margin: 0; font-size: 16px; }
  .tier-count { font-size: 13px; color: var(--ink-3); }
  .tier-attention { display: grid; gap: 10px; margin-bottom: 16px; }
  .tier-attention:empty { display: none; }
  /* minmax(0, 1fr): the column is the card's width, never a long line's (an English "No limit" list pushed the page sideways) */
  .hub { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hub > .card { margin-bottom: 0; }
  .card.fold { padding: 6px; }
  .card.fold > .collapsible-head { padding: 10px 12px; border-radius: var(--r-row); }
  .card.fold > .collapsible-head:hover { background: var(--s2); }
  .card.fold > .collapsible-body { margin-top: 0; padding: 4px 8px 10px; }
  .card.fold .card { margin-bottom: 8px; }
  .fold-text { min-width: 0; }
  /* The whole-plan total: beside the label the unbreakable range got less room than it needs, so on a phone-wide
     card the figure was cut ("₪11,314–11,91" in English; in Hebrew its start ran off the card below ~385px).
     The figure keeps its full width and goes on its own line under the label whenever the two do not fit side by
     side (the label keeps at least 14ch beside it). English from a 480px card down; Hebrew only on a card under
     325px, where it was cut, so Hebrew at 390px and up is unchanged (option 2, approved by Yonatan 2026-11-08).
     In a trip month the Hebrew label is longer and the ₪ crossed the card's edge up to ~392px, so there the figure
     goes under the label on a card up to 344px. On its own line the figure still gives way (break after "/") when
     even that line is too narrow, as at 320px, rather than being clipped. */
  #catProgressTotal { container: plantotal / inline-size; }
  @container plantotal (max-width: 480px) {
    body.lang-en .plan-total-line { flex-wrap: wrap; row-gap: 2px; }
    body.lang-en .plan-total-line > span:first-child { flex: 1 1 14ch; }
    body.lang-en .plan-total-line > span:last-child { flex: 0 1 auto; }
  }
  @container plantotal (max-width: 324px) {
    body:not(.lang-en) .plan-total-line { flex-wrap: wrap; row-gap: 2px; }
    body:not(.lang-en) .plan-total-line > span:first-child { flex: 1 1 14ch; }
    body:not(.lang-en) .plan-total-line > span:last-child { flex: 0 1 auto; }
  }
  @container plantotal (max-width: 344px) {
    body:not(.lang-en) .plan-total-line.is-trip { flex-wrap: wrap; row-gap: 2px; }
    body:not(.lang-en) .plan-total-line.is-trip > span:first-child { flex: 1 1 14ch; }
  }
  /* "Expected range ₪11,314–11,914" under Actual expenses: the range cannot break and was a few pixels wider than
     its card on a phone, so on a card too narrow for it the text is a pixel smaller (English up to a 90px card,
     Hebrew up to 86px; Hebrew at 390px and up is unchanged). */
  .stat-card.actual { container: statactual / inline-size; }
  @container statactual (max-width: 90px) {
    body.lang-en #statActualSub { font-size: 11px; }
  }
  @container statactual (max-width: 86px) {
    body:not(.lang-en) #statActualSub { font-size: 11px; }
  }
  .fold-sum { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #incomeFold > .collapsible-head { padding: 10px 12px; }
  /* saving the plan's edits is a quiet action: only "הוספה" is filled (DESIGN.md, Buttons) */
  #budgetHubCard > .btn-add { margin-top: 0; background: transparent; color: var(--mint); border: 1.5px solid color-mix(in srgb, var(--mint) 45%, transparent); box-shadow: none; min-height: 48px; }
  #budgetHubCard > .btn-add:hover { background: var(--mint-soft); }

  .cat-card { padding: 0; overflow: hidden; }
  .tier-attention .cat-card { box-shadow: var(--plate-shadow); }
  .cat-card.tier-crit { background: color-mix(in srgb, var(--crit) 9%, var(--s1)); }
  .cat-card.tier-warn { background: color-mix(in srgb, var(--warn) 9%, var(--s1)); }
  .card .cat-card { background: var(--s2); }
  .budget-cat-prog { padding: 14px 16px; cursor: pointer; border-radius: inherit; }
  .budget-cat-prog:empty { display: none; }
  .budget-cat-prog:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
  .budget-cat-prog + .budget-cat-prog { padding-top: 0; }
  .face-row { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: center; }
  .face-badge { grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--s3); color: var(--ink-2); }
  .face-badge svg { width: 22px; height: 22px; }
  .tier-crit .face-badge { background: var(--crit); color: var(--on-accent); }
  .tier-warn .face-badge { background: var(--warn-fill); color: var(--on-accent); }
  .tier-crit .face-badge svg *, .tier-warn .face-badge svg * { stroke: currentColor; }
  .face-title { font-size: 17px; font-weight: 700; line-height: 1.3; min-width: 0; }
  .tier-attention .face-title { font-size: 18px; }
  .face-status { white-space: nowrap; }
  .tier-crit .face-status { color: var(--crit); }
  .tier-warn .face-status { color: var(--warn); }
  .face-of { grid-column: 2; font-size: 13px; color: var(--ink-3); }
  .face-of svg { width: 14px; height: 14px; vertical-align: -2px; }
  .face-chev { grid-row: span 2; width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-3); transition: transform 0.28s var(--ease-out); }
  .face-chev::before { content: ''; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
  .budget-cat-prog[aria-expanded="true"] .face-chev { transform: rotate(180deg); }
  .face-meter { margin-inline-start: 56px; }
  .face-meter .progress-bar-bg { margin-top: 10px; }
  .pace-line { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
  .pace-line svg { width: 14px; height: 14px; vertical-align: -2px; }
  .pace-line.bad { color: var(--crit); font-weight: 600; }
  .pace-line.good { color: var(--mint); font-weight: 600; }
  .face-subs { display: none; margin: 12px 0 0 0; margin-inline-start: 56px; gap: 10px; }
  .budget-cat-prog[aria-expanded="true"] .face-subs { display: grid; }
  .sub-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 14px; }
  .sub-row .sub-name { color: var(--ink-2); min-width: 0; }
  .sub-row .sub-name svg { width: 14px; height: 14px; vertical-align: -2px; }
  .sub-row .sub-amt { font-weight: 600; white-space: nowrap; }
  .sub-row .sub-amt svg { width: 14px; height: 14px; vertical-align: -2px; }
  .sub-row.over .sub-amt { color: var(--crit); }
  .sub-row .progress-bar-bg { grid-column: 1 / -1; }

  /* the open card: its editing (manual total, sub-category limits, adding) under the face */
  .cat-card > .collapsible-body { margin: 0; padding: 4px 16px 16px; border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); }
  .budget-sub-wrap { padding-inline-start: 0; }
  .cat-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 0; margin: 0 0 6px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); font-size: 14px; color: var(--ink-2); }
  .cat-edit .b-label { display: none; }
  .cat-edit input[type="number"] { width: 110px !important; }

  /* Spending-category cards: read first, edit on purpose. The open body lists each sub-category as one
     line (name, amount of range, meter); a line opens to its facts, locked; its inputs show only after
     its "עריכה". The face's own sub-list would repeat the same lines, so it stays shut on these cards. */
  .cat-card[data-cat] .budget-cat-prog[aria-expanded="true"] .face-subs { display: none; }
  .sub-item { border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); margin-inline: -16px; }
  .sub-item-head {
    /* name, then the amount line under it, then the meter; the chevron beside them. Stacked, so a
       long name never gets squeezed to a letter per line in a narrow (nested) card. */
    width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: 2px 12px; align-items: center;
    min-height: 60px; padding: 12px 16px; background: none; border: none; color: inherit; cursor: pointer; text-align: start;
  }
  .sub-item-head:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
  .sub-item-head .face-chev { grid-column: 2; grid-row: 1 / span 3; width: 28px; height: 28px; }
  .sub-item.open .sub-item-head .face-chev { transform: rotate(180deg); }
  .sub-item-name { grid-column: 1; grid-row: 1; font-size: 15px; font-weight: 600; min-width: 0; }
  .sub-item-read { grid-column: 1; grid-row: 2; font-size: 14px; color: var(--ink-2); }
  .sub-item-read b { color: var(--ink); font-weight: 700; }
  .sub-item-read .over { color: var(--crit); font-weight: 700; }
  .sub-item-read .muted { color: var(--ink-3); }
  .sub-item-read svg { width: 14px; height: 14px; vertical-align: -2px; }
  .sub-item-meter { grid-column: 1; grid-row: 3; }
  .sub-item-meter:empty { display: none; }
  .sub-item-meter .progress-bar-bg { margin-top: 6px; }
  .sub-item-body { display: none; padding: 2px 16px 16px; }
  .sub-item.open .sub-item-body, .sub-item.open .sub-item-head { background: var(--s2); }
  .sub-item.open .sub-item-body { display: block; }
  .sub-item-edit { display: none; }
  .sub-item.editing .sub-item-edit { display: block; }
  .sub-item.editing .sub-item-view { display: none; }
  .sub-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin: 8px 0 14px; }
  .sub-fact span { display: block; font-size: 13px; color: var(--ink-3); }
  .sub-fact b { font-size: 17px; font-weight: 700; }
  .sub-fact b.over { color: var(--crit); }
  .sub-fact b.muted { color: var(--ink-3); font-weight: 500; font-size: 15px; }
  .btn-sub-edit, .btn-cat-tools {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: var(--r-control);
    background: var(--s3); color: var(--ink); border: none; font-weight: 700; font-size: 15px; cursor: pointer;
  }
  .btn-sub-edit svg, .btn-cat-tools svg { width: 16px; height: 16px; }
  .btn-cat-tools { margin-top: 14px; background: none; border: 1.5px solid var(--s3); }
  .btn-cat-tools[aria-expanded="true"] { display: none; }
  .editing-note { font-size: 13px; font-weight: 600; color: var(--mint); margin: 8px 0 12px; }
  .sub-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
  .sub-field span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
  .sub-field input { width: 100%; min-height: 48px; font-size: 18px; font-weight: 600; }
  .sub-field select { width: 100%; min-height: 48px; }
  .sub-field.f-wide { grid-column: 1 / -1; }
  /* a fixed bill's row draws both kinds of amount box; the fixed/range pill shows one kind */
  .sub-item:not(.mode-range) .f-range, .sub-item.mode-range .f-fixed { display: none; }
  /* a car's running costs: its name over its rows, and a line saying what fixed/variable does */
  .sub-group-label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 14px 0 2px; }
  .sub-group-label svg { width: 16px; height: 16px; }
  .sub-group-label span { font-weight: 500; color: var(--ink-3); }
  .sub-hint { font-size: 13px; color: var(--ink-3); margin: 6px 0 12px; }
  .sub-item:not(.kind-var) .k-var, .sub-item.kind-var .k-fixed { display: none; }
  .sub-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
  .btn-sub-save { min-height: 44px; padding: 10px 20px; border-radius: var(--r-control); border: none; background: var(--mint); color: var(--on-accent); font-weight: 700; font-size: 15px; cursor: pointer; }
  .btn-sub-cancel { min-height: 44px; padding: 10px 18px; border-radius: var(--r-control); background: none; border: 1px solid var(--s3); color: var(--ink-2); font-weight: 600; font-size: 15px; cursor: pointer; }
  .sub-more { margin-inline-start: auto; position: relative; }
  .sub-more summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 10px; border-radius: var(--r-control); color: var(--ink-2); font-weight: 600; }
  .sub-more summary::-webkit-details-marker { display: none; }
  .sub-more summary:hover { background: var(--s3); }
  /* opens in the flow under the buttons: the card clips overflow, and a floating menu covered the fields */
  .sub-more[open] { flex-basis: 100%; margin-inline-start: 0; }
  .sub-more-menu { margin-top: 6px; padding: 6px; border-radius: var(--r-lg); background: var(--s3); }
  .sub-more-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; background: none; border: none; border-radius: var(--r-control); color: var(--ink); font-size: 15px; text-align: start; cursor: pointer; }
  .sub-more-menu button:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
  .sub-more-menu button.danger { color: var(--crit); }
  .sub-more-menu svg { width: 18px; height: 18px; flex: none; }
  .cat-tools { display: none; padding-top: 12px; }
  .cat-tools.open { display: grid; gap: 10px; justify-items: start; }
  .cat-tools .cat-edit { width: 100%; }
  /* a fixed-expense group's bill rows and add box run full width; only the done button hugs its text */
  .cat-tools.fixed-tools.open { justify-items: stretch; }
  .fixed-tools > .btn-sub-cancel { justify-self: start; }
  .cat-add-sub { display: flex; gap: 6px; width: 100%; }
  #budgetInputs .budget-row:not(.cat-edit) { margin-bottom: 14px; flex-wrap: wrap; row-gap: 8px; }
  .budget-row .b-label svg { width: 18px; height: 18px; vertical-align: -3px; }

  /* ── Investing (Horizon): the projection plate first, then one column of plates; two columns from 900px ── */
  .inv-grid { display: grid; gap: 16px; }
  @media (min-width: 900px) {
    .inv-grid { grid-template-columns: 440px minmax(0, 1fr); align-items: start; gap: 24px; }
    .inv-hero { position: sticky; top: 76px; }
  }
  .inv-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
  .inv-surface { background: var(--s1); border-radius: var(--r-surface); padding: 18px; box-shadow: var(--plate-shadow); min-width: 0; }
  .inv-surface h2 { font-size: 17px; font-weight: 700; }
  .inv-head { margin-bottom: 12px; }
  .inv-lead { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
  .inv-lead:empty, .inv-note:empty { display: none; }
  .inv-note { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
  .inv-note a { color: var(--mint); font-weight: 600; display: inline-block; padding-block: 10px; }
  .inv-hero { background: linear-gradient(180deg, var(--s2), var(--s1) 70%); }
  .inv-lbl { font-size: 15px; font-weight: 600; color: var(--ink-2); }
  .inv-figure { display: flex; align-items: flex-start; gap: 3px; direction: ltr; justify-content: flex-end; line-height: 0.9; margin-top: 6px; }
  html[dir="ltr"] .inv-figure { justify-content: flex-start; }
  .inv-figure .n { font-size: 56px; font-weight: 800; letter-spacing: -0.045em; }
  .inv-figure .cur { font-size: 20px; font-weight: 700; color: var(--ink-2); margin-top: 6px; }
  .inv-under { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
  .inv-stats, .inv-scen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
  .inv-head + .inv-scen { margin-top: 0; }
  .inv-stat { background: var(--s2); border-radius: var(--r-lg); padding: 10px 12px; min-width: 0; }
  .inv-stat span { display: block; font-size: 12.5px; color: var(--ink-3); }
  .inv-stat b { font-size: 18px; font-weight: 800; }
  .inv-chart { margin-top: 14px; position: relative; }
  .inv-chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
  .inv-chart .grid-line { stroke: var(--track); stroke-width: 1; }
  .inv-chart .axis { font-family: var(--font); font-size: 11px; fill: var(--ink-3); }
  .inv-chart .area { fill: color-mix(in srgb, var(--mint) 22%, transparent); }
  .inv-chart .line { fill: none; stroke: var(--mint); stroke-width: 2.5; stroke-linejoin: round; }
  .inv-chart .put { fill: none; stroke: var(--bar); stroke-width: 2; stroke-dasharray: 4 4; }
  .inv-chart .dlabel { font-family: var(--font); font-size: 12px; font-weight: 700; }
  .inv-chart .dlabel.m { fill: var(--mint); }
  .inv-chart .dlabel.p { fill: var(--ink-2); }
  .inv-chart .cross { stroke: var(--ink-3); stroke-width: 1; }
  .inv-chart .dot { fill: var(--mint); stroke: var(--s1); stroke-width: 2; }
  .inv-tip { position: absolute; top: -46px; transform: translateX(-50%); background: var(--s3); color: var(--ink); font-size: 12.5px; padding: 6px 10px; border-radius: var(--r-control);
             box-shadow: 0 10px 24px -12px var(--shadow); pointer-events: none; white-space: nowrap; z-index: 2; }
  .inv-tip b { display: block; font-size: 14px; }
  .inv-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }
  .inv-legend i { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid var(--mint); vertical-align: middle; margin-inline-end: 6px; }
  .inv-legend i.p { border-top: 2px dashed var(--bar); }
  /* no draw-in animation: a chart caught in its first frame (background tab, preview) showed no line */
  @keyframes inv-fade { from { opacity: 0; } }

  /* holdings: one card per holding, its rows inside */
  #investHoldingsList { display: grid; gap: 8px; }
  .inv-holding { background: var(--s2); border-radius: var(--r-row); padding: 10px 12px; display: grid; gap: 6px; }
  .inv-holding .fixed-item-row { background: none; padding: 0; margin: 0 !important; }
  .inv-holding input { min-height: 40px; }
  /* A number reads left to right and is never cut: 100,000 showed as "00000" in a field 78px wide.
     !important only because the rows are drawn with inline min-widths (app.js renderInvestHoldings). */
  .inv-holding input[type="number"], .inv-hform input[type="number"] { direction: ltr; text-align: end; min-width: 11ch !important; }
  .inv-logged { font-size: 13px; font-weight: 700; color: var(--crit); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
  .inv-logged.is-done { color: var(--mint); }
  .inv-logged svg { width: 14px; height: 14px; }
  .inv-add-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; border-radius: var(--r-lg); font-size: 14px; font-weight: 600; margin-top: 10px; cursor: pointer;
                 color: var(--mint); background: none; border: 1.5px dashed color-mix(in srgb, var(--mint) 45%, transparent); text-align: start; }
  .inv-add-row svg.i { width: 18px; height: 18px; }
  .inv-add-row[aria-expanded="true"] { border-style: solid; }
  .inv-hform { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-lg); background: var(--s2); margin-top: 8px; box-shadow: inset 0 1px 0 var(--edge); }
  .inv-hform[hidden] { display: none; }
  .inv-hform .fixed-item-row { background: none; padding: 0; margin: 0; }
  .inv-hform .fixed-item-row > * { flex: 1 1 140px; min-width: 0; }
  .inv-hform input, .inv-hform select { background: var(--s1); }
  .inv-hform .preset-grid { margin-bottom: 8px; }
  .inv-hform .btn-primary { margin-top: 4px; }

  /* the plan's controls */
  .inv-controls { display: grid; gap: 16px; }
  .inv-ctl label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
  .inv-ctl output { font-size: 15px; font-weight: 800; color: var(--ink); }
  .inv-ctl .preset-grid { margin-bottom: 8px; gap: 6px; }
  .inv-money { display: flex; align-items: center; gap: 6px; background: var(--s2); border: 1.5px solid var(--track); border-radius: var(--r-md); padding: 0 12px; direction: ltr; }
  .inv-money:focus-within { border-color: var(--mint); }
  .inv-money input { font: inherit; font-size: 20px; font-weight: 800; color: var(--ink); background: none; border: 0; outline: none; padding: 10px 0; width: 100%; min-width: 0; text-align: right; box-shadow: none; }
  html[dir="ltr"] .inv-money input { text-align: left; }
  .inv-money span { color: var(--ink-3); font-weight: 700; }
  #panel-invest input[type="range"] { width: 100%; accent-color: var(--mint); height: 28px; padding: 0; border: 0; background: none; }
  .inv-range-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
  .inv-kv { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; font-size: 14px; margin-top: 12px; }
  .inv-kv > span:nth-child(odd) { color: var(--ink-2); }
  .inv-kv > span:nth-child(even) { font-weight: 700; text-align: end; white-space: nowrap; }
  .inv-kv > .sep { grid-column: 1 / -1; height: 1px; background: var(--track); }
  .inv-kv > span.big { font-size: 18px; font-weight: 800; color: var(--ink); }
  /* the separator shifts the odd/even rhythm by one, so the total row is aligned explicitly */
  .inv-kv > span.big:not(:last-child) { text-align: start; white-space: normal; }
  .inv-kv > span.big:last-child { text-align: end; white-space: nowrap; }
  .inv-kv .tax { color: var(--crit); }
  .inv-kv > span.inv-infl { white-space: normal; font-weight: 600; font-size: 13px; color: var(--ink-2); max-width: 24ch; }

  /* the year-end forecast, folded */
  .inv-fold { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: start; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font: inherit; }
  .inv-fold-end { display: flex; align-items: center; gap: 10px; flex: none; }
  .inv-fold > span:first-child { min-width: 0; }
  .inv-fold-end b { font-size: 20px; font-weight: 800; }
  .inv-fold .chev { width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.28s var(--ease-out); }
  .inv-fold[aria-expanded="true"] .chev { transform: rotate(225deg); }
  .inv-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.34s var(--ease-out); }
  .inv-panel[data-open="true"] { grid-template-rows: 1fr; }
  .inv-panel > div { overflow: hidden; min-height: 0; }
  .inv-breakdown { display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); padding-top: 12px; }
  .inv-breakdown b { color: var(--ink); font-weight: 600; }
  .inv-disclaimer { font-size: 12.5px; color: var(--ink-3); text-align: center; padding: 4px 8px; text-wrap: balance; }
  @media (prefers-reduced-motion: reduce) { .inv-panel, .inv-fold .chev { transition: none; } }
  .denom-action { background: none; border: 0; padding: 6px 10px; margin-top: 2px; font: inherit; font-size: 14px; font-weight: 700; color: var(--mint); cursor: pointer; border-radius: var(--r-control); }
  .denom-action:hover { background: var(--s2); }
  .donut-wrap.is-empty .donut-deco { display: block; position: absolute; inset: 0; margin: auto; aspect-ratio: 1; max-width: 100%; max-height: 100%; border-radius: 50%;
    background: radial-gradient(closest-side, transparent 57%, var(--track) 58%, var(--track) 99%, transparent 100%); pointer-events: none; }
  .donut-wrap.is-empty .donut-center-left { color: var(--ink-3); font-weight: 600; }
  /* touch screens: small toggles and sliders get a finger-sized target */
  @media (pointer: coarse) {
    .field-mode-btn { min-height: 40px; padding: 8px 12px; }
    #panel-invest input[type="range"] { height: 40px; }
  }
