/*
 * COMPRIMO CSS — V10
 * Committee design directives: Ive, Buhai/Row, Hara, Fukasawa,
 * Müller, Morrison, Norman, Mahdavi, Jobs
 * "One moment. The savings number. Everything else recedes."
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  /* Surface */
  --bg:          #F0EDE8;
  --bg-soft:     #EAE6E0;
  --surface:     #FFFFFF;
  --surface-low: #F5F2ED;

  /* Shadows — warm, not cool */
  --shadow-xs:   0 1px 4px rgba(26,24,20,0.04);
  --shadow-sm:   0 2px 12px rgba(26,24,20,0.05);
  --shadow-md:   0 4px 24px rgba(26,24,20,0.07);
  --shadow-lg:   0 12px 48px rgba(26,24,20,0.09);
  --shadow-xl:   0 24px 80px rgba(26,24,20,0.12);

  /* Text */
  --text:        #1A1A18;
  --text-soft:   #6B665E;
  --text-faint:  #A8A39B;
  --text-ghost:  #C8C3BB;

  /* Forest — recedes into interactions only (Morrison) */
  --forest:      #2D6A4F;
  --forest-mid:  #3D7A5F;
  --forest-light:#40916C;
  --forest-ghost:rgba(45,106,79,0.06);
  --forest-glow: rgba(45,106,79,0.12);
  --forest-ring: rgba(45,106,79,0.20);

  /* Gold — THE moment (Buhai: one accent, full authority) */
  --gold:        #C9A961;
  --gold-deep:   #B8943F;
  --gold-soft:   rgba(201,169,97,0.08);
  --gold-glow:   rgba(201,169,97,0.15);

  /* Structure */
  --border:      #EDEBE6;
  --border-soft: #F0EDE8;
  --track:       #E8E5DF;

  /* Status */
  --error:       #C0392B;
  --error-soft:  rgba(192,57,43,0.07);

  /* Shorthand aliases */
  --shadow:      0 2px 24px rgba(26,26,24,0.05);
  --shadow-lift: 0 12px 48px rgba(26,26,24,0.08);
  --radius:      16px;
  --radius-sm:   10px;

  /* Typography — three sizes only (Müller) */
  --font:        'DM Sans', system-ui, sans-serif;
  --size-dom:    clamp(52px, 10vw, 96px);   /* dominant: savings number */
  --size-hero:   clamp(36px, 6vw, 64px);    /* hero headline */
  --size-sup:    15px;                       /* supporting: body copy */
  --size-cap:    12px;                       /* caption: labels, metadata */

  /* Radii — differentiated by purpose (Ive) */
  --r-precision: 8px;     /* query editor, data table, code */
  --r-card:      16px;    /* standard card */
  --r-invite:    22px;    /* auth cards, calculator, overlays */
  --r-pill:      100px;   /* buttons */

  /* Monospace */
  --mono:      'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Motion */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.4, 0, 1, 1);
  --t-fast:      150ms;
  --t-mid:       250ms;
  --t-slow:      600ms;
  --t-bloom:     900ms;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--size-sup);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}
::selection { background: var(--forest-glow); }

/* ── Typography (three sizes, strict) ───────────────────────── */
.t-dominant {
  font-size: var(--size-dom);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
.t-hero {
  font-size: var(--size-hero);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--text);
}
.t-hero strong { font-weight: 600; }
.t-sup {
  font-size: var(--size-sup);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-soft);
}
.t-cap {
  font-size: var(--size-cap);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}
.t-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

/* ── Layout ──────────────────────────────────────────────────── */
.container   { max-width: 1080px; margin: 0 auto; padding: 0 48px; }
.container-sm{ max-width: 640px;  margin: 0 auto; padding: 0 48px; }
.container-xs{ max-width: 480px;  margin: 0 auto; padding: 0 32px; }

