/* YIELD · Design System
 * Source: extracted from legacy SPA index.html <style> block.
 * Used by new Jinja2 panel (/panel/*) — consistent with legacy SPA.
 * Palette reverted 2026-06-01 to Claude warm cream/clay; the AV-LNCH
 * base-vocabulary token *names* are retained for the alias architecture
 * (so 90+ pages need no edits) but now hold Claude values. Downstream
 * legacy (--accent, --card, --border, …) + all --v2-* tokens inherit
 * via var(). Only colors changed — Geist type / brand-mesh / theme
 * transition / FOUC / unified loading are kept.
 * ==============================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

/* ==============================================================
   DESIGN TOKENS — Claude warm cream/clay, Geist type, light default
   + [data-theme="dark"].
   2026-06-01: palette reverted to Claude warm cream/clay. The AV-LNCH
   base-vocab token *names* (--surface, --line, --ice, …) are retained
   for the alias architecture, now holding Claude values; downstream
   legacy + v2 tokens inherit via var(). YIELD-specific palettes
   (platform / tier / loop / group / section) are kept intact.
   ============================================================== */
:root,
[data-theme="light"] {
  /* — base vocabulary (warm cream, Claude clay accent) — */
  --bg-1:       #EFEAE0;
  --surface:    #FFFFFF;
  --surface-1:  #F5F1EB;
  --surface-2:  #EFEAE0;
  --line:       #E8E0D4;
  --line-1:     #D4C9B8;
  --text-1:     #1F1B16;
  --text-2:     #6B6156;
  --text-3:     #9B9185;

  --ice:        #D97757;
  --ice-1:      #C56643;
  --ice-dim:    rgba(217, 119, 87, .16);
  --ice-line:   rgba(217, 119, 87, .40);
  --flame:      #D97757;
  --flame-1:    #C56643;
  --flame-dim:  rgba(217, 119, 87, .14);
  --flame-line: rgba(217, 119, 87, .38);
  --cool:       #94c7d9;
  --tan:        #beb199;

  --ok:    #5BA968;
  --warn:  #E8A246;
  --fail:  #D95757;
  --idle:  #9B9185;

  /* scales (radii / spacing / type / motion) */
  --r-1: 4px;  --r-2: 6px;  --r-3: 8px;  --r-4: 12px; --r-5: 16px;
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 56px;
  --fs-1: 11px; --fs-2: 12px; --fs-3: 13px; --fs-4: 14px; --fs-5: 16px;
  --fs-6: 20px; --fs-7: 26px; --fs-8: 34px; --fs-9: 44px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 320ms;

  /* — YIELD legacy names -> Claude warm values (chrome) — */
  --bg:             #FAF9F6;
  --bg-raised:      var(--surface);
  --card:           var(--surface);
  --card-hover:     var(--surface-1);
  --border:         var(--line);
  --border-strong:  var(--line-1);

  --text:           #1F1B16;
  --text-dim:       var(--text-2);
  --text-faint:     var(--text-3);

  --accent:         var(--ice);
  --accent-hover:   var(--ice-1);
  --accent-soft:    var(--ice-dim);
  --accent-border:  var(--ice-line);

  /* platform brand colors — immutable, kept */
  --spotify:        #1DB954;
  --tiktok:         #FE2C55;
  --tiktok-cyan:    #25F4EE;
  --youtube:        #FF0033;

  /* semantic states -> AV-LNCH */
  --danger:         var(--fail);
  --warning:        var(--warn);
  --success:        var(--ok);

  /* radii (YIELD names aligned to AV-LNCH scale) */
  --radius-card:    var(--r-4);
  --radius-btn:     var(--r-3);
  --radius-input:   var(--r-2);

  /* shadows — Claude warm-tinted (ink, not pure black) */
  --shadow-sm:      0 1px 2px rgba(31, 27, 22, .04);
  --shadow-md:      0 4px 12px rgba(31, 27, 22, .06);
  --shadow-lg:      0 24px 60px rgba(31, 27, 22, .12);

  /* Tier background tints — used by tier cards (kept) */
  --tier-skip-tint:    rgba(107, 114, 128, 0.08);
  --tier-half-tint:    rgba(96, 165, 250, 0.08);
  --tier-full-tint:    rgba(20, 184, 166, 0.08);
  --tier-hooked-tint:  rgba(245, 158, 11, 0.08);
  --tier-replay-tint:  rgba(236, 72, 153, 0.08);

  /* Group accent colors — used by tier group titles (kept) */
  --group-distribution:   #8b5cf6;
  --group-engagement:     #e8394b;
  --group-exploration:    #3b82f6;
  --group-antibot:        #f59e0b;

  /* Loop type accents (kept) */
  --loop-fyp:             #FE2C55;
  --loop-fyp-tint:        rgba(254, 44, 85, 0.04);
  --loop-following:       #25F4EE;
  --loop-following-tint:  rgba(37, 244, 238, 0.04);

  /* Section accent bars (kept) */
  --section-safety:       #f59e0b;
  --section-stealth:      #1f2937;
  --section-recipe:       #FE2C55;
  --section-whitelist:    #5BA968;

  /* Helpers — Claude gradient stops */
  --gradient-fyp:         linear-gradient(90deg, #FE2C55 0%, #D97757 100%);
  --gradient-following:   linear-gradient(90deg, #25F4EE 0%, #3B82F6 100%);
}

[data-theme="dark"] {
  /* — base vocabulary (warm brown, Claude salmon accent) — */
  --bg-1:       #373029;
  --surface:    #373029;
  --surface-1:  #403830;
  --surface-2:  #473E35;
  --line:       #4A4135;
  --line-1:     #5D5145;
  --text-1:     #F5F1EB;
  --text-2:     #BCB1A3;
  --text-3:     #8A7F71;

  --ice:        #E8947D;
  --ice-1:      #F0A890;
  --ice-dim:    rgba(232, 148, 125, .20);
  --ice-line:   rgba(232, 148, 125, .45);
  --flame:      #E8947D;
  --flame-1:    #F0A890;
  --flame-dim:  rgba(232, 148, 125, .22);
  --flame-line: rgba(232, 148, 125, .50);
  --cool:       #94c7d9;
  --tan:        #beb199;

  --ok:    #5BA968;
  --warn:  #E8A246;
  --fail:  #D95757;
  --idle:  #8A7F71;

  /* — YIELD legacy names -> Claude warm dark values — */
  --bg:             #2B2620;
  --bg-raised:      var(--surface);
  --card:           var(--surface);
  --card-hover:     var(--surface-1);
  --border:         var(--line);
  --border-strong:  var(--line-1);

  --text:           #F5F1EB;
  --text-dim:       var(--text-2);
  --text-faint:     var(--text-3);

  --accent:         var(--ice);
  --accent-hover:   var(--ice-1);
  --accent-soft:    var(--ice-dim);
  --accent-border:  var(--ice-line);

  --danger:         var(--fail);
  --warning:        var(--warn);
  --success:        var(--ok);

  --shadow-sm:      0 1px 2px rgba(0, 0, 0, .2);
  --shadow-md:      0 4px 12px rgba(0, 0, 0, .3);
  --shadow-lg:      0 24px 60px rgba(0, 0, 0, .4);

  /* Tier background tints — darker for dark mode (kept) */
  --tier-skip-tint:    rgba(107, 114, 128, 0.12);
  --tier-half-tint:    rgba(96, 165, 250, 0.12);
  --tier-full-tint:    rgba(20, 184, 166, 0.12);
  --tier-hooked-tint:  rgba(245, 158, 11, 0.12);
  --tier-replay-tint:  rgba(236, 72, 153, 0.12);

  /* Group accent colors — same hue, slightly brighter for dark bg (kept) */
  --group-distribution:   #a78bfa;
  --group-engagement:     #f87171;
  --group-exploration:    #60a5fa;
  --group-antibot:        #fbbf24;

  /* Loop type accents (kept) */
  --loop-fyp:             #FE2C55;
  --loop-fyp-tint:        rgba(254, 44, 85, 0.06);
  --loop-following:       #25F4EE;
  --loop-following-tint:  rgba(37, 244, 238, 0.06);

  /* Section accent bars (kept) */
  --section-safety:       #fbbf24;
  --section-stealth:      #9ca3af;
  --section-recipe:       #FE2C55;
  --section-whitelist:    #6EE7B7;

  /* Helpers — Claude gradient stops (same both themes) */
  --gradient-fyp:         linear-gradient(90deg, #FE2C55 0%, #D97757 100%);
  --gradient-following:   linear-gradient(90deg, #25F4EE 0%, #3B82F6 100%);
}

/* ==============================================================
   LUCIDE ICON DEFAULTS
   ============================================================== */
.ico { width: 16px; height: 16px; vertical-align: -2px; flex-shrink: 0; }
.ico-sm { width: 13px; height: 13px; }
.ico-lg { width: 20px; height: 20px; }

/* ==============================================================
   RESET / BASE
   ============================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
body { font-family: "Geist", -apple-system, "Segoe UI", system-ui, sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: "Geist Mono", "JetBrains Mono", "SF Mono", "Consolas", monospace; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* Theme transition flag — enabled briefly by toggleTheme() during a flip,
   then removed so subsequent interactions are not globally animated. */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition: background-color var(--dur-base) ease,
              color var(--dur-base) ease,
              border-color var(--dur-base) ease,
              fill var(--dur-base) ease,
              stroke var(--dur-base) ease !important;
}

/* Subtle warm scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--line-1); }

/* Brand mesh — signature decorative gradient (clay -> tan).
   Opt-in: add class="brand-mesh" to a page header / hero band. */
.brand-mesh {
  position: relative;
  background:
    radial-gradient(800px 400px at 0% 0%, rgba(217,119,87,.20), transparent 60%),
    radial-gradient(600px 300px at 30% 0%, rgba(217,119,87,.14), transparent 50%),
    radial-gradient(700px 350px at 70% 0%, rgba(190,177,153,.10), transparent 50%),
    radial-gradient(900px 450px at 100% 0%, rgba(217,119,87,.18), transparent 60%);
}
[data-theme="dark"] .brand-mesh {
  background:
    radial-gradient(800px 400px at 0% 0%, rgba(232,148,125,.22), transparent 60%),
    radial-gradient(600px 300px at 30% 0%, rgba(232,148,125,.14), transparent 50%),
    radial-gradient(700px 350px at 70% 0%, rgba(190,177,153,.10), transparent 50%),
    radial-gradient(900px 450px at 100% 0%, rgba(232,148,125,.20), transparent 60%);
}

/* ==============================================================
   LAYOUT
   ============================================================== */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}
.topbar-inner {
  max-width: 1600px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; gap: 12px;
  width: 100%;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; flex-shrink: 0; }
.brand-icon {
  width: 32px; height: 32px; border-radius: 10px; background: var(--accent);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.brand-icon svg { width: 16px; height: 16px; display: block; }
.brand-title { font-size: 18px; font-weight: 600; letter-spacing: .02em; }

/* .nav-tabs removed in TU1 — replaced by .topbar-nav-groups */

.content {
  max-width: 1600px; margin: 0 auto; padding: 32px 24px; flex: 1; width: 100%;
}

.section-title { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.section-sub   { font-size: 14px; color: var(--text-dim); margin-top: 4px; }

/* ==============================================================
   CARDS
   ============================================================== */
.card         { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-sm); padding: 16px; }
.card-raised  { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px; }
.card-accent  { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--radius-card); padding: 16px; }

/* ==============================================================
   SECTION BLOCKS — colored accent containers for major form groups
   ============================================================== */
.section-block {
  --_accent: var(--accent);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 0;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.section-block:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.section-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--_accent) 7%, var(--card)) 0%,
    var(--card) 100%
  );
  position: relative;
}
.section-block-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--_accent);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}
.section-block-header .icon {
  font-size: 22px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--_accent) 12%, var(--bg-raised));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.section-block-header h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}
