/* ── Pro additions to tokens.css · elevation + a tighter type scale ──
   Reuses every existing color/motion token; adds only depth + figure steps.
   Light mode inherits via the same vars (shadows soften, highlight flips). */
:root {
  /* elevation · the design system: the warm layered ladder (tokens.css --e0..e4) is
     the system of record. These aliases keep the Pro layer's class names
     routing through the canonical --e tokens (one ladder, never a cool fork). */
  --elev-1:    var(--e1);
  --elev-2:    var(--e2);
  --elev-3:    var(--e3);
  --edge-hi:   var(--e-inset);                                                   /* warm top light-catch */
  --edge-gold: inset 0 1px 0 color-mix(in srgb, var(--ember-hi) 55%, transparent); /* tokenized gold light-catch, auto-tracks light/dark */

  /* figure scale · instrument hierarchy for money + readouts (Pro-specific) */
  --fs-data-xl: 30px;   /* hero sell / margin readout */
  --fs-data-lg: 22px;   /* tier price, fin payment */
  --fs-data-md: 16px;   /* total, net readout */
  --fs-data-sm: 13px;   /* row money */
  --fs-micro:   9px;    /* sub-labels under stat tiles */
}

/* ════════════════════════════════════════════════════════════════════
   QUOTE MAVEN · PRO LAYER (assets/pro.css)
   Additive only. Builds on tokens.css + app.css. Elevates the instrument:
   machined hairlines, layered depth, tabular figures, one gold CTA system,
   the Pro surfaces (stat tiles, segmented control, benchmark rail, closing
   agent, configurator, refined modal/toast/skeleton). No glow, no bubbles,
   every color through a token. Load AFTER app.css.
   ════════════════════════════════════════════════════════════════════ */

/* ── 0 · global polish · tabular money, sharper focus ─────────────────── */
.money, .ledger, .cell-input, .opt-price, .cv-total, .margin-readout .money { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "ss01" 1; }
:where(a, button, input, [tabindex]):focus-visible { outline: none; box-shadow: var(--ring-ember); border-radius: var(--r-control); }

/* ── 1 · elevation · panels become machined hardware (the design system: e2) ─ */
.worklist, .side-card, .fin-block, .ledger-wrap, .share-panel, .cv-ledger, .cv-fin,
.opt-card, .lender-card, .pro-panel, .stat-grid, .bench-rail, .closer, .cfg-card {
  box-shadow: var(--elev-2), var(--edge-hi);
}
.opt-card, .lender-card { transition: border-color var(--m-base) var(--ease), background var(--m-base) var(--ease), box-shadow var(--m-base) var(--ease), transform var(--m-fast) var(--ease-spring); }
.opt-card:hover, .lender-card:hover { box-shadow: var(--elev-3); transform: translateY(-2px); }
.opt-card.on { box-shadow: var(--elev-2), inset 0 0 0 1px color-mix(in srgb, var(--ember) 22%, transparent), var(--edge-gold); }

/* the RECOMMENDED tier sits forward: elevation + a gold corner-rule, not a wash.
   structure carries the emphasis (top + left hairline turns gold), not decoration. */
.opt-card.rec { border-top: 2px solid color-mix(in srgb, var(--ember) 55%, var(--line)); box-shadow: var(--elev-2), var(--edge-hi); }
.opt-card.on.rec { border-top-color: var(--ember); }
.opt-badge { background: var(--graphite); box-shadow: var(--edge-hi); }

/* ── 2 · the gold CTA · the design system: solid ember + one inset light-catch,
        lifted on the --e ladder. No gradient, no glow (vibrancy never neon). ── */
.btn-gold {
  background: var(--ember); box-shadow: var(--e2), var(--edge-gold);
  transition: background var(--m-base) var(--ease), box-shadow var(--m-base) var(--ease), transform var(--m-fast) var(--ease-spring);
}
.btn-gold:hover { background: var(--ember-hi); box-shadow: var(--e2), var(--ring-ember); }
.btn-gold:active { transform: translateY(1px) scale(.985); box-shadow: var(--e-press), var(--edge-gold); }
.btn-gold .arr { transition: transform var(--m-base) var(--ease-exit); }
.btn-gold:hover .arr { transform: translateX(3px); }

