/* Maliaz design system v2 — shared by portal.maliazgrowth.com, admin.maliazgrowth.com and Atlas.
   One obsidian room. Slow 3D glass drifts behind everything. Every surface is liquid glass:
   blurred, edge-lit, with a specular sheen that follows the pointer. Champagne is the only warm
   accent; ice blue is the cool one for data. Status colors stay separate from the accent. */

@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("/shared/fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("/shared/fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("/shared/fonts/manrope-latin-wght-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #07090b;
  --bg-2: #0d1114;
  --bg-3: #141a1e;
  --ink: #f5f2ea;
  --ink-2: #d9d5cb;
  --muted: #a3a7a2;
  --faint: #767b78;
  --line: rgba(245, 242, 234, 0.09);
  --line-2: rgba(245, 242, 234, 0.16);

  --champagne: #cdb88f;
  --champagne-hi: #ecdcb8;
  --champagne-lo: #9d8660;
  --champagne-soft: rgba(205, 184, 143, 0.14);
  --ice: #9fd6ff;
  --ice-hi: #d6eeff;
  --ice-soft: rgba(159, 214, 255, 0.14);
  --sage: #93a196;
  --sage-soft: rgba(147, 161, 150, 0.15);
  --good: #9cd6a8;
  --good-soft: rgba(156, 214, 168, 0.13);
  --warn: #e7bd75;
  --warn-soft: rgba(231, 189, 117, 0.13);
  --crit: #ea8f7b;
  --crit-soft: rgba(234, 143, 123, 0.13);
  --on-champagne: #151617;

  --glass-top: rgba(255, 255, 255, 0.085);
  --glass-bot: rgba(255, 255, 255, 0.025);
  --glass-edge: rgba(255, 255, 255, 0.12);
  --glass-hi: rgba(255, 255, 255, 0.30);
  --glass-blur: 28px;
  --shadow-lg: 0 60px 120px -50px rgba(0, 0, 0, 0.9), 0 20px 44px -24px rgba(0, 0, 0, 0.7);
  --shadow-md: 0 26px 60px -30px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 10px 24px -14px rgba(0, 0, 0, 0.8);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-cap: 0.72rem;
  --fs-sm: 0.8125rem;
  --fs-body: 0.9375rem;
  --fs-lg: 1.125rem;
  --fs-h3: 1.375rem;
  --fs-h2: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem);
  --fs-h1: clamp(2.2rem, 1.4rem + 3vw, 4rem);
  --fs-num: clamp(1.9rem, 1.4rem + 1.6vw, 2.7rem);

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --gap-xs: 6px;
  --gap-sm: 10px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 40px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur: 420ms;
  --rail-w: 92px;
  --tabbar-h: 70px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--champagne-hi); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--champagne); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.eyebrow { font-size: var(--fs-cap); letter-spacing: 0.16em; text-transform: uppercase; color: var(--champagne); font-weight: 700; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wordmark { font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; display: inline-flex; align-items: baseline; gap: 2px; }
.wordmark i { font-style: normal; color: var(--champagne); }
.wordmark small { font-family: var(--sans); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-left: 10px; font-weight: 700; }

/* ---------- The room: ambient field, 3D canvas, grain, monogram ---------- */
.m-field { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.m-field canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; transition: opacity 1.2s var(--ease); }
.m-field canvas.on { opacity: 1; }
.m-field::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(60vmax 45vmax at 12% 0%, rgba(205, 184, 143, 0.16), transparent 60%),
    radial-gradient(50vmax 40vmax at 100% 100%, rgba(159, 214, 255, 0.10), transparent 60%),
    radial-gradient(45vmax 35vmax at 80% 10%, rgba(147, 161, 150, 0.08), transparent 65%);
  animation: fieldDrift 40s ease-in-out infinite alternate;
}
.m-field::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 9, 11, 0) 0%, rgba(7, 9, 11, 0.45) 100%);
}
@keyframes fieldDrift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-3%, 2%, 0) scale(1.06); } }
.m-grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.monogram {
  position: fixed; z-index: 0; pointer-events: none; user-select: none;
  right: -6vw; bottom: -12vh; width: min(60vw, 720px); aspect-ratio: 1;
  font-family: var(--serif); font-size: min(60vw, 720px); line-height: 1; color: transparent;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(205, 184, 143, 0.05) 50%, rgba(159, 214, 255, 0.04));
  -webkit-background-clip: text; background-clip: text;
  filter: blur(1px);
  transform: translate3d(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -10px), 0);
  transition: transform 1.2s var(--ease);
}
.monogram::after { content: ""; position: absolute; width: 0.12em; height: 0.12em; border-radius: 50%; right: 0.08em; bottom: 0.2em; background: radial-gradient(circle at 35% 35%, rgba(236, 220, 184, 0.55), rgba(205, 184, 143, 0.15) 70%, transparent); filter: blur(6px); }
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity 520ms var(--ease); }
.boot .wordmark { font-size: 44px; animation: bootPulse 1.6s ease-in-out infinite; }
@keyframes bootPulse { 50% { opacity: 0.55; } }