.section-block-header .section-desc {
  font-size: 12px;
  color: var(--text-faint);
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 600px) {
  .section-block-header .section-desc { display: none; }
}

.section-block-body {
  padding: 20px;
}

/* Variant: Safety (amber) — Daily Caps */
.section-block--safety {
  --_accent: var(--section-safety);
  border-color: color-mix(in srgb, var(--section-safety) 25%, var(--border));
}

/* Variant: Recipe (TikTok pink) — Action Recipe loops */
.section-block--recipe {
  --_accent: var(--section-recipe);
  border-color: color-mix(in srgb, var(--section-recipe) 20%, var(--border));
}

/* Variant: Stealth Follow (dark navy) */
.section-block--stealth {
  --_accent: var(--section-stealth);
  border-color: color-mix(in srgb, var(--section-stealth) 25%, var(--border));
}
.section-block--stealth .section-block-body {
  background: rgba(31, 41, 55, 0.02);
}

/* Variant: Content Whitelist (green) */
.section-block--whitelist {
  --_accent: var(--section-whitelist);
  border-color: color-mix(in srgb, var(--section-whitelist) 22%, var(--border));
}
.section-block--whitelist .section-block-body {
  background: rgba(91, 169, 104, 0.02);
}
.section-block--whitelist .chip {
  background: color-mix(in srgb, var(--section-whitelist) 10%, var(--bg-raised));
  border-color: color-mix(in srgb, var(--section-whitelist) 30%, var(--border));
}
.section-block--whitelist .chip-input-field:focus-within {
  border-color: var(--section-whitelist);
  outline-color: var(--section-whitelist);
}

/* Page header — behavior profile editor */
.behavior-page-header {
  padding: 8px 0 4px;
}
.behavior-page-header .section-title {
  font-size: 24px;
}

/* ==============================================================
   INNER SIDEBAR — per-tab sub-navigation (Profiles, Settings, ...)
   ============================================================== */
.layout-sidebar {
  display: grid; gap: 16px;
  grid-template-columns: 240px 1fr;
  align-items: start;
}
.layout-sidebar > * { min-width: 0; }
@media (max-width: 900px) {
  .layout-sidebar { grid-template-columns: 1fr; }
}

.sidenav {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-sm);
  padding: 10px; position: sticky; top: 72px;
  overflow: hidden;
}

/* Hero header — distinguishes each tab's sidebar at a glance.
   Props set via --hero-color (defaults to accent). */
.sidenav-hero {
  --hero-color: var(--accent);
  margin: -10px -10px 10px; padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--hero-color);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--hero-color) 8%, transparent) 0%,
    transparent 100%);
}
.sidenav-hero-row { display: flex; align-items: center; gap: 10px; }
.sidenav-hero-icon {
  font-size: 22px; line-height: 1;
  width: 36px; height: 36px; border-radius: 10px;
  background: color-mix(in srgb, var(--hero-color) 14%, var(--bg-raised));
  color: var(--hero-color);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidenav-hero-title {
  font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text);
  font-family: "JetBrains Mono", monospace;
}
.sidenav-hero-desc {
  font-size: 11px; color: var(--text-dim);
  margin-top: 6px; line-height: 1.45;
}
.sidenav-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; font-family: "JetBrains Mono", monospace;
  color: var(--text-faint); padding: 8px 12px 4px;
}
.sidenav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-btn);
  color: var(--text-dim); text-decoration: none;
  font-size: 13px; font-weight: 500;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer;
}
.sidenav-item:hover {
  background: var(--card-hover); color: var(--text); text-decoration: none;
}
.sidenav-item.active {
  background: var(--accent-soft); color: var(--accent);
  border-left-color: var(--accent);
}
.sidenav-item .count {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--text-faint);
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px;
}
.sidenav-item.active .count { color: var(--accent); border-color: var(--accent-border); background: var(--bg-raised); }
.sidenav-divider { height: 1px; background: var(--border); margin: 8px 4px; }
.sidenav-hint {
  font-size: 11px; color: var(--text-faint);
  padding: 8px 12px; line-height: 1.5;
}

/* ==============================================================
   BUTTONS
   ============================================================== */
.btn {
  border-radius: var(--radius-btn); padding: 8px 14px; font-size: 13px;
  transition: all .15s; line-height: 1.15; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; cursor: pointer; font-family: inherit;
}
.btn-ghost     { background: transparent; color: var(--text-dim); border: 1px solid transparent; }
.btn-ghost:hover{ background: var(--card-hover); color: var(--text); }
.btn-primary   { background: var(--accent); color: white; border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline   { border: 1px solid var(--border); color: var(--text); background: var(--bg-raised); }
.btn-outline:hover{ border-color: var(--border-strong); background: var(--card-hover); }
.btn-outline.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-danger    { color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border)); background: var(--bg-raised); }
.btn-danger:hover{ background: color-mix(in srgb, var(--danger) 10%, var(--bg-raised)); }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ==============================================================
   FORMS
   ============================================================== */
.input, .select, .textarea {
  border-radius: var(--radius-input); background: var(--bg-raised);
  border: 1px solid var(--border); padding: 8px 12px; color: var(--text);
  font-size: 13px; width: 100%; font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}
.textarea { min-height: 80px; resize: vertical; }
.label-text { display: block; font-size: 11px; font-family: "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 5px; }
label { display: block; }

/* Toggle */
.toggle { display: inline-block; position: relative; width: 32px; height: 18px; background: var(--border); border-radius: 999px; cursor: pointer; transition: background .15s; flex-shrink: 0; vertical-align: middle; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: white; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.toggle[data-on="true"] { background: var(--accent); }
.toggle[data-on="true"]::after { transform: translateX(14px); }

/* ==============================================================
   CHIPS / TAGS / PILLS
   ============================================================== */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; background: var(--card-hover); border: 1px solid var(--border); color: var(--text-dim); font-weight: 500; }

.phone-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 5px; font-size: 11px;
  background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text-dim); font-weight: 500;
}
.phone-chip::before {
  content: ""; width: 8px; height: 8px; border-radius: 2px;
  background: var(--phone-color, var(--text-faint));
}
.phone-chip[data-status="offline"]  { opacity: .5; text-decoration: line-through; }
.phone-chip[data-status="degraded"] { border-color: var(--warning); color: var(--warning); }