/* the reusable money/trust accent (promotes app.css's border-left rule) */
.rule-gold { border-left: 2px solid var(--ember); }

/* ── 3 · the Pro badge · gold-foil chip (only --grad-ember-deep license) ─ */
.pro-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .14em; font-size: var(--fs-micro);
  color: var(--ember-ink); background: var(--grad-ember-deep); box-shadow: var(--edge-gold);
  padding: 3px 7px; border-radius: var(--r-chip);
}
.pro-badge.ghost { color: var(--ember); background: transparent; border: 1px solid color-mix(in srgb, var(--ember) 45%, var(--line)); box-shadow: none; }

/* the upsell · a single inline ruled row, never a modal wall (Amazon: low friction) */
.pro-lock {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--graphite-2);
  padding: 14px 16px; box-shadow: var(--elev-2), var(--edge-hi);
}
.pro-lock .pl-copy { font-size: 13px; color: var(--plat-dim); }
.pro-lock .pl-copy b { color: var(--platinum); font-weight: 600; }

/* a locked surface shows the shape but seals it (a glimpse, not a wall) */
.pro-veil { position: relative; }
.pro-veil > .veil-inner { filter: saturate(.5); opacity: .42; pointer-events: none; user-select: none; }
.pro-veil > .veil-cta { position: absolute; inset: auto 0 0 0; display: flex; justify-content: center; padding: 16px; background: linear-gradient(180deg, transparent, var(--graphite-2) 64%); }

/* ── 4 · stat tiles · the Bloomberg readout (hairline grid, no gaps) ──── */
.stat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
}
.stat {
  background: var(--graphite-2); padding: 14px 16px; min-width: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.stat.lead { border-left: 2px solid var(--ember); }
.stat-k { font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; font-size: var(--fs-micro); color: var(--plat-faint); }
.stat-v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--fs-data-lg); letter-spacing: -.01em; color: var(--platinum); line-height: 1; }
.stat-v .u { font-size: 14px; color: var(--plat-faint); margin-left: 2px; }
.stat-v.gold { color: var(--ember); }
.stat-d { font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em; color: var(--plat-faint); }
.stat-d.up { color: var(--green); }
.stat-d.down { color: var(--red); }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } .stat-grid.three { grid-template-columns: repeat(3, 1fr); } }

/* ── 5 · segmented control · the instrument's mode switch (Closer tabs) ─ */
.seg { display: inline-flex; background: var(--obsidian); border: 1px solid var(--line); border-radius: var(--r-control); padding: 3px; gap: 2px; box-shadow: var(--edge-hi); }
.seg-btn {
  cursor: pointer; background: transparent; border: none; border-radius: var(--r-chip);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; font-size: 10px;
  color: var(--plat-dim); padding: 6px 13px; transition: color var(--m-base) var(--ease), background var(--m-base) var(--ease);
}
.seg-btn:hover { color: var(--platinum); }
.seg-btn.on { color: var(--ember-ink); background: var(--ember); box-shadow: var(--edge-gold); }

/* ── 6 · benchmark rail · the cross-operator data moat (Pro insight) ──── */
.bench-rail { border: 1px solid var(--line); border-left: 2px solid var(--ember); border-radius: var(--r-card); background: var(--graphite-2); padding: 16px; box-shadow: var(--elev-2), var(--edge-hi); }
.bench-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bench-head .src { font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; color: var(--plat-faint); }   /* "k=240 deals · privacy-safe" */
.bench-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.bench-row:last-child { border-bottom: none; }
.bench-label { font-size: 13px; color: var(--plat-dim); }
.bench-val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--fs-data-sm); color: var(--platinum); }
/* the win-probability meter · a ruled bar, no gradient fill */
.bench-meter { grid-column: 1 / -1; height: 4px; background: var(--obsidian); border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; margin-top: 2px; }
.bench-meter > span { display: block; height: 100%; background: var(--ember); }
.bench-meter.warn > span { background: var(--amber); }

