﻿:root {
  /* The app is light-only; opting into color-scheme stops phone/browser
     auto-darkening from inverting it (darkening chips, nav and the
     hamburger so dark glyphs vanish on dark surfaces). */
  color-scheme: light;
  --brand: #2f5bf0;
  --brand-2: #5c9dff;
  --brand-tint: rgba(47,91,240,.08);
  --brand-line: rgba(47,91,240,.25);
  --success: #109356;
  --success-tint: rgba(16,147,86,.1);
  --info: #2f5bf0;
  --info-tint: rgba(47,91,240,.08);
  --danger: #dc2626;
  --danger-tint: rgba(220,38,38,.1);
  --amber: #ffb031;
  --purple: #574fff;
  --canvas: #f9f6f4;
  --card: #ffffff;
  --border: #e5e2e0;
  --border-strong: #d5d0cb;
  --text: #282628;
  --subtext: #58585e;
  --faint: #b3a99e;
  --sidebar-w: 220px;
  --sidebar-bg: #f5f2ef;
  --radius: 14px;
  --radius-lg: 18px;
  /* Button system tokens — single source of truth for every button.
     `.btn` and `.btn-pill` share these so the whole system stays uniform. */
  --btn-rad: 999px;
  --btn-h: 40px;
  --btn-sm-h: 34px;
  --btn-xs-h: 28px;
  --btn-lg-h: 46px;
  --btn-pill-h: 52px;
  --btn-pill-sm-h: 44px;
  --shadow-sm: 0 1px 3px rgba(40,38,40,.06);
  --shadow-md: 0 4px 18px rgba(40,38,40,.08);
  --shadow-lg: 0 30px 70px -24px rgba(40,38,40,.22);
  --font-h: "Host Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-l: "Plus Jakarta Sans", "Inter", -apple-system, sans-serif;
}

/* Org-chosen accent color. Scoped to theme-org (specificity wins over the
   `.theme-org` defaults below) so it never leaks into member/platform shells.
   "brand" or an unknown token keeps the default blue. Mirrors src/lib/accents.js. */
body.theme-org[data-accent="blue"]   { --brand: #2046df; --brand-2: #5c9dff; --brand-tint: rgba(32,70,223,.09);  --brand-line: rgba(32,70,223,.26);  --info: #2046df; --info-tint: rgba(32,70,223,.09); }
body.theme-org[data-accent="green"]  { --brand: #0a7a4a; --brand-2: #34c06b; --brand-tint: rgba(10,122,74,.12);  --brand-line: rgba(10,122,74,.28);  --info: #0a7a4a; --info-tint: rgba(10,122,74,.12); }
body.theme-org[data-accent="purple"] { --brand: #4a37d6; --brand-2: #8f6bff; --brand-tint: rgba(74,55,214,.13);  --brand-line: rgba(74,55,214,.3);   --info: #4a37d6; --info-tint: rgba(74,55,214,.13); }
body.theme-org[data-accent="red"]    { --brand: #b91c1c; --brand-2: #f14848; --brand-tint: rgba(185,28,28,.11);  --brand-line: rgba(185,28,28,.28);  --info: #b91c1c; --info-tint: rgba(185,28,28,.11); }
body.theme-org[data-accent="indigo"] { --brand: #3730a3; --brand-2: #818cf8; --brand-tint: rgba(55,48,163,.11);  --brand-line: rgba(55,48,163,.3);   --info: #3730a3; --info-tint: rgba(55,48,163,.11); }
body.theme-org[data-accent="sky"]    { --brand: #075985; --brand-2: #38bdf8; --brand-tint: rgba(7,89,133,.11);   --brand-line: rgba(7,89,133,.3);    --info: #075985; --info-tint: rgba(7,89,133,.11); }
body.theme-org[data-accent="teal"]   { --brand: #0f766e; --brand-2: #2dd4bf; --brand-tint: rgba(15,118,110,.11); --brand-line: rgba(15,118,110,.3);  --info: #0f766e; --info-tint: rgba(15,118,110,.11); }
body.theme-org[data-accent="amber"]  { --brand: #b45309; --brand-2: #f59e0b; --brand-tint: rgba(180,83,9,.12);   --brand-line: rgba(180,83,9,.32);   --info: #b45309; --info-tint: rgba(180,83,9,.12); }
body.theme-org[data-accent="pink"]   { --brand: #be185d; --brand-2: #f472b6; --brand-tint: rgba(190,24,93,.11);  --brand-line: rgba(190,24,93,.3);   --info: #be185d; --info-tint: rgba(190,24,93,.11); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font-h);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-l); }
input, select, textarea { font-family: var(--font-l); font-size: 13.5px; }
::selection { background: rgba(47,91,240,.16); }

/* ---------- Icon base ---------- */
.icon {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -3px; flex-shrink: 0;
}
.icon-sm { width: 14px; height: 14px; vertical-align: -2px; stroke-width: 1.9; }


/* ---------- Auth ---------- */
.auth-page {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 16px;
  padding-top: max(88px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  background: var(--canvas);
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: "";
  position: absolute;
  width: min(640px, 90vw); height: min(640px, 90vw);
  top: -260px; left: -200px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(47,91,240,.13), transparent 70%);
  filter: blur(70px);
  pointer-events: none;
}
.auth-page::after {
  content: "";
  position: absolute;
  width: min(640px, 90vw); height: min(640px, 90vw);
  bottom: -280px; right: -200px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(87,79,255,.09), transparent 70%);
  filter: blur(70px);
  pointer-events: none;
}

/* Centered auth cards (verify, errors) hug the sticky site nav on phones */
@media (max-width: 640px) {
  .auth-page:not(.auth-split) {
    min-height: 0;
    padding: 40px 16px 40px;
  }
}

/* ---------- Split-panel auth (login / register): premium ---------- */
.auth-page.auth-split {
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  grid-template-rows: minmax(0, 1fr);
  place-items: stretch;
  width: 100%;
  height: 100vh; height: 100dvh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: var(--canvas);
}
.auth-page.auth-split::before,
.auth-page.auth-split::after { display: none; }

/* Left: form column (beige) */
.auth-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--canvas);
  padding: clamp(26px, 4vw, 52px) clamp(28px, 7vw, 92px);
  z-index: 1;
}
.auth-top {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.auth-brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--font-h); font-weight: 800; font-size: 19px; letter-spacing: -.02em;
  color: var(--text);
}
.auth-brand .logo-mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px -8px rgba(47,91,240,.6);
}
.auth-brand .logo-mark svg { width: 26px; height: 26px; }
.auth-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-l); font-size: 13px; font-weight: 600;
  color: var(--subtext); transition: color .15s;
}
.auth-back:hover { color: var(--brand); }

.auth-center { flex: 1; display: flex; align-items: center; width: 100%; }
.auth-form { width: 100%; max-width: 396px; margin: 0 auto; }
.auth-form h1 {
  font-family: var(--font-h); font-weight: 800;
  font-size: clamp(25px, 3vw, 31px);
  letter-spacing: -.035em; line-height: 1.1;
  color: var(--text); margin-bottom: 9px;
}
.auth-form .auth-sub { color: var(--subtext); font-size: 14px; line-height: 1.6; margin-bottom: 28px; }
.auth-form .field label { color: var(--subtext); }
.auth-form .input {
  background: var(--card);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
}
.auth-form .btn-pill {
  width: 100%; height: 54px;
  margin-top: 10px;
}
/* Signup option for registering as an organization (pending admin verification). */
.auth-org-toggle {
  margin: 4px 0 2px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--brand-tint);
}
.auth-check {
  display: flex; align-items: center; gap: 10px;
  font: 600 13.5px var(--font-l); color: var(--text);
  cursor: pointer; user-select: none;
}
.auth-check input { position: absolute; opacity: 0; pointer-events: none; }
.auth-check .check-box {
  flex: none; width: 20px; height: 20px;
  border: 1.5px solid var(--border-strong); border-radius: 6px;
  background: var(--card);
  display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.auth-check .check-box .icon { width: 13px; height: 13px; stroke: #fff; opacity: 0; transition: opacity .15s; }
.auth-check input:checked + .check-box { background: var(--brand); border-color: var(--brand); }
.auth-check input:checked + .check-box .icon { opacity: 1; }
.auth-check:hover .check-box { border-color: var(--brand); }
.org-fields {
  margin-top: 14px; padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--card);
}
.org-fields-title { margin: 0 0 3px; font: 700 13px var(--font-l); color: var(--text); }
.org-fields-note { margin: 2px 0 0; font-size: 12px; line-height: 1.55; color: var(--subtext); }
.auth-page .org-fields .input[type="file"] { padding: 9px 12px; }
.org-fields[hidden] { display: none; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 50px; padding: 0 18px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-l); font-size: 14px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(40,38,40,.05);
  transition: background .15s, border-color .15s, box-shadow .2s, transform .15s;
  text-decoration: none; cursor: pointer;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn-google:hover {
  background: rgba(40,38,40,.035);
  border-color: var(--brand-line);
  box-shadow: 0 2px 8px rgba(40,38,40,.08);
}
.btn-google:active { transform: scale(.985); }
.btn-google .glogo { width: 18px; height: 18px; flex: none; }
.auth-or {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 14px;
  color: var(--faint);
  font-family: var(--font-l); font-size: 10.5px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
  white-space: nowrap;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: fit-content; height: var(--btn-pill-h);
  padding: 6px 6px 6px 22px;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-l); font-size: 14.5px; font-weight: 600; letter-spacing: -.01em;
  cursor: pointer; text-align: left; line-height: 1; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(40,38,40,.08), 0 10px 24px -8px rgba(40,38,40,.4);
  transition: transform .2s, box-shadow .25s, filter .2s, background .2s, color .2s, border-color .2s;
}
.btn-pill:hover { transform: translateY(-1px); filter: brightness(.94); box-shadow: 0 2px 4px rgba(40,38,40,.12), 0 14px 28px -8px rgba(40,38,40,.5); }
.btn-pill:active { transform: translateY(0); }
.btn-pill .pill-ico {
  width: 40px; height: 40px; flex: none;
  border-radius: 999px;
  background: #fff; color: var(--brand);
  display: grid; place-items: center;
  transition: transform .25s;
}
.btn-pill:hover .pill-ico { transform: translateX(3px); }
.btn-pill .pill-ico svg, .btn-pill .pill-ico .icon { width: 16px; height: 16px; }
.btn-pill--outline, a.btn-pill--outline, button.btn-pill--outline {
  background: var(--card); color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
}
.btn-pill--outline:hover { background: var(--brand-tint); filter: none; box-shadow: none; }
.btn-pill--outline .pill-ico { background: var(--brand-tint); color: var(--brand); transform: none; }
.btn-pill--sm { height: var(--btn-pill-sm-h); padding: 5px 5px 5px 18px; font-size: 13.5px; }
.btn-pill--sm .pill-ico { width: 34px; height: 34px; }
.btn-pill--sm .pill-ico svg, .btn-pill--sm .pill-ico .icon { width: 15px; height: 15px; }
/* Compact pill for dense table rows (fits next to data instead of pushing it). */
.btn-pill--xs { height: 34px; padding: 4px 4px 4px 14px; font-size: 12.5px; }
.btn-pill--xs .pill-ico { width: 27px; height: 27px; }
.btn-pill--xs .pill-ico svg, .btn-pill--xs .pill-ico .icon { width: 13px; height: 13px; }
.btn-pill--block { width: 100%; }
.btn-pill--static { transform: none; }
.btn-pill--static:hover { transform: none; }
.auth-links {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 18px;
  font-family: var(--font-l); font-size: 12.8px;
}
.auth-links a { color: var(--brand); font-weight: 700; }
.auth-links a:hover { text-decoration: underline; }
.auth-links .muted { color: var(--faint); }
.auth-links--center { justify-content: center; text-align: center; }
.auth-links--center a { color: var(--faint); font-weight: 500; }
.auth-links--center .auth-pri { color: var(--brand); font-weight: 700; }
.auth-links--stack { flex-direction: column; gap: 6px; }

/* Transient muted state for the PWA banner CTA when the native install
   prompt isn't available yet - it becomes guidance text instead of noise. */
.btn.muted { opacity: .55; }

.auth-secure {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--faint); font-family: var(--font-l); font-size: 12px;
  padding-top: 20px;
}
.auth-secure .icon { color: var(--success); }