/* ── Navigation ──────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px;
  background: rgba(240,237,232,0.85);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--border-soft);
  transition: border-color var(--t-mid) ease;
}
.nav-brand {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none;
  font-size: 14px; font-weight: 600; letter-spacing: -0.025em;
  color: var(--text);
}
.nav-links {
  display: flex; align-items: center; gap: 28px;
}
.nav-link {
  font-size: 13px; font-weight: 400;
  color: var(--text-faint);
  text-decoration: none;
  transition: color var(--t-fast) ease;
}
.nav-link:hover { color: var(--text-soft); }
.nav-link.active { color: var(--text); font-weight: 500; }
.nav-powered {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-ghost);
}
.nav-powered strong { color: var(--text-faint); font-weight: 500; }
.page-body { padding-top: 64px; }

/* ── Trust mark ──────────────────────────────────────────────── */
.mark {
  display: inline-block;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 38% 36%, #52A67E, #1B4332);
  position: relative;
  animation: markBreathe 4s var(--ease-out) infinite;
}
.mark::after {
  content: '';
  position: absolute;
  top: 30%; left: 36%;
  width: 18%; height: 18%;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
}
@keyframes markBreathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45,106,79,0.12); transform: scale(1); }
  50%       { box-shadow: 0 0 0 7px rgba(45,106,79,0);  transform: scale(1.035); }
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  border-radius: var(--r-pill); border: none;
  font-family: var(--font); font-weight: 500; cursor: pointer;
  text-decoration: none;
  transition: all var(--t-mid) var(--ease-out);
  white-space: nowrap;
}
.btn-lg  { padding: 14px 32px; font-size: 14px; letter-spacing: -0.01em; }
.btn-md  { padding: 11px 24px; font-size: 13px; }
.btn-sm  { padding: 8px  18px; font-size: 12px; font-weight: 600; }

/* Primary — forest fill, recedes on hover to deeper */
.btn-primary {
  background: var(--forest);
  color: #fff;
}
.btn-primary:hover { background: #225540; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(45,106,79,0.25); }
.btn-primary:active { transform: translateY(0); }

/* Gold — reserved for the ONE action that closes money */
.btn-gold {
  background: var(--gold);
  color: #fff;
  font-weight: 600;
}
.btn-gold:hover { background: var(--gold-deep); transform: translateY(-1px); box-shadow: 0 6px 24px rgba(201,169,97,0.30); }

/* Ghost — secondary, recedes completely */
.btn-ghost {
  background: transparent;
  color: var(--text-faint);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-soft); border-color: var(--text-ghost); }

/* Danger */
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #a93226; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-mid) ease;
}
.card-invite {
  background: var(--surface);
  border-radius: var(--r-invite);
  box-shadow: var(--shadow-lg);
}
.card:hover { box-shadow: var(--shadow-md); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 7px;
}
input[type=text],
input[type=email],
input[type=password],
textarea,
select,
.form-input,
.form-select {
  width: 100%;
  font-family: var(--font); font-size: 14px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; outline: none;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus,
.form-input:focus, .form-select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px var(--forest-ghost);
}
input::placeholder { color: var(--text-ghost); }
.form-input-sm, .form-select-sm { font-size: 13px; padding: 8px 12px; }
.form-help { font-size: 11px; color: var(--text-faint); margin-top: 5px; }

/* Query editor — precision surface */
.query-editor {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px; line-height: 1.6;
  background: #111110; color: #E8E4DE;
  border: none; border-radius: var(--r-precision);
  padding: 20px 24px;
  min-height: 100px; resize: vertical; width: 100%;
  outline: none;
  transition: box-shadow var(--t-fast) ease;
}
.query-editor:focus {
  box-shadow: 0 0 0 2px var(--forest-ring);
}

/* Slider — precision instrument */
input[type=range] {
  width: 100%;
  appearance: none; -webkit-appearance: none;
  height: 4px; border-radius: 2px; outline: none;
  cursor: pointer; border: none; padding: 0; background: none;
  background: linear-gradient(
    to right,
    var(--forest) var(--pct, 50%),
    var(--track)  var(--pct, 50%)
  );
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--forest);
  border: 2.5px solid var(--surface);
  box-shadow: 0 1px 8px rgba(45,106,79,0.35);
  cursor: pointer;
  transition: transform var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
input[type=range]::-webkit-slider-thumb:active {
  transform: scale(1.15);
  box-shadow: 0 2px 16px rgba(45,106,79,0.45);
}
input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--forest); border: 2.5px solid var(--surface);
  box-shadow: 0 1px 8px rgba(45,106,79,0.35); cursor: pointer;
}

