/* ============================================================
   TELEMAMBA DESIGN SYSTEM v2
   Telestars-dark blue-black base · PLATINUM accent (silver/white/dark blue/black) · sharp cards
   Simple like ops-desk. Inter everywhere, mono for money.
   Platinum silver = the brand accent, used boldly (primary buttons, active nav,
   live metrics). Telegram blue ONLY for TG entities.
   ============================================================ */

/* ── Fonts (self-hosted) ── */
@font-face { font-family: "Bebas Neue"; src: url("/fonts/bebas-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/sgro-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/sgro-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jbmono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jbmono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* ── Tokens ── */
:root {
  /* surfaces — deep blue-black ladder (Telestars-like) */
  --bg: #070B14;
  --surface: #0C1322;
  --raised: #111A2E;
  --overlay: #16203A;

  /* borders */
  --line: #1B2438;
  --line-strong: #27324A;

  /* text */
  --text: #EEF2F9;
  --text-2: #93A0B8;
  --text-3: #55617A;

  /* brand */
  --acc: #C9D5EA;          /* platinum silver */
  --acc-hover: #E6ECF7;    /* bright platinum */
  --acc-down: #9AA9C4;     /* worn silver */
  --acc-wash: rgba(201, 213, 234, 0.10);
  --acc-glow: rgba(220, 230, 246, 0.22);
  /* platinum metal gradient — the ONE brand finish, reuse everywhere */
  --plat: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);

  /* semantic */
  --ok: #2ECC71;
  --ok-wash: rgba(46, 204, 113, 0.13);
  --danger: #FF4D4D;
  --danger-wash: rgba(255, 77, 77, 0.13);
  --warn: #FFB020;
  --tg: #229ED9;
  --tg-wash: rgba(34, 158, 217, 0.13);

  /* type */
  --font-ui: "Inter", -apple-system, sans-serif;
  --font-tech: "Space Grotesk", "Inter", sans-serif;   /* buttons, labels, nav — technical edge */
  --font-display: "Bebas Neue", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* radius — SHARP. Depth via borders, aggression via edges. */
  --r: 2px;        /* cards, drawers, modals */
  --r-sm: 2px;     /* buttons, inputs, nav items */
  --r-full: 2px;   /* badges, segments — sharp too; circles only for dots/avatars */

  /* scale (4px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;

  /* motion */
  --fast: 120ms ease-out;
  --move: 150ms ease-out;

  --sidebar-w: 200px;
  --topbar-h: 48px;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; overscroll-behavior-x: none; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--acc); color: #0B0E16; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--acc-down); }

/* ── Typography helpers ── */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}
/* platinum text — silver metallic gradient for display headings */
.platinum {
  background: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.star-sep { color: var(--acc); font-size: 0.85em; margin: 0 6px; }
.label {
  font-family: var(--font-tech);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.11em;
  color: var(--text-3);
}
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.t2 { color: var(--text-2); }
.t3 { color: var(--text-3); }

/* ── Buttons — sharp, bold, platinum primary ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 14px;
  font-family: var(--font-tech);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--raised);
  color: var(--text);
  transition: background var(--fast), border-color var(--fast), color var(--fast), box-shadow var(--fast);
  user-select: none; white-space: nowrap;
}
.btn:hover { background: var(--overlay); border-color: var(--acc); }
.btn:active { background: var(--surface); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid #E6ECF7; outline-offset: 1px; }

.btn-primary {
  background: var(--plat);
  border-color: #FFFFFF; color: #0B0E16;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.6), 0 0 20px var(--acc-glow);
}
.btn-primary:hover { background: linear-gradient(180deg, #FFFFFF 0%, #F2F5FA 55%, #B4C0D6 100%); box-shadow: 3px 3px 0 rgba(0,0,0,0.6), 0 0 26px rgba(220,230,246,0.35); }
.btn-primary:active { box-shadow: 1px 1px 0 rgba(0,0,0,0.6); }

.btn-outline { background: transparent; border-color: var(--acc); color: var(--acc); }
.btn-outline:hover { background: var(--acc-wash); border-color: var(--acc); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--raised); border-color: transparent; color: var(--text); }

.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #0B0E16; }

.btn-lg { height: 40px; padding: 0 var(--s5); font-size: 13px; border-radius: 2px; }
.btn-sm { height: 24px; padding: 0 var(--s2); font-size: 10.5px; border-radius: 2px; }

/* ── Inputs ── */
.input, .select, .textarea {
  width: 100%; height: 30px; padding: 0 var(--s2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 12.5px;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.textarea { height: auto; min-height: 80px; padding: var(--s2) var(--s3); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-wash); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2355617A' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 30px;
}
.field { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: var(--s4); }
.field .label { margin-bottom: 2px; }

/* ── Cards / KPI ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}
.kpi {
  display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s3) var(--s3) var(--s3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}
.kpi .label { display: flex; align-items: center; justify-content: space-between; }
.kpi .num {
  font-size: 22px; font-weight: 600; line-height: 1.15;
  background: var(--plat);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.kpi .delta { font-size: 11px; font-family: var(--font-mono); color: var(--text-3); }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--danger); }
.kpi.hot { border-color: rgba(201, 213, 234, 0.45); background: linear-gradient(160deg, rgba(220, 230, 246, 0.08), transparent 55%), var(--surface); }
.kpi.hot .num {
  background: var(--plat);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── Tables ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
  text-align: left; padding: 5px var(--s2);
  font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3);
  font-family: var(--font-tech);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.tbl td { padding: 7px var(--s2); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--fast); }
.tbl tbody tr:hover { background: var(--raised); box-shadow: inset 3px 0 0 var(--acc); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .num { text-align: right; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }

/* ── Badges & status dots ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 18px; padding: 0 7px;
  font-size: 10px; font-weight: 600;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  background: var(--raised);
}
.badge.acc { background: var(--plat); border-color: #FFFFFF; color: #0B0E16; font-weight: 700; }
.badge.ok { background: var(--ok-wash); border-color: transparent; color: var(--ok); }
.badge.danger { background: var(--danger-wash); border-color: transparent; color: var(--danger); }
.badge.tg { background: var(--tg-wash); border-color: transparent; color: var(--tg); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok { background: var(--ok); }
.dot.danger { background: var(--danger); }
.dot.tg { background: var(--tg); }
.dot.live { background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Tabs ── */
.tabs { display: flex; gap: var(--s1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; width: max-content; }
.tab {
  padding: 6px var(--s4); border-radius: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  transition: all var(--fast);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--acc); background: var(--acc-wash); }

/* ── Segbar ── */
.segbar { display: flex; gap: 5px; overflow-x: auto; white-space: nowrap; padding-bottom: 2px; }
/* albums (can be dozens per model) — wrap into rows instead of one endless horizontal scroll */
.segbar-wrap { flex-wrap: wrap; overflow-x: visible; white-space: normal; }
.seg {
  display: inline-flex; align-items: center; gap: 4px;
  height: 23px; padding: 0 8px;
  font-family: var(--font-tech);
  font-size: 10.5px; font-weight: 500; color: var(--text-2);
  border: 1px solid var(--line); border-radius: var(--r-full);
  background: var(--surface);
  transition: all var(--fast); flex: none;
}
.seg { white-space: nowrap; }
.seg:hover { border-color: var(--text-3); color: var(--text); }
.seg.active {
  border-color: #FFFFFF; color: #0B0E16;
  background: var(--plat);
  font-weight: 700; box-shadow: 2px 2px 0 rgba(0,0,0,0.55);
}
.seg .cnt { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-3); }
.seg.active .cnt { color: rgba(11, 14, 22, 0.75); }

/* ── Lightbox (fullscreen photo/video viewer) ── */
.lightbox-veil {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(2, 3, 7, 0.9);
  opacity: 0; transition: opacity var(--move);
}
.lightbox-veil.open { opacity: 1; }
.lightbox {
  position: fixed; inset: 0; z-index: 81;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; transform: scale(0.97); transition: opacity var(--move), transform var(--move);
  pointer-events: none;
}
.lightbox.open { opacity: 1; transform: scale(1); pointer-events: auto; }
.lightbox-media {
  max-width: min(94vw, 900px); max-height: 92vh; width: auto; height: auto;
  border-radius: var(--r); border: 1px solid rgba(201,213,234,.35);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  background: #05070C; object-fit: contain;
}
.lightbox-close {
  position: absolute; top: 18px; right: 22px;
  width: 38px; height: 38px; border-radius: 2px;
  background: var(--raised); border: 1px solid var(--line-strong); color: var(--text);
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { border-color: var(--acc); color: var(--acc); }

/* ── Drawer ── */
.drawer-veil {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(3, 5, 10, 0.72);
  opacity: 0; transition: opacity var(--move);
}
.drawer-veil.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(560px, 100vw);
  background: var(--surface);
  border-left: 3px solid #C9D5EA;
  transform: translateX(100%); transition: transform var(--move);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s4); }