.platform-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 500; }
.platform-pill.spotify { background: color-mix(in srgb, var(--spotify) 12%, transparent); color: var(--spotify); }
.platform-pill.tiktok  { background: color-mix(in srgb, var(--tiktok) 12%, transparent);  color: var(--tiktok); }
.platform-pill.instagram { background: color-mix(in srgb, #C13584 12%, transparent); color: #C13584; }
.platform-pill.youtube { background: color-mix(in srgb, var(--youtube) 12%, transparent); color: var(--youtube); }

.badge-success { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-warning { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-danger  { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }

/* ==============================================================
   STAT CARDS
   ============================================================== */
.stat-card { padding: 18px 20px; }
.stat-card .stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.stat-card .stat-value { font-size: 32px; font-weight: 600; line-height: 1.1; margin-top: 8px; color: var(--text); font-family: "JetBrains Mono", monospace; font-feature-settings: "tnum" 1; }
.stat-card .stat-delta { font-size: 11px; margin-top: 4px; color: var(--text-dim); }
.stat-card.accent .stat-value { color: var(--accent); }

/* ==============================================================
   TABLES
   ============================================================== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 500;
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--card-hover); }

/* ==============================================================
   ALERTS
   ============================================================== */
.alert { padding: 12px 14px; border-radius: var(--radius-input); font-size: 13px; margin-bottom: 16px; }
.alert-info { background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid var(--accent-border); color: var(--text); }
.alert-error { background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert-warn  { background: color-mix(in srgb, var(--warning) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); color: var(--text); }
.alert-success { background: color-mix(in srgb, var(--success) 12%, transparent); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); color: var(--text); }

/* ==============================================================
   UTILITY
   ============================================================== */
.hidden  { display: none !important; }
.muted   { color: var(--text-dim); }
.faint   { color: var(--text-faint); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

.txt-spotify  { color: var(--spotify); }
.txt-tiktok   { color: var(--tiktok);  }
.txt-youtube  { color: var(--youtube); }
.txt-accent   { color: var(--accent); }
.txt-success  { color: var(--success); }
.txt-warning  { color: var(--warning); }
.txt-danger   { color: var(--danger); }

/* Flexbox / grid helpers */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.flex-wrap       { flex-wrap: wrap; }

/* Grid */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }

/* Spacing */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }

/* Text size */
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }

/* Font weight */
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Pulsing live dot */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 0 0 var(--success);
  animation: live-dot-pulse 1.8s ease-in-out infinite;
}
@keyframes live-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 50%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--success) 0%, transparent); }
}

/* ==============================================================
   SCROLLBAR
   ============================================================== */
::-webkit-scrollbar       { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ==============================================================
   SLIDER (range input, live value display)
   ============================================================== */
.slider-wrap { width: 100%; }
.slider {
  width: 100%; height: 6px; -webkit-appearance: none; appearance: none;
  background: var(--border); border-radius: 3px; outline: none; cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--slider-color, var(--accent)); cursor: pointer;
  border: 2px solid var(--bg-raised); box-shadow: var(--shadow-sm);
  transition: transform .1s;
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--slider-color, var(--accent)); cursor: pointer; border: 2px solid var(--bg-raised);
}
.slider-val { color: var(--slider-color, var(--accent)); min-width: 52px; text-align: right; display: inline-block; font-size: 13px; }

/* ==============================================================
   TOGGLE (with label wrapper)
   ============================================================== */
.toggle-wrap { cursor: pointer; padding: 6px 0; }

/* ==============================================================
   CHIP INPUT (tags / hashtags / creators / handles)
   ============================================================== */
.chip-input-wrap { width: 100%; }
.chip-input-field {
  min-height: 40px; padding: 6px 8px; border-radius: var(--radius-input);
  background: var(--bg-raised); border: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  cursor: text; transition: border-color .15s;
}
.chip-input-field:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.chip-input-chips { display: contents; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 4px 3px 10px; border-radius: 14px;
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  color: var(--text); font-size: 12px; font-family: "JetBrains Mono", monospace;
}
.chip-x {
  background: transparent; border: 0; width: 18px; height: 18px;
  border-radius: 50%; cursor: pointer; color: var(--text-dim);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; padding: 0;
}
.chip-x:hover { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.chip-input-text {
  flex: 1; min-width: 120px; border: 0; background: transparent; outline: 0;
  color: var(--text); font-size: 13px; padding: 4px 6px;
}
/* Tag-add button (inline "+" for account tag cells) */
.tag-add {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px dashed var(--border);
  border-radius: 14px; padding: 2px 10px; cursor: pointer;
  font-size: 12px; color: var(--text-dim); line-height: 1.4;
  vertical-align: middle;
}
.tag-add:hover { border-color: var(--accent); color: var(--accent); }
.account-tags-cell { white-space: normal; }

/* ==============================================================
   HEALTH BAR (0-100 color-coded)
   ============================================================== */
.health-bar {
  position: relative; width: 80px; height: 18px;
  background: var(--card-hover); border-radius: 4px;
  overflow: hidden; display: inline-block; vertical-align: middle;
}
.health-bar > span:first-child {
  position: absolute; inset: 0 auto 0 0;
  height: 100%; border-radius: 4px; transition: width .3s;
}
.health-val {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text); font-weight: 600; font-family: "JetBrains Mono", monospace;
  text-shadow: 0 0 2px var(--bg);
}

/* ==============================================================
   MODAL DIALOG
   ============================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 8, 4, 0.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: modal-fade-in .15s ease-out;
}
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-body {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px;
  min-width: 440px; max-width: 720px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: modal-slide-in .2s ease-out;
}
@keyframes modal-slide-in { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close { background: transparent; border: 0; font-size: 20px; cursor: pointer; color: var(--text-dim); width: 32px; height: 32px; border-radius: 50%; }
.modal-close:hover { background: var(--card-hover); color: var(--text); }

/* ==============================================================
   LOOP ROW (multi-loop editor)
   ============================================================== */
