/* =============================================================================
   Shriram 107 Southeast — Ganapati Mahotsav 2026
   Design system. Zero build step, zero external CSS dependencies.

   Contents
     01  Reset & base
     02  Design tokens (light / dark)
     03  Typography
     04  Layout primitives
     05  Buttons & links
     06  Cards, panels, glass
     07  Stat tiles & figures
     08  Badges, pills, chips, avatars
     09  Forms & inputs
     10  Tables
     11  Navigation (topbar, sidebar, mobile bar)
     12  Overlays (modal, drawer, toast, command palette)
     13  Data visualisation
     14  Progress, rings, meters
     15  Timeline & steps
     16  States (skeleton, empty, error)
     17  Marketing sections (hero, feature grid, footer)
     18  Animation
     19  Utilities
     20  Responsive & print
   ========================================================================== */

/* ---------- 01  Reset & base --------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--plane);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
svg { flex: none; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: color-mix(in srgb, var(--brand-500) 28%, transparent); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }

/* ---------- 02  Design tokens -------------------------------------------- */

:root {
  color-scheme: light;

  --font-sans: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;

  /*
   * Brand — the festival palette: sindoor vermilion, marigold saffron and
   * temple gold. This is UI chrome only; the data-visualisation colours below
   * stay neutral on purpose, so the numbers never look decorated.
   *
   * --brand-500 is the button fill (5.6:1 against white text) and --brand-600
   * the link colour (7.4:1 on the ivory plane).
   */
  --brand-50:  #fdf0e9;
  --brand-100: #fbdccd;
  --brand-200: #f6b79c;
  --brand-300: #ef8a63;
  --brand-400: #e0521f;
  --brand-500: #b8320f;
  --brand-600: #9a2a0d;
  --brand-700: #7d220b;
  --brand-800: #5f1a08;
  --brand-900: #421206;

  --saffron-300: #fcd34d;
  --saffron-400: #f9a825;
  --saffron-500: #ef8a0b;
  --saffron-600: #c86a05;

  /* Temple gold, for ornament hairlines and garland details. */
  --gold-300: #f0d98a;
  --gold-400: #dcb44a;
  --gold-500: #b8912f;

  /* Surfaces — warm ivory rather than cool grey. */
  --plane:        #fdf7ee;
  --surface-1:    #ffffff;
  --surface-2:    #fffaf2;
  --surface-3:    #faeee0;
  --surface-sunk: #f4e5d3;
  --surface-inverse: #2a1206;

  /* Ink — warm near-black reads friendlier against ivory than pure grey. */
  --text-primary:   #2b1a10;
  --text-secondary: #5d4536;
  --text-muted:     #806858;
  --text-inverse:   #ffffff;

  /* Lines */
  --border:        rgba(80, 40, 20, 0.12);
  --border-strong: rgba(80, 40, 20, 0.22);
  --gridline:      rgba(80, 40, 20, 0.09);

  /* Status — fixed, never themed. Always paired with an icon + label. */
  --good:     #0ca30c;
  --warning:  #fab219;
  --serious:  #ec835a;
  --critical: #d03b3b;
  --good-ink:     #056b05;
  --warning-ink:  #8a5d00;
  --critical-ink: #a52020;

  /* Data series — validated against the light surface (see docs/design.md) */
  --series-in:  #1baf7a;   /* money in  */
  --series-out: #eb6834;   /* money out */
  --series-seq: #2a78d6;   /* single-hue magnitude ramp */
  --series-seq-soft: #9ec5f4;

  /* Tints for category/role accents */
  --tint-violet:  #6a5cf0;
  --tint-indigo:  #4f46e5;
  --tint-sky:     #0284c7;
  --tint-teal:    #0d9488;
  --tint-emerald: #059669;
  --tint-amber:   #d97706;
  --tint-orange:  #ea580c;
  --tint-rose:    #e11d48;
  --tint-slate:   #64748b;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(20, 19, 31, 0.05);
  --shadow-sm: 0 1px 3px rgba(20, 19, 31, 0.07), 0 1px 2px rgba(20, 19, 31, 0.04);
  --shadow-md: 0 6px 16px -4px rgba(20, 19, 31, 0.10), 0 2px 6px -2px rgba(20, 19, 31, 0.06);
  --shadow-lg: 0 18px 40px -12px rgba(20, 19, 31, 0.16), 0 6px 14px -6px rgba(20, 19, 31, 0.08);
  --shadow-xl: 0 34px 70px -20px rgba(20, 19, 31, 0.24), 0 10px 24px -10px rgba(20, 19, 31, 0.10);
  --shadow-brand: 0 12px 30px -10px color-mix(in srgb, var(--brand-500) 45%, transparent);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-full: 999px;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-blur: saturate(180%) blur(20px);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 140ms;
  --t-base: 240ms;
  --t-slow: 420ms;

  /* Metrics */
  --topbar-h: 68px;
  --sidebar-w: 268px;
  /* Full-bleed layout. Set a px value here to go back to a centred column. */
  --container: 100%;
}

/*
 * Light theme only.
 *
 * The dark palette and its prefers-color-scheme block were removed
 * deliberately: a festival site is warm, bright and printed as often as it is
 * scrolled, and a half-maintained second theme is worse than none. The tokens
 * above are the single source of truth.
 */

/* ---------- 03  Typography ------------------------------------------------ */

h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.022em;
  color: var(--text-primary);
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 1.4rem + 3.4vw, 4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.9vw, 2.6rem); letter-spacing: -0.03em; }
h3 { font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.6rem); }
h4 { font-size: 1.0625rem; }
h5 { font-size: 0.9375rem; }

p { text-wrap: pretty; }