/* ── Modal ── */
.modal-veil {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(3, 5, 10, 0.78);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s4);
}
.modal {
  width: 100%; max-width: 420px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: var(--s5);
}
.modal h3 { font-size: 15px; font-weight: 600; margin-bottom: var(--s2); }
.modal p { color: var(--text-2); font-size: 13px; margin-bottom: var(--s4); }
.modal .row { display: flex; gap: var(--s2); justify-content: flex-end; }

/* ── Toasts ── */
.toasts { position: fixed; bottom: var(--s4); right: var(--s4); z-index: 80; display: flex; flex-direction: column; gap: var(--s2); }
.toast {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s4);
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  border-left: 3px solid var(--text-3);
  font-size: 12.5px;
  animation: toastIn var(--move);
  max-width: 340px;
}
.toast.ok { border-left-color: var(--ok); }
.toast.danger { border-left-color: var(--danger); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Skeletons ── */
.skel { background: var(--raised); border-radius: 6px; position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skel-row { height: 14px; margin: var(--s2) 0; }

/* ── Empty state ── */
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s16) var(--s4); text-align: center; }
.empty img, .empty svg { opacity: 0.16; }
.empty .label { font-size: 11px; }

/* ── App layout ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none;
  background: linear-gradient(180deg, #090E1A 0%, #060A12 100%);
  border-right: 1px solid var(--line-strong);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  height: max(var(--topbar-h), env(titlebar-area-height, var(--topbar-h))); padding: 0 var(--s4);
  border-bottom: 1px solid var(--line-strong);
  position: relative;
  flex: none;
}
.sidebar .brand::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, #FFFFFF, #C9D5EA 45%, rgba(152,165,188,0.25));
}
.sidebar .brand > span:first-child { display: inline-flex; align-items: center; }
.sidebar .brand img, .sidebar .brand svg { width: 34px; height: 34px; }
.sidebar .brand .name {
  font-family: var(--font-display); font-size: 24px; letter-spacing: 0.05em; text-transform: uppercase;
  background: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar nav { flex: 1; overflow-y: auto; padding: var(--s4) var(--s2) var(--s3); }
.navsec { margin-bottom: var(--s4); }
.navsec > .label { display: flex; align-items: center; gap: 6px; padding: var(--s1) var(--s3) var(--s1) var(--s4); color: var(--text-3); }
.navsec > .label::before { content: ""; width: 8px; height: 2px; background: var(--plat); flex: none; }
.navitem {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 34px; padding: 0 var(--s4);
  font-family: var(--font-tech);
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  border-radius: 0;
  border-left: 3px solid transparent;
  transition: all var(--fast);
  text-align: left;
}
.navitem:hover { color: var(--text); background: rgba(255,255,255,0.03); transform: translateX(2px); }
.navitem.active {
  color: #FFF; font-weight: 700; border-left-color: #E6ECF7;
  background: linear-gradient(90deg, rgba(220,230,246,0.16), transparent 75%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.navitem .ico { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--text-3); transition: color var(--fast); }
.navitem:hover .ico { color: var(--text-2); }
.navitem.active .ico { color: #E6ECF7; }
.sidebar .foot { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* impersonation banner (platform owner inside a client space) */
.impbar {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 300;
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  background: var(--raised); border: 1px solid var(--acc); border-radius: var(--r);
  font-family: var(--font-tech); font-size: 12px; font-weight: 600; box-shadow: 4px 4px 0 rgba(0,0,0,.5);
}
.estclock { font-size: 11px; color: var(--text-3); letter-spacing: 0.04em; flex: none; }
.topbar {
  height: max(var(--topbar-h), env(titlebar-area-height, var(--topbar-h))); flex: none;
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s5);
  padding-left: max(var(--s5), env(titlebar-area-x, 0px));
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 40;
  -webkit-app-region: drag; app-region: drag;
}
.topbar button, .topbar input, .topbar select { -webkit-app-region: no-drag; app-region: no-drag; }
.topbar .crumb {
  position: relative;
  font-family: var(--font-display); font-size: 18px; letter-spacing: 0.05em; text-transform: uppercase;
  background: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.topbar .spacer { flex: 1; }
.content { padding: var(--s4); flex: 1; }

.viewhead { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); flex-wrap: wrap; }
.viewhead h2 {
  font-family: var(--font-display); font-size: 24px; letter-spacing: 0.04em; text-transform: uppercase;
  background: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.viewhead .sub { color: var(--text-2); font-size: 11.5px; width: 100%; margin-top: -4px; }
.viewhead .spacer { flex: 1; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s2); margin-bottom: var(--s4); }