/* ── 7 · CLOSING AGENT console · the floor-bounded concession engine ──── */
.closer { border: 1px solid var(--line); border-left: 2px solid var(--ember); border-radius: var(--r-card); background: var(--graphite-2); padding: 0; overflow: hidden; box-shadow: var(--elev-2), var(--edge-hi); }
.closer-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.closer-body { padding: 16px; }
/* the headline number: deepest price that still holds the floor */
.closer-quote { display: flex; align-items: baseline; gap: 12px; }
.closer-quote .money { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--fs-data-xl); color: var(--ember); line-height: 1; }
.closer-quote .cap { font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; color: var(--plat-dim); }
.closer-rule { height: 1px; background: var(--line); margin: 14px 0; }
.closer-facts { display: flex; flex-wrap: wrap; gap: 18px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .02em; color: var(--plat-dim); }
.closer-facts b { color: var(--platinum); font-weight: 500; }
.closer-facts .ok { color: var(--green); }
/* the concession slider re-uses .margin-range; the floor stop is a ruled tick */
.closer-track { position: relative; margin: 16px 0 6px; }
.closer-floor-tick { position: absolute; top: -4px; width: 1px; height: 14px; background: var(--red); }
.closer-floor-tick::after { content: "FLOOR"; position: absolute; top: -13px; left: -10px; font-family: var(--mono); font-size: 8px; letter-spacing: .1em; color: var(--red); }
/* the talk-track · a ruled, numbered list (structure, not bubbles) */
.track-list { margin: 4px 0 0; padding: 0; list-style: none; counter-reset: tk; }
.track-list li { counter-increment: tk; display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; color: var(--plat-dim); line-height: 1.5; }
.track-list li::before { content: counter(tk, decimal-leading-zero); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--ember); padding-top: 2px; }
.track-list li:last-child { border-bottom: none; }
.track-list li .tk { min-width: 0; }
.track-list li .say { display: block; color: var(--platinum); }

/* ── 8 · CONFIGURATOR · customer re-solves live, margin stays server-side ─ */
.cfg-card { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--graphite-2); padding: 16px; box-shadow: var(--elev-2), var(--edge-hi); }
.cfg-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.cfg-opt:last-of-type { border-bottom: none; }
.cfg-opt .cfg-name { font-size: 14px; color: var(--platinum); }
.cfg-opt .cfg-name small { display: block; font-size: 12px; color: var(--plat-dim); margin-top: 2px; }
.cfg-delta { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--plat-dim); }
.cfg-delta.add { color: var(--ember); }
/* the toggle · a ruled switch, precise not bubbly (24px track, square-ish) */
.cfg-toggle { position: relative; width: 40px; height: 22px; flex: 0 0 auto; border: 1px solid var(--line-hi); border-radius: var(--r-pill); background: var(--obsidian); cursor: pointer; transition: border-color var(--m-base) var(--ease), background var(--m-base) var(--ease); }
.cfg-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--plat-faint); transition: transform var(--m-base) var(--ease-spring), background var(--m-base) var(--ease); }
.cfg-toggle.on { border-color: var(--ember); background: color-mix(in srgb, var(--ember) 18%, var(--obsidian)); }
.cfg-toggle.on::after { transform: translateX(18px); background: var(--ember); }
/* the live total that re-solves · the figure animates on change, briefly */
.cfg-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.cfg-total .money { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--fs-data-lg); color: var(--ember); }
.cfg-resolve { animation: cfg-tick var(--m-pulse) var(--ease-exit); }
@keyframes cfg-tick { 0% { opacity: .35; transform: translateY(-2px); } 100% { opacity: 1; transform: none; } }

/* ── 9 · the Pro insight panel · generic elevated container ──────────── */
.pro-panel { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--graphite-2); padding: 16px; box-shadow: var(--elev-2), var(--edge-hi); }
.pro-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pro-panel-head .lbl { color: var(--ember); }