.display {
  font-size: clamp(2.6rem, 1.5rem + 4.6vw, 5.2rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.lead {
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.1875rem);
  line-height: 1.65;
  color: var(--text-secondary);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-600);
}

.section-title { display: flex; flex-direction: column; gap: 0.6rem; }
.section-title p { max-width: 62ch; }

.text-gradient {
  background: linear-gradient(100deg, var(--saffron-300) 0%, var(--gold-300) 45%, var(--saffron-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.small { font-size: 0.8125rem; }
.tiny { font-size: 0.75rem; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono { font-family: var(--font-mono); font-size: 0.8125em; letter-spacing: -0.02em; }
.strong { font-weight: 650; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 04  Layout primitives ---------------------------------------- */

/*
 * Full-bleed by default: content spans the whole viewport instead of sitting in
 * a centred column with empty bands either side.
 *
 * The gutter is the smallest that still keeps text and cards off the browser
 * edge — dropping it to zero puts headings flush against the window frame and
 * clips them under rounded corners on mobile.
 */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(0.9rem, 1.2vw, 1.5rem);
}

/* Deliberate reading columns. A receipt or an error message set 2000px wide is
   unreadable, so these keep their measure even on a full-bleed page. */
.container-narrow { max-width: 820px; }
.container-reading { max-width: 68ch; }

/* Opt back into a centred column where a page wants one. */
.container-boxed { max-width: 1240px; }

.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.section-tight { padding-block: clamp(2.5rem, 4vw, 3.75rem); }

.stack { display: flex; flex-direction: column; }
.stack-xs { gap: 0.375rem; }
.stack-sm { gap: 0.75rem; }
.stack-md { gap: 1.25rem; }
.stack-lg { gap: 2rem; }
.stack-xl { gap: 3rem; }

.row { display: flex; align-items: center; gap: 0.75rem; }
.row-tight { gap: 0.5rem; }
.row-loose { gap: 1.25rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.row-wrap { flex-wrap: wrap; }
.row-top { align-items: flex-start; }
.spacer { flex: 1 1 auto; }

.grid { display: grid; gap: clamp(0.875rem, 1.6vw, 1.25rem); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.grid-auto-lg { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

.split { display: grid; gap: clamp(1rem, 2vw, 1.75rem); grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.split-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split-reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.page-head h1 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); letter-spacing: -0.03em; }
.page-head .subtitle { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.2rem; }

/* ---------- 05  Buttons --------------------------------------------------- */

.btn {
  --btn-bg: var(--surface-1);
  --btn-fg: var(--text-primary);
  --btn-border: var(--border-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.05rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-sm);
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              background var(--t-fast) linear,
              border-color var(--t-fast) linear,
              opacity var(--t-fast) linear;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn .icon { width: 1.05rem; height: 1.05rem; }

.btn-primary {
  --btn-bg: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  --btn-fg: #fff;
  --btn-border: transparent;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { box-shadow: 0 16px 34px -12px color-mix(in srgb, var(--brand-500) 60%, transparent); }

.btn-saffron {
  --btn-bg: linear-gradient(180deg, var(--saffron-300), var(--saffron-400));
  /* Dark ink, not white: white on marigold measures 2:1 and cannot be read. */
  --btn-fg: #2b1a10;
  --btn-border: transparent;
  box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--saffron-500) 60%, transparent);
}
.btn-saffron:hover { box-shadow: 0 16px 34px -12px color-mix(in srgb, var(--saffron-500) 70%, transparent); }

.btn-ghost { --btn-bg: transparent; --btn-border: transparent; color: var(--text-secondary); }
.btn-ghost:hover { --btn-bg: var(--surface-3); color: var(--text-primary); box-shadow: none; }

.btn-outline { --btn-bg: transparent; }
.btn-outline:hover { --btn-bg: var(--surface-3); }

.btn-glass {
  --btn-bg: var(--glass-bg);
  --btn-border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.btn-danger  { --btn-bg: color-mix(in srgb, var(--critical) 12%, var(--surface-1)); --btn-fg: var(--critical-ink); --btn-border: color-mix(in srgb, var(--critical) 30%, transparent); }
.btn-success { --btn-bg: color-mix(in srgb, var(--good) 12%, var(--surface-1)); --btn-fg: var(--good-ink); --btn-border: color-mix(in srgb, var(--good) 30%, transparent); }

.btn-lg { padding: 0.85rem 1.5rem; font-size: 0.9375rem; border-radius: var(--r-md); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; border-radius: var(--r-xs); }
.btn-block { width: 100%; }
.btn-pill { border-radius: var(--r-full); }

.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.375rem;
  height: 2.375rem;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background var(--t-fast) linear, color var(--t-fast) linear, transform var(--t-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text-primary); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .icon { width: 1.15rem; height: 1.15rem; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  color: var(--brand-600);
  transition: gap var(--t-fast) var(--ease-out);
}
.link:hover { gap: 0.5rem; }
.link .icon { width: 1rem; height: 1rem; }

.icon { width: 1.25rem; height: 1.25rem; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }

/* ---------- 06  Cards, panels, glass -------------------------------------- */

.card {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: clamp(1rem, 1.6vw, 1.5rem); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem clamp(1rem, 1.6vw, 1.5rem);
  border-bottom: 1px solid var(--border);
}
.card-head h3, .card-head h4 { font-size: 1rem; letter-spacing: -0.02em; }
.card-head .subtitle { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.1rem; }
.card-foot {
  padding: 0.85rem clamp(1rem, 1.6vw, 1.5rem);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.card-hover { transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base) linear; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card-flat { box-shadow: none; }
.card-sunk { background: var(--surface-sunk); box-shadow: none; }

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--r-lg);
}

/* Gradient hairline that reads as a premium bevel */
.card-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--brand-500) 40%, transparent),
    transparent 38%,
    transparent 62%,
    color-mix(in srgb, var(--saffron-500) 30%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem;
}

.divider { height: 1px; background: var(--border); border: 0; margin-block: 1rem; }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }

/* ---------- 07  Stat tiles ------------------------------------------------ */

.stat {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.stat-label .icon { width: 0.95rem; height: 0.95rem; }
.stat-value {
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.05rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text-primary);
}
.stat-value.num { font-variant-numeric: proportional-nums; }
.stat-meta { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--text-muted); }
.stat-spark { margin-top: 0.2rem; height: 34px; }
.stat-accent {
  position: absolute;
  inset: auto -30% -60% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, var(--brand-500)) 22%, transparent), transparent 70%);
  pointer-events: none;
}