/* ---------- Liquid glass ---------- */
.glass {
  position: relative;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.11), inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  isolation: isolate;
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, var(--glass-hi), rgba(255, 255, 255, 0.02) 38%, rgba(255, 255, 255, 0) 60%, rgba(205, 184, 143, 0.24));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(460px circle at var(--mx, 30%) var(--my, -20%), rgba(255, 255, 255, 0.075), transparent 60%);
  opacity: var(--sheen, 0.9);
  transition: opacity 300ms var(--ease);
}
.glass-strong { --glass-top: rgba(255, 255, 255, 0.115); --glass-bot: rgba(255, 255, 255, 0.045); }
.glass-flat { --glass-top: rgba(255, 255, 255, 0.05); --glass-bot: rgba(255, 255, 255, 0.015); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.glass-lift { transition: transform 320ms var(--ease), box-shadow 320ms var(--ease), border-color 320ms var(--ease); }
.glass-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.2); }

/* ---------- Buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.045); color: var(--ink); font-weight: 600; font-size: var(--fs-sm); letter-spacing: 0.01em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 160ms var(--ease), background 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.26); color: var(--ink); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--champagne-hi), var(--champagne) 55%, var(--champagne-lo));
  color: var(--on-champagne); border-color: rgba(255, 240, 210, 0.5);
  box-shadow: 0 12px 32px -12px rgba(205, 184, 143, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 6px rgba(0, 0, 0, 0.15);
}
.btn-primary:hover { color: var(--on-champagne); background: linear-gradient(180deg, #f6ead0, var(--champagne-hi) 55%, var(--champagne)); transform: translateY(-1px); }
.btn-ice { background: linear-gradient(180deg, var(--ice-hi), var(--ice) 60%, #6fb6e6); color: #0b1b26; border-color: rgba(214, 238, 255, 0.5); box-shadow: 0 12px 32px -12px rgba(159, 214, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn-ice:hover { color: #0b1b26; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line); }
.btn-danger { background: var(--crit-soft); color: var(--crit); border-color: rgba(234, 143, 123, 0.4); }
.btn-sm { --h: 34px; padding: 0 14px; font-size: var(--fs-cap); }
.btn-lg { --h: 52px; padding: 0 26px; font-size: var(--fs-body); }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
.btn svg, .icon-btn svg { width: 18px; height: 18px; flex: none; }
.link-btn { background: none; border: 0; padding: 6px 2px; color: var(--champagne); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { color: var(--champagne-hi); }
/* Inline icons inside text keep text size */
.link-btn svg, .note svg, .hint svg, p > svg, .legend-hint svg, .viewas svg { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; flex: none; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Inputs ---------- */
.field { display: grid; gap: 6px; }
.field label, .label { font-size: var(--fs-cap); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.field .hint { font-size: var(--fs-sm); color: var(--faint); }
.input, .select, .textarea {
  min-height: 48px; width: 100%; padding: 0 16px; border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line-2); color: var(--ink);
  transition: border-color 200ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
}
.textarea { padding: 12px 16px; resize: vertical; min-height: 96px; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--champagne); background: rgba(0, 0, 0, 0.42); box-shadow: 0 0 0 4px var(--champagne-soft); }
.input.is-bad { border-color: var(--crit); }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23cdb88f' stroke-width='1.6'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; }
.select-sm { min-height: 34px; border-radius: 10px; font-size: var(--fs-cap); padding: 0 30px 0 10px; background-position: right 10px center; }
.select option { background: #15181a; color: var(--ink); }
.input-money { position: relative; }
.input-money::before { content: "$"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.input-money .input { padding-left: 30px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.meter-pw { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 4px; }
.meter-pw i { display: block; height: 100%; width: 0; background: var(--good); transition: width 300ms var(--ease), background 300ms var(--ease); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-err { color: var(--crit); font-size: var(--fs-sm); margin: 8px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.form-stack { display: grid; gap: 14px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 44px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line-2); position: relative; transition: background 200ms var(--ease); flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-2); transition: transform 220ms var(--ease-spring), background 200ms; }
.switch input:checked + i { background: var(--champagne); border-color: var(--champagne-hi); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--on-champagne); }
.switch input:focus-visible + i { outline: 2px solid var(--champagne); outline-offset: 3px; }

/* Segmented control and chips */
.seg, .chips { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); }
.seg button, .chip { border: 0; background: transparent; color: var(--muted); height: 34px; padding: 0 14px; border-radius: 999px; font-size: var(--fs-cap); font-weight: 700; letter-spacing: 0.02em; cursor: pointer; transition: background 200ms var(--ease), color 200ms var(--ease); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover, .chip:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .chip[aria-pressed="true"] { background: rgba(255, 255, 255, 0.11); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.seg .count { font-size: 0.68rem; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; border: 1px solid var(--line-2); color: var(--ink-2); background: rgba(255, 255, 255, 0.03); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; flex: none; }
.pill.no-dot::before { display: none; }
.pill svg { width: 13px; height: 13px; }
.pill-good { color: var(--good); border-color: rgba(156, 214, 168, 0.35); background: var(--good-soft); }
.pill-warn { color: var(--warn); border-color: rgba(231, 189, 117, 0.35); background: var(--warn-soft); }
.pill-crit { color: var(--crit); border-color: rgba(234, 143, 123, 0.35); background: var(--crit-soft); }
.pill-gold { color: var(--champagne-hi); border-color: rgba(205, 184, 143, 0.4); background: var(--champagne-soft); }
.pill-sage { color: var(--sage); border-color: rgba(147, 161, 150, 0.35); background: var(--sage-soft); }
.pill-ice { color: var(--ice); border-color: rgba(159, 214, 255, 0.35); background: var(--ice-soft); }
.pill-dim { color: var(--faint); }
.pill-lg { height: 30px; padding: 0 13px; font-size: 0.78rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; max-height: 560px; border-radius: var(--r-md); -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.table th { position: sticky; top: 0; z-index: 2; text-align: left; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 12px 14px; background: rgba(14, 17, 20, 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th button { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.table th[aria-sort="descending"] button::after { content: "↓"; color: var(--champagne); }
.table th[aria-sort="ascending"] button::after { content: "↑"; color: var(--champagne); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background 160ms var(--ease); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.table tbody tr.is-click { cursor: pointer; }
.table .r { text-align: right; white-space: nowrap; }
.table .name { font-weight: 600; color: var(--ink); white-space: nowrap; }
.bar { position: relative; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; min-width: 64px; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--champagne-lo), var(--champagne-hi)); transform-origin: left; animation: barIn 900ms var(--ease) both; }
.bar.muted > i { background: rgba(245, 242, 234, 0.28); }
.bar.ice > i { background: linear-gradient(90deg, #5fa8dd, var(--ice-hi)); }
.barcell { display: grid; grid-template-columns: 3.4em 1fr; gap: 10px; align-items: center; min-width: 140px; }
@keyframes barIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Skeleton, empty, callout ---------- */
.skel { position: relative; overflow: hidden; background: rgba(255, 255, 255, 0.04); border-radius: 8px; color: transparent !important; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); font-size: var(--fs-sm); }
.empty h3 { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.callout { padding: 14px 16px; border-radius: var(--r-md); background: var(--champagne-soft); border: 1px solid rgba(205, 184, 143, 0.3); font-size: var(--fs-sm); color: var(--ink-2); }
.callout.ice { background: var(--ice-soft); border-color: rgba(159, 214, 255, 0.3); }
.callout.crit { background: var(--crit-soft); border-color: rgba(234, 143, 123, 0.3); }
.note { font-size: var(--fs-sm); color: var(--faint); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 120; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + var(--safe-b)); display: grid; gap: 10px; max-width: calc(100vw - 32px); }
.toast { padding: 12px 16px; border-radius: var(--r-md); font-size: var(--fs-sm); max-width: 360px; animation: toastIn 420ms var(--ease-spring) both; display: flex; gap: 10px; align-items: center; font-weight: 600; }
.toast .toast-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--good-soft); color: var(--good); flex: none; }
.toast .toast-ico svg { width: 14px; height: 14px; }
.toast.is-bad { border-color: rgba(234, 143, 123, 0.4); }
.toast.is-bad .toast-ico { background: var(--crit-soft); color: var(--crit); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
@media (max-width: 640px) { .toasts { left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 12px + var(--safe-b)); } .toast { max-width: none; } }

/* ---------- Modal ---------- */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(4, 5, 7, 0.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; animation: fadeIn 260ms var(--ease) both; }
.modal { width: min(100%, 540px); padding: 32px; border-radius: var(--r-xl); animation: modalIn 520ms var(--ease-spring) both; max-height: calc(100dvh - 32px); overflow: auto; }
.modal-wide { width: min(100%, 760px); }
.modal h2 { font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1.1; margin: 0 0 6px; }
.modal .lede { color: var(--muted); margin: 0 0 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
@media (max-width: 560px) { .modal { padding: 24px 20px; } }

/* ---------- Sheet: side drawer on desktop, bottom sheet on phones ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 85; background: rgba(4, 5, 7, 0); -webkit-backdrop-filter: blur(0px); backdrop-filter: blur(0px); transition: background 360ms var(--ease), backdrop-filter 360ms var(--ease), -webkit-backdrop-filter 360ms var(--ease); }
.sheet-scrim.open { background: rgba(4, 5, 7, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(480px, calc(100vw - 24px)); border-radius: var(--r-xl); transform: translateX(calc(100% + 24px)); transition: transform 420ms var(--ease-spring); display: flex; flex-direction: column; overflow: hidden; }
.sheet-wide { width: min(680px, calc(100vw - 24px)); }
.sheet-scrim.open .sheet { transform: none; }
.sheet-grab { display: none; }
.sheet-body { overflow: auto; padding: 28px 26px 32px; display: grid; gap: 22px; align-content: start; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet h2 { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sheet-head p { color: var(--muted); margin-top: 4px; font-size: var(--fs-sm); }
.sheet section { display: grid; gap: 12px; }
.sheet section > h3 { font-size: var(--fs-cap); letter-spacing: 0.14em; text-transform: uppercase; color: var(--champagne); font-weight: 700; }
@media (max-width: 760px) {
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; transform: translateY(105%); }
  .sheet-grab { display: block; width: 44px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.25); margin: 10px auto 0; flex: none; }
  .sheet-body { padding: 18px 18px calc(28px + var(--safe-b)); }
}

/* ---------- Facts list (key/value) ---------- */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.facts > div { display: grid; gap: 3px; padding: 12px 14px; border-radius: var(--r-md); background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.facts dd { margin: 0; font-weight: 600; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.facts dd.big { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; }
.cred { display: grid; gap: 10px; margin: 6px 0 2px; }
.cred > div { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-md); background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.cred span { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.cred code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.95rem; color: var(--champagne-hi); overflow-wrap: anywhere; }

/* ---------- App shell: rail + main + tabbar ---------- */
.shell { position: relative; z-index: 2; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100dvh; }
.rail { position: sticky; top: 12px; align-self: start; margin: 12px 0 12px 12px; height: calc(100dvh - 24px); border-radius: 26px; display: flex; flex-direction: column; align-items: center; padding: 18px 8px 14px; gap: 10px; }
.rail .wordmark { font-size: 30px; margin-bottom: 8px; }
.rail .wordmark span { display: none; }
.rail nav { display: grid; gap: 4px; width: 100%; }
.rail nav a, .rail nav button { all: unset; cursor: pointer; display: grid; justify-items: center; gap: 5px; padding: 11px 4px 9px; border-radius: 16px; color: var(--muted); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; position: relative; transition: background 220ms var(--ease), color 220ms var(--ease), transform 220ms var(--ease); text-align: center; width: 100%; }
.rail nav a svg, .rail nav button svg { width: 22px; height: 22px; }
.rail nav a:hover, .rail nav button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.rail nav a[aria-current="page"], .rail nav button[aria-current="page"] { color: var(--ink); background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 24px -14px rgba(0, 0, 0, 0.8); }
.rail nav a[aria-current="page"]::before, .rail nav button[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 30%; height: 40%; width: 3px; border-radius: 999px; background: var(--champagne); box-shadow: 0 0 14px var(--champagne); }
.rail .count { position: absolute; top: 6px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--champagne); color: var(--on-champagne); font-size: 0.64rem; display: grid; place-items: center; font-weight: 800; letter-spacing: 0; }
.rail-foot { margin-top: auto; display: grid; gap: 8px; justify-items: center; width: 100%; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 1.15rem; color: var(--on-champagne); background: linear-gradient(145deg, var(--champagne-hi), var(--champagne-lo)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 18px -8px rgba(205, 184, 143, 0.7); flex: none; }
.avatar.ice { color: #0b1b26; background: linear-gradient(145deg, var(--ice-hi), #6fb6e6); }

.main { min-width: 0; padding: 12px 20px 40px 16px; display: grid; gap: var(--gap-lg); align-content: start; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; padding: 8px 0 0; }
.topbar h1 { font-family: var(--serif); font-size: var(--fs-h2); line-height: 1.05; }
.topbar .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cmd { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line-2); color: var(--muted); font-size: var(--fs-sm); cursor: text; min-width: 240px; transition: border-color 200ms, background 200ms; }
.cmd:hover, .cmd:focus-within { border-color: rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.4); }
.cmd svg { width: 16px; height: 16px; flex: none; }
.cmd input { all: unset; flex: 1; min-width: 0; color: var(--ink); }
.cmd kbd { font-family: inherit; font-size: 0.66rem; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--faint); }
.mobilebar { display: none; }
.tabbar { display: none; }
.view { display: grid; gap: var(--gap-lg); animation: viewIn 420ms var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .main { padding: 8px 14px calc(var(--tabbar-h) + 24px + var(--safe-b)); gap: 18px; }
  .mobilebar { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px 0; }
  .mobilebar .wordmark { font-size: 26px; }
  .mobilebar .mb-actions { display: flex; gap: 8px; align-items: center; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); z-index: 60; height: var(--tabbar-h); border-radius: 24px; padding: 6px; }
  .tabbar button, .tabbar a { all: unset; cursor: pointer; display: grid; justify-items: center; align-content: center; gap: 3px; border-radius: 18px; color: var(--muted); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; position: relative; transition: color 200ms, background 200ms; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--ink); background: rgba(255, 255, 255, 0.09); }
  .tabbar .dot { position: absolute; top: 8px; right: 22%; width: 7px; height: 7px; border-radius: 50%; background: var(--champagne); box-shadow: 0 0 10px var(--champagne); }
  .topbar h1 { font-size: 1.7rem; }
  .cmd { min-width: 0; width: 100%; }
}

/* ---------- Panels and KPI tiles ---------- */
.panel { padding: 22px 22px 24px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--serif); font-size: var(--fs-h3); line-height: 1.15; }
.panel-head p { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; max-width: 56ch; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { padding: 18px 18px 16px; display: grid; gap: 6px; position: relative; overflow: hidden; min-height: 118px; }
.kpi .k-label { font-size: var(--fs-cap); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.kpi .k-label svg { width: 16px; height: 16px; color: var(--champagne); }
.kpi .k-val { font-family: var(--serif); font-size: var(--fs-num); line-height: 1; letter-spacing: -0.01em; }
.kpi .k-sub { font-size: var(--fs-sm); color: var(--faint); display: flex; gap: 6px; align-items: center; }
.kpi .k-sub .up { color: var(--good); } .kpi .k-sub .down { color: var(--crit); }
.kpi .spark { position: absolute; right: 0; bottom: 0; left: 0; height: 44px; opacity: 0.55; pointer-events: none; }
.kpi.ice .k-label svg { color: var(--ice); }
.kpi.good .k-val { color: var(--good); }
.rows { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); text-align: left; color: inherit; transition: background 180ms var(--ease), transform 180ms var(--ease), border-color 180ms var(--ease); width: 100%; cursor: pointer; }
.row:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--line-2); transform: translateX(2px); }
.row .t { display: grid; gap: 2px; min-width: 0; }
.row .t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t span { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sev { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04); }
.sev-crit { background: var(--crit); box-shadow: 0 0 14px rgba(234, 143, 123, 0.6); }
.sev-warn { background: var(--warn); box-shadow: 0 0 12px rgba(231, 189, 117, 0.5); }
.sev-info { background: var(--ice); box-shadow: 0 0 12px rgba(159, 214, 255, 0.5); }
.sev-calm { background: var(--sage); }
.date-tile { width: 54px; height: 58px; border-radius: 14px; display: grid; place-content: center; gap: 0; text-align: center; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line-2); flex: none; }
.date-tile b { font-family: var(--serif); font-size: 1.5rem; line-height: 1; font-weight: 400; }
.date-tile span { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 3px; }
.date-tile.today { border-color: var(--champagne); background: var(--champagne-soft); }
.date-tile.today b { color: var(--champagne-hi); }

/* ---------- Kanban board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 4px 4px 14px; margin: -4px -4px 0; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.board::-webkit-scrollbar { height: 8px; }
.board::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 999px; }
.col { scroll-snap-align: start; display: grid; grid-template-rows: auto 1fr; gap: 10px; padding: 12px 10px 12px; min-height: 360px; border-radius: 22px; transition: background 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease); --tone: var(--ice); }
.col[data-tone="ice"] { --tone: var(--ice); } .col[data-tone="sage"] { --tone: var(--sage); } .col[data-tone="gold"] { --tone: var(--champagne); } .col[data-tone="good"] { --tone: var(--good); } .col[data-tone="dim"] { --tone: var(--faint); }
.col.over { border-color: var(--tone); box-shadow: 0 0 0 1px var(--tone), 0 0 40px -10px var(--tone), var(--shadow-md); --glass-top: rgba(255, 255, 255, 0.13); }
.col-head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 2px; }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 12px var(--tone); flex: none; }
.col-head h3 { font-size: var(--fs-sm); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.col-head .n { margin-left: auto; font-size: var(--fs-cap); color: var(--muted); font-weight: 700; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); }
.col-head .sum { font-size: var(--fs-cap); color: var(--tone); font-weight: 700; }
.col-hint { font-size: var(--fs-cap); color: var(--faint); padding: 0 8px 4px; }
.cards { display: grid; gap: 8px; align-content: start; min-height: 120px; padding-bottom: 20px; }
.card { display: grid; gap: 8px; padding: 12px 12px 12px 14px; border-radius: 16px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), var(--shadow-sm); cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-x pan-y; position: relative; transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), opacity 220ms, border-color 220ms; }
.card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.26); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), var(--shadow-md); }
.card:active { cursor: grabbing; }
.card.lifting { opacity: 0.35; transform: scale(0.98); box-shadow: none; }
.card.is-new { animation: cardIn 600ms var(--ease-spring) both; }
.card.is-late { border-color: rgba(234, 143, 123, 0.5); }
.card.is-late::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 999px; background: var(--crit); box-shadow: 0 0 10px var(--crit); }
.card .c-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.card .c-name { font-weight: 700; font-size: var(--fs-body); line-height: 1.25; }
.card .c-when { font-size: var(--fs-cap); color: var(--muted); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.card .c-when.today { color: var(--champagne-hi); }
.card .c-addr { font-size: var(--fs-sm); color: var(--muted); display: flex; gap: 6px; align-items: center; }
.card .c-addr svg { width: 14px; height: 14px; flex: none; color: var(--faint); }
.card .c-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .c-amt { font-family: var(--serif); font-size: 1.25rem; color: var(--good); }
.card .c-amt.q { color: var(--champagne-hi); }
.card .grip { position: absolute; right: 6px; top: 8px; color: var(--faint); opacity: 0; transition: opacity 200ms; }
.card .grip svg { width: 16px; height: 16px; }
.card:hover .grip { opacity: 0.7; }
.card-ghost { position: fixed; z-index: 200; pointer-events: none; transform: rotate(2deg) scale(1.04); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.2); opacity: 0.98; transition: none; width: var(--w); }
.drop-slot { height: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px dashed rgba(255, 255, 255, 0.25); transition: height 180ms var(--ease), margin 180ms; margin: 0; }
.drop-slot.show { height: var(--h, 92px); }
.cards .empty { padding: 26px 10px; border: 1px dashed var(--line); border-radius: 14px; font-size: var(--fs-cap); }
@keyframes cardIn { from { opacity: 0; transform: translateY(-10px) scale(0.96); } }
body.dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
body.dragging * { cursor: grabbing !important; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; min-height: 160px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.chart .axis-label { fill: var(--faint); font-size: 11px; font-weight: 600; }
.chart .val-label { fill: var(--ink-2); font-size: 11.5px; font-weight: 700; }
.chart .capsule { fill: url(#capsuleIce); stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.8; filter: drop-shadow(0 8px 14px rgba(159, 214, 255, 0.25)); transition: opacity 200ms; }
.chart .capsule.gold { fill: url(#capsuleGold); filter: drop-shadow(0 8px 14px rgba(205, 184, 143, 0.3)); }
.chart .capsule.partial { opacity: 0.6; stroke-dasharray: 3 3; }
.chart .line { fill: none; stroke: var(--ice); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 8px rgba(159, 214, 255, 0.5)); }
.chart .line.gold { stroke: var(--champagne-hi); filter: drop-shadow(0 0 8px rgba(205, 184, 143, 0.5)); }
.chart .area { fill: url(#areaIce); opacity: 0.6; }
.chart .area.gold { fill: url(#areaGold); }
.chart .pt { fill: var(--bg); stroke: var(--ice); stroke-width: 2; }
.chart .pt.gold { stroke: var(--champagne-hi); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .tip { position: absolute; transform: translate(-50%, calc(-100% - 10px)); padding: 8px 12px; border-radius: 10px; background: rgba(12, 14, 17, 0.95); border: 1px solid var(--line-2); font-size: var(--fs-cap); white-space: nowrap; pointer-events: none; display: grid; gap: 2px; z-index: 3; box-shadow: var(--shadow-sm); }
.chart .tip b { font-size: 1rem; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-cap); color: var(--muted); font-weight: 700; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Gauge ring */
.gauge { position: relative; width: 100%; aspect-ratio: 1; max-width: 230px; margin: 0 auto; display: grid; place-items: center; }
.gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 12; }
.gauge .arc { fill: none; stroke: url(#gaugeGold); stroke-width: 12; stroke-linecap: round; filter: drop-shadow(0 0 10px rgba(205, 184, 143, 0.55)); transition: stroke-dashoffset 1.4s var(--ease); }
.gauge .arc.ice { stroke: url(#gaugeIce); filter: drop-shadow(0 0 10px rgba(159, 214, 255, 0.55)); }
.gauge .g-center { text-align: center; display: grid; gap: 2px; }
.gauge .g-center b { font-family: var(--serif); font-size: 2.6rem; line-height: 1; font-weight: 400; }
.gauge .g-center span { font-size: var(--fs-cap); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* Funnel */
.funnel { display: grid; gap: 10px; }
.f-step { display: grid; grid-template-columns: 76px 1fr 40px; gap: 12px; align-items: center; font-size: var(--fs-sm); }
.f-step span { color: var(--muted); font-weight: 700; font-size: var(--fs-cap); letter-spacing: 0.06em; text-transform: uppercase; }
.f-track { height: 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); overflow: hidden; }
.f-bar { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #5fa8dd, var(--ice-hi)); box-shadow: 0 0 14px rgba(159, 214, 255, 0.45); transition: width 1.1s var(--ease); }
.f-step:nth-child(3) .f-bar { background: linear-gradient(90deg, var(--champagne-lo), var(--champagne-hi)); box-shadow: 0 0 14px rgba(205, 184, 143, 0.45); }
.f-step:nth-child(4) .f-bar { background: linear-gradient(90deg, #5e9c6b, var(--good)); box-shadow: 0 0 14px rgba(156, 214, 168, 0.45); }
.f-step b { text-align: right; font-family: var(--serif); font-size: 1.3rem; }

/* Goal meters */
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.goal { padding: 16px 16px 14px; display: grid; gap: 8px; }
.goal > span { font-size: var(--fs-cap); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.goal .gv { display: flex; align-items: baseline; gap: 8px; }
.goal .gv b { font-family: var(--serif); font-size: 1.9rem; line-height: 1; font-weight: 400; }
.goal .gv small { color: var(--faint); font-size: var(--fs-cap); font-weight: 700; }
.meter { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--champagne-lo), var(--champagne-hi)); transition: width 1.2s var(--ease); }
.meter.hit i { background: linear-gradient(90deg, #5e9c6b, var(--good)); box-shadow: 0 0 12px rgba(156, 214, 168, 0.5); }
.goal .gstate { font-size: var(--fs-cap); color: var(--faint); font-weight: 600; }

/* Money ledger list */
.money { display: grid; gap: 8px; }
.money > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); }
.money > div b { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); font-weight: 400; }
.money > div.total { border: 0; padding-top: 14px; color: var(--ink); font-weight: 700; }
.money > div.total b { font-size: 1.9rem; color: var(--champagne-hi); }

/* Timeline */
.timeline { display: grid; gap: 14px; border-left: 1px solid var(--line-2); margin-left: 6px; padding-left: 18px; }
.tl { position: relative; display: grid; gap: 3px; }
.tl::before { content: ""; position: absolute; left: -22.5px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--champagne); box-shadow: 0 0 10px var(--champagne); }
.tl span { font-size: var(--fs-cap); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tl p { font-size: var(--fs-sm); color: var(--ink-2); }

/* Upload drop zone */
.drop { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 22px 16px; border-radius: var(--r-md); border: 1.5px dashed rgba(255, 255, 255, 0.28); background: rgba(0, 0, 0, 0.22); cursor: pointer; transition: border-color 200ms, background 200ms, transform 200ms; position: relative; }
.drop:hover, .drop.over { border-color: var(--champagne); background: var(--champagne-soft); }
.drop.over { transform: scale(1.01); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop svg { width: 26px; height: 26px; color: var(--champagne); margin-bottom: 4px; }
.drop b { font-weight: 700; font-size: var(--fs-sm); }
.drop span { font-size: var(--fs-cap); color: var(--muted); }
.drop.has-file { border-style: solid; border-color: var(--good); background: var(--good-soft); }
.file-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); font-size: var(--fs-sm); }
.file-row svg { width: 18px; height: 18px; color: var(--champagne); flex: none; }
.file-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Install banner */
.install-banner { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.install-banner .ib-icon { width: 46px; height: 46px; border-radius: 12px; flex: none; overflow: hidden; box-shadow: var(--shadow-sm); }
.install-banner .ib-icon img { width: 100%; height: 100%; }
.install-banner .ib-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.install-banner .ib-text b { font-size: var(--fs-sm); }
.install-banner .ib-text span { font-size: var(--fs-cap); color: var(--muted); }
.steps { display: grid; gap: 10px; counter-reset: s; }
.steps li { list-style: none; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; font-size: var(--fs-sm); color: var(--ink-2); }
.steps li::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--champagne-soft); color: var(--champagne-hi); font-weight: 800; font-size: var(--fs-cap); }

/* Plan cards */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.plan { padding: 18px; display: grid; gap: 8px; cursor: pointer; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); transition: border-color 200ms, background 200ms, transform 200ms; text-align: left; }
.plan:hover { border-color: rgba(255, 255, 255, 0.3); }
.plan[aria-pressed="true"] { border-color: var(--champagne); background: var(--champagne-soft); box-shadow: 0 0 0 1px var(--champagne), 0 20px 40px -24px rgba(205, 184, 143, 0.5); }
.plan h4 { font-family: var(--serif); font-size: 1.35rem; }
.plan p { font-size: var(--fs-sm); color: var(--muted); }
.plan .price { font-family: var(--serif); font-size: 1.6rem; color: var(--champagne-hi); }
.plan .price small { font-family: var(--sans); font-size: var(--fs-cap); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

/* Reveal on load */
.reveal { animation: rise 760ms var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }

/* Login layout (shared by portal and admin) */
.auth { position: relative; z-index: 2; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-side { display: grid; grid-template-rows: auto 1fr auto; gap: 32px; padding: clamp(20px, 4vw, 56px); max-width: 640px; width: 100%; justify-self: end; }
.auth-side h1 { font-family: var(--serif); font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -0.015em; }
.auth-side h1 em { font-style: italic; color: var(--champagne-hi); }
.auth-side .lede { color: var(--muted); font-size: var(--fs-lg); margin-top: 16px; max-width: 46ch; }
.auth-card { padding: 30px; display: grid; gap: 18px; border-radius: var(--r-xl); }
.auth-card h2 { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; }
.auth-card .hint { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.auth-foot { font-size: var(--fs-cap); color: var(--faint); display: flex; gap: 8px; align-items: center; }
.auth-foot span { color: var(--good); }
.auth-art { position: relative; overflow: hidden; display: grid; align-items: end; padding: 40px; }
.auth-art .art-caption { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-cap); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.auth-art .art-stack { position: absolute; inset: 0; display: grid; place-items: center; }
@media (max-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { justify-self: stretch; max-width: none; grid-template-rows: auto auto auto; gap: 22px; }
  .auth-art { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .monogram { transform: none; }
}