.loop-row {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 12px; background: var(--bg-raised);
  position: relative; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .2s, transform .2s;
}
.loop-row:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.loop-row-header {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
/* Gradient accent bar at top of card (colored via modifier) */
.loop-row-header::before {
  content: ""; position: absolute;
  top: -17px; left: -17px; right: -17px;
  height: 4px; border-radius: 12px 12px 0 0;
  background: var(--border-strong);
  pointer-events: none;
}
.loop-row-header .loop-row-type-icon {
  font-size: 24px; line-height: 1;
}
.loop-row-idx {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: "JetBrains Mono", monospace; font-size: 13px;
  transition: background .15s;
}
.loop-row-actions { margin-left: auto; display: flex; gap: 4px; }
.loop-row-actions button {
  background: transparent; border: 1px solid var(--border);
  padding: 4px 8px; border-radius: 6px; cursor: pointer;
  color: var(--text-dim); font-size: 14px; line-height: 1;
}
.loop-row-actions button:hover { border-color: var(--accent); color: var(--accent); }
.loop-row-actions button.del:hover { border-color: var(--danger); color: var(--danger); }

/* --- FYP loop modifier (warm pink/coral) --- */
.loop-row--fyp {
  background: var(--loop-fyp-tint);
  border-color: rgba(254, 44, 85, 0.25);
}
.loop-row--fyp:hover {
  border-color: rgba(254, 44, 85, 0.45);
}
.loop-row-header--fyp::before {
  background: var(--gradient-fyp);
}
.loop-row--fyp .loop-row-idx {
  background: var(--loop-fyp);
}

/* --- Following loop modifier (cool cyan/teal) --- */
.loop-row--following {
  background: var(--loop-following-tint);
  border-color: rgba(37, 244, 238, 0.30);
}
.loop-row--following:hover {
  border-color: rgba(37, 244, 238, 0.50);
}
.loop-row-header--following::before {
  background: var(--gradient-following);
}
.loop-row--following .loop-row-idx {
  background: var(--loop-following);
}

/* --- Add-loop buttons (type-colored dashed) --- */
.btn-add-loop--fyp,
.btn-add-loop--following {
  padding: 12px 14px;
}
.btn-add-loop--fyp {
  border: 2px dashed var(--loop-fyp);
  color: var(--loop-fyp);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn-add-loop--fyp:hover {
  background: var(--loop-fyp-tint);
  border-color: var(--loop-fyp);
  box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.10);
  color: var(--loop-fyp);
}
.btn-add-loop--following {
  border: 2px dashed var(--loop-following);
  color: var(--loop-following);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn-add-loop--following:hover {
  background: var(--loop-following-tint);
  border-color: var(--loop-following);
  box-shadow: 0 0 0 3px rgba(37, 244, 238, 0.10);
  color: var(--loop-following);
}

/* --- Dark mode: following-eng cyan tint --- */
[data-theme="dark"] .following-eng--cyan {
  background: rgba(37, 244, 238, 0.06);
}
/* --- Dark mode: stealth/whitelist body tints --- */
[data-theme="dark"] .section-block--stealth .section-block-body {
  background: rgba(31, 41, 55, 0.06);
}
[data-theme="dark"] .section-block--whitelist .section-block-body {
  background: rgba(91, 169, 104, 0.04);
}
[data-theme="dark"] .card-raised--inset {
  background: color-mix(in srgb, var(--section-stealth) 6%, var(--bg-raised));
}

/* ==============================================================
   TIER CARDS (collapsible engagement tier editor)
   ============================================================== */
.tier-cards { margin: 12px 0 8px; display: flex; flex-direction: column; gap: 10px; }

.tier-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--tier-color, var(--border-strong));
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.tier-card:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.tier-card[open] {
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.tier-card[open]::before {
  /* very subtle tinted background using tier color */
  content: ''; position: absolute; pointer-events: none;
}

.tier-card > summary {
  cursor: pointer;
  padding: 12px 16px;
  list-style: none;
  display: grid;
  grid-template-columns: 18px 28px auto 1fr auto;
  gap: 12px;
  align-items: center;
  user-select: none;
}
.tier-card > summary::-webkit-details-marker { display: none; }
.tier-card > summary::before {
  content: '\25B6'; /* ▶ */
  font-size: 10px;
  color: var(--text-faint);
  transition: transform 0.2s;
}
.tier-card[open] > summary::before { transform: rotate(90deg); }
.tier-card > summary:hover { background: var(--card-hover); }

.tier-card .tier-icon { font-size: 20px; line-height: 1; }
.tier-card .tier-name {
  font-weight: 700; font-size: 14px; letter-spacing: 0.02em;
  color: var(--tier-color, var(--text));
}
.tier-card .tier-meta {
  display: flex; gap: 14px; align-items: center;
  font-size: 12px; color: var(--text-muted, var(--text-faint));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tier-card .tier-weight-pill {
  background: var(--tier-color, var(--border-strong));
  color: white; font-weight: 700; font-size: 11px;
  padding: 3px 8px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
  min-width: 38px; text-align: center;
}
.tier-card .tier-watch-time {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 11px; color: var(--text-faint);
}
.tier-card .tier-chances {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 11px; color: var(--text-muted, var(--text-faint));
  letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: right; min-width: 0;
}
.tier-card .tier-chances .chance-key { opacity: 0.55; }

.tier-card > .tier-body {
  padding: 6px 16px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
  transition: background-color 0.2s;
}

/* Tier-color body tint when open */
.tier-card.tier-skip[open]   > .tier-body { background: var(--tier-skip-tint); }
.tier-card.tier-half[open]   > .tier-body { background: var(--tier-half-tint); }
.tier-card.tier-full[open]   > .tier-body { background: var(--tier-full-tint); }
.tier-card.tier-hooked[open] > .tier-body { background: var(--tier-hooked-tint); }
.tier-card.tier-replay[open] > .tier-body { background: var(--tier-replay-tint); }

/* Gradient accent bar between summary and body when open */
.tier-card[open] > summary {
  position: relative;
}
.tier-card[open] > summary::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--tier-color, var(--border-strong)), transparent);
  pointer-events: none;
}

.tier-card .tier-body-desc {
  font-size: 12px; color: var(--text-muted, var(--text-faint));
  margin: 8px 0 12px;
}

/* Tier group base — colored left bar + spacing */
.tier-group {
  padding-left: 12px;
  border-left: 3px solid transparent;
  margin-bottom: 16px;
}
.tier-group:last-child { margin-bottom: 0; }

/* Scoped --_gc (group color) drives border, title, and slider theming. */
.tier-group--distribution { --_gc: var(--group-distribution); }
.tier-group--engagement   { --_gc: var(--group-engagement); }
.tier-group--exploration  { --_gc: var(--group-exploration); }
.tier-group--antibot      { --_gc: var(--group-antibot); }

.tier-group--distribution,
.tier-group--engagement,
.tier-group--exploration,
.tier-group--antibot { border-left-color: var(--_gc); }

/* Group title — colored per group */
.tier-card .tier-group-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--tier-color, var(--text-faint));
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.tier-group--distribution .tier-group-title,
.tier-group--engagement .tier-group-title,
.tier-group--exploration .tier-group-title,
.tier-group--antibot .tier-group-title {
  color: var(--_gc);
  border-bottom-color: color-mix(in srgb, var(--_gc) 30%, var(--border));
}

.tier-card .slider-wrap { margin-bottom: 0; }

/* ---------- Group-colored slider tracks + thumbs ---------- */
/* Uses var(--bg-raised) instead of hardcoded white for dark mode. */

.tier-group--engagement input[type="range"]::-webkit-slider-thumb,
.tier-group--exploration input[type="range"]::-webkit-slider-thumb,
.tier-group--antibot input[type="range"]::-webkit-slider-thumb {
  background: var(--_gc);
  box-shadow: 0 0 0 2px var(--bg-raised), 0 0 0 3px var(--_gc);
}
.tier-group--engagement input[type="range"]::-webkit-slider-runnable-track,
.tier-group--exploration input[type="range"]::-webkit-slider-runnable-track,
.tier-group--antibot input[type="range"]::-webkit-slider-runnable-track {
  background: color-mix(in srgb, var(--_gc) 20%, var(--border));
}
.tier-group--engagement input[type="range"]::-moz-range-thumb,
.tier-group--exploration input[type="range"]::-moz-range-thumb,
.tier-group--antibot input[type="range"]::-moz-range-thumb {
  background: var(--_gc);
  box-shadow: 0 0 0 2px var(--bg-raised), 0 0 0 3px var(--_gc);
}
.tier-group--engagement input[type="range"]::-moz-range-track,
.tier-group--exploration input[type="range"]::-moz-range-track,
.tier-group--antibot input[type="range"]::-moz-range-track {
  background: color-mix(in srgb, var(--_gc) 20%, var(--border));
}
.tier-group--engagement .slider-val,
.tier-group--exploration .slider-val,
.tier-group--antibot .slider-val { color: var(--_gc); }