.delta { display: inline-flex; align-items: center; gap: 0.2rem; font-weight: 650; font-size: 0.75rem; }
.delta .icon { width: 0.85rem; height: 0.85rem; }
.delta-up { color: var(--good-ink); }
.delta-down { color: var(--critical-ink); }
.delta-flat { color: var(--text-muted); }

.hero-figure {
  font-size: clamp(2.6rem, 1.8rem + 3.6vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}

/* ---------- 08  Badges, pills, chips, avatars ----------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-secondary);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge .icon { width: 0.8rem; height: 0.8rem; }

.badge-success  { background: color-mix(in srgb, var(--good) 13%, transparent);     color: var(--good-ink);     border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.badge-warning  { background: color-mix(in srgb, var(--warning) 18%, transparent);   color: var(--warning-ink);  border-color: color-mix(in srgb, var(--warning) 32%, transparent); }
.badge-critical { background: color-mix(in srgb, var(--critical) 13%, transparent);  color: var(--critical-ink); border-color: color-mix(in srgb, var(--critical) 26%, transparent); }
.badge-info     { background: color-mix(in srgb, var(--series-seq) 13%, transparent); color: var(--series-seq);  border-color: color-mix(in srgb, var(--series-seq) 26%, transparent); }
.badge-brand    { background: color-mix(in srgb, var(--brand-500) 13%, transparent); color: var(--brand-600);    border-color: color-mix(in srgb, var(--brand-500) 26%, transparent); }
.badge-neutral  { background: var(--surface-3); color: var(--text-secondary); }
.badge-lg { padding: 0.32rem 0.7rem; font-size: 0.75rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  transition: all var(--t-fast) linear;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.active, .chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--brand-500) 12%, var(--surface-1));
  border-color: color-mix(in srgb, var(--brand-500) 40%, transparent);
  color: var(--brand-600);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(140deg, var(--tint, var(--brand-500)), color-mix(in srgb, var(--tint, var(--brand-500)) 55%, #000));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.avatar-sm { width: 1.75rem; height: 1.75rem; font-size: 0.625rem; }
.avatar-lg { width: 3rem; height: 3rem; font-size: 0.9375rem; }
.avatar-xl { width: 4.5rem; height: 4.5rem; font-size: 1.35rem; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -0.55rem; box-shadow: 0 0 0 2px var(--surface-1); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.tint-violet  { --tint: var(--tint-violet); --accent: var(--tint-violet); }
.tint-indigo  { --tint: var(--tint-indigo); --accent: var(--tint-indigo); }
.tint-sky     { --tint: var(--tint-sky); --accent: var(--tint-sky); }
.tint-teal    { --tint: var(--tint-teal); --accent: var(--tint-teal); }
.tint-emerald { --tint: var(--tint-emerald); --accent: var(--tint-emerald); }
.tint-amber   { --tint: var(--tint-amber); --accent: var(--tint-amber); }
.tint-orange  { --tint: var(--tint-orange); --accent: var(--tint-orange); }
.tint-rose    { --tint: var(--tint-rose); --accent: var(--tint-rose); }
.tint-slate   { --tint: var(--tint-slate); --accent: var(--tint-slate); }

.tile-icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
  border-radius: var(--r-md);
  color: var(--tint, var(--brand-500));
  background: color-mix(in srgb, var(--tint, var(--brand-500)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint, var(--brand-500)) 22%, transparent);
}
.tile-icon .icon { width: 1.3rem; height: 1.3rem; }
.tile-icon-lg { width: 3.25rem; height: 3.25rem; border-radius: var(--r-lg); }
.tile-icon-lg .icon { width: 1.6rem; height: 1.6rem; }

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.4rem;
  padding: 0.1rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
}

/* ---------- 09  Forms ----------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 0.375rem; }
.label { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }
.label .req { color: var(--critical); }
.hint { font-size: 0.75rem; color: var(--text-muted); }
.error-text { font-size: 0.75rem; color: var(--critical-ink); display: flex; align-items: center; gap: 0.3rem; }

.input, .select, .textarea {
  width: 100%;
  padding: 0.625rem 0.8rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast) linear, box-shadow var(--t-fast) linear, background var(--t-fast) linear;
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 18%, transparent);
}
.input[aria-invalid="true"] { border-color: var(--critical); }
.textarea { min-height: 6.5rem; resize: vertical; line-height: 1.55; }
.select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b7a90' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1rem;
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group .icon {
  position: absolute;
  left: 0.75rem;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--text-muted);
  pointer-events: none;
}
.input-group .input { padding-left: 2.4rem; }
.input-prefix {
  position: absolute;
  left: 0.85rem;
  font-weight: 650;
  color: var(--text-muted);
  pointer-events: none;
}
.input-group.has-prefix .input { padding-left: 2rem; }

.input-xl {
  padding: 1rem 1.1rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.checkbox, .radio {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.15rem 0;
  cursor: pointer;
  font-size: 0.875rem;
}
.checkbox input, .radio input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  accent-color: var(--brand-500);
  flex: none;
}

.switch { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative;
  width: 2.5rem;
  height: 1.4rem;
  border-radius: var(--r-full);
  background: var(--border-strong);
  transition: background var(--t-base) var(--ease-out);
  flex: none;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 0.175rem;
  left: 0.175rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-spring);
}
.switch input:checked + .switch-track { background: var(--brand-500); }
.switch input:checked + .switch-track::after { transform: translateX(1.1rem); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.segmented {
  display: inline-flex;
  padding: 0.2rem;
  gap: 0.15rem;
  background: var(--surface-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.segmented button {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--r-xs);
  transition: all var(--t-fast) linear;
}
.segmented button:hover { color: var(--text-primary); }
.segmented button[aria-pressed="true"] {
  background: var(--surface-1);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

/* Amount picker on the contribute screen */
.amount-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.6rem; }
.amount-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.9rem 0.6rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-1);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  transition: all var(--t-fast) var(--ease-out);
}
.amount-option span { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.02em; }
.amount-option:hover { border-color: var(--brand-400); transform: translateY(-2px); }
.amount-option[aria-pressed="true"] {
  border-color: var(--brand-500);
  background: color-mix(in srgb, var(--brand-500) 10%, var(--surface-1));
  color: var(--brand-600);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 14%, transparent);
}

