/* =====================================================================
   TEAM HERETICS — MARKETING HUB
   Design system: black & gold, minimal, clean functional accents.
   Hand-written CSS (no framework). Fonts via Google Fonts w/ fallbacks.
   ===================================================================== */


/* Ensure [hidden] always wins regardless of display rules in component CSS */
[hidden] { display: none !important; }

/* ----------------------------- TOKENS ------------------------------ */
/* Identidad D (sept 2026): negro cálido, tipografía del sistema, sin acento de marca.
   El color lo ponen los juegos (--val, --lol, --cod…); el "acento" de la UI es blanco cálido.
   Los nombres --gold* se mantienen por compatibilidad: hoy significan "acento de UI". */
:root {
  /* Type families */
  --f-body:    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --f-display: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  --f-serif:   'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --f-mono:    ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --font-body: var(--f-body); --font-mono: var(--f-mono); --font-primary: var(--f-display);

  /* Canvas / surfaces — warm near-black */
  --bg:        #0a0a09;
  --bg-2:      #0d0d0c;
  --panel:     #11100f;
  --card:      #171614;
  --card-2:    #1b1a17;
  --elevated:  #201f1c;
  --hover:     #262420;

  /* Hairlines */
  --line:      rgba(255,245,230,.07);
  --line-2:    rgba(255,245,230,.10);
  --line-strong: rgba(255,245,230,.16);

  /* UI accent (historically "gold") — warm white */
  --gold:      #f4f1ec;
  --gold-soft: #ffffff;
  --gold-deep: #cfc9c0;
  --gold-ink:  #f4f1ec;
  --gold-glow: transparent;
  --on-accent: #0a0a09;

  /* Text — all tiers ≥4.5:1 on --card */
  --ink:       #f4f1ec;
  --ink-2:     #bdb7ae;
  --ink-3:     #a39d95;
  --ink-4:     #8c867e;

  /* Game identity — the Hub's main colour language (differ in lightness, not only hue) */
  --val:       #f0885e;
  --lol:       #5b8def;
  --cod:       #c8ea74;
  --val-bg:    rgba(240,136,94,.14);
  --lol-bg:    rgba(91,141,239,.16);
  --cod-bg:    rgba(200,234,116,.12);
  --val-glow:  rgba(240,136,94,.22);
  --lol-glow:  rgba(91,141,239,.22);
  --cod-glow:  rgba(200,234,116,.20);

  /* Functional accents — status, data series and secondary games */
  --teal:      #54cdbf;
  --emerald:   #5bbf8a;
  --violet:    #9b8ce8;
  --rose:      #e0808f;
  --sky:       #7da7f0;
  --amber:     #e8a15c;
  --crimson:   #d14343;

  --teal-bg:    rgba(84,205,191,.12);
  --emerald-bg: rgba(91,191,138,.12);
  --violet-bg:  rgba(155,140,232,.12);
  --rose-bg:    rgba(224,128,143,.12);
  --gold-bg:    rgba(244,241,236,.07);
  --sky-bg:     rgba(125,167,240,.12);
  --amber-bg:   rgba(232,161,92,.12);
  --crimson-bg: rgba(209,67,67,.12);
  --rose-glow:    rgba(224,128,143,.22);
  --sky-glow:     rgba(125,167,240,.22);
  --violet-glow:  rgba(155,140,232,.22);
  --teal-glow:    rgba(84,205,191,.22);
  --emerald-glow: rgba(91,191,138,.22);
  --amber-glow:   rgba(232,161,92,.22);
  --crimson-glow: rgba(209,67,67,.22);

  --indigo:      #7b8ce8;
  --orange:      #e89b5c;
  --purple:      #c47dd4;
  --slate:       #8098b0;
  --lime:        #8ecc5c;
  --indigo-bg:   rgba(123,140,232,.12);
  --orange-bg:   rgba(232,155,92,.12);
  --purple-bg:   rgba(196,125,212,.12);
  --slate-bg:    rgba(128,152,176,.12);
  --lime-bg:     rgba(142,204,92,.12);
  --indigo-glow: rgba(123,140,232,.22);
  --orange-glow: rgba(232,155,92,.22);
  --purple-glow: rgba(196,125,212,.22);
  --slate-glow:  rgba(128,152,176,.22);
  --lime-glow:   rgba(142,204,92,.22);

  /* Radii — a notch tighter */
  --r-xs: 6px;
  --r-sm: 9px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --pill: 999px;

  /* Elevation — borders do the work; no glows */
  --shadow:    0 1px 2px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.45);
  --glow:      none;

  /* Layout */
  --sidebar: 236px;
  --topbar:  60px;

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);

  /* Social channel colours */
  --ch-tiktok: #58cee0;
  --ch-ig:     #d97b5a;
  --ch-twitch: #c4aaff;
  --ch-x:      #8f8fa0;
  --ch-yt:     #e85555;

  /* Type scale — fixed rem ramp (~1.12 ratio), respects user font settings */
  --text-3xs: 0.625rem;   /* 10 */
  --text-2xs: 0.6875rem;  /* 11 */
  --text-xs:  0.75rem;    /* 12 */
  --text-sm:  0.8125rem;  /* 13 */
  --text-base:0.875rem;   /* 14 · body */
  --text-md:  0.9375rem;  /* 15 */
  --text-lg:  1rem;       /* 16 */
  --text-xl:  1.125rem;   /* 18 */
  --text-2xl: 1.25rem;    /* 20 */
  --text-3xl: 1.5rem;     /* 24 */
  --text-4xl: 1.75rem;    /* 28 */
  --text-5xl: 2.125rem;   /* 34 */
  --lh-tight: 1.15; --lh-snug: 1.35; --lh-body: 1.55;
}

/* ----------------------------- RESET ------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%;
  font-kerning: normal; font-optical-sizing: auto; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--text-base);
  line-height: 1.5;
  letter-spacing: -0.005em;
  min-height: 100vh;
  overflow: hidden; /* app shell handles scroll */
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul { list-style: none; }
img, svg { display: block; }
/* SVG sprite icons: the sprite's wrapping <g fill/stroke> does NOT carry into the
   <use> shadow tree, so stroke/fill must be declared on the <use> instances or they
   fall back to the SVG default (fill:black, stroke:none) and render as black blobs. */
use[href^="#i-"] { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
use[href^="#b-"] { fill: currentColor; stroke: none; }
::selection { background: var(--gold); color: #1a1206; }

/* Keyboard focus — clear gold ring for keyboard users, suppressed for pointer */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.post:focus-visible, .swatch:focus-visible, .match-row:focus-visible, .match-card:focus-visible,
.card.hoverable:focus-visible, .kit-row:focus-visible { outline-offset: 3px; }

/* Skip to content link (screen-reader and keyboard accessibility) */
.skip-link {
  position: absolute; top: -100%; left: 0; z-index: 200;
  padding: 8px 16px; background: var(--gold); color: #1a1206;
  font-weight: 600; font-size: 14px;
}
.skip-link:focus { top: 0; }

/* inline text button (looks like a link, behaves like a button) */
.linklike { display: inline; background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #26262e; border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #34343e; background-clip: padding-box; }

/* Ambient background glow */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(900px 520px at 14% -10%, rgba(244,241,236,.08), transparent 60%);
  background-size: 100% 100%;
}

/* ------------------------- TYPOGRAPHY ------------------------------ */
/* default size for inline helper icons; component rules (.chip svg, .btn svg…) override via higher specificity */
.gico { width: 15px; height: 15px; flex: none; stroke-width: 1.9; }
.cal-ev .gico { width: 13px; height: 13px; }

.font-display { font-family: var(--f-display); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
h1,h2,h3,h4 { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.01em; line-height: var(--lh-tight); text-wrap: balance; }
/* align display + data numerals so animated counters and tables don't reflow */
.kpi .num, .metric .num, .pw-stat .v, .delta, .cd-box .v, .cd2-seg b, .hb-cd .b .v,
.cell-main .ms, .tbl td.mono, .countdown .v { font-variant-numeric: tabular-nums; }
.eyebrow {
  font-family: var(--f-display);
  font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0; 
  color: var(--ink-3);
}

/* ============================ APP SHELL ============================ */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; }

/* --------------------------- SIDEBAR ------------------------------- */
.sidebar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  position: relative; z-index: 40;
  will-change: transform;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 4px; }
.brand-mark {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: radial-gradient(120% 120% at 30% 20%, #20201a, #0e0e0c);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text .name { font-family: var(--f-display); font-weight: 700; font-size: 14.5px; letter-spacing: .02em; }
.brand-text .sub { font-size: var(--text-3xs); color: var(--ink-3); letter-spacing: .04em; }

.nav-sec { margin-top: 22px; position: relative; z-index: 1; }
.nav-label { font-size: var(--text-3xs); letter-spacing: 0;  color: var(--ink-4); padding: 0 10px 8px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; position: relative; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
  transition: color .2s var(--ease), background .2s var(--ease);
  z-index: 1;
}
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.9; flex: none; transition: color .2s, transform .25s var(--ease); }
.nav-item .nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  background: var(--gold-bg); color: var(--gold-ink);
  padding: 1px 7px; border-radius: var(--pill); font-family: var(--f-mono);
}
.nav-item:hover { color: var(--ink); background: rgba(255,255,255,.03); }
.nav-item.active { color: var(--gold-ink); }
.nav-item.active svg { color: var(--gold-ink); }
/* sliding active indicator */
.nav-pill {
  position: absolute; left: 0; width: 100%; height: 38px; z-index: 0;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--gold-bg), rgba(244,241,236,.03));
  border: 1px solid rgba(244,241,236,.22);
  box-shadow: inset 0 0 0 1px rgba(244,241,236,.04);
  transition: transform .42s var(--ease-out), left .42s var(--ease-out), width .42s var(--ease-out), height .42s var(--ease-out), opacity .3s;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.nav-pill::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 99px; background: var(--gold); box-shadow: 0 0 12px var(--gold);
}

.side-foot { margin-top: auto; padding-top: 14px; }

/* collapse toggle */
.collapse-btn {
  margin-left: auto; width: 28px; height: 28px; flex: none; border-radius: 8px;
  display: grid; place-items: center; color: var(--ink-3);
  border: 1px solid var(--line); background: var(--card); transition: all .2s var(--ease);
}
.collapse-btn svg { width: 15px; height: 15px; }
.collapse-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--hover); }

/* Discord-style team presence */
.team-presence { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 10px 11px; margin-bottom: 10px; }
.tp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tp-title { font-family: var(--f-display); font-size: 11px; font-weight: 600; letter-spacing: 0;  color: var(--ink-4); }
.tp-count { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.tp-member { display: flex; align-items: center; gap: 9px; padding: 5px 3px; border-radius: 8px; transition: background .15s; cursor: pointer; }
.tp-member:hover { background: rgba(255,255,255,.03); }
.tp-av { position: relative; flex: none; }
.tp-status { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--card); }
.tp-status.online { background: var(--emerald); } .tp-status.idle { background: var(--gold); } .tp-status.dnd { background: var(--rose); } .tp-status.offline { background: #4a4a4a; }
.tp-member .nm { font-size: 12.5px; font-weight: 500; line-height: 1.1; }
.tp-member .act { font-size: 11px; color: var(--ink-3); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-member .act.live { color: var(--emerald); }

.profile { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); transition: background .2s; }
.profile:hover { background: rgba(255,255,255,.03); }

/* ---- collapsed sidebar ---- */
.app { transition: grid-template-columns .32s var(--ease); }
body.sidebar-collapsed { --sidebar: 76px; }
.sidebar { overflow: hidden; }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .collapse-hide,
body.sidebar-collapsed .profile > div:not(.avatar),
body.sidebar-collapsed .profile > svg { display: none; }
body.sidebar-collapsed .brand { flex-direction: column; gap: 12px; }
body.sidebar-collapsed .collapse-btn { margin-left: 0; }
body.sidebar-collapsed .nav-item { justify-content: center; font-size: 0; padding: 9px 0; gap: 0; }
body.sidebar-collapsed .nav-item svg { font-size: 0; }
body.sidebar-collapsed .profile { justify-content: center; }
body.sidebar-collapsed .nav-pill::before { left: 4px; }
/* collapsed nav tooltips (to the right) */
body.sidebar-collapsed .nav-item { position: relative; }
body.sidebar-collapsed .nav-item::after {
  content: attr(data-label); position: absolute; left: calc(100% + 6px); top: 50%;
  transform: translateY(-50%) translateX(-4px); background: var(--elevated); color: var(--ink);
  border: 1px solid var(--line-2); padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 500;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
  box-shadow: var(--shadow); z-index: 60;
}
body.sidebar-collapsed .nav-item:hover::after, body.sidebar-collapsed .nav-item:focus-visible::after { opacity: 1; transform: translateY(-50%); }

/* avatar */
.avatar {
  position: relative;
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 600;
  font-size: 12.5px; color: #0c0c0f; letter-spacing: .02em;
}
.profile-status-dot {
  position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--bg-2); background: var(--emerald);
}

/* Profile popup — status row (used in modal) */
.pp-status-row { display: flex; gap: 4px; padding: 6px 10px 8px; flex-wrap: wrap; }
.pp-status-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 6px;
  border: 1px solid transparent; background: none;
  font: inherit; font-size: 12px; color: var(--ink-3);
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.pp-status-btn:hover { background: var(--hover); color: var(--ink-2); }
.pp-status-btn.active { background: var(--elevated); border-color: var(--gold); color: var(--ink); }
.pp-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }

/* Profile popup — Discord-style status trigger */
.pp-status-area { padding: 4px 6px 2px; }
.pp-status-trigger {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px; border-radius: 7px;
  background: none; border: none; font: inherit;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: background .12s, color .12s; text-align: left;
}
.pp-status-trigger:hover,
.pp-status-open .pp-status-trigger { background: var(--hover); color: var(--ink); }
.pp-st-label { flex: 1; font-weight: 500; }

/* Profile popup — collapsible status dropdown */
.pp-status-opts {
  max-height: 0; overflow: hidden;
  transition: max-height .22s var(--ease-out);
  border-radius: 0 0 6px 6px;
}
.pp-status-open .pp-status-opts { max-height: 240px; }
.pp-status-chev { transition: transform .15s var(--ease-out); }
.pp-status-open .pp-status-chev { transform: rotate(180deg); }

/* Status option rows */
.pp-so-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 7px 14px; border: none;
  background: none; font: inherit; color: var(--ink-3);
  cursor: pointer; transition: background .12s, color .12s; text-align: left;
}
.pp-so-btn:hover { background: var(--hover); color: var(--ink); }
.pp-so-btn.pp-status-active { color: var(--ink); }
.pp-so-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pp-so-text { display: flex; flex-direction: column; gap: 1px; }
.pp-so-label { font-size: 12.5px; font-weight: 500; }
.pp-so-sub { font-size: 11px; color: var(--ink-4); line-height: 1.3; }
.pp-so-btn.pp-status-active .pp-so-dot { box-shadow: 0 0 0 2px var(--gold); }

/* Profile popup — mini theme toggle switch */
.pp-theme-switch {
  margin-left: auto; width: 28px; height: 16px; border-radius: 8px;
  background: var(--line-strong); position: relative; flex: none;
  transition: background .2s;
}
.pp-theme-switch::after {
  content: ''; position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink-4); top: 2px; left: 2px; transition: transform .2s, background .2s;
}
.pp-theme-switch.light { background: var(--gold); }
.pp-theme-switch.light::after { transform: translateX(12px); background: #1a1206; }

/* ── Profile popup slim (v79) ─────────────────────────────────────── */

.pp-identity { display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 10px; }
.pp-id-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pp-id-name { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-id-role { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-id-email { font-size: 10.5px; font-family: var(--f-mono); color: var(--ink-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* Keyboard shortcut badge inline in menu */
.pp-kbd { margin-left: auto; font-family: var(--f-mono); font-size: 10px; color: var(--ink-4); background: var(--elevated); border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 5px; line-height: 1.5; pointer-events: none; }

/* Popup footer: version + sync */
.pp-footer { display: flex; align-items: center; justify-content: space-between; padding: 7px 14px 8px; border-top: 1px solid var(--line); margin-top: 2px; }
.pp-version { font-size: 10.5px; font-family: var(--f-mono); color: var(--ink-4); }
.pp-sync { font-size: 11px; color: var(--ink-4); display: flex; align-items: center; gap: 4px; }
.pp-sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); flex: none; }

/* Profile modal avatar swatch */
.av-swatch {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; flex: none;
  border: 2px solid transparent; transition: transform .12s, border-color .12s;
}
.av-swatch:hover { transform: scale(1.15); }
.av-swatch.selected { border-color: var(--gold); }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

/* --------------------------- MAIN -------------------------------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; position: relative; }
/* Scroll-hint gradient — fades out once user scrolls past 80px */
.main::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 56px;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  pointer-events: none; z-index: 5;
  opacity: 1; transition: opacity .3s;
}
.main.scrolled::after { opacity: 0; }

.topbar {
  height: var(--topbar); flex: none;
  display: flex; align-items: center; gap: 16px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,8,10,.72); backdrop-filter: blur(14px);
  position: relative; z-index: 30;
}
.topbar .titles { min-width: 0; }
.topbar h1 { font-size: 18px; }
.topbar .crumb { font-size: var(--text-2xs); color: var(--ink-3); display: flex; align-items: center; gap: 6px; margin-bottom: 1px; }
.topbar .crumb b { color: var(--gold-ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--card);
  transition: all .2s var(--ease); position: relative; touch-action: manipulation;
}
.icon-btn svg { width: 18px; height: 18px; stroke-width: 1.9; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--hover); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--card); }
.icon-btn .bell-count { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--gold); color: #0c0c0f; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--card); }