/* ── Mobile bottom nav ── */
.botnav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
  padding-bottom: env(safe-area-inset-bottom);
}
.botnav .navitem {
  flex-direction: column; gap: 3px; height: 56px; padding: var(--s2) 0;
  justify-content: center; font-size: 10px; font-weight: 600;
  border-radius: 0;
}
.botnav .navitem.active { background: none; color: #FFF; }
.botnav .navitem.active .ico { color: #E6ECF7; }
.botnav .navitem .ico { width: auto; font-size: 17px; }

/* Mobile "More" sheet — reaches every section not in the bottom bar */
.moresheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(4,7,12,.6);
  display: flex; align-items: flex-end; animation: msfade .16s ease; }
.moresheet { width: 100%; background: var(--surface); border-top: 1px solid var(--line-strong);
  padding: 10px 14px calc(16px + env(safe-area-inset-bottom)); animation: msup .2s cubic-bezier(.2,.8,.2,1); }
.moresheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong);
  margin: 2px auto 14px; }
.moresheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.moresheet-item { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 16px 6px; background: var(--raised); border: 1px solid var(--line);
  color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.moresheet-item .ico { color: var(--text-3); display: inline-flex; }
.moresheet-item:active { background: var(--surface); }
.moresheet-item.active { border-color: var(--acc); color: var(--text); }
.moresheet-item.active .ico { color: var(--acc); }
@keyframes msfade { from { opacity: 0; } }
@keyframes msup { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .moresheet-bg, .moresheet { animation: none; } }

/* Fans table: compact + every row ONE line high — long values are truncated with a
   full-text tooltip, so nothing may wrap and stretch the row */
.tbl-fans { font-size: 11.5px; }
.tbl-fans td { white-space: nowrap; padding: 4px 6px; }
.tbl-fans th { padding: 5px 6px; }
/* the fan opened last — glows for a few seconds after coming back, then fades out */
.tbl-fans tr.lastopen td { animation: lastopen-fade 5s ease-out forwards; }
@keyframes lastopen-fade {
  0% { background: var(--acc-wash); box-shadow: inset 2px 0 0 var(--acc); }
  70% { background: var(--acc-wash); box-shadow: inset 2px 0 0 var(--acc); }
  100% { background: transparent; box-shadow: none; }
}

/* ── Responsive: fluid at EVERY width ──
   ≥1081px full sidebar · 641–1080px icon rail · ≤640px bottom nav.
   Fans table columns hide low-priority first so the list always FITS the window
   width with no horizontal scroll: .c2 hidden <640 · .c3 hidden <1020 · .c4 hidden <1280. */
@media (max-width: 1280px) { .tbl-fans .c4 { display: none; } }
@media (max-width: 1020px) { .tbl-fans .c3 { display: none; } }

@media (max-width: 1080px) {
  .sidebar { width: 60px; }
  .sidebar .brand { justify-content: center; padding: 0; }
  .sidebar .brand .name { display: none; }
  .navsec > .label { visibility: hidden; height: 10px; padding: 0; }
  .navitem { font-size: 0; gap: 0; justify-content: center; padding: 0; }
  .navitem .ico { font-size: 16px; width: auto; }
  .sidebar .foot { display: none; }
}
@media (max-width: 640px) {
  .sidebar { display: none; }
  .botnav { display: flex; }
  .botnav .navitem { flex: 1; font-size: 10px; gap: 3px; padding: var(--s2) 0; justify-content: center; }
  .botnav .navitem .ico { font-size: 17px; }
  .content { padding: var(--s3); padding-bottom: 84px; }
  .drawer { width: 100vw; border-left: 0; }
  .kpi .num { font-size: 22px; }
  .tbl-fans .c2 { display: none; }
  .viewhead h2 { font-size: 24px; }
  .fanprev { display: none !important; }
  /* free up the cramped topbar on phones: the EST clock is a nice-to-have, drop it so the
     section's action buttons (+ Add chatter / manager, etc.) fit instead of being clipped */
  .estclock { display: none; }
  .topbar { gap: var(--s2); padding: 0 var(--s3); }
  .crumb { flex: none; }
  /* card headers with action buttons wrap to a new line instead of running off-screen */
  .autocard-head { flex-wrap: wrap; row-gap: 6px; }
  .autocard-head .ttl { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  /* any addrow (composer/filters) stacks its controls instead of overflowing */
  .addrow { flex-wrap: wrap; }
  .addrow .input, .addrow .select, .addrow .textarea { min-width: 0; }
}

/* ── Login ── */
.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(700px 420px at 50% -10%, rgba(220, 230, 246, 0.10), transparent 65%),
    var(--bg);
  padding: var(--s4);
}
.gate-box {
  position: relative;
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: var(--s10) var(--s8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 24px 80px rgba(0, 0, 0, 0.55);
}
.gate-box::before {
  content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 3px;
  background: var(--plat);
}
.gate-box .mark { display: flex; justify-content: center; margin-bottom: var(--s5); position: relative; }
.gate-box h1 {
  font-family: var(--font-display); font-size: 40px; text-align: center; letter-spacing: 0.06em; text-transform: uppercase;
  background: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.gate-box .sub {
  text-align: center; margin: var(--s1) 0 var(--s8);
  font-size: 12.5px; color: var(--text-2);
}
.gate-box form { display: flex; flex-direction: column; gap: var(--s3); }
.gate-box .input { height: 44px; }
.gate-box .btn { height: 44px; border-radius: var(--r-sm); font-size: 14px; }
.gate-err { text-align: center; color: var(--danger); font-size: 12px; min-height: 18px; }
.gate-foot { text-align: center; margin-top: var(--s6); font-size: 11px; color: var(--text-3); }

/* ── AGGRESSIVE PASS ── */
.hazard { height: 2px; background: var(--plat); opacity: 0.9; }
.btn-primary { box-shadow: 3px 3px 0 rgba(0,0,0,0.55), 0 0 18px var(--acc-glow); }
.btn-primary:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 rgba(0,0,0,0.55); }
.kpi.hot { border-color: var(--acc); border-width: 1px; position: relative; overflow: hidden; }
.kpi.hot::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--acc); }