/* ── 10 · refined table foot · the sealed total (Bloomberg ledger) ────── */
.ledger tfoot tr.total td { box-shadow: inset 0 1px 0 var(--line); }   /* a second hairline under the rule = a sealed sum */
.ledger tfoot tr.total td.sell { font-size: var(--fs-data-sm); letter-spacing: -.01em; }
.ledger td.r .money, .ledger .money { font-variant-numeric: tabular-nums; }
/* a quiet zebra on dense ledgers, ruled not filled */
.ledger.dense tbody tr:nth-child(even) td { background: var(--tint-row); }

/* ── 11 · empty states · a directive, not a void (Apple: first run = product) ─ */
.empty-pro { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--graphite-2); padding: 30px 22px; box-shadow: var(--elev-2), var(--edge-hi); max-width: var(--max-w-text); }
.empty-pro .e-no { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--ember); }
.empty-pro h3 { font-family: var(--disp); font-size: 19px; letter-spacing: -.01em; margin: 10px 0 8px; color: var(--platinum); }
.empty-pro p { font-size: 14px; color: var(--plat-dim); margin: 0 0 18px; max-width: 52ch; }

/* ── 12 · skeleton · loading reads as instrument warm-up, never a spinner ─ */
.skl { background: linear-gradient(90deg, var(--graphite) 0%, var(--graphite-2) 50%, var(--graphite) 100%); background-size: 200% 100%; border-radius: var(--r-chip); animation: skl-pan 1.4s var(--ease) infinite; }
.skl.line { height: 12px; margin: 8px 0; }
.skl.fig { height: 28px; width: 120px; }
@keyframes skl-pan { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── 13 · refined modal · layered, with depth (lifts the e-sign card) ── */
.cs-card { box-shadow: var(--e4), var(--edge-hi); }
.cs-scrim { background: var(--scrim); backdrop-filter: blur(4px) saturate(120%); }
.modal-enter { animation: modal-in var(--m-enter) var(--ease-exit); }
@keyframes modal-in { 0% { opacity: 0; transform: translateY(8px) scale(.985); } 100% { opacity: 1; transform: none; } }

/* ── 14 · refined toast · the gold-ruled status line, with depth ──────── */
#toast { box-shadow: var(--elev-3), var(--edge-hi); }

/* ── 15 · micro-interactions · earned, hardware-settle motion ─────────── */
.fm-press { transition: transform var(--m-fast) var(--ease-spring); }
.stat, .bench-row, .cfg-opt { transition: background var(--m-base) var(--ease); }
.work-row .work-val, .list-row .lr-val { transition: color var(--m-base) var(--ease); }
.work-row:hover .work-val, .list-row:hover .lr-val { color: var(--ember); }

/* the one scripted reveal license: a value that just re-solved ticks once.
   never gate visibility on it (rest state is visible); add .cfg-resolve
   transiently and remove via setTimeout (the Glass-Roof reveal rule). */

/* ── 16 · accessibility · honor reduced motion (Tesla: it ships in-file) ─ */
@media (prefers-reduced-motion: reduce) {
  .skl, .cfg-resolve, .modal-enter, .btn-gold, .btn-gold .arr, .cfg-toggle, .cfg-toggle::after { animation: none !important; transition: none !important; }
  .btn-gold:hover .arr, .work-row:hover .work-val, .list-row:hover .lr-val { transform: none; }
}

/* ── 18 · builder · the Pro row (Closing Agent | Insights) spacing ────── */
.build-grid.pro-row { margin-top: 22px; }
.pro-row .closer-body .margin-range { accent-color: var(--ember); width: 100%; }

/* ── 17 · light mode polish · the same instrument in daylight ─────────── */
@media (prefers-color-scheme: light) {
  .stat-grid, .bench-meter { background: var(--line); }
  .pro-veil > .veil-cta { background: linear-gradient(180deg, transparent, var(--graphite-2) 64%); }
  .closer-floor-tick::after, .stat-d.down { color: var(--red); }
}