/* topbar clock */
.topbar-hud { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; flex: none;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .05em; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); }
.topbar-hud b { color: var(--ink-2); font-weight: 600; }

.searchbar {
  display: flex; align-items: center; gap: 9px; width: 260px;
  padding: 0 12px; height: 38px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card); color: var(--ink-3);
  transition: all .2s; cursor: text;
}
.searchbar:hover { border-color: var(--line-2); }
.searchbar svg { width: 16px; height: 16px; }
.searchbar kbd {
  margin-left: auto; font-family: var(--f-mono); font-size: 10.5px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 5px;
  padding: 1px 6px; color: var(--ink-3);
}

.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.view { display: none; padding: 26px 26px 60px; max-width: 1320px; margin: 0 auto; }
.view.active { display: block; }

/* ----------------------------- BUTTONS ----------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 13px; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  transition: all .2s var(--ease); position: relative; overflow: hidden; touch-action: manipulation;
}
.btn svg { width: 16px; height: 16px; stroke-width: 2; }
.btn:hover { background: var(--hover); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; }
.btn.sm.icon-only { width: 32px; padding: 0; }
.btn.gold {
  color: #1a1206; border: none;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 18px rgba(244,241,236,.22);
  font-weight: 600;
}
.btn.gold:hover { box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 8px 26px rgba(244,241,236,.34); }
/* sheen */
.btn.gold::after {
  content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-18deg); transition: left .6s var(--ease);
}
.btn.gold:hover::after { left: 130%; }

/* ----------------------------- CARDS ------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); position: relative;
}
.card.pad { padding: 18px; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-h h3 { font-size: 14.5px; }
.card-h .sub { font-size: var(--text-xs); color: var(--ink-3); text-wrap: pretty; }
.card-h .spacer { flex: 1; }

.hoverable { transition: transform .28s var(--ease), border-color .28s, box-shadow .28s, background .28s; cursor: pointer; }
.hoverable:hover { transform: translateY(-3px); border-color: rgba(244,241,236,.28); box-shadow: var(--shadow), 0 0 0 1px rgba(244,241,236,.08); }

/* Grids */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, 1fr); }
.cols-3-1 { grid-template-columns: 2fr 1fr; align-items: start; }
.cols-2 { grid-template-columns: 1fr 1fr; }

/* KPI card */
.kpi { padding: 16px 17px; }
.kpi .top { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.kpi .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.kpi .ico svg { width: 16px; height: 16px; stroke-width: 2; }
.kpi .label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.kpi .num { font-family: var(--f-display); font-weight: 600; font-size: 27px; letter-spacing: -0.01em; line-height: 1; }
.kpi .num small { font-size: 15px; color: var(--ink-3); font-weight: 500; }
.kpi .foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.kpi .spark { margin-left: auto; }

.delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--f-mono); font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: var(--pill); }
.delta svg { width: 12px; height: 12px; stroke-width: 2.4; }
.delta.up { color: var(--emerald); background: var(--emerald-bg); }
.delta.down { color: var(--rose); background: var(--rose-bg); }
.delta.flat { color: var(--ink-3); background: rgba(255,255,255,.05); }

/* Chips / badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: var(--pill);
  font-size: 12px; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--card-2);
  transition: all .18s var(--ease); white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; }
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip.active { color: var(--gold-ink); border-color: rgba(244,241,236,.4); background: var(--gold-bg); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: var(--r-xs);
  letter-spacing: .01em;
}
.badge .d { width: 6px; height: 6px; border-radius: 50%; }
.tag { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.05); color: var(--ink-2); border: 1px solid var(--line); }

/* ── Tools view ─────────────────────────────────────── */
.lk-search-wrap {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card);
  min-width: 220px; max-width: 320px;
}
.lk-search-wrap svg { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.lk-search-wrap input { flex: 1; border: none; background: transparent; color: var(--ink); font-size: 13px; outline: none; }
.lk-search-wrap input::placeholder { color: var(--ink-4); }

/* ── Tools list ─────────────────────────────────────────────────── */
.links-grid {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}

.tool-card {
  display: flex; align-items: center; gap: 0;
  border-bottom: 1px solid var(--line); background: var(--card);
  transition: background .12s var(--ease); min-height: 46px;
  /* keep existing custom prop for drag indicators */
}
.tool-card:last-child { border-bottom: none; }
.tool-card:hover { background: var(--hover); border-color: var(--line); }

.tool-card-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; flex: 0 0 300px; min-width: 0;
  border-bottom: none;
}
.tool-ico {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.tool-favicon { width: 16px; height: 16px; object-fit: contain; }
.tool-ico-init {
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.tool-name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0;
}
.tool-hd-acts {
  display: flex; gap: 3px; opacity: 0; transition: opacity .15s; margin-left: auto;
}
.tool-card:hover .tool-hd-acts { opacity: 1; }

/* Shortcut pills — inline, after the name column */
.tool-shortcuts {
  flex: 1; display: flex; align-items: center;
  flex-wrap: wrap; gap: 4px; padding: 0 8px;
}
.tool-shortcut {
  display: flex; align-items: center; gap: 0;
  height: 26px; border-radius: var(--r-sm);
  background: var(--elevated); transition: background .12s;
}
.tool-shortcut:hover { background: var(--hover); }
.shortcut-link {
  display: flex; align-items: center; gap: 6px;
  color: var(--ink-2); text-decoration: none; font-size: 12px; font-weight: 500;
  padding: 0 8px; height: 100%;
}
.shortcut-link:hover { color: var(--ink); }
.shortcut-link > svg { width: 9px; height: 9px; flex: none; color: var(--ink-4); }
.shortcut-label { white-space: nowrap; }
.shortcut-acts {
  display: flex; gap: 0; opacity: 0; transition: opacity .12s;
}
.tool-shortcut:hover .shortcut-acts { opacity: 1; }
.shortcut-act {
  width: 22px; height: 22px; border-radius: 5px; border: none;
  background: transparent; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .12s;
}
.shortcut-act:hover { background: var(--elevated); color: var(--ink); }
.shortcut-act.del:hover { color: var(--rose); background: var(--rose-bg); }

/* Add shortcut — trailing action, visible on row hover */
.tool-add-sc {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; margin-right: 6px; border-radius: var(--r-sm);
  border: 1px dashed var(--line-2); background: transparent;
  color: var(--ink-4); font-size: 11.5px; font-weight: 500;
  cursor: pointer; transition: all .15s; white-space: nowrap;
  opacity: 0;
}
.tool-card:hover .tool-add-sc { opacity: 1; }
.tool-add-sc:hover { color: var(--ink-2); border-color: var(--line-strong); background: var(--elevated); }
.tool-add-sc svg { width: 12px; height: 12px; }

/* Shared small action btn used in card headers */
.lk-act {
  width: 24px; height: 24px; border-radius: var(--r-xs);
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink-3); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
}
.lk-act:hover { background: var(--hover); color: var(--ink); border-color: var(--line-2); }
.lk-act.lk-del:hover { color: var(--rose); border-color: var(--rose-bg); background: var(--rose-bg); }

.lk-empty {
  grid-column: 1/-1; display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 60px; color: var(--ink-3); font-size: 13px;
}

/* Drag grips */
.drag-grip {
  display: flex; align-items: center; padding: 0 5px;
  cursor: grab; color: var(--ink-4); opacity: 0;
  transition: opacity .12s; flex-shrink: 0;
}
.drag-grip:active { cursor: grabbing; }
.grip-ico { display: block; }
.tool-shortcut:hover .drag-grip { opacity: 1; }
.tool-card:hover .card-grip { opacity: 1; }

/* Drag active states */
.tool-shortcut.dragging { opacity: 0.35; }
.tool-card.dragging { opacity: 0.4; }

/* Drop indicators — adjusted for list orientation */
.tool-shortcut[data-drop="before"] { box-shadow: 0 -2px 0 0 var(--gold); }
.tool-shortcut[data-drop="after"]  { box-shadow: 0  2px 0 0 var(--gold); }
.tool-card[data-drop="before"] { box-shadow: 0 -2px 0 0 var(--gold); }
.tool-card[data-drop="after"]  { box-shadow: 0  2px 0 0 var(--gold); }

/* Hide card grip when search/filter is active */
.filtering .card-grip { display: none; }

/* Color dot for tool shortcuts — inherits --lk-color from parent .tool-card */
.sc-dot {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--lk-color, var(--ink-4)); opacity: .55;
}

/* Quick links strip */
.qlinks { display: flex; flex-wrap: wrap; gap: 8px; }
.qlink {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 16px; border-radius: var(--r-sm);
  border: 1px solid color-mix(in srgb, var(--qlink-c, var(--line)) 30%, var(--line));
  background: color-mix(in srgb, var(--qlink-c, transparent) 6%, transparent);
  color: var(--ink-2); text-decoration: none;
  font-size: 11px; font-weight: 500; letter-spacing: .01em;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
  cursor: pointer;
}
.qlink img { width: 20px; height: 20px; display: block; object-fit: contain; }
.qlink svg { width: 20px; height: 20px; display: block; }
.qlink:hover {
  background: color-mix(in srgb, var(--qlink-c, var(--gold)) 12%, var(--hover));
  border-color: color-mix(in srgb, var(--qlink-c, var(--gold)) 45%, var(--line));
  color: var(--ink); transform: translateY(-1px);
}
.qlink-add { border-style: dashed; color: var(--ink-3); border-color: var(--line); background: transparent; }
.qlink-add:hover { color: var(--gold); border-color: rgba(244,241,236,.35); background: rgba(244,241,236,.04); border-style: dashed; transform: none; }
.qlink-manage { flex-direction: row; gap: 6px; border-style: dashed; color: var(--ink-3); border-color: var(--line); background: transparent; }
.qlink-manage svg { width: 11px; height: 11px; }
.qlink-manage:hover { color: var(--gold); border-color: rgba(244,241,236,.35); background: rgba(244,241,236,.04); border-style: dashed; transform: none; }

/* status colors helper classes */
.c-gold { color: var(--gold-ink); } .bg-gold { background: var(--gold-bg); color: var(--gold-ink); }
.c-teal { color: var(--teal); } .bg-teal { background: var(--teal-bg); color: var(--teal); }
.c-emerald { color: var(--emerald); } .bg-emerald { background: var(--emerald-bg); color: var(--emerald); }
.c-violet { color: var(--violet); } .bg-violet { background: var(--violet-bg); color: var(--violet); }
.c-rose { color: var(--rose); } .bg-rose { background: var(--rose-bg); color: var(--rose); }
.c-sky { color: var(--sky); } .bg-sky { background: rgba(107,182,224,.12); color: var(--sky); }
.c-amber { color: var(--amber); } .bg-amber { background: var(--amber-bg); color: var(--amber); }
.c-crimson { color: var(--crimson); } .bg-crimson { background: var(--crimson-bg); color: var(--crimson); }
.c-indigo { color: var(--indigo); } .bg-indigo { background: var(--indigo-bg); color: var(--indigo); }
.c-orange  { color: var(--orange); } .bg-orange  { background: var(--orange-bg);  color: var(--orange); }
.c-purple  { color: var(--purple); } .bg-purple  { background: var(--purple-bg);  color: var(--purple); }
.c-slate   { color: var(--slate);  } .bg-slate   { background: var(--slate-bg);   color: var(--slate); }
.c-lime    { color: var(--lime);   } .bg-lime    { background: var(--lime-bg);    color: var(--lime); }
.c-ink3 { color: var(--ink-3); }

/* ----------------------------- CHARTS ------------------------------ */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-4); font-family: var(--f-mono); font-size: 10px; }
.draw-line { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 1s var(--ease-out); }
.is-in .draw-line { stroke-dashoffset: 0; }
.area-fill { opacity: 0; transition: opacity .7s ease .3s; }
.is-in .area-fill { opacity: 1; }
.bar { transform: scaleY(0); transform-origin: bottom; transition: transform .7s var(--ease-out); }
.is-in .bar { transform: scaleY(1); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; }
.legend .it { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); cursor: pointer; transition: opacity .2s; }
.legend .it .sw { width: 9px; height: 9px; border-radius: 3px; }
.legend .it.off { opacity: .35; }