/* ── Fan hover preview card ── */
.fanprev {
  position: fixed; z-index: 55; width: 300px; pointer-events: none;
  background: var(--raised); border: 1px solid var(--acc); border-radius: var(--r);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.5); padding: var(--s3) var(--s4);
  font-size: 12px;
}
.fanprev .row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.fanprev .row b { font-weight: 600; }

/* ── Chat dock (ops-desk style full overlay) ── */
.dock-veil { position: fixed; inset: 0; z-index: 60; background: rgba(3,5,10,0.82); }
.dock {
  position: fixed; inset: 16px; z-index: 61;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  border-top: 3px solid #C9D5EA;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.5);
  display: flex; flex-direction: column; overflow: hidden;
}
.dock-head {
  flex: none; display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line-strong);
  background: var(--raised);
}
.dock-head .who { font-weight: 700; font-size: 15px; }
.dock-head .meta { color: var(--text-2); font-size: 12px; }
.dock-body { flex: 1; display: flex; min-height: 0; }
.dock-side {
  width: 300px; flex: none; overflow-y: auto; padding: var(--s4);
  border-right: 1px solid var(--line);
}
.dock-side h4 { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--acc); margin: var(--s4) 0 var(--s2); }
.dock-side h4:first-child { margin-top: 0; }
.dock-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dock-msgs { flex: 1; overflow-y: auto; padding: var(--s4); display: flex; flex-direction: column; gap: 6px; }
.dock-compose { flex: none; border-top: 1px solid var(--line-strong); padding: var(--s3) var(--s4); }
.dock-tools { display: flex; gap: 8px; margin-bottom: 8px; }
/* attach panel + chips (Gallery/Scripts content → compose attachments, price set at the box) */
.attachpanel { margin-bottom: 8px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--raised); }
.attachpanel-head { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.attachpanel-body { padding: 8px; max-height: 250px; overflow-y: auto; }
.attachpanel-body .mediagrid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.attachpanel-body .mediacard img, .attachpanel-body .mediacard video { height: 72px; }
.attachpanel-body .mediacard .cap { padding: 4px 6px; font-size: 10px; }
.attachpanel-body .mediacard.sel { outline: 2px solid var(--acc); outline-offset: -2px; }
.attachbar { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; padding: 8px; border: 1px solid var(--acc); border-radius: var(--r); background: var(--raised); }
.attachchips { display: flex; flex-wrap: wrap; gap: 6px; }
.attachchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); font-size: 11px; color: var(--text-2); }
.attachchip img { width: 30px; height: 30px; object-fit: cover; border-radius: 2px; display: block; }
.attachchip .x { cursor: pointer; color: var(--text-3); padding: 0 3px; font-size: 12px; }
.attachchip .x:hover { color: #E6697B; }
.attachprice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* emoji picker (dock compose) */
.emopicker { margin-bottom: 8px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--raised); }
.emopicker-tabs { display: flex; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.emopicker-tabs::-webkit-scrollbar { display: none; }
.emotab { flex: none; font-size: 14px; line-height: 1; padding: 4px 6px; border: 1px solid transparent; border-radius: var(--r); background: none; cursor: pointer; opacity: 0.6; }
.emotab:hover { opacity: 1; background: var(--overlay); }
.emotab.active { opacity: 1; background: var(--overlay); border-color: var(--acc); }
.emopicker-grid { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; max-height: 150px; overflow-y: auto; }
.emo { font-size: 17px; line-height: 1; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r); background: none; cursor: pointer; }
.emo:hover { background: var(--overlay); }
.bubble {
  max-width: 72%; padding: 8px 12px; font-size: 13px; white-space: pre-wrap; word-break: break-word;
  border-radius: var(--r);
}
.bubble.in { align-self: flex-start; background: var(--raised); border: 1px solid var(--line); }
.bubble.out { align-self: flex-end; background: var(--plat); color: #10131C; border: 1px solid #FFFFFF; font-weight: 500; }
.bubble .stamp { display: block; font-size: 10px; margin-top: 3px; opacity: 0.65; }
.bubble-media {
  position: relative; width: 220px; max-width: 100%; aspect-ratio: 1/1; overflow: hidden;
  border-radius: 2px; margin-bottom: 6px; cursor: zoom-in; background: #05070C;
  border: 1px solid rgba(255,255,255,.12);
}
.bubble-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bubble-media.blurred img, .bubble-media.blurred video { filter: blur(16px); transform: scale(1.08); }
.media-lock {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  padding: 5px 10px; border-radius: var(--r); font-size: 11.5px; font-weight: 700; white-space: nowrap;
  background: rgba(11,14,22,.7); border: 1px solid rgba(255,255,255,.5); color: #fff;
  pointer-events: none; backdrop-filter: blur(2px);
}
/* a PPV he actually bought — sits at the bottom of the (now unblurred) tile, not over it */
.media-lock.paid {
  top: auto; bottom: 6px; left: 6px; transform: none;
  background: rgba(11,14,22,.78); border-color: rgba(74,222,128,.8); color: #4ADE80;
}
/* info fields */
.inforow { display: grid; grid-template-columns: 104px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.inforow .label { font-size: 9.5px; }
.inforow .input, .inforow .select { height: 28px; font-size: 12px; background: var(--raised); }
/* tag chips */
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tagchip {
  font-family: var(--font-tech);
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border: 1px solid var(--line-strong); border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; color: var(--text-2); cursor: pointer;
  transition: all var(--fast); background: var(--raised);
}
.tagchip:hover { border-color: var(--acc); color: var(--text); }
.tagchip.on { background: var(--plat); border-color: #FFFFFF; color: #10131C; }
@media (max-width: 900px) {
  .dock { inset: 0; border: 0; border-radius: 0; }
  .dock-body { flex-direction: column; }
  .dock-side { width: 100%; max-height: 38vh; border-right: 0; border-bottom: 1px solid var(--line-strong); }
}
/* channel post feed — Telegram-style bubbles (same feel as the fan chat) */
.chwrap {
  background: radial-gradient(600px 300px at 50% -8%, rgba(220,230,246,.05), transparent 60%), var(--bg);
  border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 18px;
}
.chfeed { max-width: 470px; display: flex; flex-direction: column; gap: 12px; }
.chdivider {
  align-self: center; font-family: var(--font-tech); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3);
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-full);
  padding: 3px 10px; margin: 2px 0;
}
.chpost {
  position: relative; max-width: 92%; min-width: 220px; align-self: flex-start;
  background: linear-gradient(180deg, var(--overlay) 0%, var(--raised) 100%);
  border: 1px solid var(--line-strong); border-left: 2px solid var(--acc);
  border-radius: var(--r); padding: 8px 12px 6px;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
}
.chpost.sched { border-left-color: var(--warn); opacity: .92; }
.chpost .chname {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-tech); font-size: 11.5px; font-weight: 700; color: var(--tg);
  margin-bottom: 5px;
}
.chpost .chname .schedtag { font-size: 10px; color: var(--warn); font-weight: 600; }
.chpost .txt { font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.chfoot { display: flex; align-items: flex-end; gap: 8px; margin-top: 4px; }
.chfoot .stamp { margin-left: auto; font-size: 9.5px; color: var(--text-3); }
.chfoot .actions { display: inline-flex; gap: 0; opacity: 0; transition: opacity 120ms ease-out; }
.chpost:hover .chfoot .actions { opacity: 1; }
@media (hover: none) { .chfoot .actions { opacity: 1; } }
/* poll inside a post — Telegram look with fill bars */
.chpoll { padding: 2px 0 4px; min-width: 240px; }
.chpoll .q { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.chpoll .sub { font-size: 10.5px; color: var(--text-3); margin-bottom: 8px; }
.chpoll .opt {
  position: relative; display: flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 9px; margin-bottom: 5px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg);
}
.chpoll .opt .fill { position: absolute; inset: 0; width: 0; background: var(--acc-wash); border-right: 1px solid var(--acc); }
.chpoll .opt .otxt { position: relative; font-size: 12px; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chpoll .opt .opct { position: relative; font-size: 10.5px; color: var(--acc); flex: none; }

/* media grid */
.mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); }
.mediacard { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--raised); cursor: pointer; transition: border-color var(--fast); }
.mediacard:hover { border-color: var(--acc); }
.mediacard { position: relative; aspect-ratio: 1 / 1; }
.mediacard img, .mediacard video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--bg); }
.media-doc { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 30px; background: var(--bg); }
.media-view-btn {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(11,14,22,.6); border: 1px solid rgba(255,255,255,.4); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; cursor: zoom-in;
  backdrop-filter: blur(2px); z-index: 1;
}
.media-view-btn:hover { background: rgba(11,14,22,.85); }
.media-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 7px 9px; font-size: 11px; font-weight: 600; letter-spacing: .01em; color: #EDF1F8;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: linear-gradient(180deg, rgba(9,13,22,.55), rgba(7,10,17,.94));
  backdrop-filter: blur(7px) saturate(1.1); -webkit-backdrop-filter: blur(7px) saturate(1.1);
  border-top: 1px solid rgba(201,213,234,.32);
  box-shadow: 0 -1px 0 rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05);
}
.media-price {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  background: var(--plat); color: #0B0E16; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 2px; border: 1px solid #FFF;
}