/* Sum / reset bar below cards */
.tier-sum-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-top: 4px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px;
}
.tier-sum-bar .tier-sum {
  font-family: "JetBrains Mono", monospace; font-weight: 700;
  font-size: 14px; min-width: 56px; text-align: center;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(22,163,74,0.10); color: var(--success, #5BA968);
  transition: background-color 0.3s ease, color 0.3s ease;
}
.tier-sum-bar .tier-sum.warn {
  background: rgba(217,119,6,0.10); color: var(--warning, #d97706);
}
.tier-sum-bar .tier-sum-info {
  font-size: 12px; color: var(--text-muted, var(--text-faint));
}
.tier-sum-bar .tier-reset-btn { margin-left: auto; }

/* Tier sum bar — big variant (prominent bottom bar) */
.tier-sum-bar--big {
  padding: 16px 18px;
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  border-radius: 10px;
}
.tier-sum-bar--big .sum-label {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tier-sum-bar--big .sum-label-icon {
  font-size: 16px;
  line-height: 1;
}
.tier-sum-bar--big .tier-sum {
  font-size: 18px;
  min-width: 68px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(91, 169, 104, 0.15);
  color: var(--success);
}
.tier-sum-bar--big .tier-sum.warn {
  background: rgba(232, 162, 70, 0.15);
  color: var(--warning);
}
.tier-sum-bar--big .tier-reset-btn {
  padding: 8px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
}

/* Sum bar flash animation on value change (color via --_flash-color) */
@keyframes sum-flash {
  0%   { box-shadow: var(--shadow-md); }
  30%  { box-shadow: var(--shadow-md), 0 0 0 4px var(--_flash-color); }
  100% { box-shadow: var(--shadow-md); }
}
.tier-sum-bar--big.sum-changed {
  --_flash-color: rgba(91, 169, 104, 0.20);
  animation: sum-flash 1s ease-out;
}
.tier-sum-bar--big.sum-changed-warn {
  --_flash-color: rgba(232, 162, 70, 0.20);
  animation: sum-flash 1s ease-out;
}

/* Following loop "engagement" card (single flat config) */
.following-eng {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--tiktok, #ec4899);
  border-radius: 10px;
  padding: 16px;
}

/* Following flat — cyan-themed variant */
.following-eng--cyan {
  background: var(--loop-following-tint);
  border-color: color-mix(in srgb, var(--loop-following) 25%, var(--border));
  border-left: 4px solid var(--loop-following);
}
.following-eng--cyan .tier-group-title {
  color: var(--loop-following);
  border-bottom-color: color-mix(in srgb, var(--loop-following) 25%, var(--border));
}
.following-eng--cyan .input:focus {
  outline-color: var(--loop-following);
  border-color: var(--loop-following);
}

/* Inset card for Stealth proactive subsection */
.card-raised--inset {
  padding: 14px;
  border-left: 3px solid var(--section-stealth);
  background: color-mix(in srgb, var(--section-stealth) 3%, var(--bg-raised));
}

/* Stealth targets list */
.sf-targets-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
}
.sf-target-row {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}
.sf-target-row:hover { background: var(--card-hover); }

/* Small tag variant */
.tag-xs { font-size: 10px; }

/* Orphan targets notice */
.sf-orphan-notice { color: var(--warning); }

/* ==============================================================
   MONTH CALENDAR CELLS (Scheduler month view)
   ============================================================== */
.month-cell {
  display: block; padding: 8px; min-height: 90px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; text-decoration: none; color: var(--text);
  transition: all .15s; cursor: pointer;
}
.month-cell:hover { border-color: var(--border-strong); background: var(--card-hover); text-decoration: none; }
.month-cell.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.month-cell.out-of-month { opacity: .4; }
.month-cell.heat-1 { background: color-mix(in srgb, var(--accent) 15%, var(--card)); }
.month-cell.heat-2 { background: color-mix(in srgb, var(--accent) 35%, var(--card)); }
.month-cell.heat-3 { background: color-mix(in srgb, var(--accent) 60%, var(--card)); color: white; }

.heat-swatch {
  display: inline-block; width: 14px; height: 14px;
  border-radius: 3px; border: 1px solid var(--border);
  vertical-align: middle;
}

/* ==============================================================
   MACRO CELL (Phones card — MacroDroid grid)
   ============================================================== */
.macro-cell {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 5px; padding: 5px 3px; text-align: center;
  transition: border-color .15s;
}
.macro-cell:hover { border-color: var(--border-strong); }

/* (legacy phones-table compact styles removed — superseded by U5 block below) */

/* ==============================================================
   24H PREVIEW BAR (session template editor)
   ============================================================== */
.day-preview {
  position: relative; height: 56px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.day-preview-hours {
  position: absolute; inset: 0; pointer-events: none;
}
.day-preview-hours span {
  position: absolute; top: 4px; font-size: 9px;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-faint); transform: translateX(-50%);
}
.day-preview-track {
  position: absolute; inset: 24px 0 8px; background: transparent;
}
.day-preview-track::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to right,
    transparent 0, transparent calc(100%/24 - 1px),
    var(--border) calc(100%/24 - 1px), var(--border) calc(100%/24)
  );
  pointer-events: none;
}
.day-preview-block {
  position: absolute; top: 0; bottom: 0;
  border-radius: 3px; box-shadow: var(--shadow-sm);
  transition: transform .1s;
}
.day-preview-block:hover { transform: scale(1.02); z-index: 2; }

/* ==============================================================
   TOAST (dla HTMX swap notifications)
   ============================================================== */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 300;
  display: flex; flex-direction: column-reverse; gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 8px;
  box-shadow: var(--shadow-md);
  min-width: 280px; max-width: 400px;
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==============================================================
   TOPBAR SEARCH PILL + COMMAND PALETTE MODAL
   ============================================================== */
.topbar-search {
  display: flex; align-items: center; gap: 10px;
  min-width: 180px; max-width: 360px; flex: 1;
  height: 36px; padding: 0 12px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-dim); cursor: pointer; transition: all .15s;
  font-size: 13px; font-family: inherit;
}
.topbar-search:hover {
  border-color: var(--border-strong); background: var(--card-hover); color: var(--text);
}
.topbar-search .ico { width: 14px; height: 14px; opacity: .6; flex-shrink: 0; }
.kbd-cluster { display: flex; gap: 3px; align-items: center; }
.topbar-search-placeholder {
  flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kbd-chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; min-width: 18px; padding: 0 5px;
  font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 600;
  background: var(--card); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-dim); box-shadow: inset 0 -1px 0 var(--border);
}

.cmd-palette-backdrop {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 10vh;
  animation: cp-fade .15s ease;
}
@keyframes cp-fade { from { opacity: 0; } to { opacity: 1; } }
.cmd-palette {
  width: 640px; max-width: 92vw; max-height: 72vh;
  background: var(--card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: cp-slide .18s ease;
}
@keyframes cp-slide {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.cmd-palette-search {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.cmd-palette-input {
  flex: 1; background: transparent; border: 0; outline: 0;
  font-size: 15px; color: var(--text); font-weight: 500;
  font-family: inherit;
}
.cmd-palette-input::placeholder { color: var(--text-faint); }
.cmd-palette-results {
  flex: 1; overflow-y: auto; padding: 8px;
}
.cmd-palette-empty {
  padding: 48px 20px; text-align: center; color: var(--text-dim); font-size: 13px;
}
.cmd-palette-group { margin-bottom: 6px; }
.cmd-palette-group-label {
  font-size: 9px; font-family: "JetBrains Mono", monospace;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); padding: 10px 12px 4px;
}
.cmd-palette-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 6px; cursor: pointer;
  transition: background .1s;
  border: 1px solid transparent;
}
.cmd-palette-item:hover,
.cmd-palette-item.is-selected {
  background: var(--accent-soft); border-color: var(--accent-border);
}
.cmd-palette-item-label {
  font-size: 13px; color: var(--text); font-weight: 500;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmd-palette-item-hint {
  font-size: 11px; color: var(--text-faint); font-family: "JetBrains Mono", monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%;
}
.cmd-palette-footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
  background: var(--bg-raised);
  display: flex; justify-content: space-between; align-items: center;
  font-family: "JetBrains Mono", monospace; font-size: 10px;
  color: var(--text-faint); letter-spacing: .04em;
}

/* ==============================================================
   ORCHESTRATOR — Gantt timeline
   ============================================================== */
:root {
  --origin-recovery:   var(--danger);
  --origin-preflight:  var(--warning);
  --origin-postflight: var(--tiktok);
  --origin-cron:       var(--success);
  --origin-manual:     var(--accent);
}

.gantt-container {
  position: relative;
  min-height: 120px;
}
.gantt-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  position: sticky; top: 0; z-index: 6;
}
.gantt-header-cell {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-faint); padding: 10px 12px;
}
.gantt-phone-col {
  width: 140px; min-width: 140px; flex-shrink: 0;
  padding: 8px 12px;
  display: flex; align-items: center; gap: 6px;
  border-right: 1px solid var(--border);
}
.gantt-scale {
  flex: 1; position: relative; height: 36px;
}
.gantt-scale-tick {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-family: "JetBrains Mono", monospace; font-size: 10px;
  color: var(--text-faint); white-space: nowrap;
}
.gantt-scale-tick::before {
  content: ""; position: absolute; left: 0; top: calc(100% + 2px);
  width: 1px; height: 8px; background: var(--border);
}

.gantt-body {
  position: relative;
}
.gantt-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}
.gantt-row:hover {
  background: var(--card-hover);
}
.gantt-lane {
  flex: 1; position: relative;
  min-height: 44px;
}

.gantt-event {
  position: absolute; top: 6px; height: 18px;
  border-radius: 4px;
  display: flex; align-items: center;
  padding: 0 6px;
  cursor: pointer;
  overflow: hidden; white-space: nowrap;
  font-size: 10px; font-weight: 500;
  transition: filter .15s, box-shadow .15s;
  z-index: 2;
}
.gantt-event:hover {
  filter: brightness(1.1);
  box-shadow: var(--shadow-md);
  z-index: 3;
}
.gantt-event:focus,
.gantt-event:focus-visible {
  z-index: 10;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  filter: brightness(1.1);
  box-shadow: var(--shadow-md);
}

