  /* ── THEME: LIGHT ──────────────────────────────────────────────────────── */
  :root {
    --bg:           #ffffff;
    --bg2:          #fafafa;
    --bg3:          #ffffff;
    --surface:      #ffffff;
    --surface2:     #fafafa;
    --border:       #e5e5e5;
    --border2:      #d4d4d4;
    --ink:          #171717;
    --ink2:         #171717;
    --muted:        #737373;
    --primary:      #facc15;
    --primary2:     #ca9a04;
    --danger:       #e7000b;
    --danger2:      #c70009;
    --ok:           #16a34a;
    --rule-lines:   rgba(23,23,23,0.05);
    --table-th:     rgba(250,250,250,0.98);
    --table-tr:     rgba(250,204,21,0.04);
    --chip-bg:      #f5f5f5;
    --suggest-bg:   #ffffff;
    --shadow-modal: rgba(10,10,10,0.52);
    --shadow-sm:    rgba(0,0,0,0.07);
    --moto-fill:    #facc15;
    --moto-opacity: 0.05;
    --moto-chain-opacity: 0.04;
  }

  /* ── THEME: DARK ───────────────────────────────────────────────────────── */
  html.dark {
    --bg:           #09090b;
    --bg2:          #171717;
    --bg3:          #171717;
    --surface:      #171717;
    --surface2:     #1c1c1f;
    --border:       #2a2a2d;
    --border2:      #3a3a3d;
    --ink:          #fafafa;
    --ink2:         #f5f5f5;
    --muted:        #a1a1aa;
    --primary:      #facc15;
    --primary2:     #fde047;
    --danger:       #ff6467;
    --danger2:      #e7000b;
    --ok:           #4ade80;
    --rule-lines:   rgba(250,204,21,0.06);
    --table-th:     rgba(23,23,23,0.98);
    --table-tr:     rgba(250,204,21,0.035);
    --chip-bg:      rgba(250,204,21,0.10);
    --suggest-bg:   #171717;
    --shadow-modal: rgba(0,0,0,0.78);
    --shadow-sm:    rgba(0,0,0,0.32);
    --moto-fill:    #facc15;
    --moto-opacity: 0.06;
    --moto-chain-opacity: 0.05;
    color-scheme: dark;
  }

  /* ── BASE ──────────────────────────────────────────────────────────────── */
  html { transition: background-color 0.35s ease, color 0.25s ease; }
  html, body { background: var(--bg); color: var(--ink); font-family: 'Outfit', sans-serif; }
  body { transition: background-color 0.35s ease; }

  #root { position: relative; z-index: 1; }

  /* ── TYPOGRAPHY ────────────────────────────────────────────────────────── */
  .num     { font-variant-numeric: tabular-nums; font-family: 'Space Mono', monospace; }
  .display { font-family: 'Outfit', sans-serif; letter-spacing: -0.02em; font-weight: 700; }
  .smcap   { font-family: 'Outfit', sans-serif; text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; font-weight: 600; }
  .rule    { background-image: linear-gradient(to right, transparent, var(--border2) 20%, var(--border2) 80%, transparent); height: 1px; }
  .brand-rule {
    height: 2px;
    background: linear-gradient(to right, transparent 0%, #facc15 20%, #facc15 80%, transparent 100%);
    opacity: 0.75;
  }

  /* ── MARKER HIGHLIGHT ANIMATION ────────────────────────────────────────── */
  @keyframes markerWipe {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }
  @keyframes markerText {
    0%, 49% { color: var(--ink); }
    50%, 100% { color: #171717; }
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .marker-word {
    position: relative;
    display: inline-block;
    white-space: nowrap;
  }
  .marker-word::before {
    content: '';
    position: absolute;
    inset: 1px -4px;
    background: #facc15;
    transform-origin: left center;
    transform: scaleX(0);
    z-index: 0;
    animation: markerWipe 0.55s cubic-bezier(0.34, 1.06, 0.64, 1) 0.55s forwards;
  }
  .marker-word > span {
    position: relative;
    z-index: 1;
    animation: markerText 0.6s ease 0.55s both;
  }
  .anim-fade-up {
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
  }

  /* ── FORMS ─────────────────────────────────────────────────────────────── */
  input:focus, select:focus, textarea:focus, button:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
  input, select, textarea {
    background: var(--bg3); border: 1px solid var(--border2); border-radius: 0px;
    padding: 6px 8px; color: var(--ink); font-family: 'Outfit', sans-serif;
    transition: background 0.3s, border-color 0.3s, color 0.2s;
  }
  input.num, .num input { font-family: 'Space Mono', monospace; text-align: right; }
  input[type=date]      { font-family: 'Space Mono', monospace; }

  /* ── TABLES ────────────────────────────────────────────────────────────── */
  table.ledger { border-collapse: collapse; width: 100%; }
  table.ledger th, table.ledger td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; }
  table.ledger th { background: var(--table-th); font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink2); font-family: 'Outfit', sans-serif; }
  table.ledger tr:hover td { background: var(--table-tr); }
  /* v3.6 fix — Tailwind .text-right (specificity 0,1,0) loses to
     table.ledger td (0,1,2), so numeric cells silently fell back to
     text-align:left while headers (inline styles) stayed right-aligned.
     This restores alignment for every report table. */
  table.ledger th.text-right, table.ledger td.text-right { text-align: right; }

  /* ── KEYS ──────────────────────────────────────────────────────────────── */
  .key     { font-family: 'Space Mono', monospace; font-size: 10px; padding: 2px 5px; background: var(--ink); color: var(--bg); border-radius: 2px; letter-spacing: 0.04em; }
  .keypaper{ font-family: 'Space Mono', monospace; font-size: 10px; padding: 2px 5px; background: rgba(0,0,0,0.15); color: #171717; border-radius: 2px; letter-spacing: 0.04em; }

  /* ── BUTTONS ───────────────────────────────────────────────────────────── */
  .btn         { padding: 6px 14px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 0px; border: 1px solid transparent; cursor: pointer; transition: all 0.15s ease; font-family: 'Outfit', sans-serif; }
  .btn-primary { background: #facc15; color: #171717; border-color: #facc15; }
  .btn-primary:hover { background: #fde047; border-color: #fde047; }
  .btn-ghost   { background: transparent; color: var(--ink); border-color: var(--border2); }
  .btn-ghost:hover { background: var(--chip-bg); }
  .btn-danger  { background: transparent; color: var(--danger); border-color: var(--danger); }
  .btn-danger:hover { background: var(--danger); color: #fff; }
  .btn-warn    { background: var(--danger); color: #fff; border-color: var(--danger); }
  .btn-warn:hover { background: var(--danger2); }

  /* ── CHIPS ─────────────────────────────────────────────────────────────── */
  .chip      { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: var(--chip-bg); border-radius: 999px; font-size: 11px; font-family: 'Outfit', sans-serif; }
  .chip-warn { background: rgba(231,0,11,0.1); color: var(--danger2); border: 1px solid rgba(231,0,11,0.28); }
  html.dark .chip-warn { background: rgba(255,100,103,0.12); color: var(--danger); border-color: rgba(255,100,103,0.3); }

  /* ── SEAL ──────────────────────────────────────────────────────────────── */
  .seal {
    width: 56px; height: 56px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fde047, #facc15 60%, #ca9a04);
    display: flex; align-items: center; justify-content: center;
    color: #171717; font-family: 'Space Mono', monospace; font-weight: 700;
    box-shadow: 0 4px 8px rgba(250,204,21,0.4), inset 0 -2px 4px rgba(0,0,0,0.15);
    transform: rotate(-7deg);
  }

  /* ── LOGOS ─────────────────────────────────────────────────────────────── */
  /* Logo removed — business name renders as text */

  /* ── SUGGEST ───────────────────────────────────────────────────────────── */
  .suggest      { position: absolute; z-index: 50; background: var(--suggest-bg); border: 1px solid var(--border2); border-radius: 0px; box-shadow: 0 8px 24px var(--shadow-sm); max-height: 280px; overflow-y: auto; min-width: 100%; }
  .suggest-item { padding: 6px 10px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--border); color: var(--ink); }
  .suggest-item:hover, .suggest-item.active { background: var(--bg2); }
  .suggest-item .meta { color: var(--muted); font-size: 11px; }

  /* ── MODAL ─────────────────────────────────────────────────────────────── */
  .modal-bg  { position: fixed; inset: 0; background: var(--shadow-modal); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
  .modal-card{ background: var(--surface); border: 1px solid var(--border2); border-radius: 0px; max-width: 700px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 48px var(--shadow-modal); }

  /* ── TAILWIND OVERRIDES (bg/text/border → CSS variables) ───────────────── */
  .bg-paper   { background-color: var(--surface)  !important; }
  .bg-paper2  { background-color: var(--surface2) !important; }
  .text-ink   { color: var(--ink)     !important; }
  .text-ink2  { color: var(--ink2)    !important; }
  .text-mute  { color: var(--muted)   !important; }
  .text-rule2 { color: var(--border2) !important; }
  .border-rule  { border-color: var(--border)  !important; }
  .border-rule2 { border-color: var(--border2) !important; }

  html.dark .bg-paper2\/30  { background-color: rgba(28,28,31,0.5)   !important; }
  html.dark .bg-paper2\/40  { background-color: rgba(28,28,31,0.62)  !important; }
  html.dark .bg-paper2\/50  { background-color: rgba(28,28,31,0.72)  !important; }
  html.dark .bg-paper2\/60  { background-color: rgba(28,28,31,0.82)  !important; }
  html.dark .bg-paper\/70   { background-color: rgba(23,23,23,0.85)  !important; }
  html.dark .bg-wax         { background-color: var(--primary) !important; }
  html.dark .bg-wax\/10     { background-color: rgba(250,204,21,0.10) !important; }
  html.dark .bg-ok\/10      { background-color: rgba(74,222,128,0.10) !important; }
  html.dark .text-wax       { color: var(--muted) !important; }
  html.dark .text-ok        { color: var(--ok)    !important; }
  html.dark .text-gold      { color: var(--danger) !important; }
  html.dark .border-wax     { border-color: var(--border2) !important; }

  /* ── RECHARTS ──────────────────────────────────────────────────────────── */
  html.dark .recharts-text { fill: var(--ink2) !important; }
  html.dark .recharts-cartesian-grid-horizontal line,
  html.dark .recharts-cartesian-grid-vertical   line { stroke: var(--border) !important; }

  /* ── PRINT ─────────────────────────────────────────────────────────────── */
  @media print {
    body { background: white; }
    .no-print, #moto-bg { display: none !important; }
  }

  /* ── SCROLLBAR ─────────────────────────────────────────────────────────── */
  ::-webkit-scrollbar       { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--muted); }


  /* ── GLOW CARD EFFECT (gold/amber theme, hue ≈ 47°) ────────────────────── */
  /* Mouse position is synced to --mx/--my on :root via JS.
     [data-glow] elements compute their own spotlight offset. */
  [data-glow] {
    position: relative;
    isolation: isolate;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
  }
  /* Spotlight fill */
  [data-glow]::before {
    content: '';
    pointer-events: none;
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background-image: radial-gradient(
      220px 220px at
      calc(var(--mx, -999px) - var(--cx, 0px))
      calc(var(--my, -999px) - var(--cy, 0px)),
      hsla(47, 90%, 62%, 0.10),
      transparent 100%
    );
    z-index: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
  }
  /* Glowing border */
  [data-glow]::after {
    content: '';
    pointer-events: none;
    position: absolute;
    inset: -1.5px;
    border-radius: inherit;
    padding: 1.5px;
    background-image: radial-gradient(
      160px 160px at
      calc(var(--mx, -999px) - var(--cx, 0px))
      calc(var(--my, -999px) - var(--cy, 0px)),
      hsla(47, 90%, 60%, 0.70),
      transparent 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
  }
  [data-glow]:hover::before,
  [data-glow]:hover::after { opacity: 1; }
  [data-glow] > * { position: relative; z-index: 1; }

  /* ── SCROLL-IN ANIMATION ───────────────────────────────────────────────── */
  .scroll-anim {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .scroll-anim.in-view { opacity: 1; transform: none; }

  /* ── SIMPLE SPRING SWITCH (Dark Mode Toggle) ───────────────────────────── */
  .nds-switch {
    position: relative; display: inline-flex; align-items: center;
    height: 24px; width: 44px; border-radius: 9999px; border: none; cursor: pointer;
    padding: 0; flex-shrink: 0; transition: background 0.3s ease;
  }
  .nds-switch[aria-checked="true"]  { background: #27272a; }
  .nds-switch[aria-checked="false"] { background: #e4e4e7; }
  html.dark .nds-switch[aria-checked="false"] { background: #3a3a3d; }
  .nds-switch__thumb {
    display: inline-block; height: 20px; width: 20px; border-radius: 50%;
    transition: transform 0.38s cubic-bezier(0.34,1.56,0.64,1), background 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
  }
  .nds-switch[aria-checked="true"]  .nds-switch__thumb {
    transform: translateX(22px);
    background: #facc15;
    box-shadow: 0 0 10px rgba(250,204,21,0.65);
  }
  .nds-switch[aria-checked="false"] .nds-switch__thumb {
    transform: translateX(2px);
    background: #171717;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  }
  html.dark .nds-switch[aria-checked="false"] .nds-switch__thumb { background: #a1a1aa; }

  /* ── CURRENCY BACKGROUND ───────────────────────────────────────────────── */
  @keyframes currencyDrift {
    0%   { transform: translateY(0px) rotate(var(--r0)) scale(1); opacity: var(--op0); }
    35%  { opacity: var(--op1); }
    70%  { transform: translateY(var(--dy)) rotate(var(--r1)) scale(var(--sc)); }
    100% { transform: translateY(0px) rotate(var(--r0)) scale(1); opacity: var(--op0); }
  }
  #currency-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    user-select: none;
  }
  .cb-sym {
    position: absolute;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    animation: currencyDrift var(--dur) ease-in-out var(--delay) infinite;
    will-change: transform, opacity;
  }
  html.dark .cb-sym { color: #facc15; }
  .cb-svg {
    position: absolute;
    animation: currencyDrift var(--dur) ease-in-out var(--delay) infinite;
    will-change: transform, opacity;
  }