/* Right: storytelling panel (blue) */
.auth-side {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 90% at 18% 8%, rgba(92,157,255,.4), transparent 55%),
    radial-gradient(90% 80% at 95% 20%, rgba(87,79,255,.42), transparent 55%),
    radial-gradient(100% 90% at 95% 96%, rgba(87,79,255,.32), transparent 55%),
    linear-gradient(165deg, #4b78f5 0%, #2f5bf0 46%, #1b3cb8 100%);
  display: flex;
  flex-direction: column;
  padding: clamp(38px, 5vw, 64px);
}
.auth-side > * { position: relative; z-index: 1; }
.by-hamdal {
  display: block;
  font: 600 9px/1.2 var(--font-l);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 4px;
  white-space: nowrap;
}
.auth-side-mark {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-h); font-weight: 700; font-size: 20px; letter-spacing: -.01em;
  flex: none;
}
.auth-side-mark .mk {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.24);
  display: grid; place-items: center;
}
.auth-side-mark .mk svg { width: 22px; height: 22px; }
.auth-side .by-hamdal { color: rgba(255, 255, 255, .72); }
.auth-side-main {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(18px, 4vh, 40px) 0;
}
.auth-side-main h2 {
  font-family: var(--font-h); font-weight: 800;
  font-size: clamp(27px, 3.2vw, 36px);
  letter-spacing: -.04em; line-height: 1.12;
  max-width: 440px;
}
.auth-side-main .lead { margin-top: 13px; color: rgba(255,255,255,.78); font-size: 15px; line-height: 1.6; max-width: 420px; }
.auth-points { display: grid; gap: 14px; margin-top: 30px; }
.auth-points li {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-l); font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,.94);
}
.auth-points .ic {
  width: 26px; height: 26px; border-radius: 999px;
  background: rgba(255,255,255,.15);
  color: #dce6ff;
  display: grid; place-items: center; flex: none;
}
.auth-points .ic svg { width: 12px; height: 12px; }
.auth-quote {
  flex: none;
  border-top: 1px solid rgba(255,255,255,.14);
  padding-top: 22px;
  max-width: 440px;
}
.auth-quote p { font-family: var(--font-h); font-size: 14.5px; line-height: 1.55; color: rgba(255,255,255,.94); }
.auth-quote .who { display: flex; align-items: center; gap: 10px; margin-top: 13px; font-family: var(--font-l); font-size: 12.5px; }
.auth-quote .who .av {
  width: 32px; height: 32px; border-radius: 999px;
  background: linear-gradient(145deg, #5c9dff, #574fff 60%, #1b3cb8);
  border: 1px solid rgba(255,255,255,.3);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff;
}
.auth-quote .who b { display: block; font-weight: 700; margin-bottom: 2px; }
.auth-quote .who span { color: rgba(255,255,255,.62); font-size: 12px; }

/* Auth: single column on smaller screens, hide storytelling panel */
@media (max-width: 1024px) {
  .auth-page.auth-split { grid-template-columns: 1fr; height: auto; min-height: 100dvh; }
  .auth-side { display: none; }
  .auth-main { padding: 26px 22px 30px; }
  .auth-center { align-items: center; }
  .auth-form { margin: 0; }
  .auth-secure { padding-top: 16px; }
}

@media (max-width: 640px) {
  .auth-main { padding: 22px 18px 24px; }
  .auth-form h1 { font-size: clamp(24px, 7.5vw, 29px); }
  .auth-form .auth-sub { margin-bottom: 22px; }
  .auth-links {
    display: grid; gap: 9px;
    justify-content: center;
    text-align: center; justify-items: center;
    margin-top: 18px;
  }
  .auth-links a { font-size: 13.5px; }
  .auth-top { gap: 12px; }
  .auth-form .field { gap: 7px; }
  .auth-form .input {
    height: 48px; padding: 0 14px;
    border-radius: 13px; font-size: 14.5px;
  }
  .auth-form .btn-pill { height: 50px; }
  .auth-form .btn-pill .pill-ico { width: 38px; height: 38px; }
  .btn-google { height: 50px; font-size: 13.5px; }
  .auth-or { margin: 16px 0 12px; gap: 10px; }
}

@media (max-width: 760px) {
  .auth-links {
    display: grid; gap: 9px;
    justify-content: center;
    text-align: center; justify-items: center;
  }
  .auth-links a { font-size: 13.5px; }
}

@media (max-width: 400px) {
  .auth-top { flex-wrap: wrap; row-gap: 10px; }
  .auth-brand { gap: 9px; font-size: 16.5px; }
  .auth-brand .logo-mark { width: 38px; height: 38px; border-radius: 12px; }
  .auth-brand .logo-mark svg { width: 22px; height: 22px; }
  .auth-back { font-size: 12px; }
  .auth-form h1 { font-size: 23px; }
  .auth-form .field { gap: 6px; }
  .auth-form .field label { font-size: 13px; }
  .auth-form .input {
    height: 46px; padding: 0 12px;
    border-radius: 12px; font-size: 14px;
  }
  .auth-form .btn-pill { height: 48px; padding: 5px 5px 5px 16px; }
  .auth-form .btn-pill .pill-ico { width: 36px; height: 36px; }
  .btn-google { height: 48px; padding: 0 16px; font-size: 13px; }
  .btn-google .glogo { width: 17px; height: 17px; }
  .auth-or { margin: 14px 0 10px; font-size: 10px; gap: 9px; }
  .auth-secure { padding-top: 12px; font-size: 11px; }
}

/* Center-column auth (verify pages) */
.auth-err {
  display: flex; gap: 8px; align-items: flex-start;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 12.8px;
  margin-bottom: 16px;
}
.auth-box {
  position: relative;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow-lg);
}
.auth-box .brand-row {
  display: flex; align-items: center; gap: 11px; margin-bottom: 14px;
}
.auth-box .brand-row .logo-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px -6px rgba(47,91,240,.5);
}
.auth-box .brand-row .logo-mark svg { width: 23px; height: 23px; }
.auth-box h1 {
  font-family: var(--font-h); font-weight: 800;
  font-size: 21px; letter-spacing: -.02em;
  color: var(--text);
}
.auth-box .auth-sub { color: var(--subtext); font-size: 13.5px; line-height: 1.55; margin-bottom: 22px; }
.auth-box .input { padding: 11px 13px; }
.auth-box .btn-primary { width: 100%; height: 46px; border-radius: 11px; }
.auth-box .btn-pill { width: 100%; height: 52px; margin-top: 6px; }
.auth-box .auth-foot { margin-top: 18px; text-align: center; color: var(--faint); font-size: 12.5px; }
.auth-box .auth-foot a { color: var(--brand); font-weight: 700; }