.method-option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.9rem 1rem;
  text-align: left;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-1);
  transition: all var(--t-fast) var(--ease-out);
}
.method-option:hover { border-color: var(--brand-400); }
.method-option[aria-pressed="true"] { border-color: var(--brand-500); background: color-mix(in srgb, var(--brand-500) 8%, var(--surface-1)); }
.method-option .tile-icon { width: 2.25rem; height: 2.25rem; }
.method-option .method-name { font-weight: 650; font-size: 0.9375rem; }
.method-option .method-desc { font-size: 0.75rem; color: var(--text-muted); }

/* OTP boxes */
.otp-row { display: flex; gap: 0.5rem; justify-content: center; }
.otp-box {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-1);
}
.otp-box:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 18%, transparent); }

.dropzone {
  display: grid;
  place-items: center;
  gap: 0.5rem;
  padding: 1.75rem 1rem;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-muted);
  transition: all var(--t-fast) linear;
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-dragging {
  border-color: var(--brand-500);
  background: color-mix(in srgb, var(--brand-500) 6%, var(--surface-2));
  color: var(--brand-600);
}

/* ---------- 10  Tables ---------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  -webkit-overflow-scrolling: touch;
}

.table { font-size: 0.875rem; min-width: 620px; }
.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--t-fast) linear; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num, .table .amount { text-align: right; font-variant-numeric: tabular-nums; }
.table .amount { font-weight: 650; }
.table-clickable tbody tr { cursor: pointer; }
.table caption { caption-side: bottom; padding: 0.75rem 1rem; font-size: 0.75rem; color: var(--text-muted); text-align: left; }

.cell-primary { font-weight: 600; color: var(--text-primary); }
.cell-sub { font-size: 0.75rem; color: var(--text-muted); }
.cell-stack { display: flex; flex-direction: column; gap: 0.1rem; }

/* Card-style rows on small screens */
@media (max-width: 700px) {
  .table-cards { min-width: 0; }
  .table-cards thead { display: none; }
  .table-cards tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.75rem;
    padding: 0.85rem 0.95rem;
    border-bottom: 1px solid var(--border);
  }
  .table-cards tbody td { padding: 0; border: 0; }
  .table-cards tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .table-cards td.span-2 { grid-column: 1 / -1; }
}

/* ---------- 11  Navigation ------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: box-shadow var(--t-base) linear;
}
.topbar.is-scrolled { box-shadow: var(--shadow-sm); }
.topbar-inner { display: flex; align-items: center; gap: 1rem; width: 100%; }

.brand { display: inline-flex; align-items: center; gap: 0.65rem; font-weight: 750; letter-spacing: -0.025em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  border-radius: 0.7rem;
  color: #fff;
  background: linear-gradient(140deg, var(--saffron-400), var(--brand-500) 58%, var(--brand-700));
  box-shadow: var(--shadow-brand);
}
.brand-mark .icon { width: 1.25rem; height: 1.25rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 0.9375rem; }
.brand-text span { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.01em; }

.nav-links { display: flex; align-items: center; gap: 0.15rem; }
.nav-link {
  position: relative;
  padding: 0.5rem 0.8rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  transition: color var(--t-fast) linear, background var(--t-fast) linear;
}
.nav-link:hover { color: var(--text-primary); background: var(--surface-3); }
.nav-link.active { color: var(--brand-600); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-500);
}

/* App shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.shell-main { min-width: 0; display: flex; flex-direction: column; }
/* Matches the .container gutter so portal pages sit as wide as public ones. */
.shell-content {
  flex: 1;
  padding: clamp(1rem, 1.6vw, 1.5rem) clamp(0.9rem, 1.2vw, 1.5rem);
  padding-bottom: 5.5rem;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.sidebar-brand { padding: 0.35rem 0.5rem 0.75rem; }
.sidebar-group { display: flex; flex-direction: column; gap: 0.1rem; }
.sidebar-heading {
  padding: 0.9rem 0.75rem 0.3rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  transition: all var(--t-fast) linear;
}
.sidebar-link .icon { width: 1.1rem; height: 1.1rem; color: var(--text-muted); transition: color var(--t-fast) linear; }
.sidebar-link:hover { background: var(--surface-3); color: var(--text-primary); }
.sidebar-link:hover .icon { color: var(--text-secondary); }
.sidebar-link.active {
  background: color-mix(in srgb, var(--brand-500) 11%, transparent);
  color: var(--brand-600);
  font-weight: 650;
}
.sidebar-link.active .icon { color: var(--brand-600); }
.sidebar-link .count {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-secondary);
}
.sidebar-link.active .count { background: var(--brand-500); color: #fff; }
.sidebar-foot { margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--border); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem;
  border-radius: var(--r-md);
  transition: background var(--t-fast) linear;
}
.user-chip:hover { background: var(--surface-3); }
.user-chip-text { min-width: 0; text-align: left; }
.user-chip-text b { display: block; font-size: 0.8125rem; font-weight: 650; }
.user-chip-text span { display: block; font-size: 0.6875rem; color: var(--text-muted); }