/* donut */
.donut-track { stroke: #20202733; }
.donut-seg { transition: stroke-dashoffset 1.1s var(--ease-out); }

/* sparkline mini */
.sparkline { width: 96px; height: 36px; }

/* ----------------------------- TABLE ------------------------------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: 0;  color: var(--ink-4); font-weight: 600; padding: 0 14px 11px; }
.tbl td { padding: 13px 14px; border-top: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.022); }
.cell-main { display: flex; align-items: center; gap: 11px; }
.cell-main .nm { font-weight: 600; }
.cell-main .ms { font-size: 11.5px; color: var(--ink-3); }

/* ----------------------------- KANBAN ------------------------------ */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.board::-webkit-scrollbar { height: 4px; }
.board::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 2px; border: none; }
.board > .col { flex: 0 0 260px; min-width: 0; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; min-height: 200px; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px 12px; }
.col-h .t { font-family: var(--f-display); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.col-h .ct { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); background: rgba(255,255,255,.05); padding: 1px 7px; border-radius: 99px; }
.col-h .dot { width: 7px; height: 7px; border-radius: 50%; }
.post {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px; margin-bottom: 10px; cursor: grab;
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.post:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.post:active { cursor: grabbing; }
.post .ph { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.post .ttl { font-size: 13px; font-weight: 600; line-height: 1.35; margin-bottom: 7px; }
.post .pf { display: flex; align-items: center; gap: 8px; margin-top: 11px; }
.post .pf .when { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.post.dragging { opacity:.35; pointer-events:none; }
.col.drag-over { background:rgba(244,241,236,.06); outline:1px dashed rgba(244,241,236,.3); border-radius:var(--r-sm); }

/* channel glyph */
.ch { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.ch svg { width: 13px; height: 13px; }
.ch.x { background: #1c1c22; color: #fff; }
.ch.ig { background: rgba(224,128,143,.14); color: var(--rose); }
.ch.tw { background: rgba(155,140,232,.14); color: var(--violet); }
.ch.yt { background: rgba(224,128,143,.12); color: #e57373; }
.ch.tk { background: rgba(84,205,191,.14); color: var(--teal); }

/* ----------------------------- CALENDAR ---------------------------- */
.cal { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--card); }
.cal-dow { display: grid; grid-template-columns: repeat(7,1fr); border-bottom: 1px solid var(--line); }
.cal-dow div { padding: 11px 12px; font-size: 11px; letter-spacing: 0;  color: var(--ink-4); font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-cell { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; position: relative; transition: background .2s; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: rgba(255,255,255,.015); }
.cal-cell.dim { background: rgba(0,0,0,.18); }
.cal-cell.dim .dn { color: var(--ink-4); }
.cal-cell.today .dn { color: #1a1206; background: var(--gold); }
.cal-cell .dn { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; margin-bottom: 6px; }
.cal-ev { font-size: 11px; padding: 3px 7px; border-radius: 6px; margin-bottom: 4px; display: flex; align-items: center; gap: 5px; cursor: pointer; transition: transform .15s; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-ev:hover { transform: translateX(2px); }
.cal-ev .d { width: 6px; height: 6px; border-radius: 2px; flex: none; }
.cal-ev.match { background: var(--gold-bg); color: var(--gold-soft); border: 1px dashed rgba(244,241,236,.3); }

/* ----------------------------- MATCHES ----------------------------- */
.next-match {
  border: 1px solid rgba(244,241,236,.22);
  background:
    radial-gradient(600px 200px at 85% -40%, rgba(244,241,236,.10), transparent 70%),
    var(--card);
  border-radius: var(--r-xl); padding: 22px 24px;
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
}
.versus { display: flex; align-items: center; gap: 16px; }
.team { display: flex; align-items: center; gap: 12px; }
.team .crest { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 17px; border: 1px solid var(--line-2); }
.team .crest.th { background: linear-gradient(160deg,#211b0c,#0e0e0c); color: var(--gold-ink); border-color: rgba(244,241,236,.3); }
.team .tn { font-family: var(--f-display); font-weight: 600; font-size: 16px; }
.team .tm { font-size: 11.5px; color: var(--ink-3); }
.vs { font-family: var(--f-display); font-weight: 700; color: var(--ink-4); font-size: 13px; }
.countdown { display: flex; gap: 9px; }
.cd-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 12px; text-align: center; min-width: 58px; }
.cd-box .v { font-family: var(--f-mono); font-weight: 600; font-size: 22px; color: var(--gold-ink); }
.cd-box .l { font-size: 9.5px; letter-spacing: 0;  color: var(--ink-4); margin-top: 2px; }

.match-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); margin-bottom: 10px; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.match-row:hover { border-color: var(--line-strong); transform: translateX(3px); }
.match-row .mt { text-align: center; }
.match-row .mt .t { font-family: var(--f-mono); font-weight: 600; font-size: 14px; }
.match-row .mt .d { font-size: 10.5px; color: var(--ink-3);  letter-spacing: 0; }
.match-row .mm { display: flex; align-items: center; gap: 10px; }
.match-row .content-pills { display: flex; gap: 6px; }

/* -------- Match cards (Game Calendar) -------- */
#matchList { display: grid; grid-template-columns: repeat(auto-fill, minmax(218px, 1fr)); gap: 12px; }
.match-card { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--card); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.match-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 10px 28px rgba(0,0,0,.32); }
.mc-band { height: 3px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; }
.mc-time-day { text-align: right; }
.mc-time { font-family: var(--f-mono); font-size: 13px; font-weight: 600; display: block; line-height: 1.2; }
.mc-day  { font-size: 10px;  letter-spacing: 0; color: var(--ink-4); display: block; margin-top: 1px; }
.mc-versus { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 14px; gap: 8px; }
.mc-team { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.mc-th-logo { width: 42px; height: 42px; object-fit: contain; }
.mc-av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 13px; flex: none; }
.mc-opp-crest { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; }
.mc-opp-logo { width: 100%; height: 100%; object-fit: contain; }
[data-theme="light"] .mc-opp-crest { background: #1c1a11; padding: 5px; border: 1.5px solid rgba(244,241,236,.2); }
.mc-tname { font-size: 10.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 82px; }
.mc-vs { font-family: var(--f-display); font-size: 11px; font-weight: 700; color: var(--ink-4); letter-spacing: .1em; flex: none; }
.mc-info { padding: 8px 12px; border-top: 1px solid var(--line); }
.mc-info-row { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-3); padding: 2px 0; }
.mc-info-row svg { width: 11px; height: 11px; flex: none; }
.mc-fmt { font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; background: rgba(255,255,255,.06); color: var(--ink-3); margin-left: auto; letter-spacing: .04em; }
.mc-pills { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--line); }
.mc-pills .content-pills { display: flex; gap: 5px; }

.cpill { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; border: 1px solid var(--line); position: relative; }
.cpill svg { width: 13px; height: 13px; color: var(--ink-3); }
.cpill.done { background: var(--emerald-bg); border-color: transparent; }
.cpill.done svg { color: var(--emerald); }
.cpill.todo { background: var(--gold-bg); border-color: transparent; }
.cpill.todo svg { color: var(--gold-ink); }

.game-badge { font-family: var(--f-display); font-size: 10px; font-weight: 600; letter-spacing: 0;  padding: 3px 7px 3px 6px; border-radius: 6px; display:inline-flex; align-items:center; gap:4px; vertical-align:middle; line-height:1; }
.game-ico { height: 13px; width: auto; max-width: 36px; flex: none; display: block; object-fit: contain; }
.game-ico use { fill: currentColor; stroke: none; }
.game-ico-tint { position: relative; display: inline-flex; isolation: isolate; border-radius: 2px; overflow: hidden; line-height: 0; flex: none; }
.game-ico-tint .game-ico { filter: grayscale(1) contrast(1.1); }
.game-ico-tint::after { content: ''; position: absolute; inset: 0; background: var(--tc); mix-blend-mode: color; pointer-events: none; }
.gdot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

/* ----------------------------- AI STUDIO --------------------------- */
.ai-grid { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.seg { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; }
.seg button { flex: 1; height: 32px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--ink-3); transition: all .2s; }
.seg button.on { background: var(--card-2); color: var(--ink); box-shadow: var(--shadow); }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; transition: all .2s; font-size: 12.5px; font-weight: 500; }
.opt:hover { border-color: var(--line-2); background: rgba(255,255,255,.02); }
.opt.on { border-color: rgba(244,241,236,.4); background: var(--gold-bg); color: var(--gold-ink); }
.opt .oi { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: rgba(255,255,255,.04); flex: none; }
.opt.on .oi { background: rgba(244,241,236,.16); }
.opt .oi svg { width: 14px; height: 14px; }
textarea.input, input.input {
  width: 100%; background: var(--elevated); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 10px 12px; color: var(--ink); font-size: 13px; resize: vertical; transition: border-color .18s, box-shadow .18s;
}
textarea.input:hover, input.input:hover { border-color: var(--line-strong); }
textarea.input:focus, input.input:focus { outline: none; border-color: rgba(244,241,236,.45); box-shadow: 0 0 0 3px var(--gold-glow); }
.slider-wrap { display: flex; align-items: center; gap: 12px; }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--gold)); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.toggle { position: relative; width: 42px; height: 24px; border-radius: 99px; background: #26262e; border: 1px solid var(--line-2); cursor: pointer; transition: background .25s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-3); transition: transform .25s var(--ease), background .25s; }
.toggle.on { background: var(--gold-bg); border-color: rgba(244,241,236,.4); }
.toggle.on::after { transform: translateX(18px); background: var(--gold); }

.gen-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; margin-bottom: 12px; position: relative; }
.gen-card .gh { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.gen-card .body { font-size: 13.5px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.gen-card .gf { display: flex; align-items: center; gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.gen-card .cc { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.skeleton { background: linear-gradient(90deg, #16161b 25%, #20202a 50%, #16161b 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
.ai-advanced { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.ai-advanced summary { font-size: 12px; font-weight: 500; color: var(--ink-3); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; user-select: none; }
.ai-advanced summary::after { content: '›'; display: inline-block; font-size: 14px; transition: transform .2s; margin-left: auto; }
.ai-advanced[open] summary::after { transform: rotate(90deg); }
.ai-advanced summary:hover { color: var(--ink-2); }
.ai-advanced .field { margin-bottom: 0; }
.typing { border-right: 2px solid var(--gold); animation: caret 1s steps(1) infinite; }

/* ----------------------------- BRAND ------------------------------- */
.swatch { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; }
.swatch:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.swatch .col { height: 86px; }
.swatch .meta { padding: 10px 12px; background: var(--card); }
.swatch .meta .nm { font-size: 12.5px; font-weight: 600; }
.swatch .meta .hx { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.dodont { border: 1px solid var(--line); border-radius: var(--r); padding: 15px; background: var(--card); }
.dodont .h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 9px; }
.dodont .h .ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; }
.dodont.do .h .ic { background: var(--emerald-bg); color: var(--emerald); }
.dodont.dont .h .ic { background: var(--rose-bg); color: var(--rose); }
.dodont ul li { font-size: 12.5px; color: var(--ink-2); padding: 5px 0 5px 18px; position: relative; }
.dodont ul li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-4); }
.logo-stage { height: 180px; border-radius: var(--r); display: grid; place-items: center; position: relative; overflow: hidden; border: 1px solid var(--line); }
.logo-stage.dark { background: #0a0a09; }
.logo-stage.gold { background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep)); }
.logo-stage.light { background: #f4f3ee; }

/* asset kit row */
.kit-row { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); transition: border-color .2s, background .2s; }
.kit-row:hover { border-color: var(--line-strong); background: var(--card-2); }
.kit-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }

/* ----------------------------- TOAST ------------------------------- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 11px; padding: 12px 15px;
  background: var(--elevated); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--shadow-lg); font-size: 13px; min-width: 240px;
  animation: toastIn .4s var(--ease-out);
}
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast .ti { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.toast-close { margin-left: auto; flex: none; background: none; border: none; cursor: pointer; color: var(--ink-3); padding: 2px; border-radius: 4px; display: grid; place-items: center; opacity: .7; }
.toast-close:hover { opacity: 1; color: var(--ink); }
.toast-close svg { width: 13px; height: 13px; }

/* ----------------------------- COMMAND PALETTE --------------------- */
.scrim { position: fixed; inset: 0; z-index: 150; background: rgba(4,4,6,.6); backdrop-filter: blur(4px); display: none; opacity: 0; transition: opacity .2s; }
.scrim.open { display: block; opacity: 1; }
.cmdk { position: fixed; z-index: 151; top: 18vh; left: 50%; transform: translateX(-50%) translateY(-8px) scale(.98); width: min(560px, 92vw); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); display: none; opacity: 0; overflow: hidden; transition: opacity .2s, transform .2s var(--ease-out); }
.cmdk.open { display: block; opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.cmdk .top { display: flex; align-items: center; gap: 11px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.cmdk input { flex: 1; background: none; border: none; font-size: 15px; outline: none; }
.cmdk .list { max-height: 320px; overflow-y: auto; padding: 8px; }
.cmdk .res { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; }
.cmdk .res:hover, .cmdk .res.sel { background: rgba(244,241,236,.08); }
.cmdk .res .ri { width: 30px; height: 30px; border-radius: 8px; background: var(--card-2); display: grid; place-items: center; flex: none; }
.cmdk .res .ri svg { width: 16px; height: 16px; color: var(--gold-ink); }
.cmdk .res .rt { font-size: 13.5px; font-weight: 500; }
.cmdk .res .rs { font-size: 11.5px; color: var(--ink-3); }

/* ----------------------------- ANIMATIONS -------------------------- */
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes caret { 50% { border-color: transparent; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
@keyframes liveRing { 0% { box-shadow: 0 0 0 0 rgba(224,128,143,.5); } 100% { box-shadow: 0 0 0 7px rgba(224,128,143,0); } }

.spin { animation: spin .8s linear infinite; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); animation: liveRing 1.6s infinite; }

/* view entrance — plays on first paint only; JS adds .no-reveal on revisit */
.reveal { opacity: 0; transform: translateY(10px); }
.view.active .reveal { animation: revealUp .4s var(--ease-out) forwards; }
.view.no-reveal .reveal { animation: none !important; opacity: 1; transform: none; }
@keyframes revealUp { to { opacity: 1; transform: none; } }
.view.active .reveal.d1 { animation-delay: .02s; }
.view.active .reveal.d2 { animation-delay: .06s; }
.view.active .reveal.d3 { animation-delay: .10s; }
.view.active .reveal.d4 { animation-delay: .14s; }
.view.active .reveal.d5 { animation-delay: .18s; }
.view.active .reveal.d6 { animation-delay: .22s; }

/* utility */
.row { display: flex; align-items: center; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap14 { gap: 14px; } .gap16 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt20{margin-top:20px}.mt24{margin-top:24px}
.mb6{margin-bottom:6px}.mb10{margin-bottom:10px}.mb14{margin-bottom:14px}.mb18{margin-bottom:18px}.mb24{margin-bottom:24px}
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.dim2 { color: var(--ink-4); }
.fs12 { font-size: var(--text-xs); } .fs13 { font-size: var(--text-sm); } .fw600 { font-weight: 600; }
.section-h { display: flex; align-items: center; gap: 12px; margin: 26px 0 14px; }
.section-h h2 { font-size: 16px; }
.section-h .spacer { flex: 1; }
.hr { height: 1px; background: var(--line); border: none; margin: 0; }

.mobile-only { display: none; }

/* ------------------- OVERVIEW: METRIC STRIP ----------------- */
.metric-strip { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
.metric { padding: 15px 18px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: none; }
.metric .m-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.metric .label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.metric .m-spark { margin-left: auto; }
.metric .m-val { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.metric .num { font-family: var(--f-display); font-weight: 600; font-size: 24px; line-height: 1; letter-spacing: -.01em; }
.metric .num small { font-size: 14px; color: var(--ink-3); }
.metric:first-child .num { font-size: 36px; }
.metric-link { cursor: pointer; transition: background .15s var(--ease); }
.metric-link:hover { background: var(--hover); }
.metric-link:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* tooltip (hover + keyboard focus) */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; z-index: 90;
  bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: var(--elevated); color: var(--ink); border: 1px solid var(--line-2);
  font-size: 11.5px; font-weight: 500; white-space: nowrap; padding: 5px 9px; border-radius: 7px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================ MODAL / COMPOSER ===================== */
.scrim2 { position: fixed; inset: 0; z-index: 120; background: rgba(3,3,3,.68); backdrop-filter: blur(5px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.scrim2.open { opacity: 1; visibility: visible; }
.modal { position: fixed; z-index: 130; top: 50%; left: 50%; width: min(820px, 95vw); max-height: 90vh; transform: translate(-50%, -47%) scale(.975); opacity: 0; visibility: hidden; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; transition: opacity .3s var(--ease-out), transform .3s var(--ease-out), visibility .3s; }
.modal.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h .mh-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-bg); flex: none; }
.card-h .mh-ico { display: grid; place-items: center; border-radius: 10px; flex: none; }
.mh-ico svg { width: 18px; height: 18px; color: var(--gold-ink); }
.modal-h h3 { font-size: 16px; }
.modal-h .sub { font-size: var(--text-xs); color: var(--ink-3); text-wrap: pretty; }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--bg-2); }
.composer-grid { display: grid; grid-template-columns: 1fr 300px; gap: 22px; }
input[type=date].input, input[type=time].input, select.input { color-scheme: dark; height: 38px; padding-top: 0; padding-bottom: 0; }
select.input { cursor: pointer; }

/* ── Custom select ────────────────────────────────────────────────── */
.v-sel-wrap { position: relative; display: block; width: 100%; }
.v-sel-wrap::after {
  content: "";
  position: absolute; right: 11px; top: 50%;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transition: border-color .15s;
}
.v-sel-wrap:focus-within::after { border-color: var(--gold); }
.v-sel {
  -webkit-appearance: none; appearance: none;
  background: var(--elevated) !important;
  color: var(--ink) !important;
  padding: 0 32px 0 12px !important;
  height: 38px; width: 100%;
  border: 1px solid var(--line-2) !important;
  border-radius: var(--r-sm) !important;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.v-sel:hover { border-color: var(--line-strong) !important; }
.v-sel:focus {
  border-color: rgba(244,241,236,.45) !important;
  box-shadow: 0 0 0 3px var(--gold-glow) !important;
  outline: none;
}
.ch-pick { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--pill); cursor: pointer; transition: all .18s var(--ease); font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.ch-pick svg { width: 14px; height: 14px; }
.ch-pick:hover { border-color: var(--line-2); }
.ch-pick.on { border-color: rgba(244,241,236,.45); background: var(--gold-bg); color: var(--gold-ink); }
.acct-pick { display: inline-flex; align-items: center; padding: 5px 11px; border: 1px solid var(--line); border-radius: var(--pill); cursor: pointer; transition: all .18s var(--ease); font-size: 12px; font-weight: 500; color: var(--ink-3); background: none; }
.acct-pick:hover { border-color: var(--line-2); color: var(--ink); }
.acct-pick.on { border-color: color-mix(in srgb, var(--acol) 45%, transparent); background: color-mix(in srgb, var(--acol) 14%, transparent); color: var(--acol); }
.preview-label { font-size: 11px; letter-spacing: 0;  color: var(--ink-4); font-weight: 600; margin-bottom: 9px; }
.tw-card { border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px; background: var(--bg-2); }
.tw-card .tw-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tw-card .tw-body { font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; min-height: 60px; color: var(--ink); }
.tw-card .tw-body.empty { color: var(--ink-4); }
.tw-card .tw-img { height: 130px; border-radius: 10px; margin-top: 12px; background: repeating-linear-gradient(135deg, #211f1a, #211f1a 10px, #1b1916 10px, #1b1916 20px); display: grid; place-items: center; color: var(--ink-4); border: 1px solid var(--line); }
.tw-card .tw-actions { display: flex; gap: 26px; margin-top: 13px; color: var(--ink-4); }
.tw-card .tw-actions svg { width: 16px; height: 16px; }

/* ------- Social preview platform variants ------- */
.prev-img { background: repeating-linear-gradient(135deg, var(--card-2) 0 10px, var(--bg-2) 10px 20px); display: flex; align-items: center; justify-content: center; color: var(--ink-4); border: 1px solid var(--line); border-radius: 8px; position: relative; overflow: hidden; }
.prev-img > svg { width: 24px; height: 24px; position: relative; z-index: 1; }
.prev-img.sq { aspect-ratio: 1/1; width: 100%; }
.prev-img.wide { width: 100%; aspect-ratio: 16/9; }
.prev-img.tall { width: 100%; aspect-ratio: 9/16; max-height: 200px; }
.prev-ig-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.prev-ig-acts { display: flex; align-items: center; gap: 12px; margin: 9px 0 6px; color: var(--ink-3); }
.prev-ig-acts svg { width: 18px; height: 18px; }
.prev-ig-body { font-size: 12px; line-height: 1.5; }
.prev-tk-over { position: absolute; bottom: 0; left: 0; right: 38px; padding: 26px 8px 8px; background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff; font-size: 12px; line-height: 1.4; z-index: 2; }
.prev-tk-sub { font-size: 10px; color: rgba(255,255,255,.6); margin-top: 4px; }
.prev-tk-side { position: absolute; bottom: 8px; right: 0; width: 38px; display: flex; flex-direction: column; align-items: center; gap: 5px; z-index: 2; color: #fff; }
.prev-tk-ico { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.prev-tk-ico svg { width: 18px; height: 18px; }
.prev-tk-ico span { font-size: 9px; }
.prev-yt-info { display: flex; align-items: flex-start; gap: 9px; margin-top: 9px; }
.ev-accts { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.ev-acct { font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 3px; line-height: 1.6; }

/* ============================ WEEK CALENDAR ======================= */
.cal-week { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--card); }
.cw-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cw-dh { padding: 11px 13px; border-right: 1px solid var(--line); }
.cw-dh:last-child { border-right: none; }
.cw-dh .dow { font-size: 10.5px;  letter-spacing: 0; color: var(--ink-4); font-weight: 600; }
.cw-dh .dnum { font-family: var(--f-mono); font-size: 17px; font-weight: 600; margin-top: 1px; }
.cw-dh.today { background: var(--gold-bg); }
.cw-dh.today .dnum, .cw-dh.today .dow { color: var(--gold-ink); }
.cw-body { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: calc(100svh - 300px); }
.cw-col { border-right: 1px solid var(--line); padding: 9px; display: flex; flex-direction: column; gap: 7px; transition: background .2s; }
.cw-col:last-child { border-right: none; }
.cw-col.today { background: rgba(244,241,236,.035); }
.cw-col:hover { background: rgba(255,255,255,.018); }
.cw-ev { border: 1px solid var(--line); border-radius: 9px; padding: 8px 9px; background: var(--card-2); cursor: grab; transition: transform .18s var(--ease), border-color .18s, box-shadow .18s; }
.cw-ev:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.cw-ev .ev-top { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.cw-ev .ev-time { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); margin-left: auto; }
.cw-ev .ev-ttl { font-size: 12px; font-weight: 500; line-height: 1.3; }
.cw-ev.match { background: var(--gold-bg); border-color: rgba(244,241,236,.28); border-style: dashed; cursor: default; opacity: .82; }
.cw-ev.match:hover { transform: none; box-shadow: none; border-color: rgba(244,241,236,.4); }
.cw-ev.vac { background: none; border: 1px dashed color-mix(in srgb, var(--ink-3) 30%, transparent); border-radius: 7px; padding: 4px 8px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cw-ev.vac:hover { transform: none; box-shadow: none; border-color: var(--line-strong); background: var(--hover); }
.vac-lbl { font: 500 11px/1 var(--f-body); color: var(--ink-3); }
.cw-add { margin-top: auto; border: 1px dashed var(--line-2); border-radius: 8px; padding: 6px; display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--ink-4); font-size: 11.5px; cursor: pointer; transition: all .18s; background: none; }
.cw-add:hover { color: var(--gold-ink); border-color: rgba(244,241,236,.4); background: var(--gold-bg); }
.cw-add svg { width: 13px; height: 13px; }
/* Vacation sidebar badge */
.tp-member { cursor: pointer; }
.tp-vac { font: 600 9px/1 var(--f-body); color: var(--ink-3); background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; padding: 2px 6px;  letter-spacing: 0; flex: none; }
/* Vacation entry in modal */
.vac-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--bg-2); border-radius: var(--r-sm); border: 1px solid var(--line); }

/* ------- Planner legend bar ------- */
.planner-legend { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-base); background: var(--card); margin-bottom: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.planner-legend-section { font-weight: 600; color: var(--ink-2); font-size: 11px;  letter-spacing: 0; }
.planner-legend-sep { width: 1px; height: 18px; background: var(--line-strong); flex: none; margin-inline: 6px; }
/* ------- Week view post card extras ------- */
.cw-ev.post-ev { cursor: pointer; }
.cw-ev .ev-foot { display: flex; align-items: center; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.cw-ev .ev-stat { font-size: 10px; color: var(--ink-4); }
.tbadge { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 0; padding: 2px 5px; border-radius: 3px;  line-height: 1.6; }
.tbadge.ed { background: rgba(110,193,235,.1); color: var(--sky); }
.tbadge.com { background: var(--gold-bg); color: var(--gold-ink); }

.cal-nav { display: inline-flex; align-items: center; gap: 4px; }
.cal-nav button:not(.btn) { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); transition: all .18s; }
.cal-nav button:not(.btn):hover { border-color: var(--line-strong); background: var(--hover); color: var(--ink); }
.cal-nav svg { width: 15px; height: 15px; }
.cal-range { font-family: var(--f-display); font-weight: 600; font-size: 14px; min-width: 150px; text-align: center; }

@keyframes heroSheen { from { background-position: 140% 0; } to { background-position: -140% 0; } }
.cd-box { min-width: 60px; }
.cd-box .v { font-size: 24px; transition: transform .3s var(--ease); }
.cd-flip { animation: cdFlip .4s var(--ease-out); }
@keyframes cdFlip { 0% { transform: translateY(-45%); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ============== MATCH-DAY HERO (the Overview showpiece) ========== */
.hero-banner { position: relative; overflow: hidden; min-height: 336px; display: flex; flex-direction: column; perspective: 1100px;
  border: 1px solid rgba(244,241,236,.22); border-radius: var(--r-xl); padding: 22px 26px;
  background:
    radial-gradient(660px 320px at 8% -40%, var(--game-glow, var(--gold-glow)), transparent 70%),
    radial-gradient(520px 260px at 104% 140%, rgba(244,241,236,.06), transparent 70%),
    linear-gradient(180deg, #16140e, var(--card)); }
.hb-grid-bg { position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.5px); background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 92%); mask-image: linear-gradient(180deg, #000, transparent 92%); }
.hb-sheen { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 38%, rgba(244,241,236,.10) 50%, transparent 62%); background-size: 280% 100%; animation: heroSheen 7s linear infinite; }
.hb-embers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hb-ember { position: absolute; bottom: -8px; width: 3px; height: 3px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 7px 1px var(--gold-glow); opacity: 0; animation: emberRise linear infinite; }
@keyframes emberRise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 14% { opacity: .9; } 80% { opacity: .4; } 100% { transform: translateY(-290px) scale(1); opacity: 0; } }

.hb-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hb-eyebrow { display: inline-flex; align-items: center; gap: 9px; font-family: var(--f-display); font-weight: 700; font-size: 12.5px; letter-spacing: 0;  color: var(--gold-ink); }
.hb-comp { font-size: 12px; color: var(--ink-3); }

.hb-body { position: relative; z-index: 2; display: grid; grid-template-columns: 1.55fr 1fr; gap: 26px; align-items: center; padding: 18px 0; flex: 1;
  transform: rotateX(var(--tx,0deg)) rotateY(var(--ty,0deg)); transform-style: preserve-3d; transition: transform .3s var(--ease); will-change: transform; }
.versus-big { display: flex; align-items: center; gap: 20px; }
.hb-team { display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; }
.hb-crest { width: 80px; height: 80px; border-radius: 22px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 25px; border: 1px solid var(--line-2); transition: transform .3s var(--ease); }
.hb-crest.th { background: radial-gradient(120% 120% at 30% 20%, #2a2210, #0e0e0c); color: var(--gold-ink); border-color: rgba(244,241,236,.4); box-shadow: 0 0 34px -6px var(--gold-glow); animation: floaty 5s ease-in-out infinite; }
.hb-crest.opp { box-shadow: 0 0 34px -8px var(--opp, rgba(255,255,255,.2)); animation: floaty 5s ease-in-out .7s infinite; }
.versus-big:hover .hb-crest.th { transform: translateX(-4px); }
.versus-big:hover .hb-crest.opp { transform: translateX(4px); }
.hb-team .tn { font-family: var(--f-display); font-weight: 600; font-size: 15.5px; }
.hb-team .tm { font-size: 10px; letter-spacing: 0;  color: var(--ink-4); }
.vs-clash { font-family: var(--f-display); font-weight: 700; font-size: 19px; color: var(--ink-3); position: relative; padding: 0 6px; }
.vs-clash::before { content: ''; position: absolute; inset: -9px -8px; border: 1px solid var(--line-2); border-radius: 50%; opacity: .5; animation: pulse 2.6s ease-in-out infinite; }

.hb-cd { display: flex; gap: 9px; margin-top: 22px; }
.hb-cd .b { background: rgba(0,0,0,.32); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; text-align: center; min-width: 60px; }
.hb-cd .b .v { font-family: var(--f-mono); font-weight: 600; font-size: 26px; color: var(--gold-ink); line-height: 1; }
.hb-cd .b .l { font-size: 9px; letter-spacing: 0;  color: var(--ink-4); margin-top: 5px; }
.hb-ctas { display: flex; gap: 9px; margin-top: 18px; flex-wrap: wrap; }

.hb-player { position: relative; border: 1px solid var(--game-line, var(--line-2)); border-radius: 18px; padding: 18px; overflow: hidden;
  background: linear-gradient(180deg, var(--game-bg2, rgba(255,255,255,.02)), transparent 80%); }
.pw-eyebrow { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0;  color: var(--game-c, var(--gold)); margin-bottom: 13px; display: flex; align-items: center; gap: 7px; }
.pw-main { display: flex; align-items: center; gap: 14px; }
.pw-av { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 21px; color: #0c0c0f; flex: none;
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--game-c, var(--gold)), 0 0 30px -4px var(--game-glow, var(--gold-glow)); animation: floaty 4.5s ease-in-out infinite; }
.pw-name { font-family: var(--f-display); font-weight: 700; font-size: 23px; letter-spacing: -.01em; line-height: 1; }
.pw-role { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.pw-stats { display: flex; gap: 8px; margin-top: 15px; }
.pw-stat { flex: 1; background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 10px; padding: 8px 5px; text-align: center; }
.pw-stat .v { font-family: var(--f-mono); font-weight: 600; font-size: 15px; color: var(--ink); }
.pw-stat .l { font-size: 8.5px; letter-spacing: 0;  color: var(--ink-4); margin-top: 3px; }

.hb-foot { position: relative; z-index: 2; display: flex; align-items: center; gap: 9px; padding-top: 15px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hb-task { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--card-2); font-size: 12px; color: var(--ink-2); cursor: pointer; transition: all .18s var(--ease); }
.hb-task svg { width: 13px; height: 13px; }
.hb-task:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.hb-task.done { color: var(--emerald); border-color: transparent; background: var(--emerald-bg); }
.hb-task.done .lbl { text-decoration: line-through; }
.hb-progress { margin-left: auto; display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--ink-3); font-family: var(--f-mono); }
.hb-progress .track { width: 90px; height: 6px; border-radius: 99px; background: #26241f; overflow: hidden; }
.hb-progress .track > i { display: block; height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transform-origin: left; transition: transform .9s var(--ease-out); }

@media (max-width: 920px) {
  .hb-body { grid-template-columns: 1fr; gap: 18px; }
  .hb-player { order: -1; }
  .versus-big { justify-content: center; }
}

/* --- player-led hero layout (v2) --- */
.hb-stage { position: relative; z-index: 2; flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; padding: 8px 0 2px; }
.hb-left { min-width: 0; }
.hb-date { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0;  color: var(--ink-4); margin-bottom: 9px; }
.hb-greet { font-family: var(--f-display); font-weight: 700; font-size: max(1.6rem, min(3.6vw, 2.4rem)); letter-spacing: -.02em; line-height: 1.02; text-wrap: balance; }
.hb-greet b { color: var(--gold-ink); font-weight: 700; }
.hb-matchcard { margin-top: 22px; max-width: 470px; }
.hb-matchcard .hb-eyebrow { font-size: 11px; letter-spacing: .14em; margin-bottom: 13px; }
.hb-mc-row { display: flex; align-items: center; gap: 11px; }
.hb-crest.sm { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 15px; border: 1px solid var(--line-2); flex: none; }
.hb-crest.sm.th { background: radial-gradient(120% 120% at 30% 20%, #2a2210, #0e0e0c); color: var(--gold-ink); border-color: rgba(244,241,236,.4); }
.th-logo, .crest-logo { width: 72%; height: 72%; object-fit: contain; display: block; }
.vs-clash.sm { font-size: 12.5px; padding: 0 1px; }
.vs-clash.sm::before { inset: -6px -4px; }
.hb-mc-meta { margin-left: 5px; min-width: 0; }
.hb-mc-meta .nm { font-weight: 600; font-size: 14px; }
.cd2 { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cd2-time { display: flex; align-items: flex-start; gap: 8px; }
.cd2-seg { display: flex; flex-direction: column; align-items: center; min-width: 48px; }
.cd2-seg b { font-family: var(--f-mono); font-weight: 600; font-size: 46px; color: var(--gold-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.cd2-seg i { font-size: 9px; letter-spacing: 0;  color: var(--ink-4); font-style: normal; margin-top: 7px; }
.cd2-colon { font-family: var(--f-mono); font-size: 38px; color: #4c483f; line-height: 1.05; padding-bottom: 4px; }
.hb-watch { margin-top: 20px; }

/* the prominent animated portrait (the centerpiece) */
.hb-portrait { perspective: 700px; transition: transform .35s var(--ease-out); }
.hb-portrait:hover { transform: scale(1.025); }
.portrait-frame { position: relative; width: 262px; height: 318px; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--pcs, var(--line-2)); box-shadow: 0 38px 92px -28px var(--pcg, rgba(0,0,0,.6)), inset 0 1px 0 rgba(255,255,255,.06);
  transition: box-shadow .35s var(--ease-out); animation: portraitFloat 6s ease-in-out infinite; }
.hb-portrait:hover .portrait-frame { box-shadow: 0 46px 110px -26px var(--pcg, rgba(0,0,0,.6)), inset 0 1px 0 rgba(255,255,255,.08); }
@keyframes portraitFloat { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-9px) rotate(-.4deg); } }
.pf-bg { position: absolute; inset: 0; background: radial-gradient(130% 75% at 50% -5%, var(--pcs), transparent 60%), linear-gradient(180deg, #17150f 0%, #0b0b09 80%); }
.pf-initials { position: absolute; top: 12px; right: 18px; font-family: var(--f-display); font-weight: 700; font-size: 76px; line-height: .76; color: rgba(255,255,255,.055); letter-spacing: -.03em; }
.pf-sil { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 102%; height: 90%; }
.pf-sil .body { fill: #16140f; }
.pf-sil .rim { fill: none; stroke: var(--pc); stroke-width: 2.5; opacity: .55; }
.pf-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pf-scan { position: absolute; inset: 0; pointer-events: none; opacity: .5; background: repeating-linear-gradient(180deg, transparent 0 2px, rgba(0,0,0,.16) 2px 3px); }
.pf-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(120deg, transparent 42%, rgba(255,255,255,.10) 50%, transparent 58%); background-size: 280% 100%; animation: heroSheen 5.5s linear infinite; }
.pf-frame { position: absolute; inset: 9px; pointer-events: none; opacity: .7;
  background:
    linear-gradient(var(--pc),var(--pc)) 0 0/15px 1.5px no-repeat, linear-gradient(var(--pc),var(--pc)) 0 0/1.5px 15px no-repeat,
    linear-gradient(var(--pc),var(--pc)) 100% 0/15px 1.5px no-repeat, linear-gradient(var(--pc),var(--pc)) 100% 0/1.5px 15px no-repeat,
    linear-gradient(var(--pc),var(--pc)) 0 100%/15px 1.5px no-repeat, linear-gradient(var(--pc),var(--pc)) 0 100%/1.5px 15px no-repeat,
    linear-gradient(var(--pc),var(--pc)) 100% 100%/15px 1.5px no-repeat, linear-gradient(var(--pc),var(--pc)) 100% 100%/1.5px 15px no-repeat; }
.pf-name { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 34px 16px 15px; background: linear-gradient(180deg, transparent, rgba(5,5,4,.86) 58%); }
.pf-name .game-badge { margin-bottom: 8px; }
.pf-name .pn { font-family: var(--f-display); font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: -.01em; }
.pf-name .ph { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

/* --- signature entrance (plays once on first paint) --- */
.hb-bloom { position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: 0;
  background: radial-gradient(680px 360px at 10% -30%, var(--game-glow, var(--gold-glow)), transparent 68%); }
.hb-enter .hb-bloom { animation: heroBloom 1s var(--ease-out) forwards; }
@keyframes heroBloom { from { opacity: 0; } to { opacity: .5; } }
.hb-enter .hb-anim { opacity: 0; animation: heroRise .7s var(--ease-out) forwards; animation-delay: calc(var(--i,0) * 90ms + .12s); }
@keyframes heroRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hb-enter .portrait-frame { animation: portraitFloat 6s ease-in-out infinite .95s, pfReveal .9s var(--ease-out) both; }
@keyframes pfReveal { from { clip-path: inset(0 0 100% 0 round 22px); opacity: 0; } to { clip-path: inset(0 0 0 0 round 22px); opacity: 1; } }

@media (max-width: 920px) {
  .hb-stage { grid-template-columns: 1fr; gap: 20px; justify-items: start; }
  .hb-portrait { order: -1; align-self: center; justify-self: center; }
  .hb-matchcard { max-width: 100%; }
}
@media (max-width: 560px) {
  .portrait-frame { width: 204px; height: 254px; }
  .cd2 { flex-wrap: wrap; gap: 10px; }
}

/* ====================== AI STUDIO extras ========================= */
.ai-rail { display: flex; flex-direction: column; gap: 14px; }
.suggest-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--card-2); font-size: 12px; color: var(--ink-2); cursor: pointer; transition: all .18s; font-family: var(--f-mono); }
.suggest-chip svg { width: 14px; height: 14px; flex: none; }
.suggest-chip:hover { border-color: rgba(244,241,236,.4); color: var(--gold-ink); background: var(--gold-bg); }
.ai-feature-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-stat { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); }
.mini-stat .ms-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.voice-meter { height: 7px; border-radius: 99px; background: #2a2925; overflow: hidden; margin-top: 7px; }
.voice-meter > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--emerald), var(--gold)); transition: width .8s var(--ease-out); }
.ai-tone-ctx { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ai-tone-voice { font-size: 11px; color: var(--ink-4); line-height: 1.5; margin-bottom: 8px; font-style: italic; }
.ai-tone-rules { display: flex; flex-direction: column; gap: 3px; }
.ai-tone-rule { display: flex; align-items: flex-start; gap: 5px; font-size: 11px; line-height: 1.4; }
.ai-tone-rule svg { width: 10px; height: 10px; flex: none; margin-top: 2px; }
.ai-tone-rule.ok { color: var(--emerald); }
.ai-tone-rule.ok span { color: var(--ink-3); }
.ai-tone-rule.warn { color: var(--gold-ink); }
.ai-tone-rule.warn span { color: var(--ink-3); }
.hist-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; transition: background .15s; }
.hist-item:hover { background: rgba(255,255,255,.03); }

/* brand tab segs: content-width buttons, not stretched */
#brandTabs .seg { width: auto; }
#brandTabs .seg button { flex: none; padding: 0 12px; white-space: nowrap; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }

/* ====================== BRAND: matrix + assistant =============== */
.brand-assistant { border: 1px solid rgba(244,241,236,.22); border-radius: var(--r-lg); background: radial-gradient(500px 180px at 90% -40%, rgba(244,241,236,.08), transparent 70%), var(--card); padding: 18px 20px; }
.ba-input { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 4px 4px 4px 13px; margin-top: 14px; transition: border-color .2s, box-shadow .2s; }
.ba-input:focus-within { border-color: rgba(244,241,236,.5); box-shadow: 0 0 0 3px var(--gold-glow); }
.ba-input input { flex: 1; background: none; border: none; outline: none; color: var(--ink); font-size: 14px; height: 38px; }
.ba-suggest { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.ba-answer { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
/* Brand assistant empty state */
.ba-recents { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.ba-recent-label { font-size: 11px; font-weight: 600; color: var(--ink-4); letter-spacing: 0;  margin-bottom: 8px; }
.ba-recent {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--card-2); text-align: left; cursor: pointer;
  font-size: 13px; color: var(--ink-2); font-family: inherit;
  transition: background .15s, border-color .15s; margin-bottom: 4px;
}
.ba-recent:hover { background: var(--hover); border-color: var(--line-2); color: var(--ink); }
.ba-recent .ba-rec-badge {
  font-family: var(--f-display); font-size: 10px; font-weight: 600;
  letter-spacing: 0;  padding: 2px 7px;
  border-radius: 5px; flex: none;
}
.ba-recent .ba-rec-time { margin-left: auto; font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.brand-matrix { width: 100%; border-collapse: collapse; }
.brand-matrix th { font-size: 11px;  letter-spacing: 0; color: var(--ink-4); font-weight: 600; padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.brand-matrix th:first-child { text-align: left; }
.brand-matrix td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.brand-matrix td:first-child { text-align: left; }
.brand-matrix tbody tr:hover { background: rgba(255,255,255,.02); }
.matrix-dot { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; }
.matrix-dot svg { width: 14px; height: 14px; }
.player-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 14px; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; cursor: pointer; }
.player-card:hover { transform: translateY(-3px); border-color: var(--gc, var(--gold)); box-shadow: var(--shadow); }

/* ====================== extra motion / dynamism ================= */
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(244,241,236,0); } 50% { box-shadow: 0 0 22px 0 rgba(244,241,236,.18); } }
@keyframes sweepIn { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.hoverable:hover .game-badge { animation: none; }
.stagger > * { opacity: 0; animation: revealUp .45s var(--ease-out) forwards; }
.stagger > *:nth-child(1){animation-delay:.03s}.stagger > *:nth-child(2){animation-delay:.07s}.stagger > *:nth-child(3){animation-delay:.11s}.stagger > *:nth-child(4){animation-delay:.15s}.stagger > *:nth-child(5){animation-delay:.19s}.stagger > *:nth-child(6){animation-delay:.23s}.stagger > *:nth-child(7){animation-delay:.27s}
.pressable { transition: transform .12s var(--ease); }
.pressable:active { transform: scale(.97); }

/* ----------------------------- RESPONSIVE -------------------------- */
@media (max-width: 860px) {
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric:first-child .num { font-size: 28px; }
  .metric:first-child .m-spark { opacity: 1; width: auto; overflow: visible; }
  .metric:nth-child(2) { border-right: none; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  /* touch targets >= 44px */
  .chip { height: 44px; padding: 0 14px; }
  .icon-btn { width: 44px; height: 44px; }
  .btn { height: 44px; }
  .btn.sm { height: 44px; }
  .ct-stat-clickable { min-height: 44px; }
  .nav-item { padding: 11px 11px; }
  .composer-grid { grid-template-columns: 1fr; }
  .cal-week { overflow-x: auto; }
  .cw-head, .cw-body { grid-template-columns: repeat(7, minmax(118px, 1fr)); }
  /* disable desktop collapse on mobile (sidebar becomes a drawer) */
  .collapse-btn { display: none; }
  body.sidebar-collapsed .brand-text, body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-badge, body.sidebar-collapsed .collapse-hide,
  body.sidebar-collapsed .profile > div:not(.avatar), body.sidebar-collapsed .profile > svg { display: revert; }
  body.sidebar-collapsed .nav-item { font-size: 13.5px; justify-content: flex-start; padding: 11px 11px; }
  body.sidebar-collapsed .nav-item::after { content: none; }
}
@media (max-width: 560px) {
  .metric-strip { grid-template-columns: 1fr; }
  .metric { border-right: none; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: none; }
}

/* ----------------------------- RESPONSIVE -------------------------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols-3-1, .cols-2 { grid-template-columns: 1fr; }
  .ai-grid { grid-template-columns: 1fr; }
  .board > .col { flex-basis: 220px; }
}
@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 256px; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .app { grid-template-columns: 1fr; }
  .mobile-only { display: grid; }
  .searchbar { display: none; }
  .next-match { grid-template-columns: 1fr; }
  .board > .col { flex-basis: 200px; }
  .view { padding: 18px 16px 60px; }
  .topbar { padding: 0 16px; }
  .topbar-hud { display: none; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .cal-cell { min-height: 64px; }
}

/* ----------------------------- REDUCED MOTION ---------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .draw-line { stroke-dashoffset: 0 !important; }
  .bar { transform: scaleY(1) !important; }
  .area-fill { opacity: 1 !important; }
  .stagger > * { opacity: 1 !important; transform: none !important; }
  .hb-sheen, .hb-embers, .pf-shine, .hb-bloom { display: none !important; }
  .hb-crest, .pw-av, .vs-clash::before, .portrait-frame, .hb-enter .portrait-frame { animation: none !important; }
  .hb-enter .hb-anim { opacity: 1 !important; animation: none !important; transform: none !important; }
}

/* ========================= CONTACTS VIEW ========================= */

/* Stats bar */
.ct-stats-bar { display:flex; align-items:center; gap:0; padding:10px 0 16px; flex-wrap:wrap; }
.ct-stat-chip { display:flex; flex-direction:column; align-items:center; padding:8px 18px; min-width:72px; }
.ct-chip-num { font:700 22px/1 var(--f-display); color:var(--ink); }
.ct-chip-lbl { font:500 10px/1 var(--f-body); color:var(--ink-3); margin-top:4px; letter-spacing: 0;  }
.ct-stat-clickable { cursor:pointer; border-radius:8px; border:1px solid transparent; transition:background .15s, border-color .15s; }
.ct-stat-clickable:hover { background:var(--elevated); }
.ct-stat-clickable:hover .ct-chip-ico { color:var(--ink-2); }
.ct-stat-clickable.active { background:var(--gold-bg); border-color:rgba(244,241,236,.4); }
.ct-stat-clickable.active .ct-chip-lbl { color:var(--gold); }
.ct-stat-clickable.active .ct-chip-ico { color:var(--gold); }
.ct-stat-clickable.active .ct-chip-num { color:var(--gold); }
.ct-chip-ico { display:block; color:var(--ink-4); margin-bottom:5px; transition:color .15s; }
.ct-stat-sep { width:1px; height:32px; background:var(--line); }
.ct-stat-divider { width:1px; height:44px; background:var(--line); margin:0 10px; opacity:.5; align-self:center; }
.ct-sync-pill { display:flex; align-items:center; gap:5px; margin-left:auto; padding:4px 10px; border-radius:20px; border:1px solid var(--line); background:var(--bg-2); font:500 11px/1 var(--f-body); color:var(--ink-3); transition:opacity .3s; white-space:nowrap; }
.ct-sync-dot { width:6px; height:6px; border-radius:50%; background:var(--ink-4); flex-shrink:0; }
.ct-sync-dot.saving { background:var(--gold); animation:ct-pulse 1s ease-in-out infinite; }
.ct-sync-dot.success { background:#34d399; }
.ct-sync-dot.error { background:var(--rose,#f87171); }
@keyframes ct-pulse { 0%,100%{opacity:1} 50%{opacity:.25} }

/* Controls row */
.ct-controls { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; position:relative; z-index:10; }

/* Overflow dropdown for Sync / Import / Export */
.ct-more-wrap { position:relative; }
.ct-more-wrap summary { list-style:none; cursor:pointer; }
.ct-more-wrap summary::-webkit-details-marker { display:none; }
.ct-more-menu {
  position:absolute; top:calc(100% + 6px); right:0; z-index:60;
  background:var(--card-2); border:1px solid var(--line-2); border-radius:var(--r-sm);
  box-shadow:0 6px 20px rgba(0,0,0,.5); min-width:148px; padding:4px;
  display:flex; flex-direction:column; gap:2px;
}
.ct-more-item {
  display:flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:4px;
  font:500 13px/1 var(--f-body); color:var(--ink-2);
  background:transparent; border:0; width:100%; text-align:left;
  cursor:pointer; transition:background .12s,color .12s;
}
.ct-more-item:hover { background:var(--elevated); color:var(--ink); }
.ct-more-item svg { flex-shrink:0; opacity:.7; }

/* Tone guide collapse toggle */
.ai-tone-toggle {
  display:flex; align-items:center; gap:5px;
  background:none; border:0; padding:6px 0 2px; width:100%;
  font:500 11px/1 var(--f-body); color:var(--ink-3);
  cursor:pointer; text-align:left; transition:color .15s;
}
.ai-tone-toggle:hover { color:var(--ink-2); }
.ct-search-wrap { display:flex; align-items:center; gap:8px; background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:0 12px; height:36px; min-width:200px; flex:1; max-width:280px; }
.ct-search-wrap svg { color:var(--ink-3); flex-shrink:0; }
.ct-search-wrap input { background:none; border:none; outline:none; color:var(--ink); font:400 13px/1 var(--f-body); flex:1; }
.ct-search-wrap input::placeholder { color:var(--ink-4); }
.ct-filter-selects { display:flex; gap:8px; flex-wrap:wrap; }
.ct-filter-selects select { background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm); color:var(--ink-2); font:400 12px/1 var(--f-body); height:36px; padding:0 28px 0 10px; cursor:pointer; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2386868e' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 8px center; }
.ct-filter-selects select:focus { outline:none; border-color:var(--gold-deep); }
.ct-view-toggle { display:flex; background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; }
.ct-view-btn { display:flex; align-items:center; justify-content:center; width:34px; height:34px; background:none; border:none; cursor:pointer; color:var(--ink-4); transition:color .15s, background .15s; }
.ct-view-btn.active { background:var(--card); color:var(--ink); }
.ct-org-actions { display:flex; gap:6px; flex-wrap:wrap; margin-left:auto; }
.ct-org-btn { display:inline-flex; align-items:center; gap:5px; padding:0 10px; height:32px; background:none; border:1px solid var(--line); border-radius:var(--r-sm); color:var(--ink-3); font:500 11px/1 var(--f-body); cursor:pointer; transition:color .15s, border-color .15s; white-space:nowrap; }
.ct-org-btn:hover { color:var(--ink); border-color:var(--line-2); }
@media (pointer: coarse) { .ct-org-btn { min-height:44px; } }

/* Legend bar */
.ct-legend-bar { display:flex; align-items:center; gap:8px; margin-bottom:10px; min-height:28px; }
.ct-legend-toggle { display:inline-flex; align-items:center; gap:5px; background:none; border:none; cursor:pointer; color:var(--ink-3); font:500 11px/1 var(--f-body); padding:4px 0; transition:color .15s; flex-shrink:0; }
.ct-legend-toggle:hover { color:var(--ink); }
.ct-legend-toggle svg:last-child { transition:transform .2s var(--ease); }
.ct-legend-toggle.open svg:last-child { transform:rotate(180deg); }
.ct-legend-pills { display:none; gap:6px; flex-wrap:wrap; }
.ct-legend-pills.open { display:flex; }
.ct-legend-item { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:var(--pill); border:1px solid var(--line); background:none; cursor:pointer; color:var(--ink-3); font:500 11px/1 var(--f-body); transition:all .15s; }
.ct-legend-item:hover { border-color:var(--line-2); color:var(--ink-2); }
.ct-legend-item.active { border-color:currentColor; }
.ct-legend-dot, .org-dot { display:inline-block; width:6px; height:6px; border-radius:50%; flex-shrink:0; }

/* Org chip */
.org-chip { display:inline-flex; align-items:center; gap:5px; padding:2px 8px; border-radius:var(--pill); border:1px solid; font:600 11px/1 var(--f-body); white-space:nowrap; }

/* Scoped table */
.ct-table-wrap { overflow-x:auto; border-radius:var(--r); border:1px solid var(--line); }
.ct-table-wrap table { width:100%; border-collapse:collapse; }
.ct-table-wrap thead th { background:var(--bg-2); padding:9px 12px; text-align:left; font:600 10px/1 var(--f-display); letter-spacing: 0;  color:var(--ink-3); white-space:nowrap; border-bottom:1px solid var(--line); cursor:pointer; user-select:none; }
.ct-table-wrap thead th:last-child { cursor:default; }
.ct-table-wrap thead th.sorted { color:var(--gold); }
.ct-table-wrap thead th .sort-arrow { opacity:.5; font-style:normal; }
.ct-table-wrap thead th.sorted .sort-arrow { opacity:1; color:var(--gold); }
.ct-table-wrap tbody tr { border-bottom:1px solid var(--line); cursor:pointer; transition:background .1s; }
.ct-table-wrap tbody tr:last-child { border-bottom:none; }
.ct-table-wrap tbody tr:hover { background:var(--hover); }
.ct-table-wrap tbody tr.bulk-selected { background:rgba(244,241,236,.08); }
.ct-table-wrap tbody td { padding:9px 12px; font:400 13px/1.3 var(--f-body); color:var(--ink-2); vertical-align:middle; }
.ct-table-wrap tbody td:first-child { padding-left:14px; }
.ct-table-wrap .sort-btn-wrap { display:flex; align-items:center; gap:6px; }
.ct-table-wrap #sortSelect { background:var(--bg-2); border:1px solid var(--line); border-radius:5px; color:var(--ink-3); font:600 10px/1 var(--f-display); letter-spacing: 0;  padding:4px 20px 4px 6px; cursor:pointer; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none' stroke='%2386868e' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 5px center; }

/* Name cell */
.ct-name-cell { display:flex; align-items:center; gap:10px; }
.ct-name-cell .avatar { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font:700 11px/1 var(--f-display); color:#0a0a09; flex-shrink:0; overflow:hidden; }
.ct-name-cell .avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.ct-td-name { font:600 13px/1.2 var(--f-body); color:var(--ink); }
.ct-td-nick { font:500 11px/1 var(--f-display); color:var(--ink-3); margin-top:2px; letter-spacing:.3px; }
.ct-nick-at { color:var(--gold); opacity:.7; }
.ct-links-cell { display:flex; align-items:center; gap:6px; }
.ct-icon-link { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:var(--r-sm); color:var(--ink-3); transition:color .15s, background .15s; text-decoration:none; }
.ct-icon-link:hover { color:var(--gold); background:var(--gold-glow); }
.ct-row-actions { display:flex; align-items:center; gap:4px; opacity:0; transition:opacity .15s; }
.ct-table-wrap tbody tr:hover .ct-row-actions { opacity:1; }
.ct-row-btn { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:var(--r-sm); background:none; border:none; cursor:pointer; color:var(--ink-3); transition:color .15s, background .15s; }
.ct-row-btn:hover { color:var(--ink); background:var(--elevated); }
.ct-row-btn.danger:hover { color:var(--rose); background:var(--rose-bg); }
.cb-col { width:32px; text-align:center; }
.bulk-cb { width:14px; height:14px; accent-color:var(--gold); cursor:pointer; }

/* Cards */
.ct-cards-wrap { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
.ct-card { position:relative; border:1px solid var(--line); border-radius:var(--r); background:var(--card); overflow:hidden; cursor:pointer; transition:border-color .15s, box-shadow .15s; }
.ct-card:hover { border-color:var(--line-2); box-shadow:var(--shadow); }
.ct-card-top { display:flex; align-items:center; gap:10px; padding:14px 14px 10px; }
.ct-card-av { width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; font:700 13px/1 var(--f-display); color:#0a0a09; flex-shrink:0; overflow:hidden; }
.ct-card-av img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.ct-card-name { font:600 14px/1.2 var(--f-body); color:var(--ink); }
.ct-card-nick { font:500 11px/1 var(--f-display); color:var(--ink-3); margin-top:2px; letter-spacing:.3px; }
.ct-card-org { font:500 11px/1 var(--f-body); color:var(--ink-3); margin-top:3px; }
.ct-card-body { padding:0 14px 10px; display:flex; flex-direction:column; gap:5px; }
.ct-card-row { display:flex; align-items:center; gap:7px; color:var(--ink-3); font:400 12px/1.3 var(--f-body); }
.ct-card-row span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ct-card-footer { display:flex; align-items:center; justify-content:space-between; padding:8px 14px 12px; border-top:1px solid var(--line); margin-top:4px; }
.ct-card-actions { display:flex; gap:4px; }

/* Empty state */
.ct-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:60px 20px; }
.ct-empty-icon { font-size:32px; opacity:.4; }
.ct-empty-text { font:500 14px/1 var(--f-body); color:var(--ink-3); }

/* Group headers */
.ct-group-row td { padding:8px 14px 4px; background:var(--bg-2); font:600 11px/1 var(--f-display); letter-spacing: 0;  color:var(--ink-3); }
.ct-group-dot { display:inline-block; width:6px; height:6px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.ct-group-count { margin-left:6px; opacity:.5; font-weight:400; }

/* Detail side panel */
.ct-overlay-detail { position:fixed; inset:0; z-index:120; pointer-events:none; }
.ct-overlay-detail.open { pointer-events:auto; }
.ct-overlay-detail .ct-overlay-bg { position:absolute; inset:0; background:rgba(0,0,0,.5); opacity:0; transition:opacity .25s var(--ease); }
.ct-overlay-detail.open .ct-overlay-bg { opacity:1; }
.detail-panel { position:absolute; left:50%; top:50%; transform:translate(-50%,-48%) scale(.97); width:480px; max-width:calc(100vw - 32px); max-height:calc(100vh - 64px); background:var(--panel); border:1px solid var(--line-2); border-radius:var(--r); overflow-y:auto; opacity:0; transition:transform .22s var(--ease-out), opacity .18s; }
.ct-overlay-detail.open .detail-panel { transform:translate(-50%,-50%) scale(1); opacity:1; }
.dp-stripe { height:4px; }
.dp-header { padding:20px 20px 16px; border-bottom:1px solid var(--line); }
.dp-top { display:flex; align-items:flex-start; gap:12px; margin-bottom:12px; }
.dp-av { width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center; font:700 16px/1 var(--f-display); color:#0a0a09; flex-shrink:0; overflow:hidden; }
.dp-av img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.dp-name { font:700 18px/1.1 var(--f-display); color:var(--ink); letter-spacing:-.3px; }
.dp-nick { font:500 12px/1 var(--f-display); color:var(--ink-3); margin-top:4px; letter-spacing:.3px; }
.dp-role { font:400 13px/1.3 var(--f-body); color:var(--ink-2); margin-top:4px; }
.dp-tags { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
.dp-section { padding:16px 20px; border-bottom:1px solid var(--line); }
.dp-section:last-of-type { border-bottom:none; }
.dp-stitle { font:600 10px/1 var(--f-display); letter-spacing: 0;  color:var(--ink-3); margin-bottom:10px; }
.dp-row { display:flex; align-items:flex-start; gap:10px; margin-bottom:8px; color:var(--ink-2); font:400 13px/1.4 var(--f-body); }
.dp-row svg { flex-shrink:0; margin-top:1px; color:var(--ink-3); }
.dp-val a { color:var(--gold); text-decoration:none; }
.dp-val a:hover { text-decoration:underline; }
.dp-notes { font:400 13px/1.6 var(--f-body); color:var(--ink-2); background:var(--bg-2); border-radius:var(--r-sm); padding:10px 12px; }
.dp-footer { display:flex; gap:8px; padding:16px 20px; border-top:1px solid var(--line); }

/* Contact modal overlay */
.ct-overlay-modal { position:fixed; inset:0; z-index:130; display:flex; align-items:center; justify-content:center; opacity:0; pointer-events:none; transition:opacity .2s var(--ease); }
.ct-overlay-modal.open { opacity:1; pointer-events:auto; }
.ct-overlay-modal .ct-modal-scrim { position:absolute; inset:0; background:rgba(0,0,0,.65); }
.ct-modal-box { position:relative; background:var(--panel); border:1px solid var(--line); border-radius:var(--r-lg); width:640px; max-width:calc(100vw - 32px); max-height:90vh; display:flex; flex-direction:column; box-shadow:var(--shadow-lg); transform:translateY(8px); transition:transform .2s var(--ease-out); }
.ct-overlay-modal.open .ct-modal-box { transform:none; }
.ct-modal-hd { display:flex; align-items:center; gap:10px; padding:16px 20px; border-bottom:1px solid var(--line); flex-shrink:0; }
.ct-modal-title { font:700 15px/1 var(--f-display); color:var(--ink); letter-spacing:.3px; }
.ct-modal-title span { color:var(--gold); }
.ct-modal-close { margin-left:auto; width:28px; height:28px; background:none; border:none; cursor:pointer; color:var(--ink-3); border-radius:var(--r-sm); display:flex; align-items:center; justify-content:center; transition:color .15s, background .15s; font-size:14px; }
.ct-modal-close:hover { color:var(--ink); background:var(--elevated); }
.ct-modal-bd { overflow-y:auto; flex:1; padding:0; }
.ct-form-section { padding:16px 20px 4px; border-bottom:1px solid var(--line); }
.ct-form-section:last-child { border-bottom:none; }
.ct-form-stitle { font:600 10px/1 var(--f-display); letter-spacing: 0;  color:var(--gold-deep); margin-bottom:12px; }
.ct-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 14px; margin-bottom:12px; }
.ct-form-group { display:flex; flex-direction:column; gap:5px; }
.ct-form-group.full { grid-column:1/-1; }
.ct-form-group label { font:500 11px/1 var(--f-body); color:var(--ink-3); }
.ct-form-group label .req { color:var(--rose); }
.fi { background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm); color:var(--ink); font:400 13px/1 var(--f-body); padding:8px 10px; width:100%; transition:border-color .15s; }
.fi:focus { outline:none; border-color:var(--gold-deep); }
.fi::placeholder { color:var(--ink-4); }
.fs { background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm); color:var(--ink-2); font:400 13px/1 var(--f-body); padding:8px 28px 8px 10px; width:100%; cursor:pointer; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2386868e' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 8px center; transition:border-color .15s; }
.fs:focus { outline:none; border-color:var(--gold-deep); }
.ft { background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm); color:var(--ink); font:400 13px/1.5 var(--f-body); padding:8px 10px; width:100%; resize:vertical; min-height:80px; transition:border-color .15s; }
.ft:focus { outline:none; border-color:var(--gold-deep); }
.ct-modal-ft { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:14px 20px; border-top:1px solid var(--line); flex-shrink:0; }

/* Photo upload */
.photo-upload-wrap { display:flex; align-items:center; gap:12px; background:var(--bg-2); border:1px dashed var(--line-2); border-radius:var(--r-sm); padding:12px; cursor:pointer; transition:border-color .15s; }
.photo-upload-wrap:hover { border-color:var(--gold-deep); }
.photo-preview { width:44px; height:44px; border-radius:50%; background:var(--elevated); display:flex; align-items:center; justify-content:center; overflow:hidden; flex-shrink:0; color:var(--ink-3); }
.photo-preview img { width:100%; height:100%; object-fit:cover; }
.photo-upload-text { font:400 12px/1.5 var(--f-body); color:var(--ink-3); }
.photo-upload-text strong { color:var(--ink-2); }
.photo-remove-btn { margin-left:auto; font:500 11px/1 var(--f-body); color:var(--rose); background:var(--rose-bg); border:none; border-radius:var(--r-sm); padding:4px 8px; cursor:pointer; }

/* Import modal */
.import-drop { border:2px dashed var(--line-2); border-radius:var(--r); padding:32px 20px; text-align:center; cursor:pointer; transition:border-color .15s, background .15s; }
.import-drop:hover, .import-drop.drag { border-color:var(--gold-deep); background:var(--gold-glow); }
.import-text { font:600 14px/1 var(--f-body); color:var(--ink-2); margin-bottom:6px; }
.import-sub { font:400 11px/1.5 var(--f-body); color:var(--ink-4); }

/* Org manager rows */
.om-row { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.om-color { width:28px; height:28px; border-radius:5px; border:1px solid var(--line); cursor:pointer; padding:2px; background:none; }
.om-name-input { flex:1; background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm); color:var(--ink); font:400 13px/1 var(--f-body); padding:6px 10px; }
.om-name-input:focus { outline:none; border-color:var(--gold-deep); }
.om-count { font:400 11px/1 var(--f-body); color:var(--ink-4); white-space:nowrap; }
.om-del { background:none; border:none; cursor:pointer; color:var(--ink-4); font-size:16px; line-height:1; padding:2px 4px; transition:color .15s; }
.om-del:hover { color:var(--rose); }

/* Bulk action bar */
.bulk-bar { position:fixed; bottom:-64px; left:50%; transform:translateX(-50%); z-index:140; display:flex; align-items:center; gap:8px; background:var(--elevated); border:1px solid var(--line-2); border-radius:var(--r-lg); padding:10px 16px; box-shadow:var(--shadow-lg); transition:bottom .25s var(--ease-out); white-space:nowrap; }
.bulk-bar.visible { bottom:24px; }
.bulk-count { font:600 13px/1 var(--f-display); color:var(--gold); min-width:80px; }
.bulk-field-select, .bulk-select { background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm); color:var(--ink-2); font:400 12px/1 var(--f-body); padding:6px 22px 6px 8px; cursor:pointer; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none' stroke='%2386868e' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 6px center; }
.bulk-apply { background:var(--gold); color:#0a0a09; border:none; border-radius:var(--r-sm); padding:6px 12px; font:700 11px/1 var(--f-display); letter-spacing:.5px; cursor:pointer; transition:filter .15s; }
.bulk-apply:hover { filter:brightness(1.1); }
.bulk-del { background:var(--rose-bg); color:var(--rose); border:1px solid transparent; border-radius:var(--r-sm); padding:6px 12px; font:700 11px/1 var(--f-display); letter-spacing:.5px; cursor:pointer; transition:background .15s; }
.bulk-del:hover { background:rgba(224,128,143,.25); }
.bulk-close { background:none; border:none; cursor:pointer; color:var(--ink-4); font-size:14px; padding:2px 4px; transition:color .15s; }
.bulk-close:hover { color:var(--ink); }
.btn-bulk-active { background:var(--gold) !important; color:#0a0a09 !important; border-color:var(--gold) !important; }

@media (max-width: 860px) {
  .detail-panel { width:100vw; }
  .ct-form-grid { grid-template-columns:1fr; }
  .ct-controls { gap:8px; }
  .ct-org-actions { margin-left:0; }
  .ct-stats-bar { gap:0; }
  .ct-stat-chip { padding:6px 12px; min-width:56px; }
  .ct-chip-num { font-size:18px; }
  .bulk-bar { width:calc(100vw - 24px); flex-wrap:wrap; justify-content:center; bottom:-120px; }
  .bulk-bar.visible { bottom:16px; }
}

/* ----------------------------- POPOVERS (notifications + profile) -- */
.pop {
  position: fixed; z-index: 80; width: 332px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity .18s var(--ease-out), transform .18s var(--ease-out);
}
.pop.open { opacity: 1; pointer-events: auto; transform: none; }
#notifPop { top: 60px; right: 84px; }
#profilePop { left: 14px; bottom: 76px; width: 248px; transform: translateY(6px); }
#profilePop.open { transform: none; }
#profilePop::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 1;
  background: linear-gradient(90deg, transparent 5%, var(--gold-deep) 25%, var(--gold) 50%, var(--gold-deep) 75%, transparent 95%);
  pointer-events: none;
}
.pop-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.pop-h .gico { width: 15px; height: 15px; color: var(--gold-ink); }
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; line-height: 1.45; transition: background .15s; }
.notif:hover { background: rgba(255,255,255,.03); }
.notif:last-child { border-bottom: 0; }
.notif .ni { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.notif .ni svg { width: 15px; height: 15px; }
.notif .nw { color: var(--ink-4); font-size: 11px; font-family: var(--f-mono); margin-top: 3px; }
.notif.read { opacity: .5; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; background: none; border: 0; color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.menu-item:hover { background: rgba(244,241,236,.08); color: var(--ink); }
.menu-item:hover svg { color: var(--gold-ink); }
.menu-item svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; transition: color .15s; }
.menu-item.danger { color: var(--rose); }
.menu-item.danger svg { color: var(--rose); }

/* Profile trigger chevron rotation */
.profile-chev { transition: transform .18s var(--ease-out); }
#profileBtn[aria-expanded="true"] .profile-chev { transform: rotate(180deg); }
.pop-sep { height: 1px; background: var(--line); margin: 4px 0; }
.cpill[role="button"] { cursor: pointer; }
.cpill[role="button"]:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
@media (max-width: 640px) {
  #notifPop { right: 10px; left: 10px; width: auto; top: 56px; }
  #profilePop { left: 10px; bottom: 70px; }
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar-hud { display: none; }
  .searchbar { width: 38px; padding: 0; overflow: hidden; justify-content: center; }
  .searchbar > span, .searchbar kbd { display: none; }
  #createBtn { padding: 0; width: 38px; }
  #createBtn .btn-label { display: none; }
}

/* ===== Bolder match-day hero — figure-forward (no portrait card) ===== */
.hero-banner { min-height: 392px; }
.hb-greet { font-size: 2rem; }
@media (max-width: 900px) { .hb-greet { font-size: 1.625rem; } }
.hb-figure { position: relative; align-self: stretch; width: clamp(300px, 32vw, 430px); min-height: 300px; }
.hbf-spot { position: absolute; right: 2%; bottom: -4%; width: 94%; height: 98%; z-index: 0; pointer-events: none;
  background: radial-gradient(58% 60% at 53% 33%, var(--pcg, var(--gold-glow)), transparent 70%); }
.hbf-ghost { position: absolute; right: -3%; bottom: -12%; z-index: 0; pointer-events: none; user-select: none;
  font-family: var(--f-display); font-weight: 700; line-height: .8; letter-spacing: -.03em;
  font-size: clamp(150px, 17vw, 252px); color: var(--pc, var(--gold)); opacity: .12; }
.hbf-img, .hbf-sil { position: absolute; right: 4%; bottom: 0; height: 116%; width: auto; z-index: 1;
  filter: drop-shadow(0 30px 50px rgba(0,0,0,.55)); }
.hbf-img { max-width: 92%; object-fit: contain; object-position: bottom; }
.hbf-sil .body { fill: #100f0c; }
.hbf-sil .rim { fill: none; stroke: var(--pc, var(--gold)); stroke-width: 3; opacity: .92;
  filter: drop-shadow(0 0 16px var(--pcg, var(--gold-glow))); }
.hb-figure .hbf-name { position: absolute; left: 4%; bottom: 14px; z-index: 3; text-shadow: 0 2px 14px rgba(0,0,0,.7); }
.hb-figure .hbf-name .pn { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: -.01em; line-height: 1; margin-top: 7px; color: var(--ink); }
.hb-figure .hbf-name .ph { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.hb-enter .hb-figure { animation: hbFigIn 1s var(--ease-out) .35s both; }
@keyframes hbFigIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .hb-figure { order: -1; align-self: center; justify-self: center; width: 100%; max-width: 360px; min-height: 244px; }
  .hbf-img, .hbf-sil { position: relative; right: 0; height: 244px; margin: 0 auto; display: block; }
  .hbf-ghost { font-size: 124px; bottom: -6%; }
  .hb-figure .hbf-name { position: static; text-align: center; margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { .hb-enter .hb-figure { animation: none; } }
/* studio headshot (white-bg) treatment in the figure slot — feather into the hero, no hard box */
.hbf-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: 50% 10%;
  -webkit-mask-image: radial-gradient(76% 84% at 54% 38%, #000 48%, transparent 82%);
          mask-image: radial-gradient(76% 84% at 54% 38%, #000 48%, transparent 82%);
  z-index: 1; }
.hb-figure::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 48%; z-index: 2;
  pointer-events: none; background: linear-gradient(180deg, transparent, #100f0c 94%); }
.hb-figure .hbf-name { z-index: 3; }
.hb-figure.has-photo .hbf-sil { display: none; }

/* ===== Calmer hero motion — match the rest of the Hub (no decorative loops) ===== */
.hb-mc-row .hb-crest { animation: none; }       /* match-day crests no longer float */
.vs-clash.sm::before { animation: none; }        /* VS ring no longer pulses */
.hb-figure.has-photo .hbf-ghost { opacity: .05; } /* whisper the ghost initials behind the photo */
.brand-mark img { height: 26px; width: auto; display: block; }

/* Match kickoff time — prominent display inside the match card */
.hb-kickoff { display: flex; align-items: baseline; gap: 10px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.hb-kickoff-time { font-family: var(--f-mono); font-weight: 600; font-size: 1.375rem; color: var(--gold-ink); line-height: 1; letter-spacing: -.01em; }
.hb-kickoff-when { font-size: 12px; letter-spacing: 0;  color: var(--ink-3); }

/* ===================== THEME SYSTEM (light + dark) ===================== */
:root { --gold-ink: var(--gold); }   /* gold text color; dark theme = brand gold */
html { transition: none; }
:root[data-theme="light"]{
  --bg:#ffffff; --bg-2:#f4f3ef; --panel:#f1f0ea;
  --card:#ffffff; --card-2:#f7f6f1; --elevated:#efeee7; --hover:#eae8e0;
  --line:rgba(20,18,10,.10); --line-2:rgba(20,18,10,.14); --line-strong:rgba(20,18,10,.22);
  --ink:#0f0f10; --ink-2:#3b3b3f; --ink-3:#5f5f67; --ink-4:#83838b;
  --gold-ink:#7c6a30;                 /* readable gold text on white */
  --gold-glow:rgba(244,241,236,.28);
  --gold-bg:rgba(244,241,236,.20);
  --teal-bg:rgba(84,205,191,.16); --emerald-bg:rgba(92,192,142,.16); --violet-bg:rgba(155,140,232,.18); --rose-bg:rgba(224,128,143,.16); --sky-bg:rgba(107,182,224,.18); --gold-bg:rgba(244,241,236,.20);
  --shadow:0 1px 2px rgba(30,26,14,.06), 0 8px 24px rgba(30,26,14,.08);
  --shadow-lg:0 24px 60px rgba(30,26,14,.16);
  --glow:0 0 0 1px var(--gold-glow), 0 14px 40px rgba(244,241,236,.20);
}
/* surfaces that were hardcoded for dark */
:root[data-theme="light"] body{ background:var(--bg); }
:root[data-theme="light"] .sidebar{ background:linear-gradient(180deg,#fafaf7,#f2f1eb); }
:root[data-theme="light"] .topbar{ background:rgba(255,255,255,.82); }
:root[data-theme="light"] .nav-item:hover,
:root[data-theme="light"] .profile:hover,
:root[data-theme="light"] .tp-member:hover,
:root[data-theme="light"] .suggest-chip:hover{ background:rgba(20,18,10,.05); }
:root[data-theme="light"] .hb-matchcard,
:root[data-theme="light"] .cd-box,
:root[data-theme="light"] .pw-stat,
:root[data-theme="light"] .hb-cd .b{ background:rgba(20,18,10,.035); }
:root[data-theme="light"] .hb-crest.th,
:root[data-theme="light"] .team .crest.th{ background:linear-gradient(160deg,#f6f0db,#efe6c8); }
/* readable accent text on white */
:root[data-theme="light"] .c-emerald{ color:#2e9b63; }
:root[data-theme="light"] .c-teal{ color:#1f988b; }
:root[data-theme="light"] .c-rose{ color:#c4566a; }
:root[data-theme="light"] .c-violet{ color:#6e57c9; }
:root[data-theme="light"] .c-sky{ color:#2c84bd; }
/* team logos are designed for dark backgrounds — force dark chip in light mode */
:root[data-theme="light"] .crest:has(.crest-logo),
:root[data-theme="light"] .hb-crest:has(.crest-logo) {
  background: #1c1a11 !important;
  border-color: rgba(244,241,236,.22) !important;
}
/* theme-aware logo (white crest on dark, ink crest on light) */
.brand-mark .logo-l{ display:none; }
:root[data-theme="light"] .brand-mark{ background:#f0eee6; border-color:rgba(20,18,10,.10); box-shadow:none; }
:root[data-theme="light"] .brand-mark .logo-d{ display:none; }
:root[data-theme="light"] .brand-mark .logo-l{ display:block; }
/* theme toggle button */
.theme-toggle .moon{ display:block; } .theme-toggle .sun{ display:none; }
:root[data-theme="light"] .theme-toggle .moon{ display:none; } :root[data-theme="light"] .theme-toggle .sun{ display:block; }

/* --- light mode: hero is a light card, consistent with the theme --- */
:root[data-theme="light"] .hero-banner{
  --ink:#0f0f10; --ink-2:#3b3b3f; --ink-3:#5f5f67; --ink-4:#83838b;
  --gold-ink:#7c6a30; --line:rgba(20,18,10,.10); --line-2:rgba(20,18,10,.14); --card:#ffffff; --card-2:#f7f6f1;
  background: radial-gradient(680px 340px at 6% -38%, rgba(244,241,236,.16), transparent 70%), linear-gradient(180deg,#faf9f5,#ffffff);
  border-color: var(--line-2);
}
:root[data-theme="light"] .hb-bloom{ display:none; }
:root[data-theme="light"] .hb-grid-bg{ background-image: radial-gradient(rgba(20,18,10,.05) 1px, transparent 1.5px); }
:root[data-theme="light"] .hb-matchcard{ background:none; border-color:transparent; }
:root[data-theme="light"] .hb-crest.th{ background:linear-gradient(160deg,#f3ecd6,#ece2c2); color:#7c6a30; border-color:rgba(244,241,236,.5); }
:root[data-theme="light"] .hb-figure::after{ background:linear-gradient(180deg, transparent, #ffffff 92%); }
:root[data-theme="light"] .hb-figure .hbf-name{ text-shadow:none; }
:root[data-theme="light"] .hb-figure .hbf-name .pn{ color:var(--ink); }
:root[data-theme="light"] .hb-figure .hbf-name .ph{ color:var(--ink-2); }
:root[data-theme="light"] .hbf-ghost{ color:#1a1a1a; opacity:.045; }

/* --- smoother sidebar collapse: clip-reveal, no label wrapping --- */
.nav-item, .nav-label { white-space: nowrap; }
.brand-text { white-space: nowrap; overflow: hidden; }
.brand-text .name, .brand-text .sub { white-space: nowrap; }
.nav-item { transition: color .2s var(--ease), background .2s var(--ease); }
body.sidebar-collapsed .nav-item { justify-content: flex-start; font-size: 13.5px; padding: 9px 0 9px 15px; gap: 11px; }
/* nav label spans: smooth collapse to a clean icon-only rail */
.nav-text { display:inline-block; white-space:nowrap; overflow:hidden; max-width:200px; transition: max-width .32s var(--ease), opacity .2s var(--ease); }
body.sidebar-collapsed .nav-item { justify-content:center; padding:9px 0; gap:0; font-size:13.5px; }
body.sidebar-collapsed .nav-text { max-width:0; opacity:0; }

/* ===================================================================
   HERO ANIMATION LAYER — purposeful motion for the match-day hero
   =================================================================== */

/* 1. Live dot: breathing pulse — signals "this is happening now" */
.live-dot { animation: livePulse 2.2s ease-in-out infinite; }
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .45; transform: scale(.78); }
}

/* 2. Greeting: blur-in reveal — cinematic entrance over the plain rise */
.hb-enter .hb-greet {
  animation: heroGreetIn .95s cubic-bezier(0.16, 1, 0.3, 1) calc(2 * 90ms + .12s) both;
}
@keyframes heroGreetIn {
  from { opacity: 0; transform: translateY(12px); filter: blur(10px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

/* 3. Portrait figure: continuous gentle float after entrance */
.hb-figure { animation: figFloat 9s ease-in-out 1s infinite; }
.hb-enter .hb-figure { animation: hbFigIn 1s var(--ease-out) .35s both, figFloat 9s ease-in-out 1.35s infinite; }
@keyframes figFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-7px); }
}

/* 4. Spotlight: slow breathing glow behind the player */
.hbf-spot { animation: spotBreath 5s ease-in-out infinite; }
@keyframes spotBreath {
  0%, 100% { opacity: .8; transform: scale(1); }
  50%       { opacity: 1; transform: scale(1.08); }
}

/* 5. Kickoff time: one-time gold bloom as the card settles */
.hb-enter .hb-kickoff-time {
  animation: kickoffFlash 1.5s ease-out calc(3 * 90ms + .12s + .45s) both;
}
@keyframes kickoffFlash {
  0%   { color: var(--gold-ink); text-shadow: none; }
  35%  { color: var(--gold); text-shadow: 0 0 18px var(--gold-glow), 0 0 36px var(--gold-glow); }
  100% { color: var(--gold-ink); text-shadow: none; }
}

/* Reduced motion: no transforms, no blur, no loops */
@media (prefers-reduced-motion: reduce) {
  .live-dot                   { animation: none; opacity: 1; }
  .topbar-hud .sd             { animation: none; }
  .hbf-spot                   { animation: none; }
  .hb-figure                  { animation: none; }
  .hb-enter .hb-figure        { animation: none; opacity: 1; }
  .hb-enter .hb-greet         { animation: heroRise .4s var(--ease-out) calc(2 * 90ms + .12s) both; }
  .hb-enter .hb-kickoff-time  { animation: none; }
}

/* ===================================================================
   MATCH-DAY BRIEF
   =================================================================== */
.mdb-wrap {
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--mdb-c, var(--gold)) 28%, var(--line));
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.mdb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.mdb-prog {
  display: inline-block;
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  flex-shrink: 0;
}
.mdb-prog-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 2px;
  transform-origin: left;
  transition: transform .4s var(--ease-out);
}
.mdb-body {
  display: grid;
  grid-template-columns: 1fr 1fr 200px;
  gap: 0;
}
.mdb-col {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}
.mdb-col:last-child { border-right: none; }
.mdb-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0; 
  color: var(--ink-3);
  margin-bottom: 10px;
}
.mdb-task {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 5px 0;
  cursor: pointer;
  text-align: left;
  opacity: 1;
  transition: opacity .15s;
}
.mdb-task:hover { opacity: .75; }
.mdb-task.done { color: var(--ink-3); text-decoration: line-through; }
.mdb-task svg { color: var(--emerald); flex-shrink: 0; width: 16px; height: 16px; }
.mdb-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong, rgba(255,255,255,.18));
  flex-shrink: 0;
}
.mdb-restrictions { display: flex; flex-direction: column; gap: 6px; }
.mdb-restriction {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.4;
  padding: 6px 8px;
  background: var(--bg-2, rgba(255,255,255,.03));
  border-radius: 6px;
  border: 1px solid var(--line);
}
.mdb-ai { display: flex; flex-direction: column; }
@media (max-width: 860px) {
  .mdb-body { grid-template-columns: 1fr 1fr; }
  .mdb-ai { display: none; }
}
@media (max-width: 600px) {
  .mdb-body { grid-template-columns: 1fr; }
  .mdb-col { border-right: none; border-bottom: 1px solid var(--line); }
  .mdb-col:last-child { border-bottom: none; }
}

/* ============================= REMINDERS ============================= */
.rm-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px;
  flex-wrap: wrap;
}
.rm-tabs { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; }
.rm-tab {
  height: 30px; padding: 0 14px; border-radius: 7px;
  font-size: 12px; font-weight: 500; color: var(--ink-3); transition: all .2s;
}
.rm-tab.active { background: var(--card-2); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--ink-3); }
.btn.ghost:hover { background: rgba(255,255,255,.04); color: var(--ink); }
.btn.ghost.active { border-color: var(--gold-deep); color: var(--gold-ink); background: var(--gold-bg); }

.rm-section { margin-bottom: 24px; }
.rm-sec-h {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; 
  margin-bottom: 8px;
}
.rm-sec-count {
  background: var(--card-2); color: var(--ink-3);
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px;
  border: 1px solid var(--line);
}
/* Overdue section — label and badge in rose */
.rm-section--rose .rm-sec-h { color: var(--rose); }
.rm-section--rose .rm-sec-count { background: var(--rose-bg); border-color: rgba(224,128,143,.25); color: var(--rose); }
/* Today section — label and badge in gold */
.rm-section--gold .rm-sec-h { color: var(--gold-ink); }
.rm-section--gold .rm-sec-count { background: var(--gold-bg); border-color: rgba(244,241,236,.25); color: var(--gold-ink); }
.rm-list { display: flex; flex-direction: column; gap: 4px; }

.rm-list { display: flex; flex-direction: column; gap: 4px; }
.rm-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 0; border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid transparent;
  transition: border-color .15s, background .15s;
}
.rm-card:hover { border-color: var(--line-2); background: var(--card-2); }
.rm-card--high { border-left-color: var(--rose); }
.rm-card--medium { border-left-color: var(--gold); }
.rm-card.is-overdue { border-color: rgba(224,128,143,.2); }
.rm-card.is-done { opacity: .5; }

.rm-toggle {
  flex-shrink: 0; width: 20px; height: 20px; margin-left: 12px;
  border-radius: 50%; border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; transition: all .2s; color: var(--ink-4);
}
.rm-toggle:hover { border-color: var(--gold); color: var(--gold); }
.rm-toggle.is-done { border-color: var(--emerald); color: var(--emerald); background: var(--emerald-bg); }
.rm-circle { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; display: block; }
.rm-toggle .gico { width: 14px; height: 14px; }

.rm-body { flex: 1; min-width: 0; }
.rm-title {
  font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.35; margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rm-card.is-done .rm-title { text-decoration: line-through; color: var(--ink-3); }
.rm-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rm-chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 500; color: var(--ink-3);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px;
  padding: 2px 6px; white-space: nowrap;
}
.rm-chip .gico { width: 10px; height: 10px; }
.rm-chip--task { color: var(--emerald); background: var(--emerald-bg); border-color: rgba(92,192,142,.2); }
.rm-chip--deadline { color: var(--rose); background: var(--rose-bg); border-color: rgba(224,128,143,.2); }
.rm-chip--link { color: var(--sky); background: var(--sky-bg); border-color: rgba(107,182,224,.2); }

.rm-date {
  flex-shrink: 0; font-size: 11.5px; color: var(--ink-3); white-space: nowrap;
  font-variant-numeric: tabular-nums; align-self: center; padding-right: 4px;
}
.rm-date--overdue { color: var(--rose); font-weight: 600; }

.rm-row-acts {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
  opacity: 0; transition: opacity .12s;
}
.rm-card:hover .rm-row-acts { opacity: 1; }
.rm-act-btn {
  width: 26px; height: 26px; border-radius: 6px;
  display: grid; place-items: center; color: var(--ink-4); transition: all .15s;
}
.rm-act-btn:hover { background: var(--elevated); color: var(--ink); }
.rm-act-btn.rm-act-del:hover { color: var(--rose); background: var(--rose-bg); }
.rm-act-btn .gico { width: 13px; height: 13px; }

.rm-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 64px 24px; color: var(--ink-3); text-align: center;
}
.rm-empty p { font-size: 14px; margin: 0; }

/* Reminder modal helpers */
.field-lbl { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.rm-notify-lbl {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 500; color: var(--ink-2); cursor: pointer;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  transition: border-color .15s;
}
.rm-notify-lbl:has(input:checked) { border-color: rgba(244,241,236,.4); color: var(--gold-ink); background: var(--gold-bg); }
.rm-notify-lbl input { accent-color: var(--gold); }

/* ============================= COPY VALIDATOR ============================= */
.cv-score-card {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 20px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line); margin-bottom: 14px;
}
.cv-score-ring {
  flex-shrink: 0; width: 72px; height: 72px; border-radius: 50%;
  border: 4px solid var(--line-strong);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: border-color .3s;
}
.cv-ring--emerald { border-color: var(--emerald); }
.cv-ring--gold    { border-color: var(--gold); }
.cv-ring--rose    { border-color: var(--rose); }
.cv-score-num { font-size: 22px; font-weight: 700; line-height: 1; }
.cv-score-lbl { font-size: 10px; color: var(--ink-3); font-weight: 500; }
.cv-ring--emerald .cv-score-num { color: var(--emerald); }
.cv-ring--gold .cv-score-num    { color: var(--gold); }
.cv-ring--rose .cv-score-num    { color: var(--rose); }

.cv-section { margin-bottom: 14px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); }
.cv-sec-h {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  margin-bottom: 10px;
}
.cv-sec-h .gico { width: 13px; height: 13px; }
.cv-issues { display: flex; flex-direction: column; gap: 6px; }
.cv-issue {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.4;
  padding: 6px 8px; border-radius: 6px;
}
.cv-issue--error { background: var(--rose-bg); color: var(--rose); }
.cv-issue--warn  { background: rgba(244,241,236,.1); color: var(--gold-ink); }
.cv-issue .gico  { width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px; }
.cv-suggestion {
  font-size: 12.5px; color: var(--ink-2); padding: 5px 0;
  border-bottom: 1px solid var(--line); line-height: 1.45;
}
.cv-suggestion:last-child { border-bottom: none; }
.cv-rewrite {
  font-size: 13px; line-height: 1.55; color: var(--ink);
  background: var(--bg-2); border-radius: 8px;
  padding: 12px 14px; border: 1px solid var(--line);
  white-space: pre-wrap;
}
.suggest-chip.added { background: var(--emerald-bg); color: var(--emerald); border-color: rgba(92,192,142,.3); pointer-events: none; }

/* ============================= TREND RADAR ============================= */
.tr-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px;
}

.tr-empty {
  text-align: center; padding: 60px 20px;
  color: var(--ink-3); font-size: 13.5px; line-height: 1.6;
}
.tr-empty .gico { width: 32px; height: 32px; margin: 0 auto 12px; color: var(--ink-4); display: block; }

.tr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.tr-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px;
  transition: border-color .15s;
}
.tr-card:hover { border-color: var(--line-2); }

.tr-card-head {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px;
}
.tr-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--teal-bg); color: var(--teal);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tr-icon .gico { width: 15px; height: 15px; }
.tr-card-meta { flex: 1; min-width: 0; }
.tr-card-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.tr-card-date  { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }
.tr-card-acts  { display: flex; gap: 6px; flex-shrink: 0; }

.tr-desc {
  font-size: 13px; color: var(--ink-2); line-height: 1.55;
  margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tr-source {
  font-size: 12px; color: var(--ink-4);
  display: flex; align-items: center; gap: 5px; margin-bottom: 12px;
}
.tr-source a { color: var(--teal); text-decoration: none; }
.tr-source a:hover { text-decoration: underline; }
.tr-source .gico { width: 11px; height: 11px; }

.tr-card-footer {
  display: flex; align-items: center; gap: 8px;
  padding-top: 12px; border-top: 1px solid var(--line);
}

.tr-analysis {
  margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px;
}
.tr-acct-tabs {
  display: flex; gap: 4px; margin-bottom: 12px;
}
.tr-acct-tab {
  font-size: 11.5px; font-weight: 600; padding: 4px 10px;
  border-radius: 6px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-3); cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.tr-acct-tab.active {
  background: var(--teal-bg); color: var(--teal); border-color: rgba(84,205,191,.3);
}
.tr-acct-tab:hover:not(.active) { background: var(--hover); color: var(--ink-2); }

.tr-acct-body {
  font-size: 13px; color: var(--ink-2); line-height: 1.6;
  white-space: pre-wrap;
  background: var(--bg-2); border-radius: 8px;
  padding: 12px 14px; border: 1px solid var(--line);
  min-height: 60px;
}
.tr-acct-body.loading { color: var(--ink-4); font-style: italic; }
.tr-acct-body.error   { color: var(--rose); }

/* Light mode */
[data-theme="light"] .tr-card { background: #fff; border-color: var(--line); }
[data-theme="light"] .tr-card:hover { border-color: var(--line-2); }

/* ============================= REMINDERS DRAWER ============================= */
#remDrScrim {
  position: fixed; inset: 0; z-index: 118;
  background: rgba(0,0,0,.45);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
#remDrScrim.open { opacity: 1; visibility: visible; }

#remDrawer {
  position: fixed; top: 0; right: -360px; bottom: 0;
  width: 340px; z-index: 119;
  background: var(--panel); border-left: 1px solid var(--line-2);
  box-shadow: none;
  display: flex; flex-direction: column;
  transition: right .28s var(--ease-out), box-shadow .28s var(--ease-out);
}
#remDrawer.open { right: 0; box-shadow: -12px 0 40px rgba(0,0,0,.5); }

.rd-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.rd-title { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 7px; flex: 1; }
.rd-title .gico { width: 15px; height: 15px; }

.rd-date {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.rd-date-day { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.rd-date-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.rd-body {
  flex: 1; overflow-y: auto; padding: 12px 0;
}

.rd-section { margin-bottom: 4px; }
.rd-sec-h {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0;
  color: var(--ink-4); 
  padding: 8px 16px 4px;
}
.rd-sec-h .gico { width: 11px; height: 11px; }

.rd-match-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; cursor: pointer; transition: background .12s;
}
.rd-match-row:hover { background: var(--hover); }
.rd-match-time { font-size: 12px; font-weight: 600; color: var(--gold-ink); font-family: var(--f-mono); width: 40px; flex-shrink: 0; }
.rd-match-info { flex: 1; min-width: 0; }
.rd-match-opp  { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-match-comp { font-size: 11px; color: var(--ink-3); }

.rd-card {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 8px 16px; cursor: pointer; transition: background .12s;
}
.rd-card:hover { background: var(--hover); }
.rd-card.is-overdue .rd-card-title { color: var(--rose); }
.rd-card.is-done { opacity: .45; }
.rd-card-toggle {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: transparent;
  cursor: pointer; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .12s, background .12s;
}
.rd-card-toggle:hover { border-color: var(--gold); }
.rd-card-toggle.done { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.rd-card-toggle.done .gico { width: 10px; height: 10px; }
.rd-card-body { flex: 1; min-width: 0; }
.rd-card-title { font-size: 13px; color: var(--ink); line-height: 1.35; }
.rd-card-meta  { font-size: 11px; color: var(--ink-4); margin-top: 2px; display: flex; gap: 6px; }

@media (max-width: 860px) {
  .rd-card-toggle { width: 28px; height: 28px; }
  .rm-toggle { width: 28px; height: 28px; }
}
.rd-empty { text-align: center; padding: 24px 16px; color: var(--ink-4); font-size: 12.5px; }

.rd-foot {
  padding: 12px 16px; border-top: 1px solid var(--line); flex-shrink: 0;
}

/* Light mode overrides */
[data-theme="light"] .rm-card:hover { background: rgba(0,0,0,.03); }
[data-theme="light"] .rm-tabs { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.1); }
[data-theme="light"] .rm-tab.active { background: #fff; }
[data-theme="light"] .rm-sec-count { background: rgba(0,0,0,.06); }

/* ══════════════════ PREFERENCES OVERLAY (v81) ═══════════════════════ */

/* Full-screen backdrop */
.pref-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .18s var(--ease-out);
}
.pref-overlay.open { opacity: 1; pointer-events: auto; }

/* Sheet */
.pref-sheet {
  width: min(760px,96vw); height: min(560px,90vh);
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: 0 32px 80px rgba(0,0,0,.72);
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(.96) translateY(10px);
  transition: transform .2s var(--ease-out);
}
.pref-overlay.open .pref-sheet { transform: none; }

/* Sheet header */
.pref-sheet-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px 12px; border-bottom: 1px solid var(--line);
  flex: none;
}
.pref-sheet-title { font-size: 13px; font-weight: 700; font-family: var(--f-display); color: var(--ink); letter-spacing: .02em; }
.pref-sheet-close {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  color: var(--ink-4); transition: background .12s, color .12s;
}
.pref-sheet-close:hover { background: var(--hover); color: var(--ink); }
.pref-sheet-close .gico { width: 14px; height: 14px; }

/* Body: rail + panel */
.pref-body { display: flex; flex: 1; min-height: 0; }

/* Rail */
.pref-rail {
  width: 176px; flex: none;
  background: var(--bg-2); border-right: 1px solid var(--line);
  padding: 14px 7px; overflow-y: auto;
}
.pref-rail-group { margin-bottom: 18px; }
.pref-rail-label {
  display: block; font-size: 10px; font-weight: 600;
  letter-spacing: 0; 
  color: var(--ink-4); padding: 0 8px 6px;
}
.pref-rail-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 8px; border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--ink-3); text-align: left;
  transition: background .12s, color .12s;
}
.pref-rail-item .gico { width: 15px; height: 15px; flex: none; }
.pref-rail-item:hover { background: var(--hover); color: var(--ink-2); }
.pref-rail-item.active { background: var(--gold-bg); color: var(--gold-ink); }
.pref-rail-item:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Content panel */
.pref-panel { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 28px 40px; }
.pref-panel-content { max-width: 520px; }

/* Section header */
.pref-sec-hd { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pref-sec-hd h2 { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 3px; font-family: var(--f-display); }
.pref-sec-hd p { font-size: 12px; color: var(--ink-4); font-family: var(--f-body); }

/* Pref row — label+desc LEFT, control RIGHT */
.pref-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 12px 8px 12px 10px; border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: background .1s, border-color .12s;
}
.pref-sec-hd + .pref-row { border-top: 1px solid var(--line); }
.pref-row:hover { background: rgba(255,255,255,.025); border-left-color: var(--gold); }
.pref-lbl { flex: 1; min-width: 0; }
.pref-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.pref-desc { font-size: 11px; color: var(--ink-4); margin-top: 2px; line-height: 1.4; }
.pref-ctrl { flex: none; display: flex; align-items: center; }

/* Readonly values */
.pref-val {
  font-size: 12.5px; color: var(--ink-3);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 5px 10px; line-height: 1.4;
}
.pref-val.mono { font-family: var(--f-mono); font-size: 11px; }

/* Select */
.pref-select {
  padding: 7px 28px 7px 11px;
  border-radius: var(--r-sm);
  background: var(--elevated);
  border: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--ink);
  appearance: none; cursor: pointer; min-width: 130px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,.35)' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color .15s, box-shadow .15s;
}
.pref-select:hover { border-color: var(--line-strong); outline: none; }
.pref-select:focus { border-color: rgba(244,241,236,.45); box-shadow: 0 0 0 3px var(--gold-glow); outline: none; }

/* Segmented control — active uses gold fill */
.pref-seg {
  display: inline-flex; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 3px; gap: 2px;
}
.pref-seg-btn {
  padding: 5px 12px; border-radius: 7px; font-size: 12px;
  color: var(--ink-3); transition: background .12s, color .12s; white-space: nowrap;
}
.pref-seg-btn:hover { color: var(--ink-2); background: var(--hover); }
.pref-seg-btn.active { background: var(--gold); color: #1a1206; font-weight: 600; }
.pref-seg-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Avatar gradient swatches */
.pref-grad-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pref-grad-swatch {
  width: 24px; height: 24px; border-radius: 50%; flex: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .12s, border-color .12s;
}
.pref-grad-swatch:hover { transform: scale(1.15); }
.pref-grad-swatch.active { border-color: var(--gold); }

/* Accent color swatches */
.pref-accent-row { display: flex; gap: 6px; }
.pref-accent-swatch {
  width: 20px; height: 20px; border-radius: 50%; flex: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .12s, border-color .12s;
}
.pref-accent-swatch:hover { transform: scale(1.15); }
.pref-accent-swatch.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(244,241,236,.28); }

/* Toggle (notifications) */
.pref-toggle {
  width: 36px; height: 20px; border-radius: 10px; flex: none;
  background: var(--line-strong); position: relative;
  transition: background .18s; cursor: pointer;
}
.pref-toggle.on { background: var(--emerald); }
.pref-toggle-thumb {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; pointer-events: none;
  transition: transform .18s var(--ease-out);
}
.pref-toggle.on .pref-toggle-thumb { transform: translateX(16px); }

/* Members list */
.pref-members { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 4px; }
.pref-member-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.pref-member-row:last-child { border-bottom: none; }
.pref-member-row:hover { background: var(--hover); }
.pref-member-info { flex: 1; min-width: 0; }
.pref-member-name { font-size: 12.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.pref-member-role { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.pref-member-email { font-size: 10.5px; color: var(--ink-4); flex: none; font-family: var(--f-mono); }
.pref-you-badge {
  font-size: 10px; font-weight: 700; color: var(--gold-ink);
  background: var(--gold-bg); border: 1px solid rgba(244,241,236,.22);
  border-radius: 4px; padding: 0 5px; line-height: 1.8;
}

/* Placeholder (AI / Integrations stubs) */
.pref-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 24px; color: var(--ink-4); text-align: center; margin-top: 4px;
}
.pref-placeholder .gico { width: 20px; height: 20px; }
.pref-placeholder p { font-size: 12.5px; line-height: 1.6; max-width: 260px; }
.pref-accent-ctrl { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.pref-accent-name { font-size: 10px; color: var(--ink-4); font-family: var(--f-body); letter-spacing: .03em; line-height: 1; text-transform: capitalize; }
.pref-sec-footer { padding: 16px 8px 0; display: flex; justify-content: flex-end; }
.pref-reset { font-size: 11.5px; color: var(--ink-4); background: none; border: none; cursor: pointer; padding: 5px 8px; border-radius: var(--r-sm); transition: color .12s, background .12s; }
.pref-reset:hover { color: var(--rose); background: var(--rose-bg); }
.pref-select:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Density variants */
body.density-compact { font-size: 0.8125rem; }
body.density-compact .view { padding-top: 18px; padding-bottom: 40px; }
body.density-comfortable { font-size: 0.9375rem; }
body.density-comfortable .view { padding-top: 36px; padding-bottom: 80px; }

/* Light-mode overrides */
[data-theme="light"] .pref-overlay { background: rgba(0,0,0,.45); }
[data-theme="light"] .pref-sheet { background: #f4f4f2; border-color: rgba(0,0,0,.12); }
[data-theme="light"] .pref-rail { background: rgba(0,0,0,.03); }
[data-theme="light"] .pref-rail-item.active { background: rgba(244,241,236,.12); }
[data-theme="light"] .pref-members { background: #fff; }
[data-theme="light"] .pref-seg { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.1); }
[data-theme="light"] .pref-seg-btn.active { background: var(--gold); color: #1a1206; }
[data-theme="light"] .pref-val { background: #fff; }
[data-theme="light"] .pref-select {
  background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(0,0,0,.4)' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
[data-theme="light"] .v-sel { background: #fff !important; }
[data-theme="light"] textarea.input, [data-theme="light"] input.input { background: #fff; }
[data-theme="light"] .pref-toggle { background: rgba(0,0,0,.15); }

/* ========================= MOBILE BOTTOM NAV ========================= */
.sidebar-scrim {
  display: none;
  position: fixed; inset: 0; z-index: 39;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .25s var(--ease);
  pointer-events: none;
}
.sidebar-scrim.open { opacity: 1; pointer-events: auto; }

.mob-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  height: calc(57px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  justify-content: space-around; align-items: stretch;
}
.mob-nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  flex: 1; padding: 6px 4px; position: relative;
  background: none; border: none; cursor: pointer; touch-action: manipulation;
  color: var(--ink-4); font-size: 9.5px; font-weight: 500; letter-spacing: .01em;
  transition: color .15s; -webkit-tap-highlight-color: transparent;
}
.mob-nav-btn svg { width: 21px; height: 21px; stroke-width: 1.75; flex: none; }
.mob-nav-btn.active { color: var(--gold-ink); }
.mob-nav-btn.active svg { color: var(--gold-ink); }
.mob-nav-badge {
  position: absolute; top: 5px; left: 50%; transform: translateX(4px);
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: var(--gold); color: #0c0c0f;
  font-size: 9px; font-weight: 700; line-height: 15px; text-align: center;
  font-family: var(--f-mono);
  box-shadow: 0 0 0 2px var(--bg-2);
}

/* ========================= MOBILE LAYOUT (≤768px) ========================= */
@media (max-width: 768px) {
  /* .app z-index creates a stacking context that traps the fixed sidebar below the scrim.
     Resetting to auto lets the sidebar (z:40) and scrim (z:39) compare in the root context. */
  .app { z-index: auto; }

  /* Show mobile elements */
  .mob-nav { display: flex; }
  .sidebar-scrim { display: block; }

  /* Topbar — 56px, tighter */
  :root { --topbar: 56px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar .crumb { display: none; }
  .topbar h1 { font-size: 15px; letter-spacing: -.01em; }
  .topbar-hud { display: none; }

  /* View — account for bottom nav height */
  .view { padding: 16px 14px calc(80px + env(safe-area-inset-bottom)); }

  /* Scroll area — full height minus topbar */
  .scroll { height: calc(100dvh - var(--topbar)); }

  /* Main gradient fade at bottom — clip it away on mobile */
  .main::after { display: none; }

  /* Sidebar — force visible text even when collapsed class persists */
  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-badge,
  body.sidebar-collapsed .collapse-hide,
  body.sidebar-collapsed .profile > div:not(.avatar),
  body.sidebar-collapsed .profile > svg { display: revert; }
  body.sidebar-collapsed .nav-item { font-size: 13.5px; justify-content: flex-start; padding: 9px 11px; gap: 11px; }
  body.sidebar-collapsed .nav-item::after { content: none; }
  body.sidebar-collapsed .brand { flex-direction: row; gap: 11px; }
  body.sidebar-collapsed .collapse-btn { margin-left: auto; }

  /* Sidebar open state — show scrim */
  #sidebar.open ~ #sidebarScrim,
  body:has(#sidebar.open) .sidebar-scrim { opacity: 1; pointer-events: auto; }

  /* Modal → bottom sheet */
  .modal {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%;
    max-height: 94dvh;
    transform: translateY(16px); opacity: 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    /* drag handle visual hint */
  }
  .modal::before {
    content: ''; display: block; width: 36px; height: 4px;
    background: var(--line-strong); border-radius: 2px;
    margin: 10px auto 0; flex: none;
  }
  .modal.open { transform: none; opacity: 1; }
  .modal-h { padding: 10px 16px 14px; }
  .modal-b { padding: 14px 16px; }
  .modal-f { padding: 12px 16px; }

  /* Composer grid → single column */
  .composer-grid { grid-template-columns: 1fr; }

  /* Preferences sheet → full-height bottom sheet */
  .pref-overlay { align-items: flex-end; }
  .pref-sheet {
    width: 100%; height: 94dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(100%);
  }
  .pref-overlay.open .pref-sheet { transform: none; }
  .pref-sheet::before {
    content: ''; display: block; width: 36px; height: 4px;
    background: var(--line-strong); border-radius: 2px;
    margin: 10px auto 2px; flex: none;
  }
  /* Prefs rail → horizontal scroll tabs */
  .pref-body { flex-direction: column; }
  .pref-rail {
    width: 100%; flex: none;
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    display: flex; flex-direction: row; gap: 4px;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pref-rail::-webkit-scrollbar { display: none; }
  .pref-rail-group { display: contents; }
  .pref-rail-label { display: none; }
  .pref-rail-item {
    flex: none; padding: 6px 14px; border-radius: var(--pill);
    white-space: nowrap;
    background: var(--card);
  }
  .pref-rail-item.active { background: var(--gold-bg); color: var(--gold-ink); }
  .pref-panel { padding: 18px 16px 40px; }

  /* Contact detail panel → bottom sheet */
  .detail-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    transform: translateY(100%);
    width: 100%; max-width: 100%; max-height: 90dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    opacity: 1;
  }
  .ct-overlay-detail.open .detail-panel { transform: none; }

  /* Profile popup → anchored above bottom nav */
  #profilePop {
    left: 0; right: 0; bottom: calc(57px + env(safe-area-inset-bottom) + 4px);
    width: auto; border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(8px);
  }
  #profilePop.open { transform: none; }

  /* Notifications popup → full width below topbar */
  #notifPop { left: 8px; right: 8px; top: 58px; width: auto; }

  /* Kanban board → snap-scroll columns */
  .board { scroll-snap-type: x mandatory; gap: 10px; padding-left: 14px; padding-right: 14px; }
  .board > .col { flex: 0 0 calc(100vw - 56px); scroll-snap-align: start; }

  /* Week view — horizontal scroll stays, just tighter columns */
  .cw-head, .cw-body { grid-template-columns: repeat(7, minmax(120px, 1fr)); }

  /* KPI grid → 2 columns */
  .kpis { grid-template-columns: 1fr 1fr; }

  /* All 2/3-col grids → single column (already done at 1100px but restate for safety) */
  .cols-3-1, .cols-2 { grid-template-columns: 1fr; }
  .ai-grid { grid-template-columns: 1fr; }

  /* Metric strip → 2 cols */
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric { border-right: none; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: none; }

  /* Touch target floors */
  .btn { min-height: 44px; }
  .btn.sm { min-height: 38px; }
  .chip { height: 36px; min-height: 36px; }
  .menu-item { min-height: 44px; }
  .notif { min-height: 52px; }
  .nav-item { min-height: 44px; }
  .pp-status-btn { min-height: 38px; }
  .pref-rail-item { min-height: 36px; }

  /* Contacts form grid → single column on mobile */
  .ct-form-grid { grid-template-columns: 1fr; }

  /* Contact modal → bottom sheet */
  .ct-overlay-modal { align-items: flex-end; }
  .ct-modal-box {
    width: 100%; max-width: 100%; max-height: 94dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(16px);
  }
  .ct-overlay-modal.open .ct-modal-box { transform: none; }

  /* Next match card → single col */
  .next-match { grid-template-columns: 1fr; }

  /* Bulk action bar → appear above bottom nav when visible */
  .bulk-bar.visible { bottom: calc(57px + env(safe-area-inset-bottom) + 12px); }

  /* Hide desktop-only topbar elements on small screens */
  .searchbar { display: none; }
  #createBtn .btn-label { display: none; }
  #createBtn { padding: 0; width: 44px; }
}

/* Touch device — suppress residual hover states (combined query, no nesting) */
@media (max-width: 768px) and (pointer: coarse) {
  .hoverable:hover { transform: none; box-shadow: none; border-color: var(--line); }
  .nav-item:hover { background: none; }
  .post:hover { border-color: var(--line); }
  .menu-item:hover { background: none; }
  .menu-item:active { background: rgba(244,241,236,.08); }
  .notif:hover { background: none; }
  .notif:active { background: rgba(255,255,255,.03); }
}