/* Progress bars */
.progress-track {
  height: 6px; border-radius: 3px; background: var(--track); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--forest), var(--forest-light));
  transition: width 0.8s var(--ease-out);
}

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
}
.badge-green, .badge-success { background: var(--forest-ghost); color: var(--forest); }
.badge-gold  { background: var(--gold-soft);    color: var(--gold-deep); }
.badge-gray  { background: var(--bg-soft);      color: var(--text-faint); }
.badge-red   { background: var(--error-soft);   color: var(--error); }

/* ── Tables — precision surface ──────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-faint);
  padding: 10px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.data-table th:first-child { border-radius: var(--r-precision) 0 0 0; }
.data-table th:last-child  { border-radius: 0 var(--r-precision) 0 0; }
.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-soft);
  transition: background var(--t-fast) ease;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--forest-ghost); }
.mono {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px; color: var(--text-faint);
  letter-spacing: 0.02em;
}

/* ── Sidebar layout ──────────────────────────────────────────── */
.layout    { display: flex; min-height: 100vh; padding-top: 64px; }
.sidebar   {
  width: 212px; flex-shrink: 0;
  padding: 28px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  position: fixed; top: 64px; left: 0; bottom: 0;
  overflow-y: auto;
}
.sidebar-section {
  margin-bottom: 28px;
}
.sidebar-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--text-ghost);
  padding: 0 12px; margin-bottom: 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-radius: 9px; margin-bottom: 1px;
  color: var(--text-faint); font-size: 13px; font-weight: 400;
  text-decoration: none;
  transition: all var(--t-fast) ease;
}
.sidebar-link:hover  { background: var(--forest-ghost); color: var(--text-soft); }
.sidebar-link.active { background: var(--forest-ghost); color: var(--forest); font-weight: 500; }
.sidebar-icon { width: 15px; opacity: 0.6; }
.main-content { margin-left: 212px; flex: 1; padding: 40px 48px; }

/* ── Flash messages ──────────────────────────────────────────── */
.flashes {
  position: fixed; top: 76px; right: 24px; z-index: 300;
  max-width: 340px; display: flex; flex-direction: column; gap: 8px;
}
.flash {
  padding: 13px 18px; border-radius: 12px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: flashIn 0.3s var(--ease-out);
}
@keyframes flashIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
.flash-success { background: var(--forest); color: #fff; }
.flash-error   { background: var(--error);  color: #fff; }
.flash-info    { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* ── Stat cards ──────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  padding: 24px 28px;
}
.stat-n {
  font-size: 32px; font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text); line-height: 1;
}
.stat-n.gold { color: var(--gold); }
.stat-n.forest { color: var(--forest); }
.stat-label-text {
  font-size: 12px; font-weight: 500; color: var(--text-soft);
  margin-top: 8px;
}
.stat-sub-text {
  font-size: 11px; color: var(--text-faint);
  margin-top: 3px; font-style: italic;
}

/* ── Seed items ──────────────────────────────────────────────── */
.seed-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
  background: var(--surface); border-radius: var(--r-card);
  box-shadow: var(--shadow-xs); margin-bottom: 8px;
  transition: box-shadow var(--t-mid) ease;
  cursor: pointer;
}
.seed-item:hover { box-shadow: var(--shadow-md); }
.seed-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--forest-ghost);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}

/* ── Empty states ────────────────────────────────────────────── */
.empty {
  text-align: center; padding: 64px 24px;
}
.empty-mark { font-size: 32px; margin-bottom: 16px; opacity: 0.2; }
.empty h3   { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty p    { font-size: 13px; color: var(--text-faint); max-width: 300px; margin: 0 auto 20px; line-height: 1.6; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 13px 16px; border-radius: 11px; font-size: 13px;
  display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px;
}
.alert-success { background: var(--forest-ghost); color: var(--forest); }
.alert-error, .alert-danger { background: var(--error-soft); color: var(--error); }
.alert-info    { background: var(--gold-soft);     color: #8B6914; }

/* ── Page load sequence (Mahdavi / Hara) ─────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal="0"]  { transition-delay: 0ms; }
[data-reveal="1"]  { transition-delay: 180ms; }
[data-reveal="2"]  { transition-delay: 360ms; }
[data-reveal="3"]  { transition-delay: 500ms; }
[data-reveal="4"]  { transition-delay: 640ms; }
[data-reveal="5"]  { transition-delay: 780ms; }

/* Number bloom — gold, dominant, the one moment */
.savings-bloom {
  font-size: var(--size-dom);
  font-weight: 600;
  color: var(--gold);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
  transition: color var(--t-mid) ease;
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  padding: 24px 48px;
  border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  font-size: 11px; color: var(--text-ghost);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container, .container-sm { padding: 0 20px; }
  .nav { padding: 0 20px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 24px 20px; }
  .footer { padding: 20px; }
  .t-hero { font-size: clamp(28px, 8vw, 44px); }
}

/* ── Scroll-triggered reveal helper ─────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.7s var(--ease-out) both; }

/* ── Tooltip (progressive disclosure — Norman) ───────────────── */
.tip-wrap { position: relative; display: inline-block; }
.tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: var(--text); color: #fff;
  font-size: 11px; font-weight: 400; line-height: 1.5;
  padding: 6px 10px; border-radius: 7px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--t-fast) ease;
  z-index: 100;
}
.tip-wrap:hover .tip { opacity: 1; }