/* Mobile bottom bar */
.mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: space-around;
  padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
  background: var(--glass-bg);
  border-top: 1px solid var(--border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.mobile-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  min-width: 3.75rem;
}
.mobile-bar a .icon { width: 1.3rem; height: 1.3rem; }
.mobile-bar a.active { color: var(--brand-600); }

/* Tabs */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  position: relative;
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--t-fast) linear;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--brand-600); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--brand-500);
}
.tab .count { margin-left: 0.35rem; font-size: 0.6875rem; padding: 0.05rem 0.35rem; border-radius: var(--r-full); background: var(--surface-3); }

.breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; color: var(--text-muted); }
.breadcrumb .icon { width: 0.85rem; height: 0.85rem; }
.breadcrumb a:hover { color: var(--text-primary); }

/* ---------- 12  Overlays -------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  background: rgba(8, 9, 15, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease-out);
}
.overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  place-self: center;
  width: min(560px, calc(100vw - 2rem));
  max-height: min(85vh, 780px);
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform var(--t-base) var(--ease-out), opacity var(--t-base) var(--ease-out);
  overflow: hidden;
}
.overlay.open .modal { transform: none; opacity: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.35rem; overflow-y: auto; }
.modal-foot { padding: 1rem 1.35rem; border-top: 1px solid var(--border); background: var(--surface-2); display: flex; gap: 0.6rem; justify-content: flex-end; }

.drawer {
  place-self: stretch end;
  width: min(560px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  transform: translateX(24px);
  opacity: 0;
  transition: transform var(--t-base) var(--ease-out), opacity var(--t-base) var(--ease-out);
}
.overlay.open .drawer { transform: none; opacity: 1; }
.drawer-head { padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--border); }
.drawer-body { padding: 1.35rem; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 1rem 1.35rem; border-top: 1px solid var(--border); background: var(--surface-2); }

/* Command palette */
.palette {
  place-self: start center;
  margin-top: min(12vh, 8rem);
  width: min(640px, calc(100vw - 2rem));
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(-10px) scale(0.99);
  opacity: 0;
  transition: transform var(--t-base) var(--ease-out), opacity var(--t-base) var(--ease-out);
}
.overlay.open .palette { transform: none; opacity: 1; }
.palette-input {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.palette-input input { width: 100%; border: 0; outline: none; background: none; font-size: 1rem; }
.palette-input .icon { color: var(--text-muted); }
.palette-results { overflow-y: auto; padding: 0.5rem; }
.palette-group-label { padding: 0.6rem 0.75rem 0.3rem; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.palette-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background var(--t-fast) linear;
}
.palette-item:hover, .palette-item.is-active { background: var(--surface-3); }
.palette-item .icon { color: var(--text-muted); }
.palette-item-text { min-width: 0; flex: 1; }
.palette-item-text b { display: block; font-size: 0.875rem; font-weight: 600; }
.palette-item-text span { display: block; font-size: 0.75rem; color: var(--text-muted); }
.palette-foot { padding: 0.6rem 1rem; border-top: 1px solid var(--border); background: var(--surface-2); display: flex; gap: 1rem; font-size: 0.6875rem; color: var(--text-muted); }

/* Toasts */
.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 280px;
  max-width: 380px;
  padding: 0.85rem 1rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in var(--t-base) var(--ease-out);
}
.toast.leaving { animation: toast-out var(--t-base) var(--ease-out) forwards; }
.toast-success { border-left-color: var(--good); }
.toast-error   { border-left-color: var(--critical); }
.toast-warning { border-left-color: var(--warning); }
.toast b { display: block; font-size: 0.875rem; }
.toast p { font-size: 0.8125rem; color: var(--text-muted); }

@keyframes toast-in  { from { opacity: 0; transform: translateX(20px) scale(0.97); } }
@keyframes toast-out { to   { opacity: 0; transform: translateX(20px) scale(0.97); } }

/* AI assistant panel */
.assistant-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  font-weight: 650;
  font-size: 0.875rem;
  color: #fff;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700) 60%, var(--saffron-500));
  box-shadow: var(--shadow-brand), var(--shadow-lg);
  transition: transform var(--t-base) var(--ease-spring);
}
.assistant-fab:hover { transform: translateY(-2px) scale(1.02); }
.assistant-fab .icon { width: 1.15rem; height: 1.15rem; }

