/* ============================================================================
   PureRelay · Looseleaf Hand-Drawn Paper Design System (Production v2.0)
   Inspired by Looseleaf (shadcn/ui, drawn by hand)
   Strict CSP Compliant: style-src 'self', zero inline styles, zero innerHTML.
   Supports Light (Daylight Paper on Sage Desk) & Dark (Carbon Paper) modes.
   ============================================================================ */

:root {
  color-scheme: light dark;
  --in-oklab: ;

  /* 1. Surfaces & Paper Stocks */
  --ll-desk: light-dark(#a8c8bb, #181d1b);
  --ll-desk-deep: light-dark(#93b4a7, #111513);
  --surface: light-dark(#f8f5ee, #23201c);
  --surface-subtle: light-dark(#fbf8f1, #2b2722);
  --surface-hover: light-dark(#f2ece0, #342f29);
  --ll-pad: light-dark(#f8f2de, #211e1a);
  --ll-pad-rule: light-dark(rgba(44, 79, 158, 0.13), rgba(122, 162, 247, 0.1));
  --ll-graph: light-dark(#f4f7ef, #1e221e);
  --ll-paper-shade: light-dark(#ece6da, #2f2a24);
  --ll-kraft: light-dark(#e3d1b0, #3a3126);
  --ll-sticky-yellow: light-dark(#f7e38a, #4a3f1a);
  --ll-tape: light-dark(rgba(246, 244, 236, 0.72), rgba(210, 200, 180, 0.18));
  --ll-tape-edge: light-dark(rgba(140, 135, 120, 0.36), rgba(210, 200, 180, 0.25));

  /* 2. Inks & Pencil Semantics ("Color means who wrote it") */
  --text: light-dark(#2a2420, #f0ebe1);
  --text-secondary: light-dark(#4a433c, #c5bdb0);
  --text-muted: light-dark(#5a554e, #9b9286);
  --ll-ink: light-dark(#2a2420, #f0ebe1);
  --ll-ink-you: light-dark(#2c4f9e, #7aa2f7);
  --ll-ink-you-hover: light-dark(#1f3b7a, #9bb8ff);
  --ll-pencil: light-dark(#6b6660, #7c746a);
  --ll-pencil-mark: light-dark(#8e887f, #5e574f);
  --border: light-dark(rgba(42, 36, 32, 0.22), rgba(240, 235, 225, 0.2));
  --border-strong: light-dark(#2a2420, #c8bfb2);

  /* 3. Functional Markers & Highlighters */
  --brand: light-dark(#df6b3c, #e07a52);
  --brand-hover: light-dark(#cf5c2e, #ea8a64);
  --brand-ink: light-dark(#2a2420, #1b1714);
  --brand-soft: light-dark(#fbf0b2, #4d4117);
  --brand-text: light-dark(#7c3a14, #f7d87c);
  --ll-hi: light-dark(#f8dc4c, #8a7319);
  --ll-hi-select: light-dark(color-mix(in oklab, #f8dc4c 62%, transparent), color-mix(in oklab, #8a7319 52%, transparent));
  --ll-focus: light-dark(#2c4f9e, #7aa2f7);

  --ok-bg: light-dark(#dff0d8, #1c3525);
  --ok-fg: light-dark(#2d663b, #6ee794);
  --warn-bg: light-dark(#faecc0, #3e3113);
  --warn-fg: light-dark(#8c5310, #fbbf24);
  --crit-bg: light-dark(#fae0dc, #421d1a);
  --crit-fg: light-dark(#b33422, #f88379);
  --blue-bg: light-dark(#dce8fb, #1b2b47);
  --blue-fg: light-dark(#25478f, #8eb4ff);
  --violet-bg: light-dark(#ebe3fb, #2e2245);
  --violet-fg: light-dark(#5f3fb3, #bfa3ff);

  /* 4. Warm Umber Paper Shadows (RGB 58 44 30 — never cold grey) */
  --ll-shade: 58 44 30;
  --shadow-slip: light-dark(
    0 1px 1px rgb(58 44 30 / 0.18), 0 4px 8px -3px rgb(58 44 30 / 0.18),
    0 1px 2px rgb(0 0 0 / 0.45), 0 4px 10px -2px rgb(0 0 0 / 0.4)
  );
  --shadow-card: light-dark(
    0 1px 1.5px rgb(58 44 30 / 0.2), 0 6px 12px -5px rgb(58 44 30 / 0.24),
    0 2px 6px rgb(0 0 0 / 0.45), 0 8px 18px -6px rgb(0 0 0 / 0.45)
  );
  --shadow-paper: light-dark(
    0 1px 1.5px rgb(58 44 30 / 0.2), 0 2px 5px -1px rgb(58 44 30 / 0.12), 0 12px 24px -8px rgb(58 44 30 / 0.24),
    0 4px 14px rgb(0 0 0 / 0.55), 0 16px 32px -8px rgb(0 0 0 / 0.6)
  );
  --shadow-ink-hard: light-dark(2px 2px 0 0 #2a2420, 2px 2px 0 0 #0f0d0b);
  --shadow-ink-press: light-dark(1px 1px 0 0 #2a2420, 1px 1px 0 0 #0f0d0b);

  /* 5. Hand-Drawn Irregular Radii */
  --radius-paper: 255px 14px 225px 14px / 14px 225px 14px 255px;
  --radius-lg: 18px 8px 16px 10px / 10px 16px 8px 18px;
  --radius-btn: 14px 5px 12px 6px / 6px 12px 5px 14px;
  --radius-swipe: 3px 9px 4px 10px / 9px 3px 10px 4px;

  /* 6. Layout & Motion */
  --sidebar-w: 232px;
  --dur-press: 90ms;
  --dur-hover: 120ms;
  --dur-sheet: 280ms;
  --ease-settle: cubic-bezier(0.2, 0.9, 0.25, 1.12);

  /* 7. Typography: Readable CJK + Crisp Monospace + Subtle Sketch Accent */
  --font-ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Segoe Print", "Bradley Hand", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  accent-color: var(--brand);
}

@supports (background: linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) { color-scheme: dark; }
:root:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--ll-desk);
  background-image:
    radial-gradient(ellipse 120% 100% at 50% 35%, transparent 56%, rgb(58 44 30 / 0.08)),
    radial-gradient(circle at center, color-mix(in oklab, var(--ll-pencil) 20%, transparent) 0 0.8px, transparent 1.2px);
  background-size: 100% 100%, 24px 24px;
  -webkit-font-smoothing: antialiased;
}

.tabular { font-variant-numeric: tabular-nums lining-nums; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.subtext { color: var(--text-secondary); font-size: 12.5px; }
.hidden { display: none !important; }

/* Global Keyboard Focus Ring (Blue Ink — User Interaction Voice) */
:focus-visible {
  outline: 2px solid var(--ll-focus);
  outline-offset: 2px;
}

/* ==================== AUTH GATE SCREEN (Paper Card with Washi Tape) ==================== */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
}
.auth-card {
  position: relative;
  width: min(432px, 100%);
  background: var(--surface);
  background-image: linear-gradient(135deg var(--in-oklab), rgba(255, 255, 255, 0.35), transparent 44%, rgb(58 44 30 / 0.035));
  border: 1.8px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px 28px 28px;
  box-shadow: var(--shadow-paper);
  animation: ll-sheet-drop var(--dur-sheet) var(--ease-settle) both;
}
.auth-card::before {
  /* Washi masking tape holding the auth card onto the desk */
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 96px;
  height: 22px;
  transform: translateX(-50%) rotate(-1.6deg);
  background: var(--ll-tape);
  border: 1px solid var(--ll-tape-edge);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgb(58 44 30 / 0.14);
  pointer-events: none;
}
.auth-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }

/* ==================== SHELL LAYOUT ==================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.2s ease;
}
.app-shell.sidebar-collapsed { --sidebar-w: 74px; }

/* Notepad-Ruled Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background-color: var(--ll-pad);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 27px,
    var(--ll-pad-rule) 27px 28px
  );
  border-right: 1.8px solid var(--border-strong);
  box-shadow: 3px 0 14px -6px rgb(58 44 30 / 0.18);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  z-index: 20;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
  margin-bottom: 4px;
  border-bottom: 1.5px dashed var(--ll-pencil-mark);
  text-decoration: none;
  color: var(--text);
}
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-btn);
  background: var(--brand);
  color: var(--brand-ink);
  border: 1.8px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: var(--shadow-ink-hard);
  transform: rotate(-2.5deg);
}
.brand-name {
  font-weight: 850;
  font-size: 16.5px;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.brand-tag {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text);
  background: var(--ll-hi-select);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: var(--radius-swipe);
  font-weight: 700;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 12px 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; flex: 1; overflow-y: auto; }
.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: transform var(--dur-hover) ease-out, background-color var(--dur-hover) ease-out, border-color var(--dur-hover) ease-out;
}
.nav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border);
  color: var(--text);
  transform: translateX(2px);
}
.nav-btn.active {
  background: var(--ll-hi-select);
  border-color: var(--border-strong);
  color: var(--text);
  font-weight: 750;
  box-shadow: var(--shadow-ink-hard);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; text-align: center; }
.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 750;
  padding: 1px 7px;
  border-radius: var(--radius-swipe);
  background: var(--crit-bg);
  color: var(--crit-fg);
  border: 1px solid var(--crit-fg);
}

.sidebar-footer {
  border-top: 1.5px dashed var(--ll-pencil-mark);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.app-shell.sidebar-collapsed .brand-text-wrap,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-section-label,
.app-shell.sidebar-collapsed .nav-badge { display: none; }
.app-shell.sidebar-collapsed .nav-btn { justify-content: center; padding: 10px; }

.theme-icon-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-icon-light { display: none; }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-icon-dark { display: inline; }
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-light { display: none; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-dark { display: inline; }

/* ==================== TOPBAR ==================== */
.main-col { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1.6px solid var(--border-strong);
  box-shadow: 0 3px 10px -6px rgb(58 44 30 / 0.22);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar-title-wrap h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.015em;
  display: inline-block;
  background: linear-gradient(to top, var(--ll-hi-select) 32%, transparent 32%);
  padding: 0 3px;
}
.topbar-title-wrap p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.pill-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: var(--radius-swipe);
  background: var(--ll-sticky-yellow);
  color: var(--text);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-ink-hard);
  font-weight: 800;
  font-size: 13px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: var(--shadow-ink-hard);
  transition: transform var(--dur-press) ease-out, box-shadow var(--dur-press) ease-out;
}
.icon-btn:hover { background: var(--surface-hover); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(1px); box-shadow: var(--shadow-ink-press); }
.dot-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--crit-fg);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  display: inline-grid;
  place-items: center;
}
.avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 5px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--border-strong);
  background: var(--surface-subtle);
  box-shadow: var(--shadow-slip);
}
.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 47% 53% 44% 56% / 55% 43% 57% 45%;
  background: var(--ll-ink-you);
  color: #fff;
  border: 1.5px solid var(--border-strong);
  font-weight: 800;
  font-size: 12px;
  display: grid;
  place-items: center;
}

/* ==================== CONTENT AREA & PAPER CARDS ==================== */
.content-area {
  padding: 22px 24px 44px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  position: relative;
  isolation: isolate;
  background: var(--surface);
  background-image: linear-gradient(135deg var(--in-oklab), rgba(255, 255, 255, 0.28), transparent 42%, rgb(58 44 30 / 0.03));
  border: 1.6px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px dashed var(--border);
  flex-wrap: wrap;
}
.card-title { margin: 0; font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; }

.kpi-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2-wide { display: grid; grid-template-columns: 1.05fr 1.35fr; gap: 16px; }
@media (max-width: 1120px) { .kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2, .grid-2-wide { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .app-shell { grid-template-columns: 1fr; } .sidebar { display: none; } .kpi-grid-4, .kpi-grid-3 { grid-template-columns: 1fr; } }

/* KPI Index Cards: only pseudo paper background tilts on hover, text stays razor-sharp */
.kpi-card {
  position: relative;
  isolation: isolate;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--surface);
  background-image: linear-gradient(135deg var(--in-oklab), rgba(255, 255, 255, 0.32), transparent 45%, rgb(58 44 30 / 0.03));
  border: 1.6px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-hover) ease-out, box-shadow var(--dur-hover) ease-out;
}
.kpi-card:hover::before {
  transform: rotate(-0.55deg) translateY(-2px);
  box-shadow: var(--shadow-paper);
}
.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-ink-press);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.ic-green { background: var(--ok-bg); color: var(--ok-fg); }
.ic-blue { background: var(--blue-bg); color: var(--blue-fg); }
.ic-amber { background: var(--warn-bg); color: var(--warn-fg); }
.ic-violet { background: var(--violet-bg); color: var(--violet-fg); }
.ic-rose { background: var(--crit-bg); color: var(--crit-fg); }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 650; }
.kpi-value { font-size: 23px; font-weight: 850; letter-spacing: -0.02em; margin: 2px 0; line-height: 1.25; }
.kpi-sub { font-size: 11.5px; color: var(--text-muted); }

/* ==================== BUTTONS (Marker Fill + Hard Ink Shadow + Tilt-on-Hover) ==================== */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1.6px solid var(--border-strong);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-ink-hard);
  transition: transform var(--dur-press) ease-out, box-shadow var(--dur-press) ease-out, background-color var(--dur-hover) ease-out;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px) rotate(-0.6deg); }
.btn:active { transform: translateY(1px) rotate(0deg); box-shadow: var(--shadow-ink-press); }

.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-outline { background: var(--surface-subtle); color: var(--text); }
.btn-outline:hover { background: var(--surface-hover); }
.btn-soft { background: var(--ll-hi-select); color: var(--text); }
.btn-soft:hover { background: color-mix(in oklab, var(--ll-hi) 78%, transparent); }
.btn-danger-outline {
  background: var(--crit-bg);
  color: var(--crit-fg);
  border-color: var(--crit-fg);
}
.btn-danger-outline:hover {
  background: color-mix(in oklab, var(--crit-fg) 18%, var(--surface));
}
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; }

/* ==================== FILTER BAR & NOTEBOOK INDEX TABS ==================== */
.filter-bar {
  background: var(--surface);
  border: 1.6px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-slip);
}
.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill-tabs {
  display: inline-flex;
  background: var(--ll-paper-shade);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-btn);
  padding: 3px;
  gap: 3px;
  flex-wrap: wrap;
}
.pill-tab {
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-swipe);
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background-color var(--dur-hover) ease-out, transform var(--dur-press) ease-out;
}
.pill-tab:hover { color: var(--text); background: color-mix(in oklab, var(--surface) 60%, transparent); }
.pill-tab.active {
  background: var(--ll-hi-select);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-ink-press);
}

/* ==================== FORM INPUTS (Blue Ink = User Voice) ==================== */
input[type="text"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  background: var(--surface-subtle);
  color: var(--ll-ink-you);
  caret-color: var(--ll-ink-you);
  border: 1.6px solid var(--ll-pencil);
  border-radius: var(--radius-btn);
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 550;
  outline: none;
  transition: border-color var(--dur-hover) ease-out, box-shadow var(--dur-hover) ease-out;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); font-weight: 400; }
input:focus, select:focus, textarea:focus {
  border-color: var(--ll-focus);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ll-focus) 20%, transparent);
}
input[aria-invalid="true"], select[aria-invalid="true"] {
  border-color: var(--crit-fg);
  color: var(--crit-fg);
}

/* ==================== BADGES (Hand-Circled Stamps) ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-swipe);
  border: 1.2px solid currentColor;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.b-ok { background: var(--ok-bg); color: var(--ok-fg); }
.b-warn { background: var(--warn-bg); color: var(--warn-fg); }
.b-crit {
  background-color: var(--crit-bg);
  background-image: repeating-linear-gradient(-45deg, transparent 0 4px, color-mix(in oklab, var(--crit-fg) 10%, transparent) 4px 6px);
  color: var(--crit-fg);
}
.b-blue { background: var(--blue-bg); color: var(--blue-fg); }
.b-violet { background: var(--violet-bg); color: var(--violet-fg); }
.b-brand { background: var(--brand-soft); color: var(--brand-text); }
.b-muted { background: var(--ll-paper-shade); color: var(--text-secondary); border-color: var(--border); }

/* ==================== DATA TABLES (Blue-Ink Headers + Pencil Rules) ==================== */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(560px, 72vh);
  container-type: inline-size;
  border-radius: var(--radius-lg);
  border: 1.6px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-slip);
}
table.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
table.data-table thead { position: sticky; inset-block-start: 0; z-index: 2; }
table.data-table th {
  text-align: left;
  font-weight: 750;
  font-size: 12px;
  color: var(--ll-ink-you);
  background: var(--ll-pad);
  padding: 10px 12px;
  border-bottom: 1.6px solid var(--border-strong);
  white-space: nowrap;
}
table.data-table td, table.data-table tbody th {
  padding: 10px 12px;
  border-bottom: 1px dashed var(--border);
  vertical-align: middle;
  background: var(--surface);
  white-space: nowrap;
}
table.data-table tbody th { position: sticky; inset-inline-start: 0; z-index: 1; font-weight: 700; color: var(--text); }
table.data-table tbody tr:last-child td, table.data-table tbody tr:last-child th { border-bottom: 0; }
table.data-table tbody tr:hover td, table.data-table tbody tr:hover th {
  background: color-mix(in oklab, var(--ll-hi) 16%, var(--surface));
}
.email-cell { max-width: 195px; overflow: hidden; text-overflow: ellipsis; }

@container (width < 600px) {
  table.data-table, table.data-table thead, table.data-table tbody, table.data-table tr, table.data-table th, table.data-table td { display: block; }
  table.data-table thead { display: none; }
  table.data-table tr { margin: 10px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-btn); overflow: hidden; box-shadow: var(--shadow-slip); }
  table.data-table tbody th { position: sticky; inset-block-start: 0; background: var(--ll-pad); border-bottom: 1.5px solid var(--border-strong); }
  table.data-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; }
  table.data-table td::before { content: attr(data-label); font-size: 12px; color: var(--ll-ink-you); font-weight: 700; flex-shrink: 0; white-space: nowrap; }
}

/* ==================== PROGRESS, ENDPOINTS & STATUS MATRIX ==================== */
.prog-track {
  width: 60px;
  height: 9px;
  background: var(--ll-paper-shade);
  border: 1.4px solid var(--border-strong);
  border-radius: var(--radius-swipe);
  overflow: hidden;
  display: inline-flex;
  vertical-align: middle;
}
.prog-fill { display: block; height: 100%; }
.pf-ok { background: var(--ok-fg); }
.pf-warn { background: var(--brand); }
.pf-crit {
  background-color: var(--crit-fg);
  background-image: repeating-linear-gradient(-45deg, transparent 0 4px, rgba(255, 255, 255, 0.25) 4px 6px);
}

.endpoint-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.endpoint-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  background: var(--surface-subtle);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-slip);
  font-size: 12.5px;
}

.matrix-row { display: grid; grid-template-columns: 205px 72px 72px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.matrix-row:last-child { border-bottom: 0; }
.matrix-blocks { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 4px; }
.m-block { height: 22px; border-radius: 4px; border: 1px solid rgb(58 44 30 / 0.22); }
.mb-ok { background: #3b7a4b; }
.mb-warn { background: #df8c2c; }
.mb-crit { background: #c2412d; }
.mb-idle { background: var(--ll-paper-shade); }

/* ==================== BALANCE HERO (Kraft Voucher Slip) ==================== */
.balance-hero {
  position: relative;
  background-color: var(--ll-kraft);
  background-image:
    linear-gradient(135deg var(--in-oklab), rgba(255, 255, 255, 0.25), transparent 55%, rgb(58 44 30 / 0.08)),
    radial-gradient(circle at center, rgb(58 44 30 / 0.14) 0 0.8px, transparent 1.2px);
  background-size: 100% 100%, 18px 18px;
  color: var(--text);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  text-align: center;
  box-shadow: var(--shadow-paper);
}
.balance-hero::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1.5px dashed var(--ll-pencil);
  border-radius: 12px;
  pointer-events: none;
}
.balance-hero .hero-amt {
  font-size: 38px;
  font-weight: 900;
  margin: 6px 0;
  letter-spacing: -0.02em;
  display: inline-block;
  padding: 0 12px;
  background: var(--ll-hi-select);
  border-radius: var(--radius-swipe);
}

/* ==================== DROPZONE (Graph Paper) & PIPELINE ==================== */
.dropzone {
  border: 2px dashed var(--ll-pencil);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  text-align: center;
  background-color: var(--ll-graph);
  background-image:
    radial-gradient(circle at center, color-mix(in oklab, var(--ll-pencil) 55%, transparent) 0 1px, transparent 1.4px);
  background-size: 20px 20px;
  cursor: pointer;
  transition: border-color var(--dur-hover) ease-out, background-color var(--dur-hover) ease-out;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--ll-ink-you);
  background-color: color-mix(in oklab, var(--ll-hi) 24%, var(--ll-graph));
}

.pipe-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pipe-step { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-swipe); background: var(--ll-paper-shade); color: var(--text-muted); border: 1px solid var(--border); }
.pipe-step.done { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-fg); font-weight: 700; }
.pipe-step.running { background: var(--blue-bg); color: var(--blue-fg); border-color: var(--blue-fg); font-weight: 700; }
.pipe-step.fail { background: var(--crit-bg); color: var(--crit-fg); border-color: var(--crit-fg); font-weight: 700; }

/* ==================== TYPEWRITER CODE BLOCK ==================== */
pre.code-block {
  position: relative;
  background: var(--surface-subtle);
  color: var(--text);
  border: 1.6px solid var(--border-strong);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius-btn);
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  margin: 8px 0 0;
  box-shadow: var(--shadow-slip);
}

.donut-layout { display: grid; grid-template-columns: 142px minmax(0, 1fr); gap: 14px; align-items: center; }
@media (max-width: 640px) { .donut-layout { grid-template-columns: 1fr; } }

/* ==================== DIALOGS & DRAWER (Warm Desk-Lamp Backdrop + Paper Drop) ==================== */
@keyframes ll-sheet-drop {
  0% { opacity: 0; transform: translateY(-12px) rotate(-0.9deg) scale(1.015); }
  75% { opacity: 1; transform: translateY(1px) rotate(0.15deg) scale(0.998); }
  100% { opacity: 1; transform: none; }
}

dialog.modal-box {
  padding: 0;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  width: min(650px, calc(100vw - 32px));
  max-height: 88vh;
  overflow: auto;
  box-shadow: var(--shadow-paper);
}
dialog.modal-box[open] {
  animation: ll-sheet-drop var(--dur-sheet) var(--ease-settle) both;
}
dialog.modal-box::backdrop {
  background: radial-gradient(ellipse 90% 80% at 50% 38%, rgb(58 44 30 / 0.22), rgb(58 44 30 / 0.34) 58%, rgb(58 44 30 / 0.48));
  backdrop-filter: blur(2px);
}
.modal-inner { padding: 22px 24px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1.5px dashed var(--border);
}
.modal-head h2 { margin: 0; font-size: 16.5px; font-weight: 850; }

.Drawer { --drawer-width: min(470px, 90dvw, 100dvw - 24px); --drawer-backdrop: 0; inset: 0; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; background: transparent; border: 0; overflow: visible; }
.Drawer::backdrop { background: rgb(58 44 30 / 0.42); opacity: calc(var(--drawer-backdrop) / 1.5); }
.Drawer-scroller { position: relative; display: grid; grid-template-columns: 100% var(--drawer-width); overflow-x: scroll; overscroll-behavior: none; scrollbar-width: none; scroll-snap-type: x mandatory; }
@media (prefers-reduced-motion: no-preference) { .Drawer-scroller { scroll-behavior: smooth; } }
.Drawer-scroller::before { content: ''; scroll-snap-align: start; scroll-initial-target: nearest; }
.Drawer-sheet {
  display: flex;
  flex-direction: column;
  height: 100svh;
  background: var(--ll-pad);
  color: var(--text);
  border-left: 2px solid var(--border-strong);
  overflow-y: auto;
  scroll-snap-align: end;
  padding: 18px 20px;
  gap: 16px;
  box-shadow: -12px 0 36px rgb(58 44 30 / 0.24);
}
@supports (animation-timeline: scroll()) {
  .Drawer { timeline-scope: --drawer-fade; animation: fade-drawer-backdrop linear both; animation-timeline: --drawer-fade; }
  .Drawer-scroller { scroll-timeline: --drawer-fade x; }
  @property --drawer-backdrop { syntax: '<number>'; inherits: true; initial-value: 0; }
  @keyframes fade-drawer-backdrop { 0% { --drawer-backdrop: 0; } 100% { --drawer-backdrop: 1; } }
}

.drawer-card {
  border: 1.6px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-slip);
}
.waf-item {
  background: var(--surface-subtle);
  border: 1.4px solid var(--border-strong);
  border-left: 4px solid var(--crit-fg);
  border-radius: var(--radius-btn);
  padding: 10px;
}
.waf-pattern { unicode-bidi: isolate; word-break: break-all; margin: 4px 0; }
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.stack-gap { display: flex; flex-direction: column; gap: 16px; }
.status-msg { font-size: 12.5px; color: var(--crit-fg); font-weight: 650; margin: 4px 0 0; min-height: 18px; }
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99;
  background: var(--ll-ink);
  color: var(--surface);
  border: 1.8px solid var(--border-strong);
  padding: 10px 16px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-paper);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all 0.2s var(--ease-settle);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ==================== CSP-SAFE UTILITIES & DUAL-CHANNEL ALERTS ==================== */
.trend-svg { width: 100%; height: auto; display: block; }
.u-mb-6 { margin-bottom: 6px; }
.u-mb-8 { margin-bottom: 8px; }
.u-mb-10 { margin-bottom: 10px; }
.u-mb-14 { margin-bottom: 14px; }
.u-mt-2 { margin-top: 2px; }
.u-mt-3 { margin-top: 3px; }
.u-mt-8 { margin-top: 8px; }
.u-mt-10 { margin-top: 10px; }
.u-mt-14 { margin-top: 14px; }
.u-ml-5 { margin-left: 5px; }
.u-ml-6 { margin-left: 6px; }
.u-mr-6 { margin-right: 6px; }
.u-my-drop { margin: 6px 0 12px; }
.u-m0 { margin: 0; }
.u-m0-mb8 { margin: 0 0 8px; }
.u-w-90 { width: 90px; }
.u-gap-6 { gap: 6px; }
.u-block { display: block; }
.u-flex-1 { flex: 1; }
.u-fw-600 { font-weight: 600; }
.u-fw-700 { font-weight: 700; }
.u-fw-750 { font-weight: 750; }
.u-fs-11 { font-size: 11px; }
.u-fs-12 { font-size: 12px; }
.u-fs-125 { font-size: 12.5px; }
.u-fs-13 { font-size: 13px; }
.u-fs-16 { font-size: 16px; }
.u-fs-32 { font-size: 32px; }
.u-lh-18 { line-height: 1.8; }
.u-op-90 { opacity: 0.9; }
.u-txt-muted { color: var(--text-muted); }
.u-txt-ok { color: var(--ok-fg); }
.u-txt-violet { color: var(--violet-fg); }
.u-txt-brand { color: var(--brand-text); }
.u-txt-crit { color: var(--crit-fg); }
.u-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.u-flex-between-sm { display: flex; justify-content: space-between; gap: 6px; }
.u-flex-row-gap8 { display: flex; gap: 8px; }
.u-flex-end-gap8 { display: flex; justify-content: flex-end; gap: 8px; }
.u-flex-col-gap6 { display: flex; flex-direction: column; gap: 6px; }
.u-flex-col-gap8 { display: flex; flex-direction: column; gap: 8px; }
.u-drawer-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1.5px dashed var(--ll-pencil-mark); padding-bottom: 12px; }

.legend-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.legend-left { display: flex; align-items: center; gap: 7px; min-width: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--border-strong); flex-shrink: 0; }
.legend-label { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-val { white-space: nowrap; flex-shrink: 0; }

.profile-card { border: 1.5px solid var(--border-strong); border-radius: var(--radius-btn); padding: 10px 12px; background: var(--surface-subtle); box-shadow: var(--shadow-slip); }
.profile-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }

/* Dual-Channel Alert Callout (Diagonal Hatch Left Stripe + Border) */
.agent-fallback-box {
  position: relative;
  border: 1.6px solid var(--warn-fg);
  border-left: 7px solid var(--warn-fg);
  background-color: var(--warn-bg);
  background-image: repeating-linear-gradient(-45deg, transparent 0 8px, color-mix(in oklab, var(--warn-fg) 6%, transparent) 8px 10px);
  color: var(--text);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  box-shadow: var(--shadow-slip);
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-swipe);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-subtle);
  border: 1.4px solid var(--border-strong);
  color: var(--text-secondary);
}
.load-more-wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1.5px dashed var(--border); }

/* ==================== USER ONBOARDING STICKY CARD & REDEMPTION MANAGER ==================== */
.onboard-card {
  position: relative;
  background-color: color-mix(in oklab, var(--ll-sticky-yellow) 36%, var(--surface));
  border: 1.8px solid var(--border-strong);
}
.onboard-card::after {
  content: "";
  position: absolute;
  top: -9px;
  right: 28px;
  width: 72px;
  height: 18px;
  transform: rotate(2.2deg);
  background: var(--ll-tape);
  border: 1px solid var(--ll-tape-edge);
  pointer-events: none;
}
.onboard-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
@media (max-width: 820px) { .onboard-steps { grid-template-columns: 1fr; } }
.onboard-step {
  padding: 13px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-slip);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.onboard-step.step-done {
  border-color: var(--ok-fg);
  border-left: 5px solid var(--ok-fg);
  background: var(--ok-bg);
}
.onboard-step-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 800; font-size: 13px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.amt-chip {
  padding: 4px 10px;
  border-radius: var(--radius-swipe);
  border: 1.4px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 700;
  box-shadow: var(--shadow-ink-press);
  transition: transform var(--dur-press) ease-out, background-color var(--dur-hover) ease-out;
}
.amt-chip:hover { background: var(--ll-hi-select); transform: translateY(-1px); }
.code-result-box {
  padding: 12px;
  border-radius: var(--radius-btn);
  border: 1.8px dashed var(--brand);
  background: color-mix(in oklab, var(--ll-hi) 24%, var(--surface));
  margin-top: 8px;
  font-size: 12px;
  word-break: break-all;
}
.redemption-item {
  padding: 9px 11px;
  border-radius: var(--radius-btn);
  border: 1.4px solid var(--border-strong);
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

/* ==================== CPA-GRADE ADMIN POOL TELEMETRY CARDS (Looseleaf Paper Edition) ==================== */
.u-fs-15 { font-size: 15px; }
.u-pad-12 { padding: 12px 16px; }
.u-flex-between-wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.cache-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cache-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-swipe);
  border: 1.4px solid var(--border-strong);
  background: var(--surface-subtle);
  box-shadow: var(--shadow-ink-press);
  font-size: 12px;
  font-weight: 650;
}

.pool-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  gap: 16px;
}
@media (max-width: 560px) { .pool-cards-grid { grid-template-columns: 1fr; } }