/* ── Provider cards (calculator) ─────────────────────────────── */
.prov-grid {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
  background: #F5F3EF;
  border-radius: 14px;
  border: 1px solid #EDEBE6;
  padding: 4px;
}
.prov-card {
  flex: 1 1 0;
  min-width: 0;
  padding: 18px 8px 14px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.prov-card:hover {
  background: rgba(255,255,255,0.6);
}
.prov-card.selected {
  background: #FFFFFF;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  border-color: #EDEBE6;
}
.prov-logo {
  width: 32px;
  height: 32px;
  margin: 0 auto 10px;
  display: block;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.prov-card:hover .prov-logo,
.prov-card.selected .prov-logo {
  opacity: 1;
}
.prov-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft, #6B665E);
  transition: color 0.2s ease;
  font-family: 'DM Sans', sans-serif;
}
.prov-card:hover .prov-name,
.prov-card.selected .prov-name {
  color: var(--text, #1A1A18);
}
.prov-price {
  font-size: 10px;
  color: var(--text-faint, #A8A39B);
  margin-top: 3px;
  font-family: 'DM Sans', sans-serif;
  font-variant-numeric: tabular-nums;
}

/* ── Calculator overlay ──────────────────────────────────────── */
.calc-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(26,26,24,0.40);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.calc-overlay.open { display: flex; }
.calc-panel {
  background: var(--surface);
  border-radius: var(--r-invite);
  box-shadow: var(--shadow-xl);
  padding: 48px 48px 40px;
  width: 100%; max-width: 500px;
  position: relative;
  max-height: 90vh; overflow-y: auto;
}
.calc-close {
  position: absolute; top: 18px; right: 20px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-soft); border: none;
  color: var(--text-faint); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast) ease;
}
.calc-close:hover { background: var(--bg); color: var(--text); }

/* ── Auth pages ──────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  padding: 40px 20px; background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border-radius: var(--r-invite);
  box-shadow: var(--shadow-xl);
  padding: 52px 48px;
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px; background: var(--border-soft);
  margin: 24px 0;
}

/* ── Query result panel ──────────────────────────────────────── */
.query-result {
  background: var(--surface);
  border-radius: var(--r-precision);
  box-shadow: var(--shadow-sm);
  overflow: auto; max-height: 420px;
}
.query-merkle {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 10px; font-weight: 600;
  background: var(--forest-ghost); color: var(--forest);
}

/* ── Powered by footer mark ──────────────────────────────────── */
.powered-by {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-ghost);
}
.powered-by strong { color: var(--text-faint); font-weight: 500; }