.assistant-msg {
  display: flex;
  gap: 0.7rem;
  padding: 0.85rem 0;
}
.assistant-msg .bubble {
  padding: 0.75rem 0.95rem;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.assistant-msg.from-user { flex-direction: row-reverse; }
.assistant-msg.from-user .bubble { background: var(--brand-500); color: #fff; border-bottom-right-radius: var(--r-xs); }
.assistant-msg.from-bot .bubble { background: var(--surface-3); border-bottom-left-radius: var(--r-xs); }
.assistant-facts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }
.assistant-fact {
  display: flex;
  flex-direction: column;
  padding: 0.4rem 0.6rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.75rem;
}
.assistant-fact b { font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

.typing { display: inline-flex; gap: 0.2rem; padding: 0.5rem 0; }
.typing span {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.2s var(--ease-out) infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- 13  Data visualisation ---------------------------------------- */
/* Palette validated with the dataviz validator against both surfaces.
   Two categorical slots only (money in / money out); everything with more
   than two groups uses one hue plus axis labels so colour never carries
   identity alone. See docs/design-system.md. */

.viz { position: relative; width: 100%; }
.viz svg { width: 100%; height: auto; overflow: visible; }

.viz-grid line { stroke: var(--gridline); stroke-width: 1; shape-rendering: crispEdges; }
.viz-axis line, .viz-axis path { stroke: var(--border-strong); stroke-width: 1; }
.viz-label { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-label-strong { fill: var(--text-secondary); font-size: 11px; font-weight: 600; }
.viz-value { fill: var(--text-primary); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }

.viz-bar { transition: opacity var(--t-fast) linear; }
.viz-bar:hover { opacity: 0.82; }
.viz-in   { fill: var(--series-in); }
.viz-out  { fill: var(--series-out); }
.viz-seq  { fill: var(--series-seq); }
.viz-seq-soft { fill: var(--series-seq-soft); }

.viz-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viz-line-in  { stroke: var(--series-in); }
.viz-line-out { stroke: var(--series-out); }
.viz-area-in  { fill: color-mix(in srgb, var(--series-in) 16%, transparent); }
.viz-area-out { fill: color-mix(in srgb, var(--series-out) 14%, transparent); }
.viz-dot { r: 4; stroke: var(--surface-1); stroke-width: 2; }
.viz-crosshair { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }

.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.viz-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.viz-swatch { width: 0.65rem; height: 0.65rem; border-radius: 3px; flex: none; }
.viz-swatch-in  { background: var(--series-in); }
.viz-swatch-out { background: var(--series-out); }
.viz-swatch-seq { background: var(--series-seq); }

.viz-tip {
  position: absolute;
  z-index: 5;
  min-width: 140px;
  padding: 0.55rem 0.7rem;
  font-size: 0.75rem;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -108%);
  transition: opacity var(--t-fast) linear;
}
.viz-tip.show { opacity: 1; }
.viz-tip b { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.25rem; }
.viz-tip-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.viz-tip-row span { display: inline-flex; align-items: center; gap: 0.35rem; }
.viz-tip-row var { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Horizontal bar list — the default for many-category magnitude */
.bar-list { display: flex; flex-direction: column; gap: 0.85rem; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 0.75rem; }
.bar-row-head { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.bar-row-head .icon { width: 0.95rem; height: 0.95rem; color: var(--tint, var(--text-muted)); }
.bar-row-name { font-size: 0.8125rem; font-weight: 600; }
.bar-row-value { font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.bar-row-sub { grid-column: 1 / -1; font-size: 0.6875rem; color: var(--text-muted); display: flex; justify-content: space-between; gap: 0.5rem; }
.bar-track {
  grid-column: 1 / -1;
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-sunk);
  overflow: hidden;
}
.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 4px;
  background: var(--series-seq);
  width: 0;
  transition: width 900ms var(--ease-out);
}
.bar-fill-committed { background: repeating-linear-gradient(135deg, var(--series-seq-soft) 0 6px, transparent 6px 12px); }
.bar-fill-good     { background: var(--good); }
.bar-fill-warning  { background: var(--warning); }
.bar-fill-critical { background: var(--critical); }
.bar-marker { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-muted); border-radius: 2px; }

/* ---------- 14  Progress, rings, meters ----------------------------------- */

.progress { height: 8px; border-radius: 4px; background: var(--surface-sunk); overflow: hidden; }
.progress-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand-500), var(--saffron-500));
  width: 0;
  transition: width 1s var(--ease-out);
}
.progress-lg { height: 12px; border-radius: 6px; }
.progress-sm { height: 5px; }

.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: var(--surface-sunk); }
.ring-value {
  fill: none;
  stroke: url(#ringGradient);
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s var(--ease-out);
}
.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0.15rem;
}
.ring-center .ring-figure {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.ring-center .ring-label { font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-muted); }

.meter { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; }
.meter-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex: none; }
.meter-good     { background: var(--good); }
.meter-warning  { background: var(--warning); }
.meter-critical { background: var(--critical); }

.countdown { display: flex; gap: 0.5rem; }
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 4.25rem;
  padding: 0.7rem 0.5rem;
  border-radius: var(--r-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.countdown-num {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.countdown-label { font-size: 0.625rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }

/* ---------- 15  Timeline & steps ------------------------------------------ */

.timeline { display: flex; flex-direction: column; }
.timeline-item { position: relative; display: flex; gap: 0.9rem; padding-bottom: 1.25rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-rail { position: relative; flex: none; display: flex; justify-content: center; width: 1.75rem; }
.timeline-item:not(:last-child) .timeline-rail::after {
  content: "";
  position: absolute;
  top: 1.85rem;
  bottom: -1.25rem;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}
.timeline-node {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 2px solid var(--surface-1);
  box-shadow: 0 0 0 1px var(--border);
  z-index: 1;
}
.timeline-node .icon { width: 0.9rem; height: 0.9rem; }
.timeline-node.done { background: color-mix(in srgb, var(--good) 16%, var(--surface-1)); color: var(--good-ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--good) 35%, transparent); }
.timeline-node.current { background: color-mix(in srgb, var(--warning) 20%, var(--surface-1)); color: var(--warning-ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning) 40%, transparent); animation: pulse-ring 2.2s var(--ease-out) infinite; }
.timeline-node.rejected { background: color-mix(in srgb, var(--critical) 15%, var(--surface-1)); color: var(--critical-ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--critical) 35%, transparent); }
.timeline-content { min-width: 0; padding-top: 0.1rem; }
.timeline-title { font-size: 0.875rem; font-weight: 650; }
.timeline-meta { font-size: 0.75rem; color: var(--text-muted); }
.timeline-note { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.25rem; }

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning) 40%, transparent), 0 0 0 0 color-mix(in srgb, var(--warning) 40%, transparent); }
  70%  { box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning) 40%, transparent), 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning) 40%, transparent), 0 0 0 0 transparent; }
}