.acct-card {
  position: relative;
  border: 1.6px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  background-image: linear-gradient(135deg var(--in-oklab), rgba(255, 255, 255, 0.3), transparent 44%, rgb(58 44 30 / 0.03));
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-hover) ease-out, box-shadow var(--dur-hover) ease-out;
}
.acct-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-paper);
}
.acct-card.acct-disabled {
  opacity: 0.72;
  background-color: var(--ll-paper-shade);
  border-style: dashed;
}
.acct-card.acct-alert {
  border-color: var(--warn-fg);
  border-left: 5px solid var(--warn-fg);
}
.acct-card.acct-error {
  border-color: var(--crit-fg);
  border-left: 5px solid var(--crit-fg);
}

.acct-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.acct-email { font-weight: 800; font-size: 13.5px; word-break: break-all; line-height: 1.35; color: var(--text); }
.acct-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

.quota-block { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .quota-block { grid-template-columns: 1fr; } }
.quota-win {
  padding: 9px 11px;
  border-radius: var(--radius-btn);
  background: var(--surface-subtle);
  border: 1.4px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quota-win-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 700; }
.quota-bar-bg {
  width: 100%;
  height: 9px;
  border-radius: var(--radius-swipe);
  border: 1.2px solid var(--border-strong);
  background: var(--ll-paper-shade);
  overflow: hidden;
}
.quota-bar-fill { height: 100%; transition: width 0.25s ease; }
.quota-win-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.acct-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  font-size: 12px;
  padding: 9px 11px;
  border-radius: var(--radius-btn);
  background: var(--ll-graph);
  border: 1px dashed var(--border);
}
.acct-meta-kv { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.acct-meta-k { color: var(--text-muted); font-size: 11.5px; }
.acct-meta-v { font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums lining-nums; }

.acct-spark-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acct-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
  flex: 1;
  padding-bottom: 2px;
  border-bottom: 1px dashed var(--ll-pencil-mark);
}
.spark-bar {
  flex: 1;
  min-width: 4px;
  border-radius: 2px 2px 0 0;
  background: color-mix(in oklab, var(--text) 14%, transparent);
}
.spark-bar.sp-ok { background: var(--ok-fg); }
.spark-bar.sp-warn { background: var(--brand); }
.spark-bar.sp-fail { background: var(--crit-fg); }