/* ── Utilities ───────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.flex    { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-4   { gap: 4px; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.gap-16  { gap: 16px; }
.gap-24  { gap: 24px; }
.mt-8    { margin-top: 8px; }
.mt-16   { margin-top: 16px; }
.mt-24   { margin-top: 24px; }
.mt-32   { margin-top: 32px; }
.mt-48   { margin-top: 48px; }
.mb-8    { margin-bottom: 8px; }
.mb-16   { margin-bottom: 16px; }
.mb-24   { margin-bottom: 24px; }
.text-center { text-align: center; }
.w-full  { width: 100%; }

/* ── Backward compat (untouched templates) ───────────────────── */
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.card-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.card-body { padding: 20px; }
.card-actions { display: flex; gap: 8px; }
.card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin-bottom: 6px; }
.card-value { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; color: var(--text); line-height: 1; }
.card-value.success { color: var(--forest); }
.card-value.warning { color: var(--gold); }
.card-value.accent { color: var(--gold); }
.card-sub { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.btn-full { width: 100%; }
.btn-xs { display: inline-flex; align-items: center; justify-content: center; padding: 5px 12px; font-size: 11px; font-weight: 600; border-radius: var(--r-pill); border: none; font-family: var(--font); cursor: pointer; text-decoration: none; transition: all var(--t-mid) var(--ease-out); white-space: nowrap; }
.btn-accent { background: var(--gold); color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 11px 24px; font-size: 13px; font-weight: 600; border-radius: var(--r-pill); border: none; font-family: var(--font); cursor: pointer; }
.inline-form { display: inline; }
.user-name { font-size: 13px; color: var(--text-soft); }
.table-wrapper { overflow-x: auto; }
.toast-container { position: fixed; top: 76px; right: 24px; z-index: 300; max-width: 340px; display: flex; flex-direction: column; gap: 8px; }
.nav-divider { height: 1px; background: var(--border-soft); margin: 12px 0; }
.help-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--bg-soft); font-size: 11px; color: var(--text-faint); cursor: help; margin-left: 6px; vertical-align: middle; }
.code-block { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; line-height: 1.6; background: var(--bg-soft); padding: 16px; border-radius: var(--r-precision); overflow-x: auto; color: var(--text-soft); white-space: pre-wrap; }
.code-input { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; }
.empty-state { text-align: center; padding: 24px; color: var(--text-faint); font-size: 13px; }
.empty-state a { color: var(--forest); text-decoration: none; }
.empty-cell { text-align: center; }
.chart-container { position: relative; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--border-soft); }
.pagination-info { font-size: 13px; color: var(--text-faint); }
.trust-mark { font-size: 11px; color: var(--text-ghost); font-weight: 500; }
.quick-actions { display: flex; flex-direction: column; gap: 8px; }
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); margin-top: 6px; flex-shrink: 0; }
.activity-dot.success, .activity-dot.reduce { background: var(--forest); }
.activity-dot.warning { background: var(--gold); }
.activity-dot.error { background: var(--error); }
.activity-content { flex: 1; }
.activity-text { font-size: 13px; color: var(--text-soft); }
.activity-time { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.activity-feed { }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 28px; }
.dashboard-main { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.dashboard-side { display: flex; flex-direction: column; gap: 16px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; padding: 20px; }
.result-card { padding: 16px; background: var(--bg-soft); border-radius: 10px; }
.result-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin-bottom: 6px; }
.result-value { font-size: 24px; font-weight: 600; color: var(--text); }
.result-value.success { color: var(--forest); }
.result-value.accent { color: var(--gold); }
.result-highlight { background: var(--forest-ghost); }
.result-primary { background: var(--forest); }
.result-primary .result-label { color: rgba(255,255,255,0.7); }
.result-primary .result-value { color: #fff; }
.results-footer { padding: 10px 20px; font-size: 11px; color: var(--text-faint); border-top: 1px solid var(--border-soft); }
.proof-panel { border: none; }
.proof-body { padding: 0 20px 20px; }
.proof-field { display: flex; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.proof-field:last-child { border-bottom: none; }
.proof-field label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); width: 100px; flex-shrink: 0; }
.proof-field code { font-family: 'SF Mono', monospace; font-size: 11px; color: var(--text-faint); word-break: break-all; }
.history-item { display: block; width: 100%; text-align: left; padding: 9px 10px; margin-bottom: 4px; border-radius: 8px; border: none; background: var(--bg-soft); cursor: pointer; transition: background var(--t-fast) ease; font-family: var(--font); }
.history-item:hover { background: var(--forest-ghost); }
.history-sql { font-family: 'SF Mono', monospace; font-size: 11px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { font-size: 10px; color: var(--text-faint); margin-top: 3px; }
.reference-list { }
.reference-item { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; font-size: 12px; }
.reference-item code { font-family: 'SF Mono', monospace; font-size: 11px; color: var(--forest); font-weight: 600; }
.reference-item span { color: var(--text-faint); }
.query-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }
.query-main { }
.query-sidebar { }
.vault-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-left { display: flex; gap: 8px; flex: 1; }
.toolbar-right { display: flex; gap: 6px; }
.th-check { width: 32px; }
.actions-cell { white-space: nowrap; }
.sidebar-header { padding: 0 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.sidebar-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.logo-mark { width: 24px; height: 24px; border-radius: 6px; background: radial-gradient(circle at 38% 36%, #52A67E, #1B4332); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }
.logo-text { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.025em; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border-soft); margin-top: auto; }
.sidebar-toggle, .sidebar-toggle-mobile { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 4px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; margin-bottom: 8px; }
.topbar-title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.main-wrapper { flex: 1; display: flex; flex-direction: column; }
.app-layout { display: flex; min-height: 100vh; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 9px; margin-bottom: 1px; color: var(--text-faint); font-size: 13px; font-weight: 400; text-decoration: none; transition: all var(--t-fast) ease; }
.nav-item:hover { background: var(--forest-ghost); color: var(--text-soft); }
.nav-item.active { background: var(--forest-ghost); color: var(--forest); font-weight: 500; }
.sidebar-nav { display: flex; flex-direction: column; }

/* ── Stats bar ──────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 80px 32px;
}

.stats-bar .stat-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px 20px;
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--text);
}

.stat-value.gold {
  color: var(--gold);
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-top: 10px;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  line-height: 1.4;
  font-style: italic;
}

/* ── Feature sections ───────────────────────────────────────── */
.feature-section {
  padding: 80px 0;
  max-width: 1040px;
  margin: 0 auto;
}

.feature-row {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 32px;
}

.feature-row.reverse {
  flex-direction: row-reverse;
}

.feature-text {
  flex: 1 1 340px;
  min-width: 280px;
}

.feature-demo {
  flex: 1 1 360px;
  min-width: 300px;
}

.feature-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  display: block;
  margin-bottom: 10px;
}

.feature-heading {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 12px;
}

.feature-description {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 16px;
}

.feature-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--forest);
  background: rgba(45,106,79,0.06);
  padding: 4px 10px;
  border-radius: 100px;
}