/* ---------- App shell ---------- */
.shell-header {
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  padding-top: env(safe-area-inset-top);
  background: rgba(249,246,244,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.shell-header .crumb {
  font-size: 12.8px; color: var(--subtext); font-weight: 500; font-family: var(--font-l);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.shell-header .crumb b { color: var(--text); font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }
.site-links { display: flex; align-items: center; gap: 15px; margin-right: 8px; border-right: 1px solid var(--border); padding-right: 14px; }
.site-links a { font-size: 11.5px; font-weight: 600; color: var(--subtext); text-decoration: none; white-space: nowrap; }
.site-links a:hover { color: var(--brand); }
@media (max-width: 1080px) { .site-links { display: none; } }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--subtext);
  background: transparent;
  border: none; cursor: pointer; position: relative;
  transition: .12s;
}
.icon-btn:hover { background: var(--brand-tint); color: var(--brand); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--danger);
  border: 1.5px solid #fff;
}
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; }
.user-chip:hover { background: rgba(40,38,40,.04); }
.chip-edit { display: grid; place-items: center; color: var(--faint); opacity: .75; }
.user-chip:hover .chip-edit { opacity: 1; color: var(--brand); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 99px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 11px; font-weight: 700; font-family: var(--font-l);
  overflow: hidden;
}
.user-avatar.has-photo { background: none; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-chip .nm { font-size: 12.5px; font-weight: 600; font-family: var(--font-l); }

.impersonation-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 18px; margin-bottom: 12px;
  background: linear-gradient(180deg, rgba(255,176,49,.16), rgba(255,176,49,.1));
  border: 1px solid rgba(209,126,10,.35);
  border-radius: 12px; color: #7a5208; font-size: 12.8px;
}
.impersonation-bar b { font-weight: 700; }
.impersonation-bar form { margin-left: auto; }

.shell { min-height: 100vh; min-height: 100dvh; display: flex; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 12px;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 9px;
  padding: 2px 8px 6px;
  font-weight: 800; font-size: 15px; letter-spacing: .12em; text-transform: uppercase;
}
.sidebar .brand .logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(47,91,240,.35);
  flex-shrink: 0;
}
.sidebar .brand .logo-mark svg { width: 18px; height: 18px; }
.side-group { margin-top: 20px; }
.side-label {
  font-family: var(--font-l);
  font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint);
  padding: 0 10px; margin-bottom: 7px;
}
.side-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 10px;
  color: var(--subtext); font-size: 13px; font-weight: 500; font-family: var(--font-l);
  transition: .12s;
  position: relative;
}
.side-item .icon { color: var(--faint); }
.side-item:hover { background: rgba(40,38,40,.04); color: var(--text); }
.side-item.active {
  background: var(--brand-tint);
  color: var(--brand); font-weight: 600;
}
.side-item.active .icon { color: var(--brand); }
.side-count {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px;
  background: var(--brand); color: #fff;
  font-size: 10.5px; font-weight: 700; font-family: var(--font-l);
  display: inline-flex; align-items: center; justify-content: center;
}
.side-bottom { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.side-spacer {
  margin-top: auto; display: flex; flex-direction: column;
  gap: 8px;
}
.side-spacer .side-bottom { margin-top: 0; }
.workspace {
  display: flex; align-items: center; gap: 9px;
  padding: 10px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border);
}
.workspace-icon {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; position: relative; flex-shrink: 0;
}
.workspace-icon span { width: 7px; height: 7px; border-radius: 99px; background: var(--success); border: 1.5px solid var(--card); }
.workspace-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; display: block; }
.workspace-text { flex: 1; min-width: 0; }
.workspace-text strong {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-size: 12px; color: var(--text); line-height: 1.3;
  overflow: hidden; word-break: break-word;
}
.workspace-text span { font-size: 10.5px; color: var(--faint); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sign-out entry inside the mobile sidebar drawer. Hidden on desktop where
   the header keeps its own Sign out button - visible whenever the sidebar
   turns into a drawer. */
.side-signout {
  display: none; align-items: center; gap: 9px;
  margin-top: 8px; padding: 9px 10px; border-radius: 10px;
  color: #c44747; font-size: 13px; font-weight: 600; font-family: var(--font-l);
  text-decoration: none; transition: .12s;
}
.side-signout:hover { background: rgba(196,71,71,.08); }
.side-signout .icon { color: inherit; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-content {
  flex: 1; padding: 26px 30px 60px;
  padding-bottom: max(60px, calc(env(safe-area-inset-bottom) + 20px));
  width: 100%; display: flex; flex-direction: column; gap: 14px;
}
.main-content > * { width: 100%; min-width: 0; }
.page-head { margin-bottom: 0; }

/* ---------- Page head + KPI ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; letter-spacing: -.02em; font-weight: 800; }
.page-head p { color: var(--subtext); font-size: 13px; margin-top: 2px; font-family: var(--font-l); }
.actions { display: flex; align-items: center; gap: 8px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; gap: 14px; }
.grid-kpi { grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.grid-2b { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); margin-bottom: 0; }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, border-color .18s;
}
.card:hover { box-shadow: var(--shadow-md); }
.support-strip {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
  color: var(--text);
}
.support-strip:hover { border-color: var(--brand-line); box-shadow: var(--shadow-md); }
.support-strip > .icon { color: var(--faint); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; font-family: var(--font-l); }
.card-icon-tile {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--brand);
  background: var(--brand-tint);
  font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}
.card-icon-tile.brand { color: var(--brand); background: var(--brand-tint); }
.card-icon-tile.blue { color: var(--info); background: var(--info-tint); }
.card-icon-tile.green { color: var(--success); background: var(--success-tint); }
.card-icon-tile.orange { color: #b07a1a; background: rgba(255,176,49,.12); }
.kpi-value {
  font-size: 28px; font-weight: 800; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.15;
}
.kpi-sub { color: var(--faint); font-size: 12.2px; margin-top: 4px; font-family: var(--font-l); }
.kpi-sub .up { color: var(--success); display: inline-flex; align-items: center; gap: 2px; }

a.card { text-decoration: none; color: inherit; display: block; }
a.card .card-header { margin-bottom: 10px; }
.kpi-card { position: relative; }
a.kpi-link { text-decoration: none; color: inherit; display: block; }
a.kpi-link:hover .stat-label { color: var(--brand); }

.card-link { position: relative; }
.card-link .stretched { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card-link a, .card-link button { position: relative; z-index: 2; }
.card-link .card-header { position: relative; z-index: 2; }
.card-link:hover { border-color: var(--brand-line); }

.search-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; max-width: 620px; }
.search-bar .input { flex: 1; min-width: 200px; margin-bottom: 0; }
.search-bar .select { width: auto; margin-bottom: 0; }

.org-directory { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.org-directory-card { min-height: 176px; padding: 14px; }
.org-directory-card .card-header { margin-bottom: 12px; }
.org-directory-card .card-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-directory-code { font-size: 19px; line-height: 1.1; letter-spacing: -.02em; }
.org-directory-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.org-directory-count { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.org-directory-locked { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); font-size: 11.5px; white-space: nowrap; }

.join-code-form .btn-pill { width: 100%; }
.join-code-overlay .input { font-size: 15px; height: 48px; letter-spacing: .06em; text-transform: uppercase; }
.join-code-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(40, 38, 40, 0.5);
  -webkit-backdrop-filter: blur(12px) saturate(0.9);
  backdrop-filter: blur(12px) saturate(0.9);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.join-code-overlay.open { opacity: 1; visibility: visible; }
.join-code-overlay .gate-pop {
  position: relative; width: min(420px, 100%);
  background: var(--card, #ffffff);
  border: 1px solid var(--border-strong, #d5d0cb);
  border-radius: var(--radius-lg, 18px);
  padding: 26px 24px 22px;
  box-shadow: var(--shadow-md);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s ease;
}
.join-code-overlay.open .gate-pop { transform: translateY(0) scale(1); }
.join-code-overlay .gate-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); font-size: 17px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.join-code-overlay .gate-pop-mark { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 10px; }
.join-code-overlay .gate-pop-mark svg { width: 34px; height: 34px; }
.join-code-overlay h2 { font-family: var(--font-l); font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.join-code-overlay .gate-pop-sub { color: var(--subtext, #58585e); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.join-code-overlay .gate-pop-actions { display: flex; flex-direction: column; gap: 10px; }

.payout-gate-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(40,38,40,0.5);
  -webkit-backdrop-filter: blur(12px) saturate(0.9);
  backdrop-filter: blur(12px) saturate(0.9);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.payout-gate-overlay.open { opacity: 1; visibility: visible; }
.payout-gate-overlay .gate-pop {
  position: relative; width: min(430px, 100%);
  background: var(--card, #ffffff);
  border: 1px solid var(--border-strong, #d5d0cb);
  border-radius: var(--radius-lg, 18px);
  padding: 26px 24px 22px;
  box-shadow: var(--shadow-md);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s ease;
}
.payout-gate-overlay.open .gate-pop { transform: translateY(0) scale(1); }
.payout-gate-overlay .gate-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--card);
  color: var(--text); font-size: 17px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.payout-gate-overlay .gate-pop-mark { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 12px; }
.payout-gate-overlay .gate-pop-mark svg { width: 34px; height: 34px; }
.payout-gate-overlay h2 { font-family: var(--font-l); font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.payout-gate-overlay .gate-pop-sub { color: var(--subtext, #58585e); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.payout-gate-overlay .gate-pop-actions { display: flex; flex-direction: column; gap: 10px; }


.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--subtext); font-size: 12.5px; font-weight: 600;
  font-family: var(--font-l); text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.filter-chip:hover { border-color: var(--brand-line); color: var(--brand); }
.filter-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.progress-track { height: 7px; background: rgba(40,38,40,.06); border-radius: 99px; margin-top: 12px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 99px;
  transition: width .6s cubic-bezier(.16,1,.3,1);
}

/* ---------- Bars chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 16px; }
.bar {
  flex: 1;
  border-radius: 8px 8px 4px 4px;
  background: rgba(40,38,40,.07);
  min-height: 6px;
  transition: .2s;
  position: relative;
}
.bar:hover { background: rgba(40,38,40,.12); }
.bar.orange { background: linear-gradient(180deg, var(--amber), #e5a02d); }
.bar.blue { background: linear-gradient(180deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 16px -6px rgba(47,91,240,.35); }
.bar-labels { display: flex; gap: 10px; margin-top: 10px; }
.bar-labels span { flex: 1; text-align: center; font-size: 11px; color: var(--faint); font-weight: 600; font-family: var(--font-l); }

/* ---------- Rings ---------- */
.rings-wrap { display: flex; align-items: center; gap: 26px; margin-top: 18px; }
.rings { position: relative; width: 118px; height: 118px; flex-shrink: 0; }
.rings .ring { position: absolute; inset: 0; border-radius: 99px; }
.rings .ring.one { border: 10px solid var(--brand); border-right-color: transparent; transform: rotate(-150deg); }
.rings .ring.two { inset: 11px; border: 9px solid rgba(47,91,240,.2); border-bottom-color: transparent; transform: rotate(45deg); }
.rings .ring.three { inset: 22px; border: 8px solid var(--border); border-top-color: transparent; transform: rotate(90deg); }
.ring-center {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 17px; font-weight: 800; color: var(--text);
}
.receipt-stats { display: grid; grid-template-columns: repeat(2, auto); gap: 12px 26px; }
.stat-block { display: flex; flex-direction: column; }
.stat-label { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-family: var(--font-l); }
.stat-value { font-size: 16.5px; font-weight: 700; color: var(--text); }

/* ---------- Rows / lists ---------- */
.list-rows { margin-top: 6px; }
.row-line {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 0; border-top: 1px solid rgba(40,38,40,.06);
}
.row-line .lt { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row-line .title { font-size: 13px; font-weight: 600; font-family: var(--font-l); }
.cell-label { font-weight: 600; font-size: 13.2px; font-family: var(--font-l); }
.cell-sub { color: var(--faint); font-size: 11.6px; font-family: var(--font-l); }
.mono { font-variant-numeric: tabular-nums; font-family: "SF Mono", "Cascadia Code", Consolas, monospace; font-size: 12.6px; }
.txt-red { color: var(--danger); }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.table-wrap::before {
  content: "";
  position: sticky;
  left: 0; top: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, var(--card), transparent);
  pointer-events: none;
  z-index: 5;
  flex-shrink: 0;
  display: none;
}
.table-wrap::after {
  content: "";
  position: sticky;
  right: 0; top: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(270deg, var(--card) 20%, transparent);
  pointer-events: none;
  z-index: 5;
  flex-shrink: 0;
}
.table-wrap.scrollable::before { display: block; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 0; }
thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); font-weight: 700; font-family: var(--font-l);
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card); z-index: 3;
  white-space: nowrap;
}
thead th:first-child { position: sticky; left: 0; z-index: 4; background: var(--card); }
tbody td { padding: 12px; border-bottom: 1px solid rgba(40,38,40,.05); vertical-align: middle; font-family: var(--font-l); }
tbody td:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; }