.steps { display: flex; align-items: center; gap: 0.5rem; }
.step { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); }
.step-num {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  font-size: 0.75rem;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.step.active { color: var(--text-primary); }
.step.active .step-num { background: var(--brand-500); color: #fff; border-color: transparent; }
.step.done .step-num { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.step-line { flex: 1; height: 1px; background: var(--border); min-width: 1rem; }

/* ---------- 16  States ---------------------------------------------------- */

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-3);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface-1) 70%, transparent), transparent);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-text { height: 0.75rem; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.35rem; width: 55%; margin-bottom: 0.75rem; }
.skeleton-block { height: 8rem; border-radius: var(--r-md); }
.skeleton-circle { border-radius: 50%; }

.empty {
  display: grid;
  place-items: center;
  gap: 0.65rem;
  padding: clamp(2rem, 5vw, 3.5rem) 1.5rem;
  text-align: center;
}
.empty-art {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: var(--r-xl);
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.empty-art .icon { width: 1.75rem; height: 1.75rem; }
.empty h4 { font-size: 1rem; }
.empty p { font-size: 0.875rem; color: var(--text-muted); max-width: 42ch; }

.callout {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--tint, var(--brand-500)) 8%, var(--surface-1));
  border: 1px solid color-mix(in srgb, var(--tint, var(--brand-500)) 22%, transparent);
  font-size: 0.875rem;
}
.callout .icon { color: var(--tint, var(--brand-500)); flex: none; margin-top: 0.1rem; }
.callout b { display: block; margin-bottom: 0.1rem; }
.callout p { color: var(--text-secondary); }
.callout-good     { --tint: var(--good); }
.callout-warning  { --tint: var(--warning); }
.callout-critical { --tint: var(--critical); }

/* ---------- 17  Marketing sections ---------------------------------------- */

/*
 * Rangoli-style dot field. Very low contrast — it should read as texture on
 * an ivory page, never as a pattern competing with the content.
 */
.section-festive {
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--saffron-500) 13%, transparent) 1.5px, transparent 1.6px)
    0 0 / 26px 26px,
    var(--surface-2);
}

/* Gold hairline along the top of a card, like the border of a festival card. */
.card-festive { border-top: 2px solid transparent; }
.card-festive::after {
  content: "";
  position: absolute;
  inset: -2px auto auto 0;
  width: 100%;
  height: 2px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, var(--brand-500), var(--gold-400) 50%, var(--saffron-400));
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(92vh, 860px);
  display: flex;
  align-items: center;
  padding-block: clamp(3.5rem, 10vh, 7rem);
}
.hero-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; background: var(--surface-inverse); }
.hero-bg video, .hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The pandal photo is bright and busy; hold it well back so the headline,
     countdown and figures over it stay legible. */
  opacity: 0.46;
  /* Keep the idols in frame as the hero crops on narrow screens. */
  object-position: center 42%;
  animation: hero-settle 1.2s var(--ease-out) both;
}