.acct-alert-bar {
  padding: 7px 10px;
  border-radius: var(--radius-btn);
  font-size: 11.5px;
  font-weight: 600;
  background-color: var(--warn-bg);
  background-image: repeating-linear-gradient(-45deg, transparent 0 7px, color-mix(in oklab, var(--warn-fg) 6%, transparent) 7px 9px);
  border: 1.4px solid var(--warn-fg);
  border-left: 5px solid var(--warn-fg);
}
.acct-alert-bar.is-err {
  background-color: var(--crit-bg);
  background-image: repeating-linear-gradient(-45deg, transparent 0 7px, color-mix(in oklab, var(--crit-fg) 7%, transparent) 7px 9px);
  border-color: var(--crit-fg);
}

.acct-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 9px;
  border-top: 1.5px dashed var(--border);
}
.model-tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.model-mini-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-swipe);
  background: var(--ll-pad);
  border: 1px solid var(--border);
  color: var(--text);
}

@media (max-width: 380px) {
  .auth-card { padding: 26px 18px 22px; }
  .btn-full { white-space: normal; text-align: center; }
}

/* ==================== ACCESSIBILITY: REDUCED MOTION & FORCED COLORS ==================== */
@media (prefers-reduced-motion: reduce) {
  .auth-card, dialog.modal-box[open] { animation: none; }
  .btn, .btn:hover, .btn:active, .kpi-card::before, .kpi-card:hover::before, .acct-card, .acct-card:hover, .nav-btn, .nav-btn:hover, .icon-btn, .amt-chip {
    transition: none;
    transform: none;
  }
}

@media (forced-colors: active) {
  .card, .kpi-card::before, .acct-card, .auth-card, .btn, .badge, .pill-tab.active, .drawer-card, .table-wrapper, dialog.modal-box {
    border: 2px solid CanvasText;
    box-shadow: none;
  }
  .btn-primary, .nav-btn.active, .pill-tab.active {
    background: Highlight;
    color: HighlightText;
  }
  :focus-visible {
    outline: 3px solid Highlight;
  }
}