/* ---------- Auto-stacked tables ----------
   shell-end.js marks .table-wrap.is-stacked whenever a table would need
   horizontal scrolling (or its columns would be culled on small screens).
   Rows become labeled cards: every value keeps its column name as a small
   label, so nothing is hidden and there is never any left/right scroll. */
.table-wrap.is-stacked { overflow: visible; }
.table-wrap.is-stacked table { display: block; width: 100%; }
.table-wrap.is-stacked td, .table-wrap.is-stacked td .cell-label, .table-wrap.is-stacked td .cell-sub { overflow-wrap: anywhere; }
.table-wrap.is-stacked::before,
.table-wrap.is-stacked::after { display: none; }
.table-wrap.is-stacked thead { display: none; }
.table-wrap.is-stacked tbody { display: block; }
.table-wrap.is-stacked tbody tr {
  display: block; padding: 2px 10px; margin: 0 0 6px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); box-shadow: none;
}
.table-wrap.is-stacked tbody tr:last-child { margin-bottom: 0; }
.table-wrap.is-stacked td {
  display: flex !important; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 3px 12px;
  padding: 5px 0; border: 0;
  border-bottom: 1px solid rgba(40,38,40,.06);
  text-align: right; vertical-align: middle; font-family: var(--font-l);
}
.table-wrap.is-stacked td:last-child { border-bottom: 0; }
.table-wrap.is-stacked td:first-child { position: static; }
.table-wrap.is-stacked td::before {
  content: attr(data-label); order: 0; flex: 0 1 auto; min-width: 0;
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--faint); font-family: var(--font-l);
}
.table-wrap.is-stacked td.hide-xs,
.table-wrap.is-stacked td.hide-sm { display: flex !important; }
.table-wrap.is-stacked td > * { order: 1; min-width: 0; }
.table-wrap.is-stacked td > .cell-label { flex: 1 1 auto; text-align: right; }
.table-wrap.is-stacked td > .cell-sub { width: 100%; flex: 1 1 100%; text-align: right; margin-left: auto; }
.table-wrap.is-stacked td > form,
.table-wrap.is-stacked td > a.btn { flex: 1 1 auto; }
.table-wrap.is-stacked td > form .btn,
.table-wrap.is-stacked td > .btn { width: 100%; justify-content: center; }
.table-wrap.is-stacked td[colspan] { display: block !important; }
.table-wrap.is-stacked td[colspan]::before { display: none; }
.table-wrap.is-stacked td[colspan] > * { text-align: center; }
tbody tr:hover td { background: rgba(249,246,244,.6); }
tbody tr:hover td:first-child { background: rgba(249,246,244,.6); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 11.4px; font-weight: 600; font-family: var(--font-l);
  background: rgba(40,38,40,.06); color: var(--subtext);
}
.pill-orange { background: rgba(255,176,49,.12); color: #b07a1a; }
.pill-green { background: var(--success-tint); color: #0e7a46; }
.pill-blue { background: var(--info-tint); color: var(--brand); }
.pill-purple { background: rgba(124,58,237,.1); color: #6d28d9; }
.pill-gray { background: rgba(40,38,40,.06); color: var(--subtext); }
.pill-red { background: var(--danger-tint); color: #b3261e; }
.pill.admin-pill { background: rgba(139,92,246,.12); color: #6d28d9; margin-bottom: 18px; font-size: 11px; letter-spacing: .3px; }

/* ---------- Organization card header (member dashboard / list) ---------- */
.org-card .card-title { align-items: flex-start; gap: 10px; font-family: var(--font-b); }
.org-card-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.org-card-name strong { font-size: 14.5px; font-weight: 650; font-family: var(--font-l); color: var(--text); line-height: 1.25; }
.org-card-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.org-role { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--subtext); }
.org-session { font-size: 11.5px; color: var(--subtext); }
.org-session::before { content: "·"; margin-right: 8px; color: var(--faint); }
.org-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; font-family: var(--font-l);
  white-space: nowrap;
}
.org-status .dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.org-status.is-pending { background: rgba(255,176,49,.12); color: #9a6a12; }
.org-status.is-pending .dot { background: #e09f0f; }
.org-status.is-rejected { background: var(--danger-tint); color: #b3261e; }
.org-status.is-rejected .dot { background: #d4183d; }

/* ---------- Support thread ---------- */
.thread { display: flex; flex-direction: column; gap: 10px; }
.bubble {
  border: 1px solid var(--border);
  background: var(--canvas);
  border-radius: 12px;
  padding: 11px 13px;
  align-self: flex-start; max-width: 100%;
}
.bubble.is-agent {
  background: var(--brand-tint);
  border-color: var(--brand-line);
  align-self: flex-end;
}
.bubble.is-internal {
  border-style: dashed;
  background: rgba(40,38,40,.03);
  opacity: .85;
}
.bubble-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 5px;
  font-family: var(--font-l);
}
.bubble-meta strong { font-size: 12.3px; color: var(--text); }
.bubble-meta span { font-size: 10.5px; color: var(--faint); }
.prewrap { white-space: pre-wrap; word-break: break-word; font-size: 13.3px; font-family: var(--font-l); line-height: 1.55; }
.internal-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.3px; color: var(--subtext); font-family: var(--font-l); cursor: pointer;
}
.internal-toggle input { accent-color: var(--brand); }

/* ---------- Flash variants ---------- */
.flash-success {
  background: var(--success-tint);
  border: 1px solid rgba(16,147,86,.25);
  color: #0e7a46;
}

/* ---------- Buttons ---------- */
/* Central button system: every button (legacy `.btn` and chip `.btn-pill`)
   derives size + radius from the tokens above so the app stays uniform. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 18px; height: var(--btn-h);
  border-radius: var(--btn-rad);
  border: 1px solid transparent;
  font-family: var(--font-l);
  font-size: 13px; font-weight: 600; letter-spacing: -.01em; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s, filter .15s;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn .icon { vertical-align: -2px; }

/* Primary */
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(40,38,40,.06), 0 3px 10px -4px rgba(40,38,40,.25);
}
.btn-primary:hover {
  border-color: var(--brand);
  filter: brightness(.94);
  box-shadow: 0 2px 5px rgba(40,38,40,.1), 0 8px 18px -6px rgba(40,38,40,.4);
}

/* Outline */
.btn-outline {
  background: var(--card);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(40,38,40,.05);
}
.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-tint);
  box-shadow: 0 2px 10px -2px rgba(47,91,240,.18);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--subtext);
}
.btn-ghost:hover {
  background: rgba(40,38,40,.05);
  color: var(--text);
}

/* Danger */
.btn-danger {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}
.btn-danger:hover {
  background: #fde4e4;
  border-color: #f9bfbf;
}

/* Semantic tinted variants (soft, in the same pill family) */
.btn-info { background: var(--info-tint, #eff4ff); color: var(--brand, #2f5bf0); border-color: #c9d9ff; }
.btn-info:hover { background: #e2ebff; border-color: #b3c9ff; }
.btn-warn { background: var(--warn-tint, #fff7e8); color: #b45309; border-color: #f3dfb3; }
.btn-warn:hover { background: #ffecc7; border-color: #eccf97; }
.btn-ok { background: var(--success-tint, #ebf7ef); color: #0e7a46; border-color: #bfe3cd; }
.btn-ok:hover { background: #ddf1e4; border-color: #a8d9bd; }
.btn-violet { background: rgba(124,58,237,.08); color: #6d28d9; border-color: #d8c6f5; }
.btn-violet:hover { background: rgba(124,58,237,.14); border-color: #c7aef0; }
.btn-muted { background: rgba(40,38,40,.04); color: var(--subtext); border-color: transparent; }
.btn-muted:hover { background: rgba(40,38,40,.09); color: var(--text); }

/* Success */
.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16,147,86,.15), 0 4px 12px -3px rgba(16,147,86,.3);
}
.btn-success:hover {
  background: #0e824c;
  box-shadow: 0 1px 2px rgba(16,147,86,.2), 0 8px 20px -4px rgba(16,147,86,.4);
}

/* Sizes */
.btn-sm { padding: 0 14px; height: var(--btn-sm-h); font-size: 12px; gap: 5px; }
.btn-lg { padding: 0 24px; height: var(--btn-lg-h); font-size: 14px; }
.btn-xs { padding: 0 8px; height: var(--btn-xs-h); font-size: 11px; gap: 4px; }

/* Icon only */
.btn-icon { padding: 0; width: var(--btn-h); }
.btn-icon.btn-sm { width: var(--btn-sm-h); }
.btn-icon.btn-lg { width: var(--btn-lg-h); }

/* Full width */
.btn-block { width: 100%; }

/* ---------- Quick action buttons (inline with text) ---------- */
.row-line .btn { flex-shrink: 0; }

/* ---------- Forms ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 14px; }
.field label, .field .field-label { display: block; font-size: 12.3px; font-weight: 600; margin-bottom: 6px; color: var(--subtext); font-family: var(--font-l); }
.input, .select, .textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  transition: .13s;
  font-family: var(--font-l);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.textarea { min-height: 74px; resize: vertical; }
.input-sm { padding: 5px 10px; border-radius: 8px; font-size: 12.5px; }
.form-error {
  display: flex; gap: 8px; align-items: center;
  background: #fef2f2; border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 10px; padding: 9px 12px; font-size: 12.8px; margin-bottom: 14px;
}

/* ---------- Flash ---------- */
.flash {
  display: flex; gap: 8px; align-items: flex-start;
  border-radius: 11px; padding: 11px 14px; font-size: 13px; margin-bottom: 16px;
}
.flash-success { background: var(--success-tint); border: 1px solid rgba(16,147,86,.25); color: #0e7a46; }
.flash-accent { background: var(--brand-tint); border: 1px solid var(--brand-line); color: var(--brand); }

/* ---------- Swatches / chips / empty ---------- */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 99px; border: 3px solid transparent; cursor: pointer; transition: .12s; }
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--border); }
.swatch-brand { background: var(--brand); }
.swatch-blue { background: #2563eb; }
.swatch-green { background: var(--success); }
.swatch-purple { background: var(--purple); }
.swatch-red { background: #dc2626; }

/* ---------- Plan & billing ---------- */
/* ---------- Upgrade required ---------- */
.upg-cards { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.upg-plan {
  position: relative;
  flex: 1 1 250px;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 22px 20px;
  box-shadow: var(--shadow-sm, none);
}
.upg-plan--target {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 1px var(--brand-line), 0 16px 32px -20px var(--brand);
}
.upg-plan--locked { opacity: .72; }
.upg-plan--current { background: var(--brand-tint); }
.upg-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: #fff; background: var(--brand);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 6px 16px -6px var(--brand);
}
.upg-badge--current { background: var(--subtext); box-shadow: none; }
.upg-plan-name {
  font-size: 13px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  color: var(--brand);
}
.upg-plan--current .upg-plan-name { color: var(--text); }
.upg-plan-desc { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--subtext); min-height: 40px; }
.upg-plan-price { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 4px; }
.upg-plan-price b { font-size: 32px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; color: var(--text); }
.upg-plan-price span { font-size: 12px; color: var(--faint); font-weight: 500; }
.upg-plan .btn { margin: 16px 0 4px; }
.upg-plan ul {
  list-style: none; margin: 16px 0 0; padding: 16px 0 0;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 9px;
}
.upg-plan ul li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 500; color: var(--text); }
.upg-check {
  flex: none; width: 18px; height: 18px; border-radius: 99px;
  display: grid; place-items: center;
  color: var(--brand); background: var(--brand-tint);
}
.upg-check .icon { width: 12px; height: 12px; }
.upg-note { margin-top: 18px; font-size: 12.5px; line-height: 1.6; color: var(--faint); }
.upg-note a { color: var(--brand); font-weight: 600; }
.upg-plan-note { margin: 10px 0 0; font-size: 12px; line-height: 1.55; color: var(--faint); }
.plan-card .card-body { padding-top: 10px; }
.plan-summary {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px;
}
.plan-summary-left { display: flex; flex-direction: column; gap: 3px; }
.plan-eyebrow {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint);
}
.plan-name { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.plan-summary-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.plan-price { font-size: 18px; font-weight: 700; color: var(--text); }
.plan-cadence {
  font-size: 11.5px; color: var(--faint);
  padding: 2px 8px; border-radius: 999px;
  background: var(--brand-tint); border: 1px solid var(--brand-line);
}
.plan-divider { margin: 14px 0 12px; height: 1px; background: var(--border); }
.plan-feats-title {
  display: block; font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 8px;
}
.plan-feats ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.plan-feats li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text); }
.plan-tick {
  flex: none; width: 15px; height: 15px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-tint); border: 1px solid var(--brand-line);
}
.plan-tick::after {
  content: ""; width: 6px; height: 3px;
  border-left: 1.5px solid var(--brand); border-bottom: 1.5px solid var(--brand);
  transform: rotate(-45deg) translateY(-1px);
}
.plan-foot {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 12px;
}
.plan-foot-note { font-size: 12px; line-height: 1.5; color: var(--faint); }
.plan-foot a:not(.btn) { color: var(--brand); font-weight: 600; }

/* Responsive column hiding (apply to <th>/<td>) */
@media (max-width: 640px) { .hide-sm { display: none; } }
@media (max-width: 480px) { .hide-xs { display: none; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(40,38,40,.04); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 999px;
  font-size: 12.3px; font-weight: 500; font-family: var(--font-l);
}
.chip em { color: var(--faint); font-style: normal; font-size: 11.6px; }
.empty { text-align: center; padding: 44px 18px; color: var(--subtext); }
.empty .icon { width: 34px; height: 34px; color: var(--faint); margin-bottom: 12px; }
.empty h3 { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.empty p { font-size: 12.8px; color: var(--faint); }
.empty-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.link-more { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; color: var(--brand); font-size: 12.6px; font-weight: 600; font-family: var(--font-l); }
.link-more:hover { text-decoration: underline; }
.session-pill {
  font-size: 11.4px; font-weight: 600; color: var(--subtext); font-family: var(--font-l);
  background: rgba(40,38,40,.04); padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border);
}

/* ---------- Receipt / public ---------- */
.rcp-page {
  min-height: 100vh; min-height: 100dvh;
  background: var(--canvas);
  padding: 40px 18px;
  padding-top: max(40px, env(safe-area-inset-top));
  padding-bottom: max(40px, env(safe-area-inset-bottom));
}
.rcp-card {
  max-width: 720px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.rcp-hero {
  padding: 26px 28px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.rcp-hero .big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.rcp-hero .sub { opacity: .85; font-size: 12.5px; }
.rcp-body { padding: 26px 28px; }
.rcp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 18px; }
.rcp-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(40,38,40,.06); font-size: 13.4px; font-family: var(--font-l); }
.rcp-row .l { color: var(--faint); }
.rcp-stamp { text-align: center; margin-top: 24px; }
.rcp-stamp .stamp {
  display: inline-block; border: 2px solid var(--success); color: var(--success);
  border-radius: 12px; padding: 8px 18px; font-weight: 800; font-size: 14px; letter-spacing: .12em;
  transform: rotate(-6deg);
}
.verified-flag { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-weight: 700; font-size: 13px; }
.rcp-foot { text-align: center; color: var(--faint); font-size: 12px; padding: 24px 28px; border-top: 1px solid rgba(40,38,40,.06); }
@media (max-width: 520px) {
  .rcp-page { padding: 16px 10px; }
  .rcp-card { border-radius: 14px; }
  .rcp-hero { padding: 20px 18px; flex-direction: column; text-align: center; }
  .rcp-hero .big { font-size: 22px; }
  .rcp-body { padding: 20px 18px; }
  .rcp-grid { grid-template-columns: 1fr; gap: 12px; }
  .rcp-row { font-size: 12.5px; gap: 8px; }
  .rcp-foot { padding: 18px; }
}

/* ---------- Error pages ---------- */
.err-page {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 24px 16px;
  padding-top: max(88px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  background: var(--canvas); color: var(--text);
}
.err-page--shell { min-height: calc(100vh - 130px); padding-top: 40px; }
.err-card { text-align: center; max-width: 460px; display: flex; flex-direction: column; align-items: center; }
.err-foot { text-align: center; font-size: 11px; color: var(--faint); padding: 0 16px 22px; }
.err-card .code {
  font-size: 64px; font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.err-card h1 { font-size: 19px; margin: 10px 0 6px; }
.err-card p { color: var(--subtext); font-size: 13.5px; margin-bottom: 22px; }
.err-card pre {
  width: 100%; text-align: left; margin: 0 0 20px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  white-space: pre-wrap; word-break: break-word;
  font: 11.5px/1.5 "SF Mono", "Cascadia Code", Consolas, monospace; color: var(--subtext);
}
@media (max-width: 480px) {
  .err-card .code { font-size: 48px; }
  .err-card h1 { font-size: 17px; }
}

/* ---------- Push notification permission banner ---------- */
/* Professional top-of-page banner: full-width strip that slides down from
   the top so it reads like an OS-style permission bar, on both nested
   shells and standalone pages. Uses theme tokens throughout. */
.push-banner {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 950;
  display: flex; align-items: center; gap: 16px;
  width: 100%;
  box-sizing: border-box;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 14px 22px;
  padding-top: max(14px, env(safe-area-inset-top));
  font-family: var(--font-l);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform .4s cubic-bezier(.16,1,.3,1), opacity .3s ease;
}
.push-banner.show { transform: translateY(0); opacity: 1; }
.push-banner-icon {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px var(--brand);
}
.push-banner-icon svg { width: 22px; height: 22px; }
.push-banner-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.push-banner-text strong {
  font-size: 15px; color: var(--text);
  font-family: var(--font-h); letter-spacing: -.01em; margin-bottom: 2px;
}
.push-banner-text span { font-size: 12.5px; color: var(--subtext); line-height: 1.45; max-width: 720px; }
.push-banner-actions { display: flex; gap: 10px; flex-shrink: 0; align-items: center; }
.push-banner-actions .btn-primary {
  background: var(--brand); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 20px; font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit; white-space: nowrap;
  box-shadow: 0 8px 20px -8px var(--brand);
  transition: filter .15s;
}
.push-banner-actions .btn-primary:hover { filter: brightness(1.07); }
.push-banner-actions .btn-ghost {
  background: transparent; color: var(--subtext); border: 0; border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.push-banner-actions .btn-ghost:hover { color: var(--text); background: var(--brand-tint); }
@media (max-width: 720px) {
  .push-banner { gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
  .push-banner-text strong { font-size: 14px; }
  .push-banner-text span { font-size: 12px; }
  .push-banner-actions .btn-primary { padding: 9px 14px; }
}
@media (max-width: 480px) {
  .push-banner { flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); }
  .push-banner-text strong { width: 100%; }
  .push-banner-actions { width: 100%; justify-content: flex-end; }
  .push-banner-actions .btn-primary { flex: 1; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .push-banner { transition: none; }
}

/* ---------- PWA install banner ---------- */
.pwa-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 100vw;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  box-shadow: 0 -8px 30px rgba(40,38,40,.12);
  z-index: 50;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.pwa-banner.show { transform: translateY(0); }
body.pwa-banner-open .main-content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.pwa-banner-open .page-head > .actions,
body.pwa-banner-open .page-head > form.page-head-action { bottom: max(90px, env(safe-area-inset-bottom)); }
.pwa-banner-text { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pwa-banner-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; flex-shrink: 0;
}
.pwa-banner-icon svg { width: 22px; height: 22px; }
.pwa-banner-text strong { font-size: 13.5px; }
.pwa-banner-text span { font-size: 12px; color: var(--faint); display: block; margin-top: 1px; }
.pwa-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Mobile sidebar overlay ---------- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,17,26,.32);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s, visibility .25s;
}
.sidebar-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }
.hamburger {
  display: none;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer; position: relative;
  flex-shrink: 0;
  z-index: 1;
}
.hamburger.open { z-index: 101; }
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px;
  position: absolute; left: 9px; transition: .25s;
}
.hamburger span:nth-child(1) { top: 12px; }
.hamburger span:nth-child(2) { top: 18px; }
.hamburger span:nth-child(3) { top: 24px; }
.hamburger.open span:nth-child(1) { top: 18px; transform: rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { top: 18px; transform: rotate(-45deg); }

/* ---------- Responsive ---------- */

/* Tablet landscape / small desktop */
@media (max-width: 1024px) {
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .grid-2b { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-sidebar { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .org-directory { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
}

/* Tablet portrait */
@media (max-width: 860px) {
  .hamburger { display: grid; place-items: center; }
  .side-signout { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 91;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.16,1,.3,1);
    width: min(84vw, 300px);
    box-shadow: none;
    padding: 18px 14px;
    padding-top: calc(env(safe-area-inset-top) + 12px);
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 60px rgba(40,38,40,.2);
  }
  .sidebar-overlay { display: block; }
  .main { width: 100%; }
  .main-content { padding: 20px 16px 56px; }

  /* Safe-area insets for landscape/notched phones */
  .shell-header {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
  .main-content {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  /* Page head */
  .page-head { flex-direction: column; gap: 10px; }
  .page-head .actions { width: 100%; display: flex; gap: 8px; }
  .page-head .actions .btn { flex: 1; min-height: 40px; }

  /* Compact pill buttons on small screens (keep taps comfortable, drop bulk) */
  .btn-pill { height: 44px; padding: 5px 5px 5px 18px; font-size: 13.5px; }
  .btn-pill .pill-ico { width: 34px; height: 34px; }
  .btn-pill .pill-ico svg, .btn-pill .pill-ico .icon { width: 15px; height: 15px; }
  .btn-pill--sm { height: 40px; padding: 4px 4px 4px 16px; font-size: 12.5px; }
  .btn-pill--sm .pill-ico { width: 30px; height: 30px; }
  .btn-pill--sm .pill-ico svg, .btn-pill--sm .pill-ico .icon { width: 14px; height: 14px; }
  .btn-pill--xs { height: 32px; padding: 3px 3px 3px 12px; font-size: 12px; }
  .btn-pill--xs .pill-ico { width: 25px; height: 25px; }

  /* Header: hamburger + switcher must not overlap */
  .shell-header { gap: 8px; overflow: visible; }
  .header-right { min-width: 0; gap: 4px; }
  .ctx-switch { display: none; }
  .header-right .btn-ghost { display: none; }
  .user-chip .nm { display: none; }
  .user-chip .chip-edit { display: none; }
  .shell-header .crumb { font-size: 11.5px; max-width: none; flex: 1; }
  .icon-btn { width: 38px; height: 38px; }

  /* Forms */
  .two-col { grid-template-columns: 1fr; }

  /* Tables */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
  .table-wrap table { min-width: 0; width: 100%; }
  .hide-xs { display: none !important; }

  /* Cards */
  .card { padding: 16px; }
  .card-header { gap: 6px; }

  /* Receipt/rings */
  .rings-wrap { flex-wrap: wrap; justify-content: center; gap: 18px; }
  .receipt-stats { grid-template-columns: repeat(2, 1fr); gap: 10px 20px; }

  /* Row lines (quick actions, etc.) */
  .row-line { flex-wrap: wrap; gap: 8px; }
  .row-line .btn { width: 100%; min-height: 38px; }

  /* KPI values */
  .kpi-value { font-size: 26px; }

  /* Notification rows */
  .row-line .lt { min-width: 0; flex: 1; }

  /* Member fee cards - table content */
  .card .table-wrap table { min-width: 0; }

  /* Settings grid */
  .grid > .card[style*="max-width"] { max-width: 100% !important; }

  /* Fee edit form buttons */
  .card form[style*="max-width"] { max-width: 100%; }

  /* Student detail */
  .grid.grid-2b > .card { overflow: visible; }
}

/* Mobile */
@media (max-width: 520px) {
  .grid-kpi { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .main-content { padding: 16px 12px 52px; gap: 12px; }

  /* KPI */
  .kpi-value { font-size: 22px; }
  .kpi-sub { font-size: 11.5px; }
  .page-head h2 { font-size: 17px; letter-spacing: -.01em; }
  .page-head p { font-size: 12px; }

  /* Cards */
  .card { padding: 14px; border-radius: 14px; }
  .card-icon-tile { width: 28px; height: 28px; border-radius: 8px; }
  .card-title { font-size: 12px; gap: 6px; }

  /* Header - reclaim space on tight phones */
  .shell-header .session-pill { display: none; }
  .shell-header .crumb { max-width: 42vw; }
  .icon-btn { width: 40px; height: 40px; }
  .hamburger { width: 42px; height: 42px; }

  /* Tables - contained scroll (never page-level), compact on mobile */
  table { min-width: 0; width: 100%; font-size: 12px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
  thead th { padding: 6px 8px; font-size: 10px; white-space: nowrap; }
  tbody td { padding: 8px; font-size: 12px; }
  tbody td .cell-sub, tbody td .cell-label { word-wrap: break-word; overflow-wrap: break-word; }
  .hide-sm { display: none !important; }
  .hide-xs { display: none !important; }

  /* Bars chart */
  .bars { height: 110px; gap: 5px; }
  .bar-labels span { font-size: 9px; }

  /* Rings */
  .rings { width: 86px; height: 86px; }
  .rings .ring { border-width: 7px; }
  .rings .ring.two { inset: 8px; border-width: 6px; }
  .rings .ring.three { inset: 16px; border-width: 5px; }
  .ring-center { font-size: 13px; font-weight: 700; }
  .rings-wrap { gap: 14px; }
  .receipt-stats { gap: 8px 16px; }
  .stat-value { font-size: 14px; }

  /* Progress track */
  .progress-track { height: 6px; }

  /* Session pill */
  .session-pill { font-size: 10.5px; padding: 2px 8px; }

  /* Pills */
  .pill { font-size: 10.5px; padding: 2px 8px; }

  /* Auth */
  .auth-box h1 { font-size: 23px; }
  .auth-box .auth-sub { font-size: 13px; margin-bottom: 20px; }
  .auth-brand { font-size: 15.5px; gap: 8px; }
  .auth-brand .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
  .auth-secure { font-size: 11px; }

  /* PWA banner */
  .pwa-banner { flex-direction: column; text-align: center; gap: 10px; padding: 12px 14px; }
  .pwa-banner-text { justify-content: center; }
  .pwa-banner-actions { width: 100%; display: flex; gap: 8px; }
  .pwa-banner-actions .btn { flex: 1; min-height: 40px; }

  /* Forms */
  .field label { font-size: 11.5px; }
  /* 16px input text stops iOS auto-zoom on focus; also fatter touch targets */
  .input, .select, .textarea {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 10px;
  }
  .input-sm { min-height: 38px; font-size: 15px; }
  .input:focus, .select:focus, .textarea:focus { box-shadow: 0 0 0 3px var(--brand-tint); }

  /* Auth forms (higher specificity than the 640px rule): keep 16px to avoid iOS zoom */
  .auth-form .input { font-size: 16px; height: 50px; padding: 0 14px; }

  /* Buttons - ensure touch targets */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; padding: 0 12px; font-size: 12px; }

  /* Empty states */
  .empty { padding: 32px 14px; }
  .empty .icon { width: 28px; height: 28px; }
  .empty h3 { font-size: 14px; }
  .empty p { font-size: 12px; }

  /* Flash */
  .flash { padding: 10px 12px; font-size: 12px; border-radius: 10px; }

  /* Error page */
  .err-card .code { font-size: 48px; }
  .err-card h1 { font-size: 16px; }
  .err-card p { font-size: 12.5px; }

  /* Search input */
  form[style*="max-width:360px"] { max-width: 100% !important; }

  /* Executives/promote form */
  .grid > .card { max-width: 100% !important; }

  /* Receipt page */
  .rcp-hero { padding: 18px 16px; }
  .rcp-hero .big { font-size: 20px; }
  .rcp-body { padding: 18px 16px; }
}

/* Small mobile */
@media (max-width: 380px) {
  .main-content { padding: 12px 10px 48px; gap: 10px; }
  .card { padding: 12px; border-radius: 12px; }
  .page-head h2 { font-size: 16px; }
  .kpi-value { font-size: 20px; }
  .bars { height: 90px; gap: 4px; }
  .bar-labels span { font-size: 8px; }
  .btn { min-height: 42px; font-size: 13px; }
  .btn-sm { min-height: 34px; font-size: 11.5px; }
}

/* Mobile: lift page-head actions into a thumb-reachable bottom action bar */
@media (max-width: 640px) {
  .page-head { margin-bottom: 16px; }
  .page-head > .actions,
  .page-head > form.page-head-action {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 60;
    width: auto;
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: 0 12px 40px -10px rgba(40,38,40,.32);
  }
  .page-head > .actions .btn,
  .page-head > form.page-head-action .btn {
    flex: 1;
    min-height: 44px;
    margin: 0;
  }
  .main-content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .auth-page { padding: 12px; }
  .auth-box { max-width: 360px; }
  .auth-brand { margin-bottom: 4px; }
  .err-page { padding: 12px; }
}

/* App shell on short landscape screens */
@media (max-height: 520px) and (orientation: landscape) {
  .main-content { padding-top: 12px; padding-bottom: max(66px, env(safe-area-inset-bottom)); }
  .sidebar { padding-top: calc(env(safe-area-inset-top) + 8px); }
  .grid-kpi { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .sidebar { transition: none; }
  .pwa-banner { transition: none; }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
  /* Reserved for dark theme */
}

/* Print */
@media print {
  .sidebar, .shell-header, .hamburger, .sidebar-overlay, .pwa-banner, .actions, .btn { display: none !important; }
  .main { width: 100%; }
  .main-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { background: #fff; }
}

/* Shared landing navbar & footer reused on public pages (auth, verify, errors) */
body:not(.lp) .dv-nav {
  position: sticky; top: 0; left: auto; transform: none;
  width: 100%;
  min-height: 62px;
  padding: 0 22px;
  gap: 16px;
  background: rgba(249,246,244,.86);
  border: none; border-bottom: 1px solid var(--border);
  border-radius: 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: none;
}
body:not(.lp) .dv-brand b { color: var(--text); }
body:not(.lp) .dv-brand .dv-mark,
body:not(.lp) .dv-foot-brand .dv-mark {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 6px 16px -6px rgba(47,91,240,.5);
  font-size: 0;
}
body:not(.lp) .dv-brand .dv-mark svg,
body:not(.lp) .dv-foot-brand .dv-mark svg { width: 19px; height: 19px; }
body:not(.lp) .dv-links a { color: var(--subtext); }
body:not(.lp) .dv-links a:hover { color: var(--brand); background: var(--brand-tint); }
body:not(.lp) .dv-btn-pri {
  background: var(--brand);
  box-shadow: 0 10px 24px -8px rgba(47,91,240,.55);
}
body:not(.lp) .dv-btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
body:not(.lp) .dv-btn-ghost:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-tint); }
body:not(.lp) .dv-burger { background: var(--brand-tint); border-color: var(--border-strong); color: var(--text); }
body:not(.lp) .dv-mnav { background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
body:not(.lp) .dv-mnav a:not(.dv-btn) { color: var(--text); }
body:not(.lp) .dv-mnav a:not(.dv-btn):hover { background: var(--brand-tint); color: var(--brand); }
body:not(.lp) .dv-foot { background: var(--card); border-top: 1px solid var(--border); }
body:not(.lp) .dv-foot-brand b { color: var(--text); }
body:not(.lp) .dv-foot p { color: var(--subtext); }
body:not(.lp) .dv-socials a { background: var(--brand-tint); border-color: var(--border); color: var(--subtext); }
body:not(.lp) .dv-socials a:hover { color: var(--brand); border-color: var(--brand); }
body:not(.lp) .dv-fcol h5 { color: var(--text); }
body:not(.lp) .dv-fcol a { color: var(--subtext); }
body:not(.lp) .dv-fcol a:hover { color: var(--brand); }
body:not(.lp) .dv-foot-bottom { color: var(--faint); }
body:not(.lp) .dv-foot-bottom .safe { color: var(--subtext); }

/* ------------------------------------------------------------------
   Role skins: org = indigo pro, member = emerald consumer, platform = violet ops
------------------------------------------------------------------- */
.theme-org { --brand: #2f5bf0; --brand-2: #5c9dff; --info: #2f5bf0; --info-tint: rgba(47,91,240,.09); }

.theme-member {
  --brand: #2f5bf0;
  --brand-2: #5c9dff;
  --brand-tint: rgba(47,91,240,.09);
  --brand-line: rgba(47,91,240,.24);
  --info: #2f5bf0;
  --info-tint: rgba(47,91,240,.09);
  --canvas: #faf8f5;
  --sidebar-bg: #f8f6f3;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 6px rgba(23,82,62,.07);
  --shadow-md: 0 10px 26px rgba(23,82,62,.12);
}
.theme-member .side-item { border-radius: 999px; }
.theme-member .side-item.active { border-radius: 999px; }
.theme-member .page-head h2 { font-size: 24px; }

.theme-platform {
  --brand: #2f5bf0;
  --brand-2: #5c9dff;
  --brand-tint: rgba(47,91,240,.09);
  --brand-line: rgba(47,91,240,.24);
  --info: #2f5bf0;
  --info-tint: rgba(47,91,240,.09);
  --canvas: #f4f4f6;
  --sidebar-bg: #ffffff;
  --border: #e3e2e8;
  --border-strong: #c9c6d6;
  --text: #14121f;
  --subtext: #5c5a6b;
  --faint: #9c9aac;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 0 rgba(20,18,31,.04);
  --shadow-md: 0 1px 2px rgba(20,18,31,.06), 0 10px 26px -20px rgba(20,18,31,.3);
  --shadow-lg: 0 30px 70px -26px rgba(20,18,31,.3);
}
.theme-platform .sidebar { border-right: 1px solid var(--border); background: var(--sidebar-bg); }
.theme-platform .sidebar .brand span { color: var(--text); }
.theme-platform .sidebar .brand .logo-mark { box-shadow: none; }
.theme-platform .side-label { color: #a09db3; }
.theme-platform .side-item { color: #5c5a6b; }
.theme-platform .side-item .icon { color: #a09db3; }
.theme-platform .side-item:hover { background: rgba(20,18,31,.05); color: var(--text); }
.theme-platform .side-item.active {
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 650;
  box-shadow: none;
}
.theme-platform .side-item.active .icon { color: var(--brand); }
.theme-platform .side-count { background: var(--brand); }
.theme-platform .workspace { background: #fff; border-color: var(--border); }
.theme-platform .workspace-text strong { color: var(--text); }
.theme-platform .workspace-text span { color: var(--faint); }
.theme-platform .workspace-icon span { border-color: #fff; }
.theme-platform .side-bottom { border-top-color: var(--border); }
.theme-platform .shell-header {
  height: 60px;
  padding: 0 22px;
  background: #ffffff;
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
}
.theme-platform .shell-header .crumb { font-size: 13.5px; font-weight: 600; color: var(--subtext); }
.theme-platform .crumb b { color: var(--text); font-weight: 700; }
.theme-platform .icon-btn { width: 36px; height: 36px; border-radius: 10px; }
.theme-platform .icon-btn:hover { background: #e8eefc; color: var(--brand); }
.theme-platform .user-avatar { background: var(--brand); }
.theme-platform .user-chip { padding: 4px 10px 4px 4px; }
.theme-platform .user-chip:hover { background: #eef1f6; }
.theme-platform .card {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.theme-platform .card:hover { box-shadow: var(--shadow-md); }
.theme-platform .card-header { margin-bottom: 12px; }
.theme-platform .card-title {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--subtext); font-weight: 700;
}
.theme-platform .card-icon-tile { width: 30px; height: 30px; border-radius: 9px; }
.theme-platform .kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -.04em; }
.theme-platform .kpi-sub { font-size: 12px; }
.theme-platform .page-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -.025em; }
.theme-platform .page-head p { font-size: 12.5px; color: var(--subtext); font-weight: 500; }
.theme-platform .bar.blue { background: linear-gradient(180deg, var(--brand-2), var(--brand)); box-shadow: none; }
.theme-platform .progress-fill { background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.theme-platform .session-pill { background: var(--brand-tint); color: var(--subtext); border: 1px solid var(--border); }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--canvas);
  font-size: 11px; color: var(--subtext); font-weight: 600; font-family: var(--font-l);
  white-space: nowrap; flex-shrink: 0;
}
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16,147,86,.15);
}

/* Workspace switcher (shared app shell) */
.ctx-switch { position: relative; flex-shrink: 0; }
.ctx-switch-btn {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 190px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--text);
  font-family: var(--font-l); font-size: 12.5px; font-weight: 700;
  cursor: pointer;
}
.ctx-switch-btn svg { flex-shrink: 0; }
.ctx-now {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ctx-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 248px; max-width: 320px;
  padding: 6px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow-lg);
  display: none; z-index: 120;
}
.ctx-switch.open .ctx-menu { display: block; }
.ctx-item, .side-ctx-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 9px; border-radius: 8px;
  text-decoration: none; color: var(--text);
}
.ctx-item:hover, .side-ctx-item:hover { background: #f0efee; }
.ctx-item.active, .side-ctx-item.active { background: var(--brand-tint); }
.ctx-ico {
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand);
}
.ctx-meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ctx-meta strong { font-size: 12.5px; color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-meta small { font-size: 11px; color: var(--subtext); font-weight: 500; }
.ctx-check {
  margin-left: auto; flex: none; color: var(--brand);
  display: inline-flex; align-items: center;
}
.side-ctx {
  padding: 6px 10px 4px;
}
.side-ctx-head {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--subtext); font-weight: 700; padding: 6px 9px;
}
.side-ctx-item { padding: 7px 9px; }

/* ------------------------------------------------------------------
   Help & Support center: hero + tickets + FAQ
------------------------------------------------------------------ */
.support-hero {
  position: relative; border-radius: 18px; overflow: hidden;
  margin-bottom: 24px;
}
.support-hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 55%, #1b3cb8 100%);
  opacity: 0.95;
}
.support-hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 95% 10%, rgba(255,255,255,.12) 0%, transparent 50%),
    radial-gradient(circle at 5% 90%, rgba(255,255,255,.08) 0%, transparent 50%);
}
.support-hero-body {
  position: relative; z-index: 1;
  padding: 36px 32px 32px;
  color: #fff;
}
.support-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.support-hero-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.13); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px; padding: 6px 14px;
  font-size: 12.5px; font-weight: 500; color: #fff;
  white-space: nowrap;
}
.support-hero-pill .icon { width: 14px; height: 14px; stroke: #fff; opacity: 0.8; }
.support-hero-pill strong { font-weight: 700; }
.support-hero-pill--soft { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.09); }
.support-hero-body h2 {
  margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  color: #fff; line-height: 1.25;
}
.support-hero-body > p {
  margin: 8px 0 0; font-size: 14px; line-height: 1.6;
  color: rgba(255,255,255,.82); max-width: 540px;
}
.support-hero-actions {
  display: flex; align-items: center; gap: 14px;
  margin-top: 20px; flex-wrap: wrap;
}
.support-hero-actions .btn-pill { background: #fff; color: var(--brand); }
.support-hero-actions .btn-pill .pill-ico { background: var(--brand-tint); color: var(--brand); }
.support-hero-actions .btn-pill:hover { opacity: 0.92; }
.support-contact-hero {
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,.85); font-size: 13px; font-weight: 600;
  text-decoration: none; padding: 6px 0;
}
.support-contact-hero .icon { stroke: rgba(255,255,255,.6); }
.support-contact-hero:hover { color: #fff; }
.support-contact-hero:hover .icon { stroke: #fff; }

/* Layout */
.support-wrap { max-width: 880px; margin: 0 auto; }
.support-main { display: flex; flex-direction: column; gap: 28px; }

/* Section heads */
.support-section-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.support-section-head h3 {
  margin: 0; font-size: 17px; font-weight: 750; display: flex; align-items: center; gap: 8px;
}
.support-section-head .actions { padding-top: 2px; }
.count-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--brand-tint); color: var(--brand);
}

/* ---- Ticket rows ---- */
.ticket-list { display: flex; flex-direction: column; gap: 1px; border-radius: 14px; overflow: hidden; background: var(--border); }
.ticket-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: var(--card); cursor: pointer;
  text-decoration: none; color: inherit; transition: background .15s;
}
.ticket-row:hover { background: var(--brand-tint); }
.ticket-row:hover .ticket-subject { color: var(--brand); }
.ticket-avatar {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
}
.ticket-avatar .icon { width: 18px; height: 18px; }
.ticket-avatar.is-done { background: linear-gradient(135deg, #34c06b, #0a7a4a); }
.ticket-main { flex: 1; min-width: 0; }
.ticket-subject { display: block; font-size: 14px; font-weight: 650; color: var(--text); transition: color .15s; }
.ticket-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0;
  font-size: 12.5px; color: var(--subtext); margin-top: 2px;
}
.ticket-meta .mono { margin-right: 4px; }
.ticket-meta .dot { margin: 0 5px; color: var(--faint); }
.ticket-side {
  flex: none; display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  text-transform: capitalize; white-space: nowrap;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.status-open   { background: rgba(255,176,49,.1);  color: #8a5d11; } .status-open   .status-dot { background: #e09f0f; }
.status-pending { background: rgba(47,91,240,.09); color: #1b3cb8; } .status-pending .status-dot { background: var(--brand); }
.status-resolved { background: rgba(16,155,112,.1); color: #0a6e47; } .status-resolved .status-dot { background: #10a870; }
.status-closed { background: var(--brand-tint); color: var(--subtext); } .status-closed .status-dot { background: var(--faint); }
.ticket-arrow {
  display: flex; align-items: center;
  color: var(--faint); transition: color .15s, transform .15s;
}
.ticket-row:hover .ticket-arrow { color: var(--brand); transform: translateX(2px); }

/* ---- FAQ ---- */
.support-tools .faq-search {
  position: relative; display: flex; align-items: center; margin-bottom: 18px;
}
.support-tools .faq-search .icon { position: absolute; left: 13px; color: var(--faint); pointer-events: none; }
.support-tools .faq-search .input { padding-left: 38px; }
.faq-search-count {
  position: absolute; right: 14px; font-size: 11.5px; font-weight: 600; color: var(--faint);
  pointer-events: none;
}
.faq-card {
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--card); overflow: hidden;
}
.faq-group {
  padding: 4px 22px 8px;
  border-top: 1px solid var(--border);
}
.faq-group:first-child { border-top: 0; }
.faq-group-label {
  margin: 0; padding: 16px 2px 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--faint);
}
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 12px 2px; font-size: 13.5px; font-weight: 600; color: var(--text);
  font-family: inherit; line-height: 1.5;
}
.faq-q span { flex: 1; }
.faq-q .icon {
  color: var(--faint); transition: transform .18s ease; flex: none;
  margin-top: 1px; width: 16px; height: 16px;
}
.faq-q.open .icon { transform: rotate(180deg); color: var(--brand); }
.faq-q:hover { color: var(--brand); }
.faq-q:hover .icon { color: var(--brand); }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .22s ease;
}
.faq-q.open + .faq-a { max-height: 600px; }
.faq-a p {
  margin: 0; padding: 0 2px 14px;
  font-size: 13px; line-height: 1.7; color: var(--subtext);
}
.faq-empty { padding: 18px 4px; color: var(--subtext); text-align: center; }

@media (max-width: 860px) {
  .support-hero-body { padding: 28px 20px 24px; }
  .support-hero-body h2 { font-size: 22px; }
  .ticket-side .pill { display: none; }
  .faq-group { padding: 4px 16px 8px; }
}
@media (max-width: 480px) {
  .support-hero-body h2 { font-size: 20px; }
  .support-hero-pill { font-size: 11.5px; padding: 5px 11px; }
  .ticket-avatar { width: 34px; height: 34px; }
  .ticket-row { padding: 12px; gap: 10px; }
}