@keyframes hero-settle {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 0.46; transform: none; }
}
/*
 * Warm veil over the pandal photo: deep maroon at the top left, marigold at
 * the right, fading into the ivory page. Tinted rather than blackened, so the
 * hero reads as lamplight instead of a dimmed stock image.
 */
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 12% 8%, color-mix(in srgb, #5f1a08 82%, transparent), transparent 64%),
    radial-gradient(95% 85% at 92% 18%, color-mix(in srgb, var(--saffron-600) 55%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(52, 16, 4, 0.58) 0%, rgba(42, 12, 3, 0.74) 58%, var(--plane) 100%);
}
.hero-inner { position: relative; color: #fff; width: 100%; }

/*
 * Glass panels inside the hero sit over a bright photograph, so the default
 * light-tinted glass leaves white text almost unreadable. Over the hero they
 * are smoked instead — same material, dark side.
 */
.hero .glass,
.hero .countdown-unit {
  background: rgba(40, 12, 4, 0.55);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 44px -18px rgba(30, 8, 2, 0.6);
}
.hero .ring-track { stroke: rgba(255, 255, 255, 0.22); }
.hero .ring-label,
.hero .countdown-label { color: rgba(255, 255, 255, 0.72); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero .lead { color: rgba(255, 255, 255, 0.82); max-width: 54ch; }
.hero .eyebrow { color: var(--saffron-300); }

/* Animated aurora used where no video is available */
.aurora { position: absolute; inset: -30%; z-index: -1; filter: blur(80px); opacity: 0.55; }
.aurora span {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: drift 22s var(--ease-out) infinite alternate;
}
.aurora span:nth-child(1) { width: 46%; height: 46%; left: 4%;  top: 6%;  background: var(--brand-600); }
.aurora span:nth-child(2) { width: 40%; height: 40%; right: 6%; top: 12%; background: var(--saffron-500); animation-delay: -7s; }
.aurora span:nth-child(3) { width: 38%; height: 38%; left: 32%; bottom: 2%; background: var(--gold-400); animation-delay: -14s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6%, -8%, 0) scale(1.18); }
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  padding: 1rem 1.25rem;
  border-radius: var(--r-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.trust-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; font-weight: 600; }
.trust-item .icon { width: 1rem; height: 1rem; color: var(--good); }

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.35rem;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card h4 { font-size: 1rem; }
.feature-card p { font-size: 0.8125rem; color: var(--text-muted); }

.category-card { position: relative; overflow: hidden; }
.category-card .category-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding-top: 0.85rem;
  margin-top: 0.85rem;
  border-top: 1px dashed var(--border);
}
.category-figure { display: flex; flex-direction: column; gap: 0.1rem; }
.category-figure span { font-size: 0.625rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.category-figure b { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.footer {
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem;
}
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.6fr repeat(3, 1fr); }
.footer h5 { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.75rem; }
.footer a { display: block; font-size: 0.875rem; color: var(--text-secondary); padding: 0.22rem 0; transition: color var(--t-fast) linear; }
.footer a:hover { color: var(--brand-600); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Receipt / pass */
.receipt {
  max-width: 620px;
  margin-inline: auto;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.receipt-head {
  padding: 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800) 60%, var(--saffron-600));
}
.receipt-body { padding: 1.5rem; }
.receipt-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--border); font-size: 0.875rem; }
.receipt-row:last-child { border-bottom: 0; }
.receipt-row span { color: var(--text-muted); }
.receipt-row b { font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--r-md);
  background: var(--surface-3);
}
.receipt-total b { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.receipt-perf {
  height: 1.25rem;
  background:
    radial-gradient(circle at 10px -2px, transparent 10px, var(--surface-1) 11px) repeat-x;
  background-size: 22px 22px;
}

.pass {
  position: relative;
  overflow: hidden;
  max-width: 420px;
  border-radius: var(--r-xl);
  color: #fff;
  background: linear-gradient(150deg, var(--brand-700), var(--brand-900) 55%, #1a1330);
  box-shadow: var(--shadow-xl);
}
.pass::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--saffron-500) 55%, transparent), transparent 70%);
}
.pass-body { position: relative; padding: 1.5rem; }
.pass-qr {
  display: grid;
  place-items: center;
  width: 8.5rem;
  height: 8.5rem;
  padding: 0.6rem;
  border-radius: var(--r-md);
  background: #fff;
}

/* ---------- 18  Animation -------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].revealed { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: 80ms; }
[data-reveal-delay="2"] { transition-delay: 160ms; }
[data-reveal-delay="3"] { transition-delay: 240ms; }
[data-reveal-delay="4"] { transition-delay: 320ms; }
[data-reveal-delay="5"] { transition-delay: 400ms; }
[data-reveal-delay="6"] { transition-delay: 480ms; }

.live-dot {
  position: relative;
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--good);
  flex: none;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--good);
  animation: live-pulse 2s var(--ease-out) infinite;
}
@keyframes live-pulse {
  0%   { transform: scale(1); opacity: 0.6; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

.marquee { display: flex; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 1rem; animation: marquee 42s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- 19  Utilities -------------------------------------------------- */

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 999;
  padding: 0.6rem 1rem;
  background: var(--brand-600);
  color: #fff;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}
.skip-link:focus { top: 0; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.mx-auto { margin-inline: auto; }
.mt-auto { margin-top: auto; }
.w-full { width: 100%; }
.flex-1 { flex: 1 1 auto; min-width: 0; }
.relative { position: relative; }
.no-wrap { white-space: nowrap; }
.gap-0 { gap: 0; }
.pad { padding: clamp(1rem, 1.6vw, 1.5rem); }
.pad-sm { padding: 0.85rem; }
.pad-0 { padding: 0; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 0.75rem; }
.mb-md { margin-bottom: 1.25rem; }
.mb-lg { margin-bottom: 2rem; }
.mt-sm { margin-top: 0.75rem; }
.mt-md { margin-top: 1.25rem; }
.mt-lg { margin-top: 2rem; }
.col-span-2 { grid-column: span 2; }
.col-span-full { grid-column: 1 / -1; }
.order-first { order: -1; }
.scroll-x { overflow-x: auto; }
.max-w-prose { max-width: 68ch; }

/* ---------- 20  Responsive & print ---------------------------------------- */

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 120;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--t-base) var(--ease-out);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: none; }
  .mobile-bar { display: flex; }
  .split, .split-reverse { grid-template-columns: minmax(0, 1fr); }
  .nav-links { display: none; }
  .assistant-fab { bottom: 4.75rem; }
  .toast-stack { bottom: 4.75rem; left: 1rem; right: 1rem; }
  .toast { max-width: none; }
}

@media (max-width: 720px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-even { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .countdown-unit { min-width: 3.6rem; padding: 0.55rem 0.4rem; }
  .countdown-num { font-size: 1.35rem; }
  .page-head { margin-bottom: 1.1rem; }
  .modal { width: calc(100vw - 1.5rem); border-radius: var(--r-lg); }
  .drawer { width: 100vw; }
}

@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .stat-value { font-size: 1.6rem; }
  .amount-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  .topbar, .sidebar, .mobile-bar, .assistant-fab, .toast-stack, .no-print, .footer { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .receipt { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .shell { grid-template-columns: 1fr; }
  .shell-content { padding: 0; }
  a[href]::after { content: ""; }
}

@media (forced-colors: active) {
  .card, .stat, .btn { border: 1px solid CanvasText; }
  .bar-fill, .progress-bar { forced-color-adjust: none; }
}