/* Origin color variants */
.gantt-event--recovery   { background: color-mix(in srgb, var(--origin-recovery) 75%, transparent); color: #fff; }
.gantt-event--preflight  { background: color-mix(in srgb, var(--origin-preflight) 75%, transparent); color: #fff; }
.gantt-event--postflight { background: color-mix(in srgb, var(--origin-postflight) 75%, transparent); color: #fff; }
.gantt-event--cron       { background: color-mix(in srgb, var(--origin-cron) 75%, transparent); color: #fff; }
.gantt-event--manual     { background: color-mix(in srgb, var(--origin-manual) 75%, transparent); color: #fff; }

/* Status modifiers */
.gantt-event--sent   { opacity: .45; }
.gantt-event--failed { opacity: .6; outline: 2px dashed var(--danger); outline-offset: -2px; }

.gantt-event-label {
  font-family: "JetBrains Mono", monospace;
  overflow: hidden; text-overflow: ellipsis;
}

/* "Teraz" vertical line */
.gantt-now-line {
  position: absolute; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
  z-index: 5; pointer-events: none;
}
.gantt-now-label {
  position: absolute; top: -2px; left: 4px;
  font-size: 9px; font-family: "JetBrains Mono", monospace;
  font-weight: 600; text-transform: uppercase;
  color: var(--accent); letter-spacing: .04em;
  white-space: nowrap;
}

/* Legend swatches */
.gantt-legend-swatch {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 3px; border: 1px solid var(--border);
}
.gantt-legend-swatch--pending {
  background: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
.gantt-legend-divider {
  width: 1px; height: 16px; background: var(--border); margin: 0 4px;
}

/* Gantt popover */
.gantt-popover-inner {
  min-width: 260px; max-width: 340px;
}

/* ==============================================================
   ORCHESTRATOR — Nowa komenda modal
   ============================================================== */
.ocmd-modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 8, 4, 0.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: modal-fade-in .15s ease-out;
}
.ocmd-modal-backdrop:not(.is-open) {
  display: none;
}
.ocmd-modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px;
  min-width: 440px; max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: modal-slide-in .2s ease-out;
}

/* ==============================================================
   PHONE HEALTH PILL — uniform indicator across panels
   ============================================================== */
.phone-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: default;
}
.phone-health-pill.health-healthy {
  background: rgba( 46, 160,  67, .12);
  color: var(--success);
  border-color: rgba( 46, 160,  67, .35);
}
.phone-health-pill.health-warn {
  background: rgba(217, 164,  32, .14);
  color: var(--warning);
  border-color: rgba(217, 164,  32, .40);
}
.phone-health-pill.health-problem {
  background: rgba(217,  58,  58, .10);
  color: var(--danger);
  border-color: rgba(217,  58,  58, .30);
}
.phone-health-pill.health-offline {
  background: rgba(120, 120, 120, .12);
  color: var(--text-faint);
  border-color: rgba(120, 120, 120, .30);
}

/* ==============================================================
   PREFLIGHT MODAL — harness pre-flight check overlay
   ============================================================== */
.preflight-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 8, 4, 0.45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: modal-fade-in .15s ease-out;
}
.preflight-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  min-width: 380px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: modal-slide-in .2s ease-out;
}
@media (max-width: 480px) {
  .preflight-modal {
    min-width: 0;
    max-width: 100%;
    margin: 0 8px;
    padding: 16px;
  }
}

.preflight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.preflight-title {
  font-size: 16px;
  font-weight: 600;
}

.preflight-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.preflight-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.preflight-check:last-child {
  border-bottom: none;
}
.preflight-check-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.preflight-check-name {
  font-weight: 500;
  color: var(--text);
  min-width: 110px;
}
.preflight-check-detail {
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  word-break: break-word;
}

/* Spinner for indeterminate checks */
.preflight-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: harness-spin .6s linear infinite;
  flex-shrink: 0;
}

/* Progress bar for recovery countdown */
.preflight-progress-wrap {
  height: 6px;
  background: var(--card-hover);
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0;
}
.preflight-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .3s linear;
}

.preflight-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.preflight-status-msg {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 8px 0;
}

/* ==============================================================
   RESPONSIVE — Gantt on mobile
   ============================================================== */
@media (max-width: 900px) {
  .gantt-phone-col { width: 80px; min-width: 80px; font-size: 10px; }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* === U2: setup pill === */
.setup-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 500;
  background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text-dim);
}
.setup-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint);
}
.setup-pill .progress {
  width: 28px; height: 4px; border-radius: 2px;
  background: color-mix(in srgb, var(--text-faint) 25%, transparent);
  overflow: hidden;
}
.setup-pill .progress > span {
  display: block; height: 100%; background: currentColor;
  transition: width .2s ease;
}
.setup-pill[data-state="full"] {
  color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, var(--border));
  background: color-mix(in srgb, var(--success) 8%, var(--bg-raised));
}
.setup-pill[data-state="full"] .dot { background: var(--success); }
.setup-pill[data-state="partial"] {
  color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, var(--border));
  background: color-mix(in srgb, var(--warning) 8%, var(--bg-raised));
}
.setup-pill[data-state="partial"] .dot { background: var(--warning); }
.setup-pill[data-state="unverified"] {
  color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  background: color-mix(in srgb, var(--danger) 8%, var(--bg-raised));
}
.setup-pill[data-state="unverified"] .dot { background: var(--danger); }
.setup-pill[data-state="offline"] { opacity: .55; }
.setup-pill[data-state="offline"] .progress { display: none; }

/* === U3: bulk bar === */
.bulk-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 720px;
  min-width: 480px;
  display: none;          /* JS in U5 toggles to flex */
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 80;
}
.bulk-bar[data-visible="true"] { display: flex; }
.bulk-count {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent); color: white;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; font-weight: 600;
}
.bulk-divider {
  width: 1px; height: 22px;
  background: var(--border);
}
.bulk-actions {
  display: flex; gap: 6px;
}
.bulk-actions .btn { padding: 6px 10px; font-size: 12px; }
.bulk-action-wrap { position: relative; display: inline-flex; }
.bulk-action-danger {
  border-color: var(--danger); color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--bg-raised));
}
.bulk-confirm {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 11.5px;
  white-space: normal;
  width: 280px;
  box-shadow: var(--shadow-lg);
  font-family: inherit;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 90;
}
.bulk-action-wrap:hover .bulk-confirm { opacity: 1; pointer-events: auto; }
.bulk-confirm::after {
  content: "";
  position: absolute;
  bottom: -5px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: var(--text);
}
.bulk-confirm-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  opacity: .6; font-family: "JetBrains Mono", monospace;
  margin-bottom: 4px;
}
.bulk-confirm-callsigns {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.bulk-confirm-callsigns span {
  background: color-mix(in srgb, var(--bg) 20%, transparent);
  padding: 1px 6px; border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
}
.bulk-confirm-actions {
  display: flex; gap: 6px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--bg) 25%, transparent);
}
.bulk-confirm-actions button {
  font-family: inherit; font-size: 11px;
  padding: 4px 10px; border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--bg) 30%, transparent);
  background: transparent; color: var(--bg);
  cursor: pointer;
}
.bulk-confirm-actions button.confirm {
  background: var(--danger); border-color: var(--danger); color: #fff;
}