/* ── Dock bar — minimized chats (ops-desk style) ── */
/* minimized launcher — fixed bottom-right corner */
.docklauncher {
  position: fixed; right: 18px; bottom: 18px; z-index: 59;
  width: 46px; height: 46px; flex: none;
  border-radius: 50%; border: 1px solid #C9D5EA;
  background: linear-gradient(160deg, var(--raised), var(--surface));
  box-shadow: 0 6px 20px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform var(--fast), box-shadow var(--fast);
}
.docklauncher.hidden { display: none; }
.docklauncher:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.55), 0 0 22px var(--acc-glow); }
.docklauncher .ico { color: var(--acc); display: inline-flex; }
.docklauncher .count {
  position: absolute; bottom: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--plat); color: #0B0E16; border: 2px solid var(--bg);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.docklauncher .dockbadge.float { position: absolute; top: -5px; right: -5px; }
.dockbadge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; flex: none;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg);
}
@media (max-width: 640px) { .docklauncher { bottom: 74px; } }

/* ── Automation view ── */
.auto-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); align-items: start; }
.auto-col { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.auto-full { margin-bottom: var(--s3); }
@media (max-width: 980px) { .auto-cols { grid-template-columns: 1fr; } }

/* calendar (Scheduled DMs) */
.schedwrap { display: grid; grid-template-columns: 320px 1fr; gap: var(--s5); align-items: start; }
@media (max-width: 980px) { .schedwrap { grid-template-columns: 1fr; } }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-head .mon { font-family: var(--font-tech); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; flex: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-family: var(--font-tech); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); padding: 3px 0; }
.cal-day {
  position: relative; height: 38px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer; transition: border-color var(--fast), background var(--fast);
}
.cal-day:hover { border-color: var(--acc-down); color: var(--text); }
.cal-day.dim { opacity: 0.32; }
.cal-day.today { border-color: var(--acc); }
.cal-day.sel { background: var(--plat); border-color: #FFFFFF; color: #0B0E16; font-weight: 700; }
.cal-day .cnt {
  font-size: 8.5px; line-height: 1; color: var(--acc);
  font-weight: 700;
}
.cal-day.sel .cnt { color: rgba(11,14,22,0.7); }

.autocard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: inset 0 1px 0 rgba(255,255,255,0.09); }
.autocard[draggable="true"] { cursor: grab; }
.autocard.dragging { opacity: 0.35; cursor: grabbing; }
.ttl-editable:hover { color: var(--acc); text-decoration: underline; cursor: pointer; }
.autocard-head { display: flex; align-items: center; gap: 10px; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.autocard-head .ttl { font-family: var(--font-tech); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.autocard-head .spacer { flex: 1; }
.autocard-sub { padding: var(--s2) var(--s4) 0; color: var(--text-3); font-size: 11.5px; }
.autocard-body { padding: var(--s3) var(--s4) var(--s4); }
.autocard-body.off { opacity: 0.4; pointer-events: none; user-select: none; }

/* switch — sharp platinum */
.switch { position: relative; width: 42px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .sl {
  position: absolute; inset: 0; background: var(--overlay);
  border: 1px solid var(--line-strong); border-radius: var(--r); transition: all var(--fast);
}
.switch .sl::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: var(--text-3); border-radius: var(--r); transition: all var(--fast);
}
.switch input:checked + .sl { background: var(--plat); border-color: #FFFFFF; }
.switch input:checked + .sl::before { left: 22px; background: #0B0E16; }

/* variant rows */
.varrow { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.varrow .idx {
  flex: none; width: 22px; height: 22px; margin-top: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-3);
  border: 1px solid var(--line); border-radius: var(--r); background: var(--raised);
}
.varrow .textarea { flex: 1; min-height: 42px; font-size: 12.5px; }
.varrow .rm { flex: none; margin-top: 3px; }

/* follow-up steps */
.steprow { border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); padding: var(--s2) var(--s3) var(--s3); margin-bottom: var(--s2); cursor: grab; transition: opacity var(--fast); }
.steprow.dragging { opacity: 0.35; cursor: grabbing; }
.steprow-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.steprow-head > * { cursor: auto; }
.steprow-head .stepno {
  font-family: var(--font-tech); font-size: 10px; font-weight: 700; color: var(--acc);
  width: 18px; height: 18px; flex: none; border-radius: 2px; background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
}
.step-name-input {
  border: 1px solid transparent; background: none; color: var(--text); font-weight: 600;
  font-size: 13px; padding: 3px 6px; border-radius: 2px; min-width: 60px; flex: 1 1 auto; max-width: 480px;
}
.step-name-input:hover { border-color: var(--line); }
.step-name-input:focus { border-color: var(--acc); background: var(--bg); outline: none; }
.step-name-input::placeholder { color: var(--t3); font-weight: 400; }
.steprow-head .input { width: 72px; height: 26px; font-size: 12px; }
.steprow .textarea { min-height: 42px; font-size: 12.5px; background: var(--bg); }
.step-body { display: flex; gap: 12px; align-items: flex-start; cursor: auto; }
.step-body .step-text { flex: 1; min-width: 0; }
.step-content {
  flex: none; width: 128px; display: flex; flex-flow: row wrap; align-content: flex-start;
  gap: 5px; align-self: stretch;
}
.step-thumb {
  position: relative; width: 60px; height: 60px; flex: none; border-radius: 2px; overflow: hidden;
  cursor: zoom-in; background: #05070C; border: 1px solid var(--line-strong);
}
.step-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.step-thumb .media-play { width: 20px; height: 20px; font-size: 8px; }
.step-thumb .x {
  position: absolute; top: 2px; right: 2px; z-index: 2; width: 15px; height: 15px;
  border-radius: 50%; background: rgba(7,11,20,.85); color: #fff; font-size: 9px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.step-content .btn { flex: none; width: 60px; height: 60px; font-size: 10px; padding: 2px; line-height: 1.2; white-space: normal; }

/* scheduled + manager rows */
.listrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.listrow:last-of-type { border-bottom: 0; }
.listrow .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addrow { display: flex; gap: 8px; margin-top: var(--s3); flex-wrap: wrap; align-items: center; }
.addrow .input, .addrow .select { height: 30px; }
.addrow input[type="datetime-local"] { font-family: var(--font-mono); font-size: 11.5px; padding: 0 6px; }
.listrow .when { width: 106px; flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
@media (max-width: 640px) {
  .addrow > * { flex: 1 1 100%; }
  .addrow .btn { width: 100%; }
}

/* empty state inside grids spans full width (centered cobra) */
.mediagrid .empty { grid-column: 1 / -1; }

/* arrivals chart — hover tooltip with the day's count */
.arr-bar { position: relative; flex: 1; border-radius: 1px; cursor: default; }
.arr-bar:hover { outline: 1px solid var(--acc); }
.arr-bar:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--overlay); border: 1px solid var(--acc); border-radius: var(--r);
  padding: 3px 8px; font-family: var(--font-mono); font-size: 10.5px; white-space: nowrap;
  color: var(--text); z-index: 20; box-shadow: 2px 2px 0 rgba(0,0,0,0.5); pointer-events: none;
}

/* full-width tab strip across the top of the shared dock window */
/* top bar: compact chat tabs (left) + MIN/CLOSE actions (top-right corner) */
.docktabs {
  position: fixed; top: 12px; left: 16px; right: 16px; min-height: 36px; z-index: 62;
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-strong); border-top: 3px solid #C9D5EA;
  border-radius: var(--r); padding: 0 8px; box-shadow: 0 8px 22px rgba(0,0,0,.55);
}
.docktabs.hidden { display: none; }
/* compact tabs: many fit side by side and wrap to more rows when needed */
.docktabs-scroll { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; height: auto; padding: 5px 0; }
.docktab {
  flex: 0 1 auto; max-width: 130px; min-width: 0; height: 24px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 7px; border-radius: 2px; cursor: pointer;
  font-family: var(--font-tech); font-size: 11px; font-weight: 600; color: var(--text-2);
  border: 1px solid var(--line); background: var(--raised);
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.docktab .av {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--overlay); border: 1px solid var(--line-strong);
  color: var(--acc); font-size: 7.5px; font-weight: 700;
}
.docktab .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docktab:hover { color: var(--text); background: var(--overlay); border-color: var(--line-strong); }
.docktab.active { background: var(--plat); color: #0B0E16; border-color: #FFF; font-weight: 700; }
.docktab.active .av { background: rgba(11,14,22,.15); border-color: rgba(11,14,22,.25); color: #0B0E16; }
.docktab .tabu {
  min-width: 13px; height: 13px; padding: 0 3px; border-radius: 7px; flex: none;
  background: var(--danger); color: #fff; font-family: var(--font-mono); font-size: 8.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.docktab.active .tabu { background: #0B0E16; color: #E8EDF5; }
.docktab .x { color: var(--text-3); font-size: 11px; flex: none; }
.docktab.active .x { color: rgba(11,14,22,.55); }
.docktab .x:hover { color: var(--danger); }
.docktabs-actions { flex: none; display: flex; align-items: center; gap: 2px; margin-left: 8px; height: 34px; }
.docktabs-btn {
  width: 26px; height: 26px; border: 0; background: none; cursor: pointer;
  color: var(--text-2); font-size: 14px; border-radius: 2px;
  display: inline-flex; align-items: center; justify-content: center;
}
.docktabs-btn:hover { background: var(--raised); color: var(--text); }
.docktabs-btn.danger:hover { background: var(--danger); color: #fff; }
.dock.behind { display: none; }
/* dock starts under the tab strip — height is dynamic (rows), set by dock.js as --docktabs-h */
body.dock-tabbed .dock { top: calc(20px + var(--docktabs-h, 36px)); }
@media (max-width: 640px) { .docktab .nm { display: none; } }

/* ── Gallery: storage setup + upload (with cobra) ── */
.setup-hero { text-align: center; padding: 4px 2px; }
.setup-mark { display: inline-flex; margin: 4px auto 14px; }
.setup-mark img, .setup-mark svg { width: 56px; height: 56px; filter: drop-shadow(0 0 20px var(--acc-glow)); }
.setup-title {
  font-family: var(--font-display); font-size: 26px; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--plat); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.setup-sub { color: var(--text-2); font-size: 12.5px; line-height: 1.6; margin: 6px auto 20px; max-width: 340px; }
.setup-step { display: flex; gap: 12px; align-items: flex-start; text-align: left; margin-bottom: 12px; }
.setup-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--plat); color: #0B0E16; font-family: var(--font-tech); font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px #FFF, 2px 2px 0 rgba(0,0,0,.4);
}
.setup-txt { color: var(--text); font-size: 13px; line-height: 1.5; padding-top: 2px; }
.setup-txt b { color: var(--tg); font-weight: 700; }
.setup-code {
  display: flex; gap: 8px; align-items: center; margin: 6px 0 12px 36px;
}
.setup-code code {
  flex: 1; text-align: center; font-family: var(--font-mono); font-size: 18px; font-weight: 700; letter-spacing: 3px;
  background: var(--bg); border: 1px dashed var(--acc); border-radius: var(--r); padding: 10px 12px; color: #E6ECF7;
}
.setup-cta { width: 100%; margin-top: 6px; }
.setup-status {
  display: flex; align-items: center; gap: 9px; justify-content: center;
  margin-top: 16px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--raised); font-size: 12px; color: var(--text-2);
}

/* upload dropzone */
.up-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 30px 20px; cursor: pointer; border-radius: var(--r);
  border: 2px dashed var(--line-strong); background: var(--raised);
  transition: border-color var(--fast), background var(--fast);
}
.up-drop:hover { border-color: var(--acc); background: var(--overlay); }
.up-mark img, .up-mark svg { width: 48px; height: 48px; opacity: .9; filter: drop-shadow(0 0 16px var(--acc-glow)); }
.up-drop-t { font-weight: 700; font-size: 14px; color: var(--text); }
.up-drop-s { font-size: 11.5px; color: var(--text-3); max-width: 280px; }
.up-bar { height: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); margin-top: 12px; overflow: hidden; }
.up-bar-fill { height: 100%; width: 0; background: var(--plat); transition: width var(--fast); }

/* video preview play badge */
.mediacard { position: relative; }
.media-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(11,14,22,.55); border: 1px solid rgba(255,255,255,.5); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; padding-left: 2px;
  pointer-events: none; backdrop-filter: blur(2px);
}

/* gallery detail preview */
.media-view-hero { position: relative; margin-bottom: 14px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-strong); background: #05070C; }
.media-view-hero img { width: 100%; max-height: 340px; object-fit: contain; display: block; }
.media-view-hero-video { width: 100%; max-height: 340px; display: block; background: #05070C; }