/* ── Demo cards ─────────────────────────────────────────────── */
.demo-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
  min-height: 200px;
}

.demo-terminal {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-soft);
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  white-space: nowrap;
}

.demo-terminal .keyword {
  color: var(--forest);
  font-weight: 600;
}

.column-strip {
  display: flex;
  gap: 1.5px;
  height: 14px;
  margin-bottom: 14px;
}

.column-strip .col {
  flex: 1;
  border-radius: 2px;
  background: var(--track);
  opacity: 0.35;
}

.column-strip .col.active {
  background: var(--forest);
  opacity: 1;
}

.demo-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.demo-meta strong {
  color: var(--forest);
}

.demo-meta .gold {
  color: var(--gold);
}

.demo-result-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.demo-result-row:last-child {
  border-bottom: none;
}

.demo-result-row .label {
  color: var(--text);
}

.demo-result-row .value {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.demo-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.demo-status.success {
  background: rgba(45,106,79,0.06);
}

.demo-status.watching {
  background: rgba(201,169,97,0.08);
}

.demo-status .check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--forest);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.demo-status .time {
  margin-left: auto;
  font-size: 20px;
  font-weight: 600;
  color: var(--gold);
}

.compliance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.compliance-row:last-child {
  border-bottom: none;
}

.compliance-row .name {
  color: var(--text);
  font-weight: 500;
}

.compliance-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--forest);
  background: rgba(45,106,79,0.06);
  padding: 2px 8px;
  border-radius: 100px;
}

.opportunity-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.opportunity-row:last-child {
  border-bottom: none;
}

.opportunity-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}

.opportunity-header .opp-label {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.opportunity-header .opp-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

.opportunity-risk {
  font-size: 10px;
  color: var(--text-faint);
}

.demo-note {
  font-size: 11px;
  color: var(--text-faint);
  font-style: italic;
  margin-top: 10px;
}

.seed-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--forest);
  background: rgba(45,106,79,0.06);
  padding: 2px 8px;
  border-radius: 100px;
}

.demo-footer {
  margin-top: 8px;
  font-size: 11px;
  color: var(--forest);
  font-weight: 500;
}

@media (max-width: 768px) {
  .feature-row { padding: 0 20px; }
  .stats-bar { padding: 40px 20px; }
}