/* === TU1: topbar v4 === */
/* Module color strip — 3px bar below topbar reflecting active group */
.topbar-module-strip {
  height: 3px; background: transparent;
  transition: background .2s;
}
.topbar-module-strip[data-module="dashboard"]  { background: var(--ice); }
.topbar-module-strip[data-module="personas"]   { background: #4F7E68; }
.topbar-module-strip[data-module="fleet"]      { background: #3b82f6; }
.topbar-module-strip[data-module="content"]    { background: #8b5cf6; }
.topbar-module-strip[data-module="scheduling"] { background: #5BA968; }
.topbar-module-strip[data-module="runtime"]    { background: #E8A246; }
.topbar-module-strip[data-module="system"]     { background: #9B9185; }

/* v2 7-noun IA module strip colors — scoped to [data-ui="v2"] so v1 is
   byte-identical. Design: docs/superpowers/specs/2026-05-29-yield-7noun-ia-redesign-design.md */
[data-ui="v2"] .topbar-module-strip[data-module="phones"]    { background: #3b82f6; }
[data-ui="v2"] .topbar-module-strip[data-module="accounts"]  { background: #4F7E68; }
[data-ui="v2"] .topbar-module-strip[data-module="campaigns"] { background: #E8794B; }
[data-ui="v2"] .topbar-module-strip[data-module="schedule"]  { background: #5BA968; }
[data-ui="v2"] .topbar-module-strip[data-module="drivers"]   { background: #E8A246; }
[data-ui="v2"] .topbar-module-strip[data-module="live_test"] { background: #C2624A; }
/* v2 has a hyphenated single-link label ("Live-Test") — keep nav labels on one line. */
[data-ui="v2"] .topbar-nav-group .group-label { white-space: nowrap; }

/* Nav groups container */
.topbar-nav-groups { display: flex; align-items: center; gap: 4px; }
.topbar-nav-group-wrap { position: relative; display: inline-flex; }

/* Individual nav group trigger (link or button) */
.topbar-nav-group {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text-dim); font-size: 13px; font-weight: 500;
  background: transparent; border: 1px solid transparent;
  cursor: pointer; transition: background .12s, color .12s;
  font-family: inherit; text-decoration: none;
}
.topbar-nav-group:hover { color: var(--text); background: var(--card-hover); text-decoration: none; }
.topbar-nav-group.is-active {
  color: var(--text); background: var(--bg-raised); border-color: var(--border);
  position: relative;
}
.topbar-nav-group .group-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.topbar-nav-group .lc-chev {
  width: 12px; height: 12px; opacity: .55;
  transition: transform .15s;
}
.topbar-nav-group[aria-expanded="true"] .lc-chev { transform: rotate(180deg); }

/* === TU2: topbar nav flyout === */
.topbar-nav-group-wrap { position: relative; display: inline-flex; }
.topbar-nav-flyout {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 280px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 90;
  display: grid; gap: 2px;
  animation: tb-flyout-in .12s ease-out;
}
.topbar-nav-flyout--wide { min-width: 360px; }
.topbar-nav-flyout[hidden] { display: none; }
.topbar-nav-flyout-header {
  padding: 8px 10px 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint);
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.topbar-nav-flyout-item {
  display: flex; gap: 12px; padding: 8px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none;
  transition: background .12s;
  align-items: flex-start;
}
.topbar-nav-flyout-item:hover { background: var(--card-hover); text-decoration: none; }
.topbar-nav-flyout-item.is-active { background: var(--accent-soft); }
.topbar-nav-flyout-item .item-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--bg-raised);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); flex-shrink: 0;
}
.topbar-nav-flyout-item:hover .item-icon { color: var(--accent); }
.topbar-nav-flyout-item.is-active .item-icon { color: var(--accent); background: var(--card); }
.topbar-nav-flyout-item .item-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.topbar-nav-flyout-item .item-title { font-size: 13px; font-weight: 600; line-height: 1.25; }
.topbar-nav-flyout-item .item-desc {
  font-size: 11px; color: var(--text-dim); line-height: 1.3;
  font-family: "JetBrains Mono", monospace;
}
@keyframes tb-flyout-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Tail cluster — user + divider + theme + logout */
.topbar-tail {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  flex: none;
}
.topbar-user {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px 0 4px;
  border-radius: 999px;
}
.topbar-user .avatar {
  width: 24px; height: 24px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: .04em;
}
.topbar-user .user-name {
  font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--text-dim);
  letter-spacing: .02em;
}
.topbar-user .user-name .role { color: var(--text-faint); }
.topbar-div {
  width: 1px; height: 20px; background: var(--border); flex: none;
}
.topbar-icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-btn);
  border: 1px solid transparent; background: transparent; color: var(--text-dim);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
  flex: none;
}
.topbar-icon-btn:hover { background: var(--card-hover); color: var(--text); }
.topbar-icon-btn .ico { width: 16px; height: 16px; }

/* Theme toggle — sun/moon icon swap */
.theme-toggle .tb-icon-sun { display: inline-block; }
.theme-toggle .tb-icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .tb-icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .tb-icon-moon { display: inline-block; }

/* Ops placeholder — TU3 fills content */
.topbar-ops[hidden] { display: none; }
.inline { display: inline; margin: 0; }

/* Laptop-width topbar compression.
 * Campaigns + Personas promotion made the primary nav slightly too wide at
 * 1440px. Keep all destinations visible while letting the search pill shrink
 * before the mobile horizontal-scroll treatment takes over at 900px. */
@media (max-width: 1500px) {
  .topbar-inner {
    padding: 0 16px;
    gap: 8px;
  }
  .topbar-nav-groups {
    gap: 2px;
  }
  .topbar-nav-group {
    padding: 7px 8px;
  }
  .topbar-search {
    min-width: 120px;
    max-width: 260px;
  }
  .topbar-ops {
    gap: 6px;
  }
  .topbar-ops + .topbar-tail {
    margin-left: 0;
  }
  .topbar-tail {
    gap: 6px;
  }
}

/* === U4: drawer / inspector ===
   Used by Variant B (drawer popup) + Variant C (split-view inspector).
   Width 480px so it fits next to a 1fr list column on a 1440px screen.
*/
.drawer {
  width: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.drawer-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--card) 100%);
  position: relative;
}
.drawer-head::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent);
}
.drawer-head .row1 { display: flex; align-items: center; gap: 10px; }
.drawer-head h3 { font-size: 16px; margin: 0; }
.drawer-close {
  margin-left: auto;
  background: transparent; border: 0; cursor: pointer; color: var(--text-dim);
  width: 28px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.drawer-close:hover { background: var(--card-hover); color: var(--text); }
.drawer-close svg { width: 14px; height: 14px; }

.drawer-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }

.drawer-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.drawer-stat {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.drawer-stat .lbl {
  font-size: 9px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); font-family: "JetBrains Mono", monospace;
}
.drawer-stat .val {
  font-size: 16px; font-family: "JetBrains Mono", monospace;
  font-weight: 600; color: var(--text);
  line-height: 1.2;
}
.drawer-stat.warn .val { color: var(--warning); }
.drawer-stat.danger .val { color: var(--danger); }

.drawer-section {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.drawer-section h4 {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); font-family: "JetBrains Mono", monospace;
  margin: 0 0 8px 0;
  display: flex; align-items: center; gap: 6px;
  font-weight: 600;
}
.drawer-section h4 svg { width: 12px; height: 12px; }

.account-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.account-row:last-child { border: 0; }
.account-row .handle {
  font-family: "JetBrains Mono", monospace;
  color: var(--text-dim);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.health-issue {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 5px 0;
  color: var(--text);
}
.health-issue svg { width: 12px; height: 12px; color: var(--danger); flex-shrink: 0; }
.health-issue .when {
  margin-left: auto; font-family: "JetBrains Mono", monospace; font-size: 10px;
  color: var(--text-faint);
}

.gate-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.gate-row .gate-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
}
.gate-row .gate-status.open { color: var(--success); }
.gate-row .gate-status.closed { color: var(--danger); }

.drawer-actions {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.drawer-actions .btn { justify-content: center; width: 100%; }

/* === U5: phones list (Variant A default + Variant C split) === */

/* Toolbar — search + filter chips + view toggle */
.phones-toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.phones-toolbar .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.phones-toolbar .result-count {
  font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--text-faint);
}
.search-wrap {
  position: relative; min-width: 240px; flex: 1; max-width: 380px;
}
.search-wrap > svg.search-ico {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-faint); pointer-events: none;
}
.search-wrap .input { width: 100%; padding-left: 32px; }

/* Filter chip — visually styled native select */
.filter-chip {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 26px 6px 10px;
  font-size: 12px; font-family: inherit;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-dim);
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.filter-chip:hover { border-color: var(--border-strong); color: var(--text); }
.filter-chip:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.filter-chip.active {
  border-color: var(--accent); color: var(--accent); background-color: var(--accent-soft);
}

/* View toggle — 3-option segmented (Tabela/Karty/Split) */
.view-toggle {
  display: inline-flex; padding: 3px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-btn);
}
.view-toggle a, .view-toggle button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; font-size: 12px;
  border-radius: 5px; border: 0; background: transparent;
  color: var(--text-dim); text-decoration: none;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.view-toggle a:hover, .view-toggle button:hover {
  color: var(--text); text-decoration: none;
}
.view-toggle a.active, .view-toggle button.active {
  background: var(--card); color: var(--text);
  box-shadow: var(--shadow-sm);
}
.view-toggle svg { width: 13px; height: 13px; }

/* 2-line cell — primary on top, secondary below.
   align-items: flex-start so pills/badges in Status/Setup column hug
   their content (badge ~80px, setup-pill ~100px) instead of stretching
   to full 200px column. .pri/.sec long labels still ellipsis via their
   own overflow:hidden. Vertical no-clip via td overflow:visible. */
.cell-2line {
  display: flex; flex-direction: column; gap: 2px; line-height: 1.25;
  align-items: flex-start;
}
.cell-2line .pri {
  font-size: 13px; color: var(--text); font-weight: 500;
  max-width: 100%;
}
.cell-2line .sec {
  font-size: 11px; color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  max-width: 100%;
}

/* Battery + temp inline indicators */
.bat {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: "JetBrains Mono", monospace; font-size: 12px;
}
.bat svg { width: 13px; height: 13px; }
.bat.warn { color: var(--warning); }
.bat.danger, .bat.low { color: var(--danger); }

/* Status dot (online/degraded/offline) */
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.status-dot.online   { background: var(--success); box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 18%, transparent); }
.status-dot.degraded { background: var(--warning); }
.status-dot.offline  { background: var(--text-faint); }

/* Dense scannable table — Variant A primary view.
   table-layout:fixed lets us assign predictable column widths so 60 rows
   fit on a 1280px+ screen without horizontal scroll. Long labels ellipsis
   in .cell-2line; mono numeric cells stay nowrap. */
.phones-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: visible;       /* dropdowns escape; rows don't get clipped */
  /* size to table width so there's no empty pad on the right when col
     widths sum < container. Stretches naturally on small screens via
     max-width:100% below. */
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}
.phones-table {
  width: auto;             /* size to colgroup widths, no trailing whitespace */
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.phones-table thead th {
  text-align: left;
  padding: 7px 8px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phones-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.phones-table tbody tr:last-child { border-bottom: 0; }
.phones-table tbody tr:hover { background: var(--card-hover); }
.phones-table tbody tr[aria-selected="true"] {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.phones-table tbody td {
  padding: 6px 8px;
  min-height: 38px;
  vertical-align: middle;
  /* NO overflow:hidden here — would clip stacked .cell-2line items
     (Status/Setup column has badge + setup-pill stacked vertically).
     Ellipsis applied ONLY to specific cells that need it (mono / .pri / .sec). */
}
.phones-table tbody td.mono {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phones-table .cell-2line .pri,
.phones-table .cell-2line .sec {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phones-table--ultradense tbody td { height: 28px; padding: 3px 8px; font-size: 11px; }

/* Per-row actions — opacity 0 to 1 on row hover.
   display: flex (NOT inline-flex) so the container fills the TD width,
   letting justify-content: flex-end actually push buttons to the right
   edge — aligning them under the right-aligned "Actions" <th>. */
.row-actions {
  display: flex; gap: 2px;
  opacity: 0;
  transition: opacity .12s;
  justify-content: flex-end;
}
.phones-table tbody tr:hover .row-actions,
.phones-table tbody tr.revealed .row-actions,
.phones-table tbody tr[aria-selected="true"] .row-actions { opacity: 1; }
.ico-btn {
  width: 26px; height: 26px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); text-decoration: none;
  padding: 0;
}
.row-actions form { display: inline-flex; margin: 0; }
.ico-btn:hover {
  background: var(--bg-raised); border-color: var(--border); color: var(--accent);
}
.ico-btn.danger:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
}
.ico-btn svg { width: 13px; height: 13px; }

/* Custom checkbox — matches accent */
.cb {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px; background: var(--bg-raised);
  cursor: pointer; position: relative;
  vertical-align: middle;
  margin: 0;
  flex-shrink: 0;
}
.cb:checked { background: var(--accent); border-color: var(--accent); }
.cb:checked::after {
  content: ""; position: absolute;
  left: 3px; top: 0px; width: 4px; height: 8px;
  border: solid white; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Empty filter results */
.phones-empty-row td {
  text-align: center;
  padding: 32px 12px !important;
  color: var(--text-faint);
  font-style: italic;
  height: auto !important;
}

/* Variant C — Split inspector layout */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  gap: 12px;
  align-items: start;
}
.split-list-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.split-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.split-list tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
}
.split-list tr:last-child { border-bottom: 0; }
.split-list tr:hover { background: var(--card-hover); }
.split-list tr[aria-selected="true"] {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.split-list td {
  padding: 4px 10px;
  height: 28px;
  vertical-align: middle;
  white-space: nowrap;
}
@media (max-width: 1280px) {
  .split { grid-template-columns: minmax(0, 1fr) 400px; }
}
@media (max-width: 1024px) {
  .split { grid-template-columns: 1fr; }
}

/* Mobile: keep only must-see columns */
@media (max-width: 720px) {
  .phones-table .col-health,
  .phones-table .col-accounts,
  .phones-table .col-lastseen { display: none; }
  .filter-chip { display: none; }
  .filter-chip.always-visible { display: inline-flex; }
}

/* === TU3: topbar ops indicator === */
.topbar-ops {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
  flex: none;
}
.topbar-ops[hidden] { display: none; }
.ops-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px;
  border-radius: 999px;
  background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text); font-family: "JetBrains Mono", monospace;
  font-size: 12px; text-decoration: none;
  flex: none;
}
.ops-chip:hover { border-color: var(--border-strong); text-decoration: none; }
.ops-chip .ops-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 50%, transparent);
  animation: ops-dot-pulse 1.8s ease-in-out infinite;
}
@keyframes ops-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 50%, transparent); }
  50%      { box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 0%, transparent); }
}
.topbar-ops[data-state="alert"] .ops-chip .ops-dot { background: var(--warning); }
.topbar-ops .ops-num { font-weight: 600; }
.topbar-ops .ops-total { color: var(--text-faint); }

.ops-alert {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
  color: var(--warning);
  font-size: 12px; text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  flex: none;
}
.ops-alert:hover {
  background: color-mix(in srgb, var(--warning) 20%, transparent);
  text-decoration: none;
}
.ops-alert svg { width: 14px; height: 14px; flex-shrink: 0; }
.ops-alert .ops-callsigns {
  color: var(--text-dim); font-size: 11px;
  display: inline-flex; gap: 1px;
}

@media (max-width: 1280px) {
  .ops-alert .ops-callsigns { display: none; }
}

/* === U6: row-action dropdown menu === */
.row-action-menu {
  width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 100;
  display: flex; flex-direction: column; gap: 1px;
  animation: tb-flyout-in .12s ease-out;
}
.row-action-menu[hidden] { display: none; }
.row-action-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  color: var(--text); text-decoration: none;
  font-size: 12px; font-family: inherit;
  border: 0; background: transparent; cursor: pointer;
  text-align: left; width: 100%;
}
.row-action-item:hover { background: var(--card-hover); text-decoration: none; }
.row-action-item.danger { color: var(--danger); }
.row-action-item.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.row-action-item svg { width: 13px; height: 13px; flex-shrink: 0; }
.row-action-item form { display: contents; }
.row-action-divider {
  height: 1px; background: var(--border);
  margin: 4px 0;
}

/* "Roadmap" badge on disabled flyout items */
.topbar-nav-flyout-item.is-soon {
  opacity: 0.5;
  pointer-events: none;
}
.topbar-nav-flyout-item.is-soon::after {
  content: "Roadmap";
  margin-left: auto;
  font-size: 0.75em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.08);
  color: var(--muted, #6b6a65);
}

/* Dark theme variant */
[data-theme="dark"] .topbar-nav-flyout-item.is-soon::after {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
  .topbar-inner {
    padding: 0 12px;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topbar-inner::-webkit-scrollbar { display: none; }
  .brand-title,
  .topbar-search,
  .topbar-user .user-name {
    display: none;
  }
  .topbar-nav-groups,
  .topbar-tail {
    flex: none;
  }
  .topbar-nav-group {
    padding: 7px 10px;
  }
}

/* Phase 1 T6 — Campaigns platform tabs: per-platform active background
   for YT + Spotify. Without these, .is-active applies `color: #fff` with
   no background (sibling rules in uploads.css cover only /tt + /ig),
   making the active tab invisibly white-on-white. */
.campaigns-platform-tab.is-active[href*="/yt"] {
  background: var(--youtube);
}
.campaigns-platform-tab.is-active[href*="/spotify"] {
  background: var(--spotify);
}

/* ============================================================
   Personas / Account Bank
   ============================================================ */
.account-bank-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 16px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.account-bank-hero h2 {
  font-size: 20px;
  margin-bottom: 6px;
}
.account-bank-hero p {
  color: var(--text-dim);
  max-width: 72ch;
}
.account-bank-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}
.account-bank-flow svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}
.account-bank-summary {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 10px;
}
.account-bank-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
}
.account-bank-stat span {
  display: block;
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-family: "JetBrains Mono", monospace;
}
.account-bank-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
}
.account-bank-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 160px 170px auto auto;
  gap: 8px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px;
}
.account-bank-table-wrap {
  width: 100%;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.account-bank-table {
  width: 100%;
  min-width: 980px;
}
.account-bank-platform-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 8px;
}
.account-bank-platform-dot.tt { background: var(--tiktok); }
.account-bank-platform-dot.ig { background: #C13584; }
.account-bank-source,
.account-bank-mounted-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.account-bank-unmounted {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--bg);
  color: var(--text-faint);
  font-size: 11px;
}
.account-bank-actions {
  text-align: right;
  white-space: nowrap;
}
.account-bank-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 42px 24px;
  text-align: center;
}
.account-bank-empty svg {
  color: var(--accent);
}
.account-bank-empty p {
  color: var(--text-dim);
}
.account-bank-mobile-list {
  display: none;
}
.account-bank-mobile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.account-bank-mobile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.account-bank-mobile-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg-raised);
}
.account-bank-mobile-grid span,
.account-bank-mobile-grid small {
  display: block;
  color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
}
.account-bank-mobile-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .account-bank-hero,
  .account-bank-summary,
  .account-bank-toolbar {
    grid-template-columns: 1fr;
  }
  .account-bank-flow {
    grid-template-columns: 1fr;
  }
  .account-bank-flow svg {
    transform: rotate(90deg);
    justify-self: center;
  }
}

@media (max-width: 700px) {
  .account-bank-table-wrap {
    display: none;
  }
  .account-bank-mobile-list {
    display: grid;
    gap: 10px;
  }
  .account-bank-mobile-grid {
    grid-template-columns: 1fr;
  }
}
