:root {
  /* surfaces, darkest -> lightest (dark skins) */
  --bg: #1d1d1f;
  --sunken: #141416;
  --panel: #171718;
  --list: #19191a;
  --field: #1a1a1c;
  --raised: #232326;
  --card: #262628;
  --card-hover: #2e2e31;
  --hover: #2e2e32;
  --line: #303033;
  --list-border: #2a2a2c;
  --border: #3a3a3f;
  --border-strong: #4a4a50;
  --text: #ececee;
  --muted: #8b8b92;
  --faint: #5e5e66;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-rgb: 34, 197, 94;
  --accent-2: #22c55e;
  --on-accent: #fff;
  --glow: rgba(34, 197, 94, .25);
  --hero-a: #16a34a;
  --hero-b: #0d9488;
  --hero-c: #2563eb;
  --green: #22c55e;
  --green-bg: rgba(var(--accent-rgb), .12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, .14);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, .14);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, .14);
  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, .14);
  --radius: 8px;
  --col-w: 272px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* iPhone: no grey "rubber band" past the edges. The page itself doesn't bounce, the space behind it is the app's own
   colour, and scrolling inside a panel stops at its end instead of dragging the whole page along. */
/* no vertical bounce, but sideways overscroll is left to the browser: two-finger swipe = back / forward */
html { background: var(--bg); overscroll-behavior-y: none; overscroll-behavior-x: auto; }
body { overscroll-behavior-y: none; overscroll-behavior-x: auto; }
/* only hold on to the direction each area scrolls in: a column keeps its up/down scrolling, but sideways swipes over
   it must still reach the board (holding both directions blocked sideways scrolling whenever the pointer was on a column) */
.home, .cards, .modal, .finder-list, .ana-list, .page, .cm-col { overscroll-behavior-y: contain; overscroll-behavior-x: auto; }
.board, .sheet-scroll { overscroll-behavior-x: auto; overscroll-behavior-y: auto; }
body {
  background: var(--bg); color: var(--text);
  font-size: 13px; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::-webkit-scrollbar { width: 8px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-rows: 52px 36px 1fr; height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 6px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-right: 18px; text-decoration: none; }
.brand-mark { width: 24px; height: 24px; }
.nav { display: flex; gap: 2px; }
.nav a {
  padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--raised); }
.nav a.active { color: var(--text); background: var(--hover); }
.topbar .spacer { flex: 1; }
.main { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

.search { position: relative; margin-bottom: 12px; }
.search input {
  width: 100%; background: var(--raised); border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 10px 7px 30px; outline: none;
}
.search input:focus { border-color: var(--border-strong); }
.search svg { position: absolute; left: 9px; top: 8px; color: var(--faint); }
.search-results {
  position: absolute; z-index: 30; top: 36px; left: 0; right: 0; background: var(--raised);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.45);
  max-height: 320px; overflow-y: auto; padding: 4px;
}
.search-results .res { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; cursor: pointer; }
.search-results .res:hover { background: var(--hover); }
.search-results .res small { color: var(--muted); display: block; }

.group-head {
  display: flex; align-items: center; justify-content: space-between; margin: 14px 4px 4px;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.group-head .tools { opacity: 0; display: flex; gap: 2px; }
.group-head:hover .tools { opacity: 1; }
.side-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer;
  color: var(--text); text-decoration: none; position: relative;
}
.side-item:hover { background: var(--raised); }
.side-item.active { background: var(--hover); box-shadow: inset 0 0 0 1px var(--border); }
.side-item .count { margin-left: auto; color: var(--faint); font-size: 11px; }
.side-item .more { opacity: 0; }
.side-item:hover .more { opacity: 1; }
.side-item:hover .count { display: none; }
.side-item.subtle { color: var(--muted); }
.side-item .ok { margin-left: auto; color: var(--green); }
.side-item .missing { margin-left: auto; color: var(--faint); }
.side-section {
  margin: 16px 4px 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.side-channel { display: flex; align-items: center; gap: 8px; padding: 6px 4px 10px; }
.side-channel b { display: block; font-size: 13px; }
.side-channel small { color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 12px 0; }

.icon-btn {
  background: none; border: 0; color: var(--muted); padding: 3px; border-radius: 5px; display: inline-grid;
  place-items: center; line-height: 0;
}
.icon-btn:hover { color: var(--text); background: var(--hover); }

/* ---------- board ---------- */
.board-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  min-height: 50px;
}
.board-head h1 { font-size: 15px; margin: 0; font-weight: 650; }
.board-head .meta { color: var(--muted); }
.board-head .spacer { flex: 1; }
.board {
  flex: 1; display: flex; gap: 8px; padding: 10px; overflow-x: auto; overflow-y: hidden; min-height: 0;
  align-items: stretch;
}
.column { width: var(--col-w); flex: none; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.list {
  flex: 1 1 0; min-height: 120px; display: flex; flex-direction: column; background: var(--list);
  border: 1px solid var(--list-border); border-radius: var(--radius);
}
.list-head {
  display: flex; align-items: center; gap: 6px; padding: 8px 8px 6px; font-size: 12px; font-weight: 600;
}
.list-head .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-head .n { color: var(--faint); font-weight: 500; }
.cards { flex: 1; overflow-y: auto; padding: 2px 6px 6px; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.cards.drop-files { outline: 2px dashed var(--green); outline-offset: -4px; border-radius: 8px; }
.add-card {
  margin: 0 6px 6px; padding: 6px 8px; border-radius: 6px; color: var(--muted); background: none; border: 0;
  text-align: left;
}
.add-card:hover { background: var(--raised); color: var(--text); }
.add-column {
  width: var(--col-w); flex: none; align-self: flex-start; background: rgba(255,255,255,.03);
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 10px; color: var(--muted);
}
.add-column:hover { color: var(--text); border-color: var(--border-strong); }

.card {
  background: var(--card); border: 1px solid var(--hover); border-radius: 7px; padding: 8px; cursor: pointer;
  position: relative; flex: none;
}
.card:hover { background: var(--card-hover); border-color: var(--border); }
.card.dragging { opacity: .35; }
.card .menu-btn { position: absolute; right: 4px; top: 4px; opacity: 0; }
.card:hover .menu-btn { opacity: 1; }
.placeholder { border: 1px dashed var(--border-strong); border-radius: 7px; background: rgba(255,255,255,.03); flex: none; }

.ch-top { display: flex; gap: 8px; align-items: flex-start; padding-right: 18px; }
.ch-name { font-weight: 600; font-size: 12px; line-height: 1.3; }
.ch-sub { color: var(--muted); font-size: 11px; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: #fff; overflow: hidden; background: var(--border-strong);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 20px; height: 20px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 16px; }
.avatar.xl { width: 64px; height: 64px; font-size: 24px; }
.members { display: flex; }
.members .avatar { box-shadow: 0 0 0 2px var(--card); margin-right: -5px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 7px 0; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 4px; font-size: 10.5px;
  font-weight: 600; background: var(--blue-bg); color: #8ab4ff; border: 1px solid rgba(59,130,246,.3);
}
.badge.green { background: rgba(var(--accent-rgb), .12); color: #6ee7a0; border-color: rgba(var(--accent-rgb), .3); }
.badge.red { background: var(--red-bg); color: #fca5a5; border-color: rgba(239,68,68,.3); }
.badge.amber { background: var(--amber-bg); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.badge.purple { background: var(--purple-bg); color: #d8b4fe; border-color: rgba(168,85,247,.3); }
.badge.gray { background: var(--hover); color: var(--muted); border-color: var(--border); }
.row { display: flex; align-items: center; gap: 6px; }
.row .spacer { flex: 1; }
.pill-count { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: rgba(var(--accent-rgb), .12); color: var(--green); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 8px; text-align: center; }
.stats small { display: block; color: var(--faint); font-size: 9px; letter-spacing: .05em; }
.stats b { font-size: 12px; color: var(--green); font-weight: 700; }
.stats b.neg { color: var(--red); }
.stats b.none { color: var(--faint); }
.stats b.total { color: var(--text); }

.vcard .thumb { margin: -8px -8px 8px; border-radius: 6px 6px 0 0; overflow: hidden; aspect-ratio: 16/9; background: var(--sunken); }
.vcard .thumb img, .vcard .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard .title { font-size: 12px; font-weight: 500; padding-right: 16px; word-break: break-word; }
.vcard .desc {
  color: var(--muted); font-size: 11px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.vcard .foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.vcard .foot:empty { display: none; }

.empty-state { margin: auto; text-align: center; color: var(--muted); padding: 40px; }
.empty-state h2 { color: var(--text); font-size: 16px; font-weight: 500; margin: 0 0 6px; }

/* ---------- pages ---------- */
.page { overflow-y: auto; padding: 24px; }
.page-inner { max-width: 760px; }
.page h1 { font-size: 20px; margin: 0 0 4px; }
.page p.lead { color: var(--muted); margin: 0 0 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.panel h2 { font-size: 14px; margin: 0 0 12px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.user-row:first-of-type { border-top: 0; }
.user-row .who { flex: 1; }
.user-row small { color: var(--muted); display: block; }
.tpl-cols { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tpl-col { background: var(--list); border: 1px solid var(--list-border); border-radius: 6px; padding: 6px; min-width: 130px; }
.tpl-col div { font-size: 11px; padding: 4px 6px; background: var(--card); border-radius: 4px; margin-bottom: 4px; }
.tpl-col div:last-child { margin-bottom: 0; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.input, textarea.input, select.input {
  width: 100%; background: var(--field); border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; outline: none;
}
.input:focus { border-color: var(--border-strong); }
textarea.input { resize: vertical; min-height: 90px; }
.btn {
  border: 1px solid var(--border); background: var(--hover); padding: 7px 12px; border-radius: 7px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: #fca5a5; }
.btn.danger:hover { background: var(--red-bg); border-color: rgba(239,68,68,.4); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--raised); cursor: pointer; user-select: none;
}
.chip.on { border-color: var(--green); background: rgba(var(--accent-rgb), .12); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.on { border-color: #fff; }
.hint { color: var(--muted); font-size: 12px; }
.err { color: #fca5a5; font-size: 12px; min-height: 16px; margin-top: 6px; }

/* ---------- modal / menu / toast ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; align-items: flex-start;
  justify-content: center; padding: 6vh 16px; overflow-y: auto;
}
.modal {
  background: var(--raised); border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 440px;
  padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.modal.wide { max-width: 760px; }
.modal h2 { margin: 0 0 14px; font-size: 16px; }
.modal-close { float: right; margin: -6px -6px 0 0; }
.menu {
  position: fixed; z-index: 60; min-width: 190px; background: var(--raised); border: 1px solid var(--border); border-radius: 9px;
  padding: 4px; box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.menu button {
  display: flex; width: 100%; text-align: left; background: none; border: 0; padding: 7px 9px; border-radius: 6px; gap: 8px;
}
.menu button:hover { background: var(--hover); }
.menu button.danger { color: #fca5a5; }
.menu .sep { height: 1px; background: var(--border); margin: 4px; }
.menu .label { padding: 6px 9px 2px; font-size: 11px; color: var(--muted); }
#toasts { position: fixed; bottom: 12px; right: 12px; z-index: 70; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.toast { background: var(--hover); border: 1px solid var(--border); padding: 6px 10px; border-radius: 7px; max-width: 260px; font-size: 12px; line-height: 1.35; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.toast.error { border-color: rgba(239,68,68,.5); }
.toast.warn { border-color: rgba(234,179,8,.6); background: #2a2310; max-width: 300px; }
.toast.warn b { color: #facc15; display: block; margin-bottom: 2px; }

/* card modal */
.cm-grid { display: grid; grid-template-columns: 1fr 220px; gap: 20px; }
.cm-thumb {
  aspect-ratio: 16/9; border-radius: 8px; background: var(--sunken); border: 1px dashed var(--border); display: grid; place-items: center;
  color: var(--muted); cursor: pointer; overflow: hidden; margin-bottom: 14px; position: relative;
}
.cm-thumb img, .cm-thumb video { width: 100%; height: 100%; object-fit: cover; }
.cm-thumb.drag { border-color: var(--green); }
.cm-title { font-size: 17px; font-weight: 650; background: transparent; border: 1px solid transparent; width: 100%; padding: 4px 6px; margin-left: -6px; border-radius: 6px; resize: none; }
.cm-title:hover, .cm-title:focus { border-color: var(--border); background: var(--field); outline: none; }
.cm-side h4 { margin: 14px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cm-side h4:first-child { margin-top: 0; }
.comment { display: flex; gap: 8px; margin-top: 12px; }
.comment .bubble { background: var(--field); border: 1px solid var(--hover); border-radius: 8px; padding: 8px 10px; flex: 1; white-space: pre-wrap; word-break: break-word; }
.comment small { color: var(--muted); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .modal { max-width: 380px; }
.auth .brand { margin: 0 0 18px; font-size: 18px; }

@media (max-width: 760px) {
  .body { grid-template-columns: 1fr; }
  .nav a { padding: 6px 8px; }
  .brand span { display: none; }
  .cm-grid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .page { padding: 16px; }
}

/* ---------- compact 3-up cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 5px; padding: 2px 5px 5px; }
.card { padding: 6px; border-radius: 6px; }
.card .menu-btn { right: 1px; top: 1px; padding: 2px; }
.ch-top { gap: 5px; padding-right: 12px; }
.ch-name { font-size: 10.5px; line-height: 1.25; word-break: break-word; }
.ch-sub { font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .avatar { width: 20px; height: 20px; font-size: 9px; }
.card .members .avatar { width: 15px; height: 15px; font-size: 7px; margin-right: -4px; box-shadow: 0 0 0 1.5px var(--card); }
.card .badges { margin: 5px 0; gap: 3px; }
.card .badge { font-size: 9px; padding: 1px 4px; }
.card .pill-count { font-size: 9px; padding: 0 4px; }
.card .stats { grid-template-columns: repeat(2, 1fr); row-gap: 3px; margin-top: 5px; }
.card .stats small { font-size: 8px; }
.card .stats b { font-size: 10.5px; }
.vcard .thumb { margin: -6px -6px 6px; border-radius: 5px 5px 0 0; }
.vcard .title { font-size: 10.5px; line-height: 1.3; padding-right: 12px; }
.vcard .desc { font-size: 9.5px; margin-top: 3px; }
.vcard .foot { font-size: 9.5px; gap: 5px; margin-top: 4px; }
.placeholder { min-height: 60px; }

/* smooth drag */
.cards { position: relative; }
.card { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.card.drag-src { display: none; }
.drag-ghost {
  position: fixed; z-index: 100; pointer-events: none; margin: 0; will-change: transform;
  box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 0 1px var(--border-strong); opacity: .97; cursor: grabbing;
}
.drag-ghost .menu-btn { display: none; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
.placeholder { background: rgba(var(--accent-rgb), .06); border: 1.5px dashed rgba(var(--accent-rgb), .45); transition: height .15s; }

/* channel card extras */
.card .avatar.ch-pfp { width: 30px; height: 30px; font-size: 11px; box-shadow: 0 0 0 1.5px var(--border); }
.yt-link { display: inline-grid; place-items: center; vertical-align: -2px; color: #f87171; background: rgba(239,68,68,.16); border-radius: 3px; padding: 0 2px; }
.yt-link:hover { background: rgba(239,68,68,.3); }
.badge.uploads { cursor: pointer; background: rgba(234,179,8,.13); color: #fcd34d; border-color: rgba(234,179,8,.35); font: inherit; font-size: 9px; font-weight: 600; }
.badge.uploads:hover { background: rgba(234,179,8,.22); }
.badge.uploads.unset { background: transparent; color: var(--faint); border-style: dashed; border-color: var(--border-strong); }
.badge.uploads.overdue .next { color: #fca5a5; }
.badge.uploads .next { font-weight: 500; opacity: .9; }
.board-head .badge.uploads { font-size: 11px; padding: 3px 7px; }
.add-member {
  width: 15px; height: 15px; border-radius: 50%; border: 1px dashed var(--faint); background: transparent; color: var(--muted);
  display: inline-grid; place-items: center; padding: 0; margin-left: 7px; flex: none;
}
.add-member:hover { color: var(--text); border-color: var(--text); }
.board-head .add-member { width: 22px; height: 22px; }
.popover { width: 250px; padding: 10px; }
.popover .field { margin-bottom: 9px; }
.popover .input { padding: 6px 8px; }
.pop-title { font-weight: 600; margin-bottom: 8px; }
.day-row { display: flex; gap: 3px; }
.day { flex: 1; padding: 4px 0; border-radius: 5px; border: 1px solid var(--border); background: var(--field); font-size: 11px; color: var(--muted); }
.day.on { background: rgba(234,179,8,.18); border-color: rgba(234,179,8,.5); color: #fcd34d; }
.pick-list { max-height: 220px; overflow-y: auto; margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.menu .pick { display: flex; align-items: center; gap: 8px; padding: 5px 6px; }
.menu .pick.on { background: rgba(var(--accent-rgb), .12); }
.menu .pick svg { color: var(--green); margin-left: auto; }
.pick-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-name small { color: var(--faint); }

/* zoom */
.zoom { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; margin-right: 6px; }
.zbtn { background: var(--raised); border: 0; padding: 4px 9px; color: var(--muted); font-size: 12px; min-width: 28px; }
.zbtn + .zbtn { border-left: 1px solid var(--border); }
.zbtn:hover { background: var(--hover); color: var(--text); }
.zoom-pct { min-width: 48px; font-variant-numeric: tabular-nums; }
.badge.uploads { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* full list names: wrap instead of truncating */
.list-head { align-items: flex-start; }
.list-head .name { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; padding-top: 2px; overflow-wrap: anywhere; }
.list-head .n { padding-top: 2px; }

/* templates */
.tpl-section { font-size: 15px; margin: 0 0 4px; }
.tpl-card.starred { border-color: rgba(234,179,8,.45); box-shadow: inset 0 0 0 1px rgba(234,179,8,.15); }
.star { background: none; border: 0; font-size: 20px; line-height: 1; padding: 0 2px; color: var(--faint); }
.star:hover { color: #fcd34d; transform: scale(1.1); }
.star.on { color: #facc15; cursor: default; }
.board-head .btn.sm { white-space: nowrap; }

/* rich menu */
.menu button.with-icon { align-items: center; gap: 10px; padding: 8px 10px; font-size: 13.5px; }
.menu button.with-icon svg { color: var(--muted); flex: none; }
.menu .mi-text { flex: 1; }
.menu .mi-right { color: var(--muted); font-size: 12px; }
.menu .mi-chev { color: var(--muted); font-size: 16px; line-height: 1; }
.menu button.danger.with-icon { background: rgba(239,68,68,.16); color: #fca5a5; margin-top: 2px; }
.menu button.danger.with-icon svg { color: #fca5a5; }
.menu button.danger.with-icon:hover { background: rgba(239,68,68,.26); }

/* board access */
.access-head { margin: -4px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--hover); }
.access-role { margin-bottom: 14px; }
.access-title { font-weight: 600; font-size: 13.5px; margin-bottom: 7px; }
.access-people { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.person { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 6px; background: var(--hover); border-radius: 999px; font-size: 13px; }
.person .avatar { width: 24px; height: 24px; font-size: 10px; }
.person-x { background: none; border: 0; color: var(--faint); font-size: 15px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.person-x:hover { color: #fca5a5; }
.person-add { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(59,130,246,.18); color: #93c5fd; font-size: 18px; line-height: 1; }
.person-add:hover { background: rgba(59,130,246,.3); }
.more-members { font-size: 9px; color: var(--muted); margin-left: 8px; }

/* thumbnail / products / tracking */
.avatar.xxl { width: 96px; height: 96px; font-size: 34px; }
.drop-area { flex: 1; border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 26px 12px; text-align: center; color: var(--muted); cursor: pointer; display: grid; gap: 6px; justify-items: center; }
.drop-area:hover, .drop-area.on { border-color: var(--green); color: var(--text); }
.product-rows { display: flex; flex-direction: column; gap: 6px; }
.product-row { display: grid; grid-template-columns: 1.4fr .5fr 1.6fr auto; gap: 6px; align-items: center; }
.note { background: var(--amber-bg); border: 1px solid rgba(245,158,11,.35); color: #fcd34d; padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; font-size: 12.5px; }
.note a { color: inherit; font-weight: 600; }
.tracking-stats { background: var(--field); border: 1px solid var(--hover); border-radius: 8px; padding: 10px 0; }
.tracking-stats b { font-size: 15px !important; }
.snap-list { max-height: 180px; overflow-y: auto; }
.snap { display: grid; grid-template-columns: 2fr 1fr 1fr; padding: 3px 0; border-bottom: 1px solid var(--hover); font-size: 12px; color: var(--text); }
.snap.head { color: var(--muted); font-size: 11px; }
@media (max-width: 760px) { .product-row { grid-template-columns: 1fr 1fr; } }
.list-head .name { cursor: default; user-select: none; }
.list-rename {
  flex: 1; min-width: 0; resize: none; overflow: hidden; font: inherit; font-weight: 600; line-height: 1.3;
  background: var(--sunken); border: 1px solid var(--green); border-radius: 5px; padding: 1px 5px; margin: 0 0 0 -6px; outline: none;
}

/* =====================================================================
   HOME
   ===================================================================== */
.home { overflow-y: auto; padding: 22px 26px 40px; }
.home-inner { max-width: 1320px; margin: 0 auto; display: grid; gap: 16px; }

.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 30px 32px; min-height: 210px;
  background: var(--panel); border: 1px solid var(--border); isolation: isolate;
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end;
}
.hero .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .32; z-index: -1; will-change: transform; }
.hero .b1 { width: 420px; height: 420px; background: var(--hero-a); top: -200px; left: -80px; animation: drift1 16s ease-in-out infinite alternate; }
.hero .b2 { width: 360px; height: 360px; background: var(--hero-b); top: -120px; right: 10%; animation: drift2 19s ease-in-out infinite alternate; }
.hero .b3 { width: 300px; height: 300px; background: var(--hero-c); bottom: -220px; left: 40%; animation: drift3 22s ease-in-out infinite alternate; }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
html[data-skin="paper"] .hero .blob { opacity: .28; }
html[data-skin="paper"] .hero::after { background-image: radial-gradient(rgba(0,0,0,.06) 1px, transparent 1px); }
@keyframes drift1 { to { transform: translate(120px, 60px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-90px, 70px) scale(.9); } }
@keyframes drift3 { to { transform: translate(-140px, -40px) scale(1.2); } }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.team-name {
  font-size: clamp(34px, 5vw, 60px); font-weight: 800; letter-spacing: -.03em; line-height: 1.02; margin: 6px 0 18px;
  background: linear-gradient(100deg, var(--text) 30%, var(--accent-2) 60%, var(--hero-b));
  -webkit-background-clip: text; background-clip: text; color: transparent; word-break: break-word;
}
.team-name[contenteditable="true"] { outline: 2px dashed var(--border-strong); outline-offset: 6px; border-radius: 6px; -webkit-text-fill-color: var(--text); }
.edit-pen { opacity: 0; transition: opacity .2s; }
.hero:hover .edit-pen { opacity: 1; }
.you { display: flex; align-items: center; gap: 12px; }
.you .avatar { width: 46px; height: 46px; font-size: 17px; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .3); }
.you-name { font-size: 20px; font-weight: 700; }
.greeting { color: var(--muted); margin-top: 2px; }
.hero-side { text-align: right; display: grid; gap: 10px; justify-items: end; }
.hero-date { font-size: 13px; color: var(--muted); }
.hero-date b { display: block; font-size: 30px; color: var(--text); font-weight: 750; letter-spacing: -.02em; }
.skin-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; font-weight: 600;
  background: rgba(var(--accent-rgb), .14); border: 1px solid rgba(var(--accent-rgb), .4); color: var(--text);
  backdrop-filter: blur(8px);
}
.skin-btn:hover { background: rgba(var(--accent-rgb), .24); }
.skin-dot { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--hero-a), var(--hero-b), var(--hero-c), var(--hero-a)); }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi {
  position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px 16px 14px;
  overflow: hidden; transition: transform .2s ease, border-color .2s, box-shadow .2s;
}
.kpi:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb), .5); box-shadow: 0 10px 30px -10px var(--glow); }
.kpi::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent); opacity: .7;
}
.kpi .k-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.kpi .k-label svg { color: var(--accent-2); }
.kpi .k-value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--muted); }
.kpi .k-sub b { color: var(--text); font-weight: 650; }
.kpi .k-sub .up { color: var(--green); }
html[data-skin="paper"] .kpi .k-sub .up { color: #15803d; }

.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-eq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px; min-width: 0; }
.tile-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.tile-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.tile-head .sub { color: var(--muted); font-size: 12px; }
.tile-head .spacer { flex: 1; }
.tile-head a { color: var(--muted); font-size: 12px; text-decoration: none; }
.tile-head a:hover { color: var(--text); }
.tile-empty { color: var(--muted); font-size: 12.5px; padding: 18px 4px; text-align: center; }
.tile-empty a { color: var(--accent-2); }

/* views chart */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--raised); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 9px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.chart-tip b { display: block; font-size: 13px; }
.chart-tip span { color: var(--muted); }

/* pipeline */
.pipe-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin-bottom: 10px; text-decoration: none; color: inherit; }
.pipe-row .pname { font-size: 12.5px; }
.pipe-row .pname small { color: var(--faint); margin-left: 4px; }
.pipe-row .pcount { font-weight: 700; font-variant-numeric: tabular-nums; }
.pipe-bar { grid-column: 1 / -1; height: 8px; background: var(--hover); border-radius: 999px; overflow: hidden; }
.pipe-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.pipe-row:hover .pname { color: var(--accent-2); }

/* leaderboard / lists */
.lead-row { display: grid; grid-template-columns: 18px 30px 1fr auto; gap: 10px; align-items: center; padding: 7px 6px; border-radius: 10px; text-decoration: none; color: inherit; }
.lead-row:hover { background: var(--hover); }
.lead-row .rank { color: var(--faint); font-weight: 700; font-size: 12px; text-align: center; }
.lead-row .avatar { width: 30px; height: 30px; }
.lead-row .nm { min-width: 0; }
.lead-row .nm div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 12.5px; }
.lead-row .nm small { color: var(--muted); font-size: 11px; }
.lead-row .gain { text-align: right; font-weight: 750; color: var(--green); font-variant-numeric: tabular-nums; }
html[data-skin="paper"] .lead-row .gain { color: #15803d; }
.lead-row .gain small { display: block; color: var(--faint); font-weight: 500; font-size: 10.5px; }
.minibar { grid-column: 3 / -1; height: 3px; background: var(--hover); border-radius: 3px; margin-top: -3px; }
.minibar i { display: block; height: 100%; border-radius: 3px; background: var(--accent-2); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }

.up-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; text-decoration: none; color: inherit; }
.up-row:hover { background: var(--hover); }
.datechip { width: 42px; flex: none; text-align: center; border-radius: 10px; background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-rgb), .3); padding: 4px 0; }
.datechip small { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.datechip b { font-size: 16px; }
.datechip.today { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.datechip.today small { color: inherit; opacity: .8; }
.up-row .nm { flex: 1; min-width: 0; }
.up-row .nm div { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-row .nm small { color: var(--muted); font-size: 11px; }
.role-chip { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: var(--hover); color: var(--muted); margin-right: 3px; white-space: nowrap; }

.thumb-row { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; text-decoration: none; color: inherit; }
.thumb-row:hover { background: var(--hover); }
.thumb-row .tthumb { width: 64px; aspect-ratio: 16/9; border-radius: 6px; background: var(--hover); overflow: hidden; flex: none; display: grid; place-items: center; color: var(--faint); }
.thumb-row .tthumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-row .nm { min-width: 0; flex: 1; }
.thumb-row .nm div { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-row .nm small { color: var(--muted); font-size: 11px; }

.team-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.team-member { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--hover); font-size: 12.5px; }
.team-member .avatar { width: 28px; height: 28px; }

/* skins gallery */
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.skin-card {
  text-align: left; padding: 0; border-radius: 14px; overflow: hidden; border: 2px solid var(--border); background: var(--raised);
  transition: transform .18s ease, border-color .18s;
}
.skin-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.skin-card.on { border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .18); }
.skin-card[disabled] { cursor: default; }
.skin-prev { height: 82px; padding: 10px; display: grid; grid-template-columns: 22px 1fr 1fr; gap: 6px; position: relative; }
.skin-prev .sb { border-radius: 4px; }
.skin-prev .col { border-radius: 5px; padding: 4px; display: grid; gap: 4px; align-content: start; }
.skin-prev .cd { height: 14px; border-radius: 3px; }
.skin-prev .ac { height: 5px; width: 60%; border-radius: 3px; }
.skin-meta { padding: 9px 11px 10px; display: flex; align-items: center; gap: 6px; }
.skin-meta b { font-size: 13px; }
.skin-meta small { color: var(--muted); display: block; font-size: 11px; }
.skin-meta .chk { margin-left: auto; color: var(--accent-2); }

.fade-up { opacity: 0; transform: translateY(10px); animation: fadeUp .6s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero .blob, .fade-up { animation: none !important; opacity: 1; transform: none; }
  .pipe-bar i, .minibar i { transition: none; }
}
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-eq { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .home { padding: 14px 16px 30px; }
  .hero { grid-template-columns: 1fr; padding: 22px; }
  .hero-side { justify-items: start; text-align: left; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-eq { grid-template-columns: 1fr; }
}
.chart-wrap svg { height: auto; }
.home.calm .fade-up { animation: none; opacity: 1; transform: none; }
.home.calm .pipe-bar i, .home.calm .minibar i { transition: none; }

/* =====================================================================
   SKINS — <html data-skin="…" data-ornate>, chosen per workspace.
   Each skin = palette + display font + frame gradient + background art
   (+ particles drawn by app.js on #fx).
   ===================================================================== */
:root {
  --font-body: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-body);
  --font-head: var(--font-body);
  --display-weight: 800;
  --display-tracking: -.03em;
  --display-case: none;
  --frame: linear-gradient(var(--border), var(--border));
  --frame-strong: linear-gradient(var(--border-strong), var(--border-strong));
  --btn-grad: linear-gradient(180deg, var(--accent-2), var(--accent));
  --orn: var(--accent-2);
  --app-bg: radial-gradient(1100px 600px at 85% -15%, rgba(var(--accent-rgb), .07), transparent 70%), var(--bg);
  --glass: color-mix(in srgb, var(--panel) 84%, transparent);
  --list-glass: color-mix(in srgb, var(--list) 92%, transparent);
  --title-grad: linear-gradient(100deg, var(--text) 30%, var(--accent-2) 60%, var(--hero-b));
}

/* ---- Crimson: near-black with a red accent ---- */
html[data-skin="crimson"] {
  --bg: #0f0b0b; --sunken: #0a0707; --panel: #151010; --list: #171111; --field: #140f0f; --raised: #1c1414;
  --card: #1f1616; --card-hover: #261b1b; --hover: #281c1c; --line: #2a1e1e; --list-border: #2a1e1e;
  --border: #3a2828; --border-strong: #5a3434; --text: #f6eeee; --muted: #b39d9d; --faint: #735e5e;
  --accent: #dc2626; --accent-hover: #b91c1c; --accent-rgb: 239, 68, 68; --accent-2: #f87171; --on-accent: #fff;
  --glow: rgba(239, 68, 68, .22); --hero-a: #dc2626; --hero-b: #7f1d1d; --hero-c: #ea580c;
  --frame: linear-gradient(#3a2828, #3a2828); --frame-strong: linear-gradient(#5a3434, #5a3434);
  --btn-grad: linear-gradient(180deg, #ef4444, #dc2626);
  --card-outline: rgba(239, 68, 68, .28); --card-outline-hover: #ef4444;
  --app-bg: radial-gradient(1000px 520px at 85% -15%, rgba(220, 38, 38, .12), transparent 70%), #0f0b0b;
  --title-grad: linear-gradient(100deg, #ffffff 30%, #f87171 75%);
}
/* ---- Cobalt: deep navy with a blue accent ---- */
html[data-skin="cobalt"] {
  --bg: #0a0e17; --sunken: #070a11; --panel: #0d1220; --list: #0f1424; --field: #0c111d; --raised: #121a2c;
  --card: #141b2e; --card-hover: #1a2238; --hover: #1a2238; --line: #1c243a; --list-border: #1c243a;
  --border: #28324d; --border-strong: #3b4a70; --text: #eef2ff; --muted: #9aa6c4; --faint: #5b6683;
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-rgb: 96, 165, 250; --accent-2: #60a5fa; --on-accent: #fff;
  --glow: rgba(96, 165, 250, .22); --hero-a: #3b82f6; --hero-b: #1e3a8a; --hero-c: #06b6d4;
  --frame: linear-gradient(#28324d, #28324d); --frame-strong: linear-gradient(#3b4a70, #3b4a70);
  --btn-grad: linear-gradient(180deg, #3b82f6, #2563eb);
  --card-outline: rgba(96, 165, 250, .28); --card-outline-hover: #60a5fa;
  --app-bg: radial-gradient(1000px 520px at 85% -15%, rgba(59, 130, 246, .12), transparent 70%), #0a0e17;
  --title-grad: linear-gradient(100deg, #ffffff 30%, #93c5fd 75%);
}
/* ---- Pixel Arcade (Epic): CRT cabinet ---- */
html[data-skin="arcade"] {
  --bg: #0a0a12; --sunken: #05050a; --panel: #10101c; --list: #121220; --field: #0f0f1b; --raised: #171728;
  --card: #1a1a2e; --card-hover: #22223b; --hover: #23233d; --line: #22223a; --list-border: #202036;
  --border: #34345a; --border-strong: #facc15; --text: #f5f5ff; --muted: #a3a3c8; --faint: #5f5f86;
  --accent: #16a34a; --accent-hover: #15803d; --accent-rgb: 74, 222, 128; --accent-2: #4ade80; --on-accent: #031207;
  --glow: rgba(74, 222, 128, .2); --hero-a: #16a34a; --hero-b: #1e1e3a; --hero-c: #0e7490;
  --font-display: "Press Start 2P", monospace; --font-head: "VT323", monospace; --display-weight: 400; --display-tracking: 0; --display-case: uppercase;
  --frame: linear-gradient(#34345a, #34345a);
  --frame-strong: linear-gradient(#4ade80, #4ade80);
  --btn-grad: linear-gradient(180deg, #86efac, #4ade80 50%, #16a34a);
  --orn: #facc15;
  --app-bg: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px),
            #0a0a12;
  --title-grad: linear-gradient(180deg, #ffffff, #4ade80);
}
/* ---- Daybreak (Base): light mode ---- */
html[data-skin="paper"] {
  color-scheme: light;
  --bg: #f4f4f5; --sunken: #e7e7ea; --panel: #ffffff; --list: #ececef; --field: #ffffff; --raised: #ffffff;
  --card: #ffffff; --card-hover: #fafafa; --hover: #e9e9ec; --line: #e2e2e6; --list-border: #dfdfe4;
  --border: #d4d4d8; --border-strong: #b4b4bb; --text: #18181b; --muted: #5f5f68; --faint: #9a9aa3;
  --accent: #16a34a; --accent-hover: #15803d; --accent-rgb: 22, 163, 74; --accent-2: #16a34a; --on-accent: #fff;
  --glow: rgba(22, 163, 74, .18); --hero-a: #22c55e; --hero-b: #06b6d4; --hero-c: #6366f1;
  --app-bg: radial-gradient(900px 500px at 85% -10%, rgba(34, 197, 94, .1), transparent 70%), #f4f4f5;
  --title-grad: linear-gradient(100deg, #18181b 30%, #16a34a 65%, #0891b2);
}
html[data-skin="paper"] .badge { color: #1d4ed8; }
html[data-skin="paper"] .badge.green { color: #15803d; }
html[data-skin="paper"] .badge.red, html[data-skin="paper"] .btn.danger, html[data-skin="paper"] .menu button.danger { color: #b91c1c; }
html[data-skin="paper"] .badge.amber, html[data-skin="paper"] .badge.uploads, html[data-skin="paper"] .day.on, html[data-skin="paper"] .note { color: #a16207; }
html[data-skin="paper"] .badge.purple { color: #7e22ce; }
html[data-skin="paper"] .stats b { color: #15803d; }
html[data-skin="paper"] .stats b.neg { color: #b91c1c; }
html[data-skin="paper"] .stats b.total { color: var(--text); }
html[data-skin="paper"] .overlay { background: rgba(24,24,27,.35); }
html[data-skin="paper"] .modal, html[data-skin="paper"] .menu, html[data-skin="paper"] .drag-ghost { box-shadow: 0 20px 50px rgba(0,0,0,.18); }

/* ---- skin plumbing shared by every skin ---- */
body { background: var(--app-bg); background-attachment: fixed; font-family: var(--font-body); }
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 0; }
#app { position: relative; z-index: 1; }
.shell { background: transparent; }
.topbar { background: var(--glass); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); position: relative; border-bottom-color: transparent; }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--frame); opacity: .8; }
.main, .board { background: transparent; }
.brand { font-family: var(--font-display); letter-spacing: var(--display-tracking); text-transform: var(--display-case); }
.nav a.active { background: rgba(var(--accent-rgb), .16); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .35); }
.list-head .name, .tile-head h3, .panel h2, .page h1, .modal h2, .board-head h1, .group-head, .side-section, .access-title, .pop-title {
  font-family: var(--font-head);
}
html[data-skin="arcade"] .list-head .name, html[data-skin="arcade"] .tile-head h3, html[data-skin="arcade"] .access-title { font-size: 17px; font-weight: 400; letter-spacing: .02em; }
html[data-skin="arcade"] .board-head h1, html[data-skin="arcade"] .page h1, html[data-skin="arcade"] .modal h2 { font-family: var(--font-display); font-size: 13px; line-height: 1.6; }

/* gradient frames: works for every skin (plain border by default) */
.list { background: linear-gradient(var(--list-glass), var(--list-glass)) padding-box, var(--frame) border-box; border: 1px solid transparent; }
.tile, .kpi, .panel { background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--frame) border-box; border: 1px solid transparent; }
.modal { background: linear-gradient(var(--raised), var(--raised)) padding-box, var(--frame-strong) border-box; border: 1.5px solid transparent; }
.menu { background: linear-gradient(var(--raised), var(--raised)) padding-box, var(--frame) border-box; border: 1px solid transparent; }
.hero { background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--frame-strong) border-box; border: 1.5px solid transparent; }

.btn.primary { background: var(--btn-grad); border-color: transparent; color: var(--on-accent); font-weight: 700; text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.btn.primary:hover { filter: brightness(1.08); background: var(--btn-grad); }
.team-name { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); text-transform: var(--display-case);
  background: var(--title-grad); -webkit-background-clip: text; background-clip: text; }
html[data-skin="arcade"] .team-name { font-size: clamp(22px, 3.4vw, 40px); line-height: 1.35; }
.kpi .k-value { font-family: var(--font-display); letter-spacing: var(--display-tracking); }
html[data-skin="arcade"] .kpi .k-value { font-size: 20px; }

/* per-skin hero textures */
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 4px); background-size: auto; opacity: .7;
  mask-image: none; animation: scan 8s linear infinite;
}

html { transition: background-color .3s; }
body, .topbar, .sheet-bar, .list, .card, .panel, .tile, .kpi { transition: background-color .35s ease, border-color .35s ease, color .35s ease, box-shadow .2s; }

/* =====================================================================
   SKIN COLLECTION (champion-select style)
   ===================================================================== */
.collection-ov { position: fixed; inset: 0; z-index: 80; background: radial-gradient(1200px 700px at 50% 0%, rgba(var(--accent-rgb), .18), transparent 70%), rgba(3, 3, 6, .82);
  backdrop-filter: blur(6px); display: flex; flex-direction: column; padding: 28px 32px 22px; overflow-y: auto; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.coll-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; color: #fff; }
.coll-head h1 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: .04em; font-size: 26px;
  background: var(--title-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.coll-head p { margin: 0 0 4px; color: rgba(255,255,255,.6); }
.coll-head .spacer { flex: 1; }
.coll-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; max-width: 1200px; }
.splash {
  position: relative; aspect-ratio: 3 / 4.4; border-radius: 14px; overflow: hidden; cursor: pointer; padding: 0; border: 0; color: #fff; text-align: left;
  background: var(--sp-bg); isolation: isolate; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.12), 0 18px 40px -18px rgba(0,0,0,.8);
}
.splash:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 0 0 2px var(--sp-a), 0 26px 50px -18px var(--sp-a); }
.splash.sel { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--sp-a), 0 0 40px -6px var(--sp-a); }
.splash .sp-art { position: absolute; inset: 0; z-index: -1; transition: transform .6s cubic-bezier(.2,.8,.2,1); background: var(--sp-art); }
.splash:hover .sp-art { transform: scale(1.08); }
.splash .sp-emblem { position: absolute; top: 18%; left: 50%; width: 46%; transform: translateX(-50%); filter: drop-shadow(0 0 18px var(--sp-a)); color: var(--sp-a); opacity: .95; transition: transform .5s; }
.splash:hover .sp-emblem { transform: translateX(-50%) translateY(-6px) scale(1.06); }
.splash .sp-shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.28) 48%, transparent 60%); transform: translateX(-120%); transition: transform .9s ease; }
.splash:hover .sp-shine { transform: translateX(120%); }
.splash .sp-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 14px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.splash .sp-name { font-family: var(--sp-font); font-size: 19px; font-weight: 700; line-height: 1.15; text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.splash .sp-desc { font-size: 11.5px; color: rgba(255,255,255,.72); margin-top: 3px; }
.coll-foot { display: flex; align-items: center; gap: 12px; margin-top: 22px; color: rgba(255,255,255,.7); }
.coll-foot .spacer { flex: 1; }
.equip-btn { font-family: var(--font-display); letter-spacing: .1em; text-transform: uppercase; padding: 12px 34px; font-size: 14px; border-radius: 10px; }
.skin-chip { display: inline-flex; align-items: center; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .splash, .splash .sp-art, .splash .sp-emblem, .splash .sp-shine { transition: none; } }
@media (max-width: 760px) { .collection-ov { padding: 18px 16px; } .coll-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .coll-head h1 { font-size: 22px; } }


.sp-current { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px 3px 6px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; border: 1px solid var(--sp-a); backdrop-filter: blur(4px); }
.sp-current svg { color: var(--sp-a); }
.splash .sp-desc { font-size: 11.5px; }
@media (max-width: 1000px) { .coll-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- clear outlines on every list and card, in every skin ---- */
:root { --card-outline: #4a4a52; --card-outline-hover: #6a6a74; --list-outline-w: 1.5px; }
html[data-skin="arcade"] { --card-outline: #4d4d80; --card-outline-hover: #4ade80; }
html[data-skin="paper"] { --card-outline: #cfcfd6; --card-outline-hover: #9a9aa3; --frame: linear-gradient(#cfcfd6, #cfcfd6); }
html[data-skin="midnight"] { --frame: linear-gradient(#3f3f46, #3f3f46); }
.list { border-width: var(--list-outline-w); }
.card { border: 1px solid var(--card-outline); }
.card:hover { border-color: var(--card-outline-hover); }
html[data-skin="arcade"] .card { border-width: 2px; border-radius: 4px; box-shadow: 3px 3px 0 rgba(0, 0, 0, .45); }
html[data-skin="arcade"] .card:hover { box-shadow: 3px 3px 0 rgba(74, 222, 128, .35); }
html[data-skin="arcade"] .list { border-radius: 4px; }

/* backend / api keys */
.key-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.key-row:first-of-type { border-top: 0; }
.key-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(var(--accent-rgb), .14); color: var(--accent-2); }
.key-main { flex: 1; min-width: 0; }
.key-main .row { flex-wrap: wrap; }
.key-mask { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; padding: 2px 7px; border-radius: 6px; background: var(--sunken); border: 1px solid var(--border); color: var(--muted); }
.key-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.credit { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--border); display: grid; gap: 6px; max-width: 420px; }
.credit b { font-size: 18px; font-family: var(--font-display); }
@media (max-width: 760px) { .key-row { flex-wrap: wrap; } .key-actions { width: 100%; justify-content: flex-end; } }

/* clean skin preview tiles */
.splash { aspect-ratio: auto; background: var(--raised); box-shadow: 0 0 0 1px var(--border); border-radius: 12px; }
.splash:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--border-strong); }
.splash.sel { transform: none; box-shadow: 0 0 0 2px var(--sp-a); }
.sp-mock { display: grid; grid-template-columns: 18% 1fr 1fr 1fr; gap: 5px; height: 110px; padding: 10px; }
.sp-mock .side { border-radius: 4px; }
.sp-mock .col { border-radius: 5px; padding: 5px; display: grid; gap: 5px; align-content: start; }
.sp-mock .c { height: 16px; border-radius: 3px; }
.sp-mock .c.ac { height: 5px; width: 55%; }
.splash .sp-info { position: static; background: none; padding: 10px 12px 12px; color: var(--text); }
.splash .sp-name { text-shadow: none; font-size: 14px; }
.splash .sp-desc { color: var(--muted); }
.sp-current { top: 8px; left: auto; right: 8px; background: var(--sp-a); color: #fff; border: 0; }
.sp-current svg { color: #fff; }

/* finance sheet */
.finance .fin-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.finance .fin-v { font-size: 20px !important; font-family: var(--font-body) !important; letter-spacing: -.01em !important; }
.fin-cats { display: grid; gap: 3px; margin-top: 8px; font-size: 12px; }
.fin-cats b { font-variant-numeric: tabular-nums; }
.sheet-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px 10px 0 0; background: var(--panel); max-height: calc(100vh - 360px); }
.sheet { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; min-width: 100%; font-size: 12.5px; }
.sheet th { position: sticky; top: 0; z-index: 2; background: var(--raised); color: var(--muted); font-weight: 600; text-align: left; padding: 7px 8px;
  border-bottom: 1px solid var(--border-strong); border-right: 1px solid var(--line); font-size: 11.5px; }
.sheet th.num { text-align: right; }
.sheet td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; height: 32px; }
.sheet td.rn, .sheet th.rn { width: 38px; text-align: center; color: var(--faint); background: var(--raised); font-size: 11px; position: sticky; left: 0; z-index: 1; }
.sheet th.rn { z-index: 3; }
.sheet .cell { width: 100%; height: 31px; border: 0; background: transparent; padding: 0 8px; outline: none; border-radius: 0; font-size: 12.5px; color: var(--text); }
.sheet select.cell { padding-right: 4px; cursor: pointer; }
.sheet .cell.num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet .cell:focus { box-shadow: inset 0 0 0 2px var(--accent-2); background: var(--field); position: relative; z-index: 1; }
.sheet tbody tr:hover td:not(.rn) { background: rgba(var(--accent-rgb), .04); }
.sheet tr.pending .cell { color: var(--muted); }
.sheet tr.pending td:nth-child(9) .cell { color: var(--amber); font-weight: 600; }
.sheet .rowx { text-align: center; }
.sheet .rowx .icon-btn { opacity: 0; }
.sheet tr:hover .rowx .icon-btn { opacity: 1; }
.sheet .add-row td { border-bottom: 0; }
.add-line { background: none; border: 0; color: var(--muted); padding: 0 8px; height: 31px; width: 100%; text-align: left; }
.add-line:hover { color: var(--text); background: rgba(var(--accent-rgb), .06); }
.sheet tfoot td { position: sticky; bottom: 0; background: var(--raised); border-top: 1px solid var(--border-strong); font-weight: 700; padding: 0 8px; height: 34px; }
.sheet tfoot td.tot { text-align: right; font-variant-numeric: tabular-nums; }
.month-tabs { display: flex; gap: 2px; overflow-x: auto; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 10px 10px; background: var(--raised); padding: 4px; }
.mtab { padding: 6px 14px; border-radius: 6px; color: var(--muted); text-decoration: none; white-space: nowrap; font-size: 12.5px; }
.mtab:hover { background: var(--hover); color: var(--text); }
.mtab.on { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent-2); }
.mtab.add { font-weight: 700; }
html[data-skin="paper"] .sheet tr.pending td:nth-child(9) .cell { color: #a16207; }
@media (max-width: 900px) { .finance .fin-kpis { grid-template-columns: 1fr 1fr; } }

/* Philippines clock */
.ph-clock { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; margin-right: 8px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--raised); font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ph-flag { width: 20px; height: 10px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); object-fit: cover; }
.ph-label { color: var(--muted); font-weight: 700; font-size: 11px; letter-spacing: .04em; }
@media (max-width: 760px) { .ph-label { display: none; } }

/* upload order */
.vcard .order-badge {
  position: absolute; z-index: 2; top: 4px; left: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 10px; font-weight: 800;
  background: var(--raised); color: var(--text); border: 1px solid var(--border-strong); box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.vcard.next-up { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2); }
.vcard.next-up .order-badge { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.vcard .order-badge span { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.vcard:not(:has(.thumb)) .order-badge { position: static; margin: 0 0 6px; }
.reorder-list { display: flex; flex-direction: column; gap: 6px; max-height: 56vh; overflow-y: auto; padding: 2px; }
.reorder-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--field); text-align: left; }
.reorder-row:hover { border-color: var(--border-strong); }
.reorder-row.on { border-color: rgba(var(--accent-rgb), .55); background: rgba(var(--accent-rgb), .08); }
.reorder-row.first { border-color: var(--accent-2); }
.reorder-num { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  border: 1.5px dashed var(--border-strong); color: var(--faint); }
.reorder-row.on .reorder-num { border: 0; background: var(--accent); color: var(--on-accent); }
.reorder-thumb { width: 64px; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; flex: none; background: var(--hover); display: grid; place-items: center; color: var(--faint); }
.reorder-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; }
.reorder-title small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; margin-top: 2px; }

/* ---------- login screen ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); padding: 0; place-items: stretch; }
.auth-showcase { position: relative; overflow: hidden; padding: 44px 52px; display: flex; flex-direction: column; gap: 34px;
  background: radial-gradient(900px 600px at 0% 0%, rgba(var(--accent-rgb), .16), transparent 60%), var(--panel); border-right: 1px solid var(--border); }
.auth-glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -200px; background: var(--hero-c, #2563eb);
  filter: blur(90px); opacity: .18; pointer-events: none; }
.auth-brand { font-size: 18px; margin: 0; }
.auth-pitch h2 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 800; }
.auth-pitch h2 span { color: var(--accent-2); }
.auth-pitch p { color: var(--muted); font-size: 15px; max-width: 440px; margin: 0; line-height: 1.55; }
.mini-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 560px; transform: perspective(1200px) rotateX(8deg) rotateZ(-2deg);
  transform-origin: left top; animation: floaty 7s ease-in-out infinite alternate; }
@keyframes floaty { to { transform: perspective(1200px) rotateX(6deg) rotateZ(-1deg) translateY(-6px); } }
.mini-list { background: var(--list); border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: grid; gap: 6px; align-content: start; min-height: 150px;
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.6); }
.mini-head { font-size: 10px; font-weight: 700; color: var(--muted); padding: 0 2px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-card { background: var(--card); border: 1px solid var(--card-outline, var(--border)); border-radius: 6px; padding: 6px; display: grid; gap: 5px; }
.mini-card i { display: block; height: 26px; border-radius: 4px; background: linear-gradient(135deg, var(--hover), var(--raised)); }
.mini-card b { display: block; height: 5px; border-radius: 3px; background: var(--border-strong); }
.mini-card.acc { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2); }
.mini-card.acc i { background: linear-gradient(135deg, rgba(var(--accent-rgb), .55), rgba(var(--accent-rgb), .15)); }
.auth-points { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: auto; color: var(--muted); font-size: 13px; }
.auth-points span { display: inline-flex; align-items: center; gap: 6px; }
.auth-points svg { color: var(--accent-2); }
.auth-side { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-brand-sm { display: none; margin: 0 0 22px; font-size: 17px; }
.auth-title { font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-sub { color: var(--muted); margin: 0 0 24px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .input { padding: 11px 12px; font-size: 14px; border-radius: 9px; }
.auth-card .input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--faint); padding: 6px; border-radius: 6px; line-height: 0; }
.pw-eye:hover, .pw-eye.on { color: var(--text); }
.auth-btn { width: 100%; justify-content: center; padding: 11px 12px; font-size: 14px; border-radius: 9px; position: relative; margin-top: 6px; }
.auth-btn .spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.auth-btn.loading .spinner { display: inline-block; }
.auth-btn.loading .auth-btn-label { opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-foot { color: var(--faint); font-size: 12px; text-align: center; margin: 18px 0 0; }
.auth .err { min-height: 18px; margin: -4px 0 4px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .mini-board, .shake { animation: none; } }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-showcase { display: none; }
  .auth-brand-sm { display: flex; }
}

/* uploads-per-week presets */
.uploads-pop { width: 270px; padding: 8px; }
.preset-list { display: flex; flex-direction: column; }
.menu .preset { display: flex; align-items: center; gap: 14px; padding: 9px 10px; border-radius: 8px; }
.preset-n { width: 18px; font-size: 17px; font-weight: 800; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.preset-days { flex: 1; color: var(--muted); font-size: 14px; }
.menu .preset:hover .preset-days, .menu .preset:hover .preset-n { color: var(--text); }
.menu .preset.on .preset-n, .menu .preset.on .preset-days { color: var(--text); font-weight: 700; }
.preset-check { color: var(--green); line-height: 0; }
.menu .preset-clear { margin-top: 4px; justify-content: center; color: var(--faint); font-size: 12px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; padding-top: 9px; }
.menu .preset-clear:hover { color: var(--red); background: none; }

/* one colour per uploads-per-week count (1-7) */
.u1 { --u: 148, 163, 184; --u-text: #cbd5e1; }
.u2 { --u: 96, 165, 250; --u-text: #93c5fd; }
.u3 { --u: 45, 212, 191; --u-text: #5eead4; }
.u4 { --u: 74, 222, 128; --u-text: #86efac; }
.u5 { --u: 250, 204, 21; --u-text: #fde047; }
.u6 { --u: 251, 146, 60; --u-text: #fdba74; }
.u7 { --u: 244, 114, 182; --u-text: #f9a8d4; }
html[data-skin="paper"] .u1 { --u-text: #475569; } html[data-skin="paper"] .u2 { --u-text: #1d4ed8; }
html[data-skin="paper"] .u3 { --u-text: #0f766e; } html[data-skin="paper"] .u4 { --u-text: #15803d; }
html[data-skin="paper"] .u5 { --u-text: #a16207; } html[data-skin="paper"] .u6 { --u-text: #c2410c; }
html[data-skin="paper"] .u7 { --u-text: #be185d; }
.badge.uploads[class*=" u"]:not(.unset) { background: rgba(var(--u), .14); color: var(--u-text); border-color: rgba(var(--u), .42); }
.badge.uploads[class*=" u"]:not(.unset):hover { background: rgba(var(--u), .24); }
.menu .preset[class*=" u"] .preset-n { color: var(--u-text); }
.menu .preset.on[class*=" u"] { background: rgba(var(--u), .1); }

/* ---------- per-skin typography ---------- */
html[data-skin="midnight"] { --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif; --font-display: "Inter", sans-serif; --font-head: "Inter", sans-serif;
  --display-weight: 800; --display-tracking: -.035em; }
html[data-skin="crimson"] { --font-body: "Barlow", -apple-system, sans-serif; --font-display: "Oswald", "Barlow", sans-serif; --font-head: "Oswald", sans-serif;
  --display-weight: 700; --display-tracking: .01em; --display-case: uppercase; }
html[data-skin="crimson"] .list-head .name, html[data-skin="crimson"] .tile-head h3, html[data-skin="crimson"] .nav a,
html[data-skin="crimson"] .board-head h1, html[data-skin="crimson"] .page h1, html[data-skin="crimson"] .modal h2, html[data-skin="crimson"] .k-label {
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
html[data-skin="crimson"] .list-head .name { font-size: 13px; }
html[data-skin="crimson"] .nav a { font-family: "Oswald", sans-serif; font-size: 13.5px; }
html[data-skin="cobalt"] { --font-body: "DM Sans", -apple-system, sans-serif; --font-display: "Space Grotesk", sans-serif; --font-head: "Space Grotesk", sans-serif;
  --display-weight: 700; --display-tracking: -.025em; }
html[data-skin="cobalt"] .list-head .name, html[data-skin="cobalt"] .tile-head h3 { font-weight: 700; letter-spacing: -.01em; }
html[data-skin="arcade"] { --font-body: "IBM Plex Mono", ui-monospace, monospace; }
html[data-skin="arcade"] body { font-size: 12.5px; }
html[data-skin="arcade"] .nav a, html[data-skin="arcade"] .btn { font-family: "VT323", monospace; font-size: 17px; letter-spacing: .02em; }
html[data-skin="paper"] { --font-body: "DM Sans", -apple-system, sans-serif; --font-display: "Fraunces", Georgia, serif; --font-head: "Fraunces", Georgia, serif;
  --display-weight: 700; --display-tracking: -.02em; }
html[data-skin="paper"] .list-head .name, html[data-skin="paper"] .tile-head h3 { font-weight: 700; letter-spacing: -.005em; }
.sp-name { font-family: var(--sp-font) !important; }

/* Home follows the skin's type too */
.eyebrow, .kpi .k-label, .tile-head h3, .hero-date, .skin-btn, .pipe-row .pname, .lead-row .nm div, .up-row .nm div { font-family: var(--font-head); }
.you-name, .hero-date b, .kpi .k-value, .chart-big, .datechip b, .lead-row .gain { font-family: var(--font-display); letter-spacing: var(--display-tracking); }
html[data-skin="crimson"] .you-name, html[data-skin="crimson"] .hero-date b { text-transform: uppercase; }
html[data-skin="crimson"] .eyebrow { letter-spacing: .18em; }
html[data-skin="arcade"] .you-name, html[data-skin="arcade"] .hero-date b { font-size: 14px; line-height: 1.6; }
html[data-skin="arcade"] .chart-big, html[data-skin="arcade"] .kpi .k-value { font-size: 18px; }
html[data-skin="arcade"] .eyebrow, html[data-skin="arcade"] .kpi .k-label, html[data-skin="arcade"] .tile-head h3 { font-size: 15px; letter-spacing: .04em; }
html[data-skin="paper"] .you-name { font-weight: 700; }

/* gradient picker in the Skins screen */
.grad-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; max-width: 1200px; }
.grad-label { color: rgba(255,255,255,.7); font-weight: 600; margin-right: 6px; }
.grad { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.12); color: #fff; }
.grad:hover { background: rgba(255,255,255,.1); }
.grad.on { border-color: #fff; background: rgba(255,255,255,.14); }
.grad-dot { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.grad-name { font-size: 13px; font-weight: 600; }
.skin-dot { background: conic-gradient(var(--hero-a), var(--hero-b), var(--hero-c), var(--hero-a)) !important; }
.staging-banner { position: relative; z-index: 2; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .12em; padding: 4px;
  background: repeating-linear-gradient(135deg, #facc15 0 14px, #eab308 14px 28px); color: #1a1300; }

/* Home: Upcoming row */
.up-row { padding-bottom: 14px; }
.up-scroller { display: grid; grid-auto-flow: column; grid-auto-columns: 232px; gap: 14px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.up-card { display: flex; flex-direction: column; border-radius: 12px; background: var(--card); border: 1px solid var(--card-outline, var(--border)); text-decoration: none; color: inherit;
  overflow: hidden; scroll-snap-align: start; transition: transform .18s ease, border-color .18s, box-shadow .18s; }
.up-card:hover { transform: translateY(-3px); border-color: var(--accent-2); box-shadow: 0 12px 28px -14px var(--glow); }
.up-card.tonight.next { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2), 0 10px 30px -12px var(--glow); }
.up-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--hover); display: grid; place-items: center; }
.up-thumb img, .up-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-thumb-ph { color: rgba(255,255,255,.75); }
.up-when { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800;
  background: rgba(0,0,0,.62); color: #fff; backdrop-filter: blur(6px); }
.up-when.tonight { background: var(--btn-grad); color: var(--on-accent); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.up-next, .up-order { position: absolute; right: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; background: rgba(0,0,0,.62); color: #fff; }
.up-next { background: #fff; color: #111; text-transform: uppercase; letter-spacing: .06em; }
.up-body { padding: 10px 11px 12px; display: grid; gap: 7px; }
.up-title { font-weight: 650; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.up-ch { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; min-width: 0; }
.up-ch span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-eq:has(> .tile:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* inline reorder mode */
.reorder-hint { font-size: 12px; font-weight: 600; color: var(--accent-2); padding: 0 6px; white-space: nowrap; }
.card.orderable { cursor: copy; }
.card.orderable:hover { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2); }
.card.ordered { border-color: var(--accent-2); }
.card.order-off { opacity: .4; cursor: not-allowed; }
.card.orderable:not(.ordered)::after { content: '+'; position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px dashed var(--border-strong); color: var(--muted); font-weight: 800; background: var(--raised); z-index: 2; }
.vcard.orderable:not(.ordered):not(:has(.thumb)) { padding-top: 34px; }

/* ---------- card window (3 columns) ---------- */
.modal.card-modal { position: relative; max-width: 1400px; width: 96vw; padding: 0; overflow: hidden; }
.modal.card-modal > .modal-close { position: absolute; right: 14px; top: 14px; margin: 0; z-index: 2; }
.cm-head { display: flex; align-items: center; gap: 10px; padding: 14px 56px 14px 20px; border-bottom: 1px solid var(--line); }
.cm-title2 { flex: 1; min-width: 0; font: inherit; font-family: var(--font-head); font-size: 18px; font-weight: 700; background: transparent; border: 1px solid transparent;
  border-radius: 7px; padding: 5px 8px; margin-left: -8px; color: var(--text); outline: none; }
.cm-title2:hover, .cm-title2:focus { border-color: var(--border); background: var(--field); }
.cm-in { color: var(--muted); font-size: 12.5px; }
.cm-list { background: transparent; border: 1px solid var(--border); border-radius: 7px; padding: 4px 8px; font-weight: 600; font-size: 12.5px; color: var(--text); max-width: 220px; }
.cm-id { font-size: 11.5px; color: var(--muted); background: var(--hover); padding: 3px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.cm-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; height: min(78vh, 860px); }
.cm-col { padding: 16px 20px; overflow-y: auto; border-right: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; }
.cm-col:last-child { border-right: 0; }
.cm-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.cm-sub { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.cm-desc { min-height: 150px; resize: vertical; }
.cm-row { display: flex; gap: 14px; margin-top: 16px; align-items: flex-start; }
.mz { position: relative; border-radius: 12px; border: 1.5px dashed var(--border-strong); background: var(--sunken); aspect-ratio: 16 / 9; display: grid; place-items: center;
  cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; text-decoration: none; color: inherit; }
.mz:hover, .mz.drag { border-color: var(--accent-2); background: rgba(var(--accent-rgb), .06); }
.mz.has { border-style: solid; border-color: var(--border); background: #000; }
.mz img, .mz video { width: 100%; height: 100%; object-fit: contain; display: block; }
.mz-empty { display: grid; justify-items: center; gap: 6px; color: var(--muted); text-align: center; padding: 10px; }
.mz-empty b { color: var(--text); font-weight: 600; }
.mz-empty small { font-size: 11.5px; }
.mz-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--hover); color: var(--muted); }
.mz-progress { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 26px; border-radius: 8px; background: rgba(0,0,0,.7); overflow: hidden; }
.mz-progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--btn-grad); transition: width .2s; }
.mz-progress span { position: relative; display: block; text-align: center; line-height: 26px; font-size: 12px; font-weight: 700; color: #fff; }
.mz.busy { cursor: progress; }
.mz-tools { display: flex; gap: 6px; margin-top: 8px; }
.mz-link { display: grid; place-items: center; gap: 4px; background: var(--sunken) !important; padding: 12px; text-align: center; }
.mz-link small { color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mz-audio { display: grid; justify-items: center; gap: 12px; width: 100%; padding: 16px; color: var(--accent-2); }
.mz-audio audio { width: 100%; }
.cm-feed { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.cm-empty { display: grid; justify-items: center; gap: 5px; color: var(--muted); padding: 26px 10px; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.cm-empty b { color: var(--text); font-weight: 600; }
.act { display: flex; gap: 9px; font-size: 12.5px; line-height: 1.4; }
.act b { font-weight: 650; }
.act small { display: block; color: var(--faint); font-size: 11px; }
.act .bubble { margin-top: 5px; background: var(--field); border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; white-space: pre-wrap; word-break: break-word; }
.cm-out { background: rgba(0,0,0,.08); }
.cm-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
.cm-tab { background: none; border: 0; padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cm-tab.on { background: var(--hover); color: var(--text); }
.cm-saved { font-size: 11.5px; color: var(--muted); }
.cm-out-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cm-script { flex: 1; min-height: 300px; resize: none; font-family: inherit; font-size: 14px; line-height: 1.65; }
@media (max-width: 1000px) { .cm-grid3 { grid-template-columns: 1fr; height: auto; max-height: 80vh; overflow-y: auto; } .cm-col { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; } }

/* Upcoming: compact cards for a better overview */
.upnext .up-scroller { grid-auto-columns: 158px; gap: 10px; }
.upnext .up-card { border-radius: 9px; }
.upnext .up-when, .upnext .up-next, .upnext .up-order { top: 5px; font-size: 9.5px; padding: 2px 6px; }
.upnext .up-when { left: 5px; gap: 4px; } .upnext .up-next, .upnext .up-order { right: 5px; }
.upnext .live-dot { width: 5px; height: 5px; }
.upnext .up-body { padding: 7px 8px 8px; gap: 5px; }
.upnext .up-title { font-size: 11.5px; min-height: 30px; }
.upnext .up-ch { font-size: 10.5px; gap: 5px; }
.upnext .up-ch .avatar { width: 16px; height: 16px; font-size: 8px; }
.upnext .up-thumb-ph svg { width: 16px; height: 16px; }

/* hourly views graphs + headline 24H/48H tiles */
.kpis { grid-template-columns: 1.5fr 1.5fr 1fr 1fr 1fr; }
.kpi.kpi-main { border-color: transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--frame-strong) border-box; }
.kpi.kpi-main .k-value { font-size: 38px; color: var(--text); }
.kpi.kpi-main .k-label { color: var(--accent-2); }
.hg .tile-head { align-items: center; }
.hg-total { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--accent-2); letter-spacing: var(--display-tracking); }
.hg-wrap { position: relative; height: 250px; padding: 0 0 22px 0; }
.hg-svg { position: absolute; inset: 0 0 22px 0; width: 100%; height: calc(100% - 22px); overflow: visible; }
.hg-y { position: absolute; left: 0; top: 6px; bottom: 34px; width: 44px; display: flex; flex-direction: column; justify-content: space-between; font-size: 10.5px; color: var(--faint); text-align: right; pointer-events: none; }
.hg-x { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; pointer-events: none; }
.hg-x span { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.hg-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 3px var(--panel), 0 0 14px var(--glow); transform: translate(-50%, -50%); pointer-events: none; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hg-x span:nth-child(even) { display: none; } }

/* ---------- custom dropdowns ---------- */
.fs-btn { display: inline-flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; color: var(--text);
  background: var(--field); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px 8px 12px; font: inherit; transition: border-color .15s, box-shadow .15s, background .15s; }
.fs-btn.fs-input { width: 100%; padding: 10px 12px; }
.fs-btn:hover { border-color: var(--border-strong); background: var(--raised); }
.fs-btn:focus-visible, .fs-btn.open { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
.fs-btn[disabled] { opacity: .55; cursor: not-allowed; }
.fs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.fs-chev { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--accent-2); background: rgba(var(--accent-rgb), .12); transition: transform .18s ease; flex: none; }
.fs-btn.open .fs-chev { transform: rotate(180deg); }
.fs-btn.cm-list { padding: 4px 6px 4px 10px; font-size: 12.5px; font-weight: 600; max-width: 240px; }
.fs-btn.cm-list .fs-chev { width: 18px; height: 18px; }
.fs-menu { position: fixed; z-index: 120; max-height: 300px; overflow-y: auto; padding: 5px; border-radius: 12px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(var(--raised), var(--raised)) padding-box, var(--frame) border-box; border: 1px solid transparent;
  box-shadow: 0 18px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.2); animation: fsIn .14s ease-out; }
@keyframes fsIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.fs-opt { display: flex; align-items: center; gap: 10px; justify-content: space-between; text-align: left; background: none; border: 0; border-radius: 8px;
  padding: 9px 11px; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.fs-opt:hover, .fs-opt:focus-visible { outline: none; background: rgba(var(--accent-rgb), .14); }
.fs-opt.on { color: var(--accent-2); font-weight: 650; background: rgba(var(--accent-rgb), .08); }
.fs-opt svg { color: var(--accent-2); flex: none; }
html[data-skin="paper"] .fs-menu { box-shadow: 0 16px 40px rgba(0,0,0,.14); }
@media (prefers-reduced-motion: reduce) { .fs-menu { animation: none; } .fs-chev { transition: none; } }

/* ---------- channel boards fill the whole column (video cards stay 2 per row) ---------- */
.cards.ch-cards { grid-template-columns: minmax(0, 1fr); }
.ch-cards .card .stats { grid-template-columns: repeat(4, 1fr); }

/* ---------- Move to bin: a thin red strip that only grows while you drag a board ---------- */
.bin-bar { display: flex; align-items: center; gap: 7px; margin: 6px 8px 0; padding: 0 10px; height: 24px; border-radius: 7px;
  border: 1px dashed rgba(239, 68, 68, .45); background: rgba(220, 38, 38, .08); color: #fca5a5; font-size: 11.5px;
  transition: height .15s, background .15s, border-color .15s, box-shadow .15s; flex: none; }
.bin-bar svg { width: 13px; height: 13px; }
.bin-bar b { color: #fecaca; font-weight: 650; }
.bin-bar .spacer { flex: 1; }
.bin-bar .bin-hint { color: rgba(252, 165, 165, .6); font-size: 11px; }
.bin-bar .bin-open { color: #fca5a5; font-size: 11px; text-decoration: none; padding: 1px 7px; border-radius: 5px; }
.bin-bar .bin-open:hover { background: rgba(239, 68, 68, .18); color: #fff; }
.is-dragging .bin-bar { height: 40px; font-size: 13px; background: rgba(220, 38, 38, .2); border-color: rgba(239, 68, 68, .85); }
.bin-bar.hot { background: linear-gradient(90deg, #dc2626, #ef4444); border-style: solid; border-color: #fca5a5; color: #fff;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .22), 0 6px 20px rgba(220, 38, 38, .35); }
.bin-bar.hot b, .bin-bar.hot .bin-hint, .bin-bar.hot .bin-open { color: #fff; }
.drag-ghost.to-bin { opacity: .6; filter: saturate(.3); }
[data-skin="paper"] .bin-bar { color: #b91c1c; } [data-skin="paper"] .bin-bar b { color: #991b1b; }
[data-skin="paper"] .bin-bar .bin-hint, [data-skin="paper"] .bin-bar .bin-open { color: #b91c1c; }

.bin-page .board-head { padding-left: 0; }
.bin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.bin-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--panel, var(--card)); border: 1px solid var(--border); }
.bin-row .spacer { flex: 1; }
.bin-row .nm small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.bin-row .nm > div { font-weight: 600; }

/* ---------- compact boards ---------- */
.board-head { min-height: 40px; padding: 6px 12px; gap: 8px; }
.board { padding: 6px 8px 8px; gap: 6px; }
.column { gap: 6px; }
.list-head { padding: 6px 6px 4px; gap: 4px; }
.cards { gap: 4px; padding: 1px 4px 4px; }
.ch-cards .card { padding: 6px 7px; }
.ch-cards .card .badges, .ch-cards .card .row { margin-top: 4px; }
.ch-cards .card .stats { margin-top: 4px; padding-top: 4px; }

/* YouTube link: on boards without one, and the live views pill on a channel board */
.yt-add-btn { color: #fca5a5; border-color: rgba(248, 113, 113, .45); }
.yt-open-btn { color: #fff; background: #e62117; border-color: #e62117; text-decoration: none; gap: 6px; }
.yt-open-btn:hover { background: #ff3326; border-color: #ff3326; color: #fff; }
.live-pill { display: flex; align-items: center; gap: 10px; padding: 3px 6px 3px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--raised, var(--hover)); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-pill small { color: var(--muted); font-size: 10.5px; letter-spacing: .04em; }
.live-pill .lp-total { color: var(--text); font-weight: 600; }
.live-pill .muted { color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); animation: livepulse 2s infinite; }
.live-dot.off { background: var(--faint); animation: none; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.lp-yt, .lp-btn { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--muted); background: none; border: 0; cursor: pointer; }
.lp-yt { color: #f87171; }
.lp-yt:hover, .lp-btn:hover { background: var(--hover); color: var(--text); }
.lp-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* add column: 1 / 2 / 3 stack picker */
.stack-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stack-opt { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 8px 9px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--raised, var(--hover)); color: var(--muted); font-size: 12px; font-weight: 600; }
.stack-opt:hover { color: var(--text); }
.stack-opt.on { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.stack-mini { display: flex; flex-direction: column; gap: 3px; width: 26px; height: 38px; }
.stack-mini i { flex: 1; border-radius: 3px; background: var(--faint); }
.stack-opt.on .stack-mini i { background: var(--accent); }
.stack-names .field { margin-top: 10px; }
.side-item.side-bin > span:first-child { display: inline-flex; align-items: center; gap: 6px; color: #f87171; }
.side-item.side-bin.active > span:first-child { color: #fca5a5; }

/* ---------- teams ---------- */
.team-switch { display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 0 2px; padding: 4px 9px 4px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--raised, var(--hover)); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; max-width: 190px; }
.team-switch:hover { border-color: var(--accent); }
.team-switch .ts-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-switch svg { color: var(--muted); flex: none; }
.invite-row { display: flex; align-items: center; gap: 8px; padding: 9px 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.invite-row:last-child { border-bottom: 0; }
.invite-code { font-size: 12px; color: var(--muted); background: var(--hover); padding: 2px 6px; border-radius: 5px; }
.invite-url { display: flex; gap: 8px; margin: 10px 0 4px; }
.invite-url .input { flex: 1; font-size: 12.5px; }
.badge.amber { background: var(--amber-bg); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.auth.join { display: flex; align-items: center; justify-content: center; }
@media (max-width: 760px) { .team-switch { max-width: 120px; } }

/* ---------- top-bar search + Excel-style board tabs at the bottom ---------- */
.top-search { margin: 0 8px 0 0; width: 200px; }
.top-search input { height: 30px; }
.top-search svg { top: 9px; }
.top-search .search-results { min-width: 280px; right: 0; left: auto; z-index: 60; }
.sheet-bar { display: flex; align-items: stretch; gap: 6px; padding: 0 8px 0 10px; border-bottom: 1px solid var(--line);
  background: var(--panel); min-width: 0; }
.sheet-scroll { display: flex; align-items: stretch; gap: 1px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.sheet-scroll::-webkit-scrollbar { display: none; }
.sheet-tab { display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; margin: 5px 0 -1px; color: var(--muted);
  text-decoration: none; font-size: 12.5px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; border-bottom: 0;
  border-radius: 8px 8px 0 0; user-select: none; }
.sheet-tab:hover { color: var(--text); background: var(--hover); }
.sheet-tab.on { color: var(--text); background: var(--bg, var(--raised)); border-color: var(--line); font-weight: 650;
  box-shadow: inset 0 2px 0 var(--accent); }
.sheet-tab .st-count { font-size: 10.5px; color: var(--faint); background: var(--hover); padding: 0 6px; border-radius: 99px; line-height: 16px; }
.sheet-tab.on .st-count { color: var(--text); }
.sheet-tab.bin { color: #f87171; }
.sheet-tab.bin.on { box-shadow: inset 0 2px 0 #ef4444; }
.sheet-group { align-self: center; margin: 0 2px 0 8px; padding: 3px 8px; border-radius: 6px; border: 0; background: none;
  color: var(--faint); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.sheet-group:hover { color: var(--text); background: var(--hover); }
.sheet-add, .sheet-more { align-self: center; display: grid; place-items: center; width: 26px; height: 24px; border-radius: 6px;
  border: 0; background: none; color: var(--muted); cursor: pointer; flex: none; }
.sheet-add:hover, .sheet-more:hover { color: var(--text); background: var(--hover); }
.sheet-bar .spacer { flex: 1; }
@media (max-width: 900px) { .top-search { width: 140px; } .nav a { padding: 6px 8px; } }
@media (max-width: 760px) { .top-search, .ph-clock { display: none; } }

/* ---------- Home: analytics panel on the right ---------- */
.home.has-side { display: grid; grid-template-columns: minmax(0, 1fr) clamp(330px, 28vw, 470px); padding: 0; overflow: hidden; height: 100%; }
.home.has-side.side-closed { grid-template-columns: minmax(0, 1fr); }
.home-main { overflow-y: auto; padding: 22px 26px 40px; min-width: 0; }
.ana { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.ana-top { display: flex; align-items: center; gap: 6px; padding: 10px 8px 8px 12px; border-bottom: 1px solid var(--line); }
.ana-top h3 { margin: 0; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.ana-n { font-size: 11px; color: var(--muted); background: var(--hover); padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.ana-top .btn.ana-refresh { padding: 0 8px; height: 30px; }
.ana-refresh.spin svg { animation: spin .8s linear infinite; }
.ana-list { flex: 1; overflow-y: auto; padding: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 6px; align-content: start; }
.ana-card { border: 1px solid var(--border); border-radius: 9px; background: var(--raised, var(--card)); padding: 6px; min-width: 0; }
.ana-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ana-who { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.ana-head .nm { flex: 1; min-width: 0; }
.ana-head .nm > div { font-weight: 650; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ana-head .nm small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ana-who:hover .nm > div { color: var(--accent); }
.ana-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ana-dot.live { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.ana-dot.stale { background: #f59e0b; }
.ana-dot.paused { background: var(--faint); }
.ana-box { background: var(--hover); border-radius: 7px; padding: 4px 2px 5px; margin-bottom: 5px; }
.ana-title { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 10.5px; color: var(--muted); margin-bottom: 1px; }
.ana-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: center; }
.ana-cell small { display: block; font-size: 9px; color: var(--faint); }
.ana-cell b { font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ana-cell b.up { color: #4ade80; }
.ana-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0; margin-bottom: -3px; }
.ana-when { flex: 1; font-size: 10.5px; color: var(--faint); padding-left: 2px; }
.ana-btn { display: grid; place-items: center; width: 24px; height: 22px; border-radius: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.ana-btn:hover { background: var(--hover); color: var(--text); }
.ana-btn.yt { color: #ef4444; }
.ana-btn.spin svg { animation: spin .8s linear infinite; }
@media (max-width: 1100px) {
  .home.has-side { display: block; overflow-y: auto; }
  .home-main { overflow: visible; }
  .ana { border-left: 0; border-top: 1px solid var(--line); }
  .ana-list { overflow: visible; }
}

/* ---------- compact channel boards: narrower columns, three-line cards ---------- */
.phase-board { --col-w: 214px; }
.phase-board .list-head { font-size: 11.5px; }
.ch-cards .card.ch-card { padding: 6px 7px 5px; }
.ch-card .ch-top { gap: 7px; align-items: center; padding-right: 14px; }
.ch-card .avatar.ch-pfp { width: 26px; height: 26px; font-size: 10px; }
.ch-cards .ch-card .ch-name { font-size: 11.5px; line-height: 1.25; }
.ch-cards .ch-card .ch-sub { font-size: 10px; }
.ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 5px; min-width: 0; }
.ch-people { display: flex; align-items: center; gap: inherit; margin-left: auto; }
.ch-meta .badge { padding: 1px 5px; font-size: 10px; }
.ch-meta .badge.uploads svg { width: 10px; height: 10px; }
.ch-meta .members .avatar { width: 18px; height: 18px; font-size: 8px; }
.ch-meta .add-member { width: 18px; height: 18px; }
.ch-meta .pill-count { font-size: 10px; padding: 0 5px; }
.ch-cards .ch-card .stats { margin-top: 5px; padding-top: 4px; border-top: 1px solid var(--line); }
.ch-cards .ch-card .stats small { font-size: 8px; }
.ch-cards .ch-card .stats b { font-size: 11px; }
.ch-card .menu-btn { top: 4px; right: 3px; }

.ana-head .avatar { width: 20px; height: 20px; font-size: 8px; }
.ana-head .nm small { font-size: 10px; }
.ana-title { font-size: 9.5px; }
.ana-close { margin-left: -2px; }
.home.has-side.side-closed { position: relative; }
.ana-open { position: absolute; top: 14px; right: 18px; z-index: 5; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.ana-open b { font-size: 10.5px; background: var(--hover); border-radius: 99px; padding: 1px 7px; }
.ana-open:hover { border-color: var(--accent); }
.ana-sub { font-size: 11px; color: var(--faint); }


/* lists with many channels flow sideways into extra columns (set by fitPhaseColumns) instead of scrolling */
.phase-board .column { width: calc(var(--col-w) * var(--span, 1) - (var(--span, 1) - 1) * 10px); }
/* filled column by column (top to bottom, then the next column), so fewest uploads/week sit on the left */
.cards.ch-cards.flow { grid-auto-flow: column; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 1), auto); align-content: start; overflow: hidden; } /* only the board scrolls sideways */
.spots { font-size: 12px; color: var(--muted); margin-left: 10px; display: inline-flex; gap: 6px; align-items: center; }
.spots.full { color: #f87171; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 12px; text-decoration: underline; }
.stats b.partial, .ana-cell b.partial, .live-pill b.partial { opacity: .55; }
/* wrapper for the card being dragged: carries the list's classes for styling, but takes no space itself */
.ghost-wrap { position: fixed !important; left: 0; top: 0; width: 0; height: 0; padding: 0 !important; margin: 0; display: block !important;
  overflow: visible !important; pointer-events: none; z-index: 100; border: 0; background: none; outline: 0; }
.ghost-wrap > .drag-ghost { min-width: 0; }

/* ---------- quality of life: finder, shortcuts, multi-add, reconnecting, graph switch ---------- */
.finder-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; margin-right: 8px; min-width: 230px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--raised, var(--hover)); color: var(--faint); font-size: 12.5px; cursor: pointer; }
.finder-btn span { flex: 1; text-align: left; }
.finder-btn:hover { border-color: var(--border-strong); color: var(--muted); }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 5px;
  border: 1px solid var(--border); border-bottom-width: 2px; background: var(--hover); color: var(--muted); font: 600 10.5px/1 var(--mono, ui-monospace, monospace); }
.modal.finder-modal { padding: 0; width: min(620px, calc(100vw - 32px)); overflow: hidden; }
.modal.finder-modal .modal-close { display: none; }
.finder { display: flex; flex-direction: column; max-height: min(560px, 75vh); }
.finder-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.finder-input { flex: 1; border: 0; background: none; outline: 0; color: var(--text); font-size: 15px; }
.finder-list { overflow-y: auto; padding: 6px; }
.finder-group { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 10px 10px 4px; }
.finder-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--text); text-align: left; cursor: pointer; font-size: 13px; }
.finder-item.on { background: rgba(var(--accent-rgb), .14); }
.finder-ic { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: var(--hover); color: var(--muted); flex: none; }
.finder-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder-label small { color: var(--muted); margin-left: 8px; font-size: 11.5px; }
.finder-empty { padding: 26px; text-align: center; color: var(--muted); }
.finder-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); }
.finder-foot span { display: inline-flex; align-items: center; gap: 4px; }
.shortcuts { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 4px; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.sc-keys { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.sc-or { color: var(--faint); font-size: 11.5px; margin: 0 2px; }
.qa-log { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.qa-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.qa-item svg { color: #4ade80; }
.offline-pill { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 200; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; background: #3b2a10; border: 1px solid rgba(245, 158, 11, .45); color: #fcd34d; font-size: 12.5px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.offline-pill .spinner { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.offline-pill.ok { background: #0f2e1b; border-color: rgba(34, 197, 94, .45); color: #86efac; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--hover); border: 1px solid var(--border); margin-left: 10px; }
.seg button { border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 650; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.seg button.on { background: var(--raised, var(--panel)); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
@media (max-width: 900px) { .finder-btn { min-width: 0; } .finder-btn span, .finder-btn kbd { display: none; } }

/* ---------- one continuous board: Phase 1 → 2 → 3 side by side ---------- */
.phase-board { --col-w: 182px; }
.board.continuous { gap: 0; }
.phase-sec { display: flex; flex-direction: column; flex: none; min-height: 0; padding: 0 10px 0 12px; }
.phase-sec + .phase-sec { border-left: 2px dashed var(--line); }
.phase-sec:first-child { padding-left: 0; }
.phase-sec-head { position: sticky; left: 8px; width: max-content; display: flex; align-items: baseline; gap: 8px; padding: 0 2px 6px; z-index: 2; }
.phase-sec-head b { font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.phase-sec-head span { font-size: 11px; color: var(--faint); }
.phase-sec-cols { display: flex; gap: 6px; flex: 1; min-height: 0; align-items: stretch; }
.phase-board .ch-card .ch-name { font-size: 11px; }
.phase-board .ch-card .stats b { font-size: 10.5px; }
.phase-board .ch-meta { gap: 3px; }

/* ==============================================================
   PHONES (≤ 760px): slim top bar, app-style bottom bar, everything fits the screen width
   ===================================================================== */
.mobile-nav { display: none; }
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  /* pinned to the screen's edges: no strip of another colour below the tab bar when Safari's toolbar slides away */
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 50px auto minmax(0, 1fr) auto; position: fixed; inset: 0; height: auto;
    padding-top: env(safe-area-inset-top); box-sizing: border-box; } /* Home Screen app: clear of the clock and notch */
  .topbar { padding: 0 10px; gap: 6px; min-width: 0; overflow: hidden; }
  .topbar .nav, .topbar .ph-clock, .topbar .skin-btn, .finder-btn { display: none !important; }
  .brand { margin-right: 4px; }
  .team-switch { max-width: none; flex: 1; min-width: 0; justify-content: space-between; height: 34px; }
  .topbar .spacer { display: none; }

  /* bottom bar */
  .mobile-nav { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--bg);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .mn-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; border: 0; background: none;
    color: var(--muted); font-size: 10.5px; font-weight: 600; border-radius: 10px; }
  .mn-item.on { color: var(--accent-2, var(--accent)); }
  .mn-item:active { background: var(--hover); }

  /* board tabs: one swipeable row */
  .sheet-bar { padding: 0 6px; height: 38px; }
  .sheet-bar .spacer, .sheet-bar .sheet-group, .sheet-bar .sheet-more { display: none; }
  .sheet-tab { padding: 0 12px; font-size: 13px; }

  /* boards */
  .board-head { flex-wrap: wrap; row-gap: 6px; padding: 8px 10px; }
  .board-head .zoom-ctl, .board-head [class*="zoom"] { display: none; }
  .board-head .btn.sm { height: 32px; }
  .bin-bar .bin-hint { display: none; }
  .board { -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-bottom: 10px; }
  .phase-board .column { scroll-snap-align: start; }
  .phase-board { --col-w: 230px; }
  .card .menu-btn { opacity: 1; }

  /* home: one column, channel cards underneath */
  .home.has-side, .home.has-side.side-closed { display: block; overflow-y: auto; height: 100%; }
  .home-main { padding: 12px 12px 20px; overflow: visible; }
  .ana-open { position: static; margin: 0 12px 12px; }
  .ana { border-left: 0; border-top: 1px solid var(--line); }
  .ana-list { overflow: visible; grid-template-columns: 1fr 1fr; }
  .hero { padding: 18px; }
  .hero .team-name { font-size: 34px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; }
  .seg { margin-left: 0; }
  .views-chart .tile-head { flex-wrap: wrap; row-gap: 8px; }

  /* windows become full-width sheets from the bottom */
  .overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { width: 100vw; max-width: 100vw; max-height: 92dvh; border-radius: 16px 16px 0 0; margin: 0; overflow-y: auto;
    padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .modal.finder-modal { height: 92dvh; display: flex; flex-direction: column; }
  .modal.finder-modal .finder { max-height: none; flex: 1; }
  .finder-foot { display: none; }
  .cm-grid3 { max-height: none; }
  .form-actions { position: sticky; bottom: 0; background: inherit; padding-top: 10px; }
  .menu { max-width: calc(100vw - 16px); }

  /* pages */
  .page { padding: 14px 12px 24px; }
  .invite-row { row-gap: 6px; }
  .user-row { flex-wrap: wrap; }
  input, select, textarea, .input { font-size: 16px; } /* iPhone zooms the page into anything smaller */
  .ph-label { display: none; }
}
@media (max-width: 380px) { .ana-list { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .board-head .btn[title*="template"] { display: none; }
  .phase-board .cards.ch-cards { overflow-y: auto; }
}
@media (max-width: 760px) {
  .cm-head { flex-wrap: wrap; row-gap: 6px; padding: 12px 48px 10px 14px; }
  .cm-title2 { flex: 1 1 100%; font-size: 17px; }
  .cm-col { padding: 14px; }
}

/* ---------- touch feel: press feedback, glow on new items, toasts above the bottom bar ---------- */
.card.just-added { animation: justAdded 1.6s ease-out; }
@keyframes justAdded {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .0); transform: scale(.96); }
  15% { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .7); transform: scale(1.02); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); transform: scale(1); }
}
@media (pointer: coarse) {
  * { -webkit-tap-highlight-color: transparent; }
  .card { -webkit-touch-callout: none; }
  .btn, .icon-btn, .mn-item, .sheet-tab, .card, .finder-item, .fs-opt, .menu button, .seg button, .team-switch, .add-card {
    transition: transform .12s ease, background-color .15s ease; }
  .btn:active, .icon-btn:active, .mn-item:active, .sheet-tab:active, .finder-item:active, .menu button:active, .seg button:active, .team-switch:active, .add-card:active { transform: scale(.95); }
  .card:active:not(.drag-src) { transform: scale(.98); }
}
@media (max-width: 760px) {
  #toasts { left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); align-items: center; }
  .toast { max-width: 100%; }
  .offline-pill { bottom: calc(78px + env(safe-area-inset-bottom)); }
}
/* iPhone haptics: the invisible switch over tappable things (see addHapticSwitch) */
.hap-switch { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0;
  -webkit-appearance: switch; appearance: auto; cursor: inherit; z-index: 1; }
@media (max-width: 760px) {
  .board { scroll-snap-type: none; } /* free swiping: snapping made sideways scrolls feel sticky */
}
.sec-add { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding: 2px 7px; border-radius: 6px; border: 1px dashed var(--border);
  background: none; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.sec-add:hover { color: var(--text); border-style: solid; border-color: var(--accent); }

/* dragging a whole column by its title (owners) */
.list-head.col-grab { cursor: grab; }
.column.col-dragging { opacity: .35; }
.col-ghost { position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none; padding: 8px 12px; border-radius: 10px; font-weight: 650; font-size: 12.5px;
  background: var(--raised, var(--panel)); color: var(--text); border: 1px solid var(--accent); box-shadow: 0 14px 34px rgba(0,0,0,.45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-drop-line { position: fixed; z-index: 110; width: 4px; border-radius: 4px; background: var(--accent); pointer-events: none;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25); }
.panel.danger-zone { border-color: rgba(239, 68, 68, .35); }
.panel.danger-zone h2 { color: #f87171; }

/* =====================================================================
   GENERATE
   ===================================================================== */
.gen-inner { max-width: 1320px; }
.gen-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gen-top h1 { margin: 0; }
.gen-tabs { margin: 0 0 18px; }
.gen-tabs button { padding: 6px 14px; font-size: 12.5px; }
.gpill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; width: max-content; }
.gpill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.gpill.ok { background: rgba(34, 197, 94, .14); color: #4ade80; }
.gpill.run { background: rgba(59, 130, 246, .16); color: #93c5fd; }
.gpill.run i { animation: livepulse 1.4s infinite; }
.gpill.wait { background: var(--hover); color: var(--muted); }
.gpill.bad { background: rgba(239, 68, 68, .14); color: #fca5a5; }
.gtiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.gtile { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.gt-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; }
.gt-value { font-size: 30px; font-weight: 750; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.gt-sub { color: var(--faint); font-size: 12px; }
.gsec-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; }
.gsec-head h3 { margin: 0; font-size: 15px; }
.gsec-head .spacer { flex: 1; }
.gmachine { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-bottom: 22px; }
.gm-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; margin-bottom: 8px; }
.gm-row span:first-child { color: var(--muted); }
.gm-bar { height: 5px; border-radius: 99px; background: var(--hover); overflow: hidden; }
.gm-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2, var(--accent))); transition: width .4s ease; }
.gm-bar i.done { background: #22c55e; } .gm-bar i.failed { background: #ef4444; }
.gm-bar i.running { background-size: 200% 100%; animation: gshimmer 1.4s linear infinite; background-image: linear-gradient(90deg, var(--accent), #93c5fd, var(--accent)); }
@keyframes gshimmer { to { background-position: -200% 0; } }
.gov-grid { gap: 14px; }
.gjobs .gjob { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.4fr) 150px 120px 96px 70px 130px 66px; align-items: center; gap: 12px;
  padding: 12px 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
.gjobs.compact .gjob { grid-template-columns: minmax(0, 1fr) 96px 90px 84px 60px; }
.gjob.head { font-size: 11.5px; color: var(--muted); padding-top: 4px; }
.gjob:last-child { border-bottom: 0; }
.gj-main b { display: block; font-weight: 650; }
.gj-main small { color: var(--muted); font-size: 11.5px; }
.gj-err { color: #fca5a5; }
.gj-style, .gj-when, .gj-time, .gj-tok, .gj-cost { color: var(--muted); font-variant-numeric: tabular-nums; }
.gjobs-table { overflow-x: auto; }
.gjobs-table .gjobs, .gjobs-table > .gjob { min-width: 900px; }
.gact-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.gact-row:last-child { border-bottom: 0; }
.gstyles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gstyle { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--border);
  text-decoration: none; color: inherit; transition: transform .15s ease, border-color .15s ease; }
.gstyle:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.gs-cover { position: relative; height: 112px; display: flex; align-items: flex-end; padding: 14px 16px; color: #fff; }
.gs-cover b { font-size: 34px; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 2px 12px rgba(0,0,0,.25); }
.gs-cover.sm { width: 64px; height: 64px; border-radius: 14px; padding: 10px; flex: none; }
.gs-cover.sm b { font-size: 22px; }
.gs-refs { position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.32); font-size: 11.5px; font-weight: 650; }
.gs-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 14px; flex: 1; }
.gs-name { font-weight: 700; font-size: 15px; }
.gs-ch { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.gs-foot { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; margin-top: auto; padding-top: 6px; }
.gempty { text-align: center; padding: 50px 20px; color: var(--muted); max-width: 520px; margin: 0 auto; }
.gempty h3 { color: var(--text); margin: 12px 0 6px; }
.ge-ic { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; background: var(--hover); color: var(--text); }
.ref-files { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ref-file { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.ref-file span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gstyle-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.gsh-main { min-width: 0; }
.gsh-name { font: inherit; font-size: 20px; font-weight: 750; color: var(--text); background: none; border: 1px solid transparent; border-radius: 8px; padding: 2px 6px; margin-left: -6px; }
.gsh-name:hover, .gsh-name:focus { border-color: var(--border); background: var(--field); outline: 0; }
.grunning { margin-bottom: 12px; }
.gprompt { background: var(--hover); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.gp-head { display: flex; align-items: center; gap: 8px; }
.gprompt p { margin: 6px 0; font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; line-height: 1.5; }
.gprompt small { color: var(--muted); }
.ga-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.ga-row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ga-k { color: var(--muted); }
.gdo, .gdont { margin-top: 12px; font-size: 13px; }
.gdo b { color: #4ade80; } .gdont b { color: #fca5a5; }
.gdo ul, .gdont ul { margin: 6px 0 0; padding-left: 18px; }
.gref { margin-top: 12px; }
.gstats { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.gstat { background: var(--hover); border-radius: 10px; padding: 8px 10px; }
.gstat small { display: block; color: var(--muted); font-size: 11px; }
.gstat b { font-size: 15px; font-variant-numeric: tabular-nums; }
.gpal { display: flex; height: 34px; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.gsw { display: flex; align-items: flex-end; padding: 3px 6px; min-width: 44px; }
.gsw span { font-size: 10px; font-family: var(--mono, ui-monospace, monospace); color: #fff; mix-blend-mode: difference; }
.gframes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; overscroll-behavior-x: contain; }
.gframes figure { margin: 0; flex: none; width: 110px; }
.gframes img { width: 110px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; display: block; background: var(--hover); }
.gframes figcaption { font-size: 11px; color: var(--faint); text-align: center; margin-top: 3px; }
.gdet { margin-top: 10px; font-size: 13px; }
.gdet summary { cursor: pointer; color: var(--muted); }
.gdet video { margin-top: 8px; max-height: 480px; border-radius: 10px; background: #000; }
.gdet p { white-space: pre-wrap; line-height: 1.55; }
.gvideos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gvideo { text-decoration: none; color: inherit; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.gv-thumb { position: relative; aspect-ratio: 9 / 16; background: var(--hover); }
.gv-thumb img, .gv-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gv-dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 11.5px; font-weight: 650; padding: 2px 6px; border-radius: 6px; }
.gv-title { padding: 8px 10px 0; font-weight: 650; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv-sub { padding: 2px 10px 10px; color: var(--muted); font-size: 11.5px; }
.gclaude { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.gcl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gcl-used b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.gcl-used small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 1100px) { .gstats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ga-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .gtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gmachine { grid-template-columns: 1fr; gap: 14px; }
  .gjobs.compact .gjob { grid-template-columns: minmax(0, 1fr) 90px; }
  .gjobs.compact .gjob > :nth-child(n+3) { display: none; }
  .gstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gclaude { grid-template-columns: 1fr; } .gcl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gen-tabs { overflow-x: auto; max-width: 100%; }
}
.shell.no-tabs { grid-template-rows: 52px 1fr; }
@media (max-width: 760px) { .shell.no-tabs { grid-template-rows: 50px minmax(0, 1fr) auto; } }
=======
/* ---------- Backend tabs + Sessions ---------- */
.be-tabs { display: flex; gap: 4px; margin: -4px 0 16px; border-bottom: 1px solid var(--line); }
.be-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.be-tab:hover { color: var(--text); }
.be-tab.on { color: var(--text); border-bottom-color: var(--accent-2); }
.be-tab svg { color: var(--accent-2); }
.act-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.act-kpis .k-value { font-size: 26px; }
.act-wrap { overflow-x: auto; margin: 0 -4px; }
.act-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.act-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.act-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.act-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.act-table td .hint { font-size: 11px; margin-top: 2px; }
.act-table tbody tr:last-child td { border-bottom: 0; }
.act-member { cursor: pointer; }
.act-member:hover td, .act-member:focus-visible td { background: rgba(var(--accent-rgb), .05); }
.act-member:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.act-member > td:first-child svg { color: var(--muted); transform: rotate(-90deg); transition: transform .15s; flex: none; }
.act-member.open > td:first-child svg { transform: none; }
.act-detail > td { background: var(--sunken); padding: 4px 16px 14px; white-space: normal; }
.act-detail h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 8px; }
.act-logins { display: grid; gap: 8px; }
.act-login { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.act-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.act-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.act-status.active i { background: var(--green); box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.act-status.idle i { background: var(--amber); }
.act-status.offline { color: var(--muted); }
.act-bars { display: flex; align-items: flex-end; gap: 2px; height: 30px; }
.act-bar { position: relative; width: 7px; height: 100%; border-radius: 2px; background: var(--sunken); overflow: hidden; }
.act-bar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 2px; }
.act-bar .open { background: rgba(var(--accent-rgb), .3); }
.act-bar .act { background: var(--accent-2); }
.act-bar.today { outline: 1px solid var(--muted); outline-offset: 1px; }
@media (max-width: 900px) { .act-kpis { grid-template-columns: 1fr 1fr; } }

/* ---------- Backend → TTS Status ---------- */
.tts-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tts-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--hover); }
.tts-auto { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.tts-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.tts-tile .gt-label { display: flex; align-items: center; }
.tts-tile .gt-value { font-size: 26px; }
.tts-of { color: var(--faint); font-weight: 600; }
.tts-green { color: #4ade80; } .tts-red { color: #f87171; font-size: 20px; } .tts-blue { color: #60a5fa; } .tts-orange { color: #fb923c; }
.tts-bd { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 12.5px; }
.tts-windows { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.tts-windows .gstat b { font-size: 18px; }
.tts-windows .gstat small:last-child { color: var(--faint); }
.tts-try { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px minmax(0, 1fr); gap: 8px; margin-bottom: 8px; align-items: center; }
.tts-try .row > :first-child, .tts-try .row > .fs-btn { flex: 1; min-width: 0; }
.tts-out { display: flex; align-items: center; gap: 10px; }
.tts-out audio { height: 34px; }
.tts-log { overflow-x: auto; }
.tts-row { display: grid; grid-template-columns: 130px minmax(260px, 1fr) 110px 70px 80px 110px 60px; gap: 12px; align-items: start; padding: 10px 4px;
  border-bottom: 1px solid var(--line); font-size: 13px; min-width: 860px; }
.tts-row.head { font-size: 11.5px; color: var(--muted); }
.tts-text { line-height: 1.45; }
.tts-text small { display: block; margin-top: 3px; }
.tts-text audio { display: block; height: 30px; margin-top: 6px; }
@media (max-width: 1100px) { .tts-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tts-windows { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .tts-try { grid-template-columns: 1fr; } }
.tts-row.acct { grid-template-columns: 130px minmax(260px, 1fr) 130px 80px 120px 70px; }

/* voice presets + automation */
.voice-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; max-width: 170px; }
.voice-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-btn.on { color: var(--accent-2); border-color: rgba(var(--accent-rgb), .45); background: rgba(var(--accent-rgb), .12); }
.voice-btn:hover { color: var(--text); }
.voice-btn.sm { height: 20px; width: 20px; padding: 0; justify-content: center; border-radius: 50%; flex: none; }
.vchip { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 650; padding: 1px 6px; border-radius: 99px; }
.vchip:not(.run):not(.bad) { color: var(--muted); background: var(--hover); }
.vchip.run { color: var(--accent-2); background: rgba(var(--accent-rgb), .14); animation: vpulse 1.4s ease-in-out infinite; }
.vchip.warn { color: #facc15; background: rgba(234,179,8,.14); }
.vchip.bad { color: #f87171; background: rgba(248,113,113,.12); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes vpulse { 50% { opacity: .55; } }
.auto-badge { display: inline-flex; align-items: center; gap: 2px; border: 0; cursor: pointer; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 99px;
  color: var(--green); background: rgba(34,197,94,.14); margin-left: 4px; }
.vp-list { display: flex; flex-direction: column; gap: 6px; }
.vp-row { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 10px; padding: 4px 6px 4px 4px; }
.vp-row.on { border-color: rgba(var(--accent-rgb), .6); background: rgba(var(--accent-rgb), .08); }
.vp-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--text); text-align: left; padding: 6px; cursor: pointer; }
.vp-pick b { display: block; font-size: 13.5px; }
.vp-pick small { display: block; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; }
.vp-row.on .vp-radio { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.vp-field { margin-bottom: 10px; }
.vp-field .cm-label { display: block; margin-bottom: 4px; }
.va-toggle { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.va-toggle input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.va-toggle small { display: block; color: var(--muted); }
.va-sub { margin: 12px 0 0 26px; }
.va-seg { margin-left: 0; }
.va-seg button { padding: 6px 12px; font-size: 12.5px; }
.va-seg button:disabled { opacity: .4; cursor: default; }
.va-warn { color: #fbbf24; font-size: 12.5px; }
.va-run { display: block; margin-top: 12px; font-size: 12.5px; color: var(--muted); cursor: pointer; }

/* pictures inside cards never start the browser's own image drag */
.card img, .phase-sec img, .column-title img { -webkit-user-drag: none; user-select: none; }

/* card window: script and voiceover stacked */
.cm-out-sec { display: flex; flex-direction: column; min-height: 0; }
.cm-out-script { flex: 1; margin-bottom: 16px; }
.cm-out-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 28px; }
.cm-out-head .cm-label { margin: 0; }
.cm-out .cm-script { min-height: 220px; }
.cm-out .mz-audio audio { width: 100%; }

.ch-name .pill-count { margin-left: 4px; vertical-align: 1px; font-size: 11px; padding: 0 6px; }

/* slim voiceover bar in the card window */
.vo-bar { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.vo-bar audio { flex: 1; min-width: 0; height: 40px; }
.vo-bar.vo-empty { width: 100%; justify-content: center; gap: 8px; border: 1px dashed var(--border-strong); border-radius: 10px; background: none;
  color: var(--muted); font-size: 12.5px; cursor: pointer; }
.vo-bar.vo-empty:hover, .vo-bar.drop { color: var(--text); border-color: var(--accent); background: rgba(var(--accent-rgb), .06); }
.vo-bar.busy { opacity: .5; pointer-events: none; }

/* Generate: closer to the studio screenshots */
.gen-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.gen-top { align-items: flex-start; }
.gt-of { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.gmachine { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; background: none; border: 0; padding: 0; }
.gm-tile .gm-bar { margin: 14px 0 10px; }
.gmem { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 22px; padding: 16px 18px; }
.gmem .gm-row b { color: var(--text); }
.gov-panel { min-height: 260px; }
.gnone { text-align: center; padding: 30px 16px; color: var(--muted); }
.gnone b { display: block; color: var(--text); margin: 12px 0 4px; font-size: 15px; }
.gnone p { margin: 0 auto; max-width: 340px; font-size: 13px; }
.gjobs-table > .gjobs .gjob.head { border-bottom: 1px solid var(--line); }
.gstyles { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.gs-cover { height: 150px; padding: 16px 20px; }
.gs-cover b { font-size: 44px; }
.gs-refs { top: 14px; right: 14px; font-size: 12px; padding: 4px 11px; }
.gs-body { padding: 16px 20px 16px; }
.gs-name { font-size: 16.5px; }
.gs-ch { font-size: 13.5px; }
.gs-foot { font-size: 13px; }
.gvideos { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
@media (max-width: 900px) { .gmachine, .gmem { grid-template-columns: 1fr; } .gtiles { grid-template-columns: 1fr 1fr; } }
.gen-top .spacer { flex: 1; }

/* Team → Permissions (Discord-style) */
.perm-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.perm-roles { padding: 12px; position: sticky; top: 12px; }
.perm-cap { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 4px 6px 8px; }
.perm-role { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; border: 0; background: none; color: var(--text); cursor: pointer; }
.perm-role:hover { background: var(--hover); }
.perm-role.on { background: rgba(var(--accent-rgb), .14); }
.perm-role b { display: block; font-size: 14px; }
.perm-role small { color: var(--muted); font-size: 11.5px; }
.perm-role > div { flex: 1; min-width: 0; }
.perm-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.perm-n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.perm-note { margin: 12px 6px 2px; font-size: 12px; }
.perm-main { padding: 18px 20px; }
.perm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.perm-head h2 { margin: 0; }
.perm-group { margin-top: 16px; }
.perm-group .perm-cap { margin: 0 0 4px; }
.perm-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.perm-group .perm-row:last-child { border-bottom: 0; }
.perm-txt { flex: 1; min-width: 0; }
.perm-txt b { display: block; font-size: 14px; font-weight: 650; }
.perm-txt small { color: var(--muted); font-size: 12.5px; }
.perm-sw { width: 42px; height: 24px; border-radius: 99px; border: 0; background: var(--border-strong); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.perm-sw i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.perm-sw.on { background: #22c55e; }
.perm-sw.on i { transform: translateX(18px); }
.perm-sw:disabled { opacity: .6; cursor: default; }
@media (max-width: 760px) { .perm-wrap { grid-template-columns: 1fr; } .perm-roles { position: static; } }

/* Streamer mode: blur + lock everything that would reveal a channel */
.streamer-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; margin-right: 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.streamer-btn:hover { color: var(--text); }
.streamer-btn.on { color: #fff; background: #dc2626; border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.25); }
@media (max-width: 1560px) { .streamer-btn span { display: none; } .streamer-btn { padding: 0 9px; } }
/* pictures: blurred with a lock on top */
html.streamer .avatar { color: transparent !important; position: relative; overflow: hidden; }
html.streamer .avatar img { filter: blur(6px) saturate(.4); transform: scale(1.3); }
html.streamer .avatar::after { content: ''; position: absolute; inset: 0; margin: auto; width: 55%; height: 55%; max-width: 16px; max-height: 16px; background: rgba(255,255,255,.9);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat; }
html.streamer .thumb, html.streamer .up-thumb, html.streamer .tthumb, html.streamer .reorder-thumb, html.streamer .gv-thumb,
html.streamer .gframes figure, html.streamer .cm-grid3 .cm-col:first-child .mz, html.streamer .gref video { overflow: hidden; }
html.streamer .thumb img, html.streamer .thumb video, html.streamer .up-thumb img, html.streamer .up-thumb video, html.streamer .tthumb img,
html.streamer .reorder-thumb img, html.streamer .gv-thumb img, html.streamer .gv-thumb video, html.streamer .gframes img,
html.streamer .cm-grid3 .cm-col:first-child img, html.streamer .cm-grid3 .cm-col:first-child video, html.streamer .gref video { filter: blur(16px) saturate(.5); transform: scale(1.15); }
/* names and titles: blurred, can't be selected or copied */
html.streamer :is(.ch-name, .ch-sub, .ch-title, .vcard .title, .vcard .desc, .up-title, .up-ch span, .lead-row .nm, .ana-who .nm, .finder-label,
  .reorder-title, .cm-title2, .gv-title, .gj-main b, .gact-row > div > b:last-of-type, .gs-ch, .gsh-main .hint, .sr-name, .bin-row b) {
  filter: blur(6px); user-select: none; -webkit-user-select: none; }
html.streamer .cm-title2 { pointer-events: none; }
html.streamer .ch-name .pill-count { filter: none; }
html.streamer .yt-link { visibility: hidden; }

.gmachine { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* animated 'views going up' loader: splash on refresh + any page or panel that's loading */
.cl{display:flex;align-items:center;justify-content:center}
.cl-card{display:flex;flex-direction:column;align-items:center;gap:14px;padding:22px 26px 18px;border-radius:22px;background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.02));border:1px solid rgba(255,255,255,.08);box-shadow:0 20px 60px -20px rgba(37,99,235,.45),inset 0 1px 0 rgba(255,255,255,.06);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.cl-svg{width:180px;height:100px;overflow:visible}
.cl-grid line{stroke:rgba(148,163,184,.14);stroke-width:1;stroke-dasharray:2 4}
.cl-bars rect{fill:url(#clB);opacity:.0;transform-box:fill-box;transform-origin:bottom;transform:scaleY(.1);animation:clbar 2.2s cubic-bezier(.22,1,.36,1) infinite;animation-delay:var(--d)}
.cl-area{fill:url(#clF);opacity:0;animation:clarea 2.2s ease infinite}
.cl-line{fill:none;stroke:url(#clS);stroke-width:3;stroke-linecap:round;stroke-dasharray:240;stroke-dashoffset:240;filter:drop-shadow(0 4px 10px rgba(56,189,248,.55));animation:clline 2.2s cubic-bezier(.65,0,.35,1) infinite}
.cl-dot{fill:#e0f2fe;opacity:0;animation:cldot 2.2s ease infinite}
.cl-ring{fill:none;stroke:#60a5fa;stroke-width:2;opacity:0;transform-box:fill-box;transform-origin:center;animation:clring 2.2s ease-out infinite}
.cl-txt{font:600 11px/1 Inter,system-ui,-apple-system,sans-serif;letter-spacing:.22em;text-transform:uppercase;color:rgba(203,213,225,.6)}
.cl-bar{width:120px;height:3px;border-radius:99px;background:rgba(148,163,184,.14);overflow:hidden}
.cl-bar i{display:block;height:100%;width:40%;border-radius:99px;background:linear-gradient(90deg,transparent,#60a5fa,#a5b4fc,transparent);animation:clshim 1.4s ease-in-out infinite}
@keyframes clbar{0%{transform:scaleY(.1);opacity:0}35%,78%{transform:scaleY(1);opacity:.55}100%{transform:scaleY(1);opacity:0}}
@keyframes clline{0%{stroke-dashoffset:240;opacity:1}55%,80%{stroke-dashoffset:0;opacity:1}100%{stroke-dashoffset:0;opacity:0}}
@keyframes clarea{0%,30%{opacity:0}60%,80%{opacity:1}100%{opacity:0}}
@keyframes cldot{0%,50%{opacity:0}58%,82%{opacity:1}100%{opacity:0}}
@keyframes clring{0%,55%{opacity:0;transform:scale(1)}60%{opacity:.9;transform:scale(1)}90%,100%{opacity:0;transform:scale(3.2)}}
@keyframes clshim{0%{transform:translateX(-110%)}100%{transform:translateX(260%)}}
@media (prefers-reduced-motion:reduce){.cl-bars rect,.cl-line,.cl-area,.cl-dot,.cl-ring,.cl-bar i{animation:none}.cl-bars rect{transform:none;opacity:.5}.cl-line{stroke-dashoffset:0}.cl-area,.cl-dot{opacity:1}}
.cl.page-load{min-height:60vh}
.cl.sm{padding:14px 0}
.cl.sm .cl-card{padding:14px 18px 12px;gap:10px;box-shadow:none}
.cl.sm .cl-svg{width:110px;height:60px}
.cl.sm .cl-bar{width:80px}
.gen.calm .fade-up { animation: none; opacity: 1; transform: none; }

/* Home → Channels panel expanded into a big overview of every channel */
.home.has-side.ana-wide { grid-template-columns: minmax(0, 1fr); }
.home.has-side.ana-wide .home-main { display: none; }
.home.ana-wide .ana { border-left: 0; }
.home.ana-wide .ana-top { padding: 12px 14px 10px 20px; }
.home.ana-wide .ana-top h3 { font-size: 16px; }
.home.ana-wide .ana-list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; padding: 14px 20px 30px; }
.home.ana-wide .ana-card { padding: 10px; border-radius: 12px; }
.home.ana-wide .ana-head .nm > div { font-size: 13.5px; }
.home.ana-wide .ana-cell small { font-size: 10.5px; }
.home.ana-wide .ana-cell b { font-size: 14px; }
.home.ana-wide .ana-title { font-size: 11.5px; }
.ana-wide-btn.ana-btn { width: 30px; height: 30px; }

/* the top bar never makes the page wider than the screen: the search box gives way first */
.topbar { min-width: 0; }
.topbar .finder-btn { min-width: 0; flex-shrink: 1; overflow: hidden; }
.topbar .finder-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Boards → "My boards" filter */
.my-boards-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; margin-left: 14px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--hover); color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; transition: all .15s; }
.my-boards-btn b { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--muted); }
.my-boards-btn:hover { border-color: var(--accent); }
.my-boards-btn.on { background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); border-color: transparent; color: #fff; box-shadow: 0 6px 20px -6px var(--glow); }
.my-boards-btn.on b { background: rgba(255,255,255,.22); color: #fff; }
.my-boards-note { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; font-size: 13px;
  background: rgba(var(--accent-rgb), .1); border: 1px solid rgba(var(--accent-rgb), .25); color: var(--text); }
.my-boards-note .linkish { margin-left: auto; font-size: 12.5px; }
@media (max-width: 760px) { .my-boards-btn { margin-left: 8px; height: 32px; padding: 0 10px; font-size: 13px; } }

/* custom roles */
.perm-roles-top { display: flex; align-items: center; margin-bottom: 4px; }
.perm-roles-top .perm-cap { margin-bottom: 0; }
.perm-roles-top .btn { height: 26px; padding: 0 9px; font-size: 12px; }
.perm-name { font-size: 20px; font-weight: 750; background: none; border: 1px solid transparent; border-radius: 8px; color: var(--text); padding: 4px 8px; margin-left: -8px; min-width: 0; flex: 1; max-width: 320px; }
.perm-name:hover, .perm-name:focus { border-color: var(--border); outline: none; background: var(--hover); }
.perm-swatches { display: flex; gap: 5px; }
.perm-swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.perm-swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel) inset; }
.perm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 10px; }
.perm-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 650; font-size: 13px; padding: 8px 10px; cursor: pointer; margin-bottom: -1px; }
.perm-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.perm-person { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.perm-person .btn { height: 28px; }
.badge.crole { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--rc) 18%, transparent); color: var(--text); }
.badge.crole i { width: 8px; height: 8px; border-radius: 50%; background: var(--rc); }
.perm-person .spacer, .perm-roles-top .spacer, .perm-head .spacer { flex: 1; }

/* Discord-style roles: extras */
.perm-grip { color: var(--faint); font-size: 11px; letter-spacing: -2px; cursor: grab; margin-right: -2px; }
.perm-role.dragging { opacity: .4; }
.perm-role.drop-to { box-shadow: inset 0 2px 0 var(--accent); }
.perm-n { display: inline-flex; align-items: center; gap: 3px; }
.perm-dot.lg { width: 16px; height: 16px; }
.perm-head h2 { margin: 0; }
.perm-tools { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; }
.perm-search { flex: 1; height: 34px; }
.perm-note-top { margin: 6px 0 4px; }
.perm-inh { display: block; font-style: normal; font-size: 11.5px; color: #4ade80; margin-top: 2px; }
.perm-row.changed .perm-txt b::after { content: ' • unsaved'; color: #f59e0b; font-weight: 600; font-size: 11px; }
.perm-color { width: 26px; height: 26px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.perm-swatches { flex-wrap: wrap; margin: 6px 0; }
.perm-swatch { width: 24px; height: 24px; }
.perm-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; cursor: pointer; }
.perm-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.perm-check small { display: block; color: var(--muted); font-size: 12.5px; }
.perm-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.perm-cap-row { display: flex; align-items: center; justify-content: space-between; }
.perm-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 10px; }
.perm-board { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; min-width: 0; }
.perm-board span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-board:hover { background: var(--hover); }
.perm-board.on { background: rgba(var(--accent-rgb), .1); }
.perm-board input { accent-color: var(--accent); }
.pp-who { display: flex; flex-direction: column; min-width: 0; }
.pp-who small { color: var(--muted); font-size: 11.5px; }
.pp-roles { display: flex; gap: 4px; flex-wrap: wrap; }
.perm-main { position: relative; }
.perm-savebar { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px 10px 16px; border-radius: 12px;
  background: #0b0f1a; border: 1px solid rgba(var(--accent-rgb), .4); box-shadow: 0 12px 30px rgba(0,0,0,.45); font-weight: 600; font-size: 13.5px; color: #fff; z-index: 5; }
.perm-savebar.shake { animation: permshake .4s; border-color: #ef4444; }
@keyframes permshake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.team-group { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 14px 0 4px; display: flex; align-items: center; gap: 6px; }
.team-group i { width: 8px; height: 8px; border-radius: 50%; }

.role-access { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.role-access-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 8px; margin-top: 6px; }
.user-row .pp-roles { margin-left: auto; justify-content: flex-end; }

.role-add { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 99px; border: 1px dashed var(--border-strong);
  background: none; color: var(--muted); font-size: 11.5px; font-weight: 650; cursor: pointer; }
.role-add:hover { color: var(--text); border-color: var(--accent); border-style: solid; }
.crole-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; font-size: 13px; line-height: 1; }
.crole-x:hover { color: #f87171; }
.pp-roles { align-items: center; }
.who-name { font-weight: 650; }

.perm-preview { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--hover); }
.perm-preview > div { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.owner-badge { font-weight: 700; }

/* Generate → Connect Google Gemini */
.gconnect { margin-bottom: 18px; padding: 18px 20px; border-color: rgba(var(--accent-rgb), .4); background: linear-gradient(135deg, rgba(var(--accent-rgb), .1), transparent 60%), var(--panel); }
.gc-head { display: flex; gap: 14px; align-items: flex-start; }
.gc-head h3 { margin: 0 0 4px; }
.gc-head p { margin: 0; }
.gc-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #4285f4, #9b72cb); color: #fff; flex: none; }
.gc-steps { margin: 12px 0 12px 4px; padding-left: 18px; color: var(--muted); font-size: 13.5px; line-height: 1.8; }
.gc-steps a { color: var(--accent-2); }
.gc-row { display: flex; gap: 8px; max-width: 620px; }
.gc-row .input { flex: 1; }

.gem-models { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tts-row.gem { grid-template-columns: minmax(260px, 1fr) 170px 104px 120px 80px 60px 80px; }

/* the Admin role (site admin only) */
.admin-badge { font-weight: 800; box-shadow: 0 0 0 1px rgba(245, 179, 1, .45) inset; }
.topbar .nav a.admin-link { color: #f5b301; }
.topbar .nav a.admin-link.active { background: rgba(245, 179, 1, .14); color: #fcd34d; }
.admin-note { border-color: rgba(245, 179, 1, .4); background: rgba(245, 179, 1, .08); }
.perm-sw.admin-sw.on { background: #f5b301; }

/* Generate dashboard: Styles / Videos / Jobs side by side */
.gen-crumb { color: inherit; text-decoration: none; }
.gen-crumb-sep { color: var(--muted); font-weight: 600; }
.gen-top { gap: 8px; }
.gtiles { margin-bottom: 14px; }
.gtiles .gtile { padding: 12px 14px; }
.gtiles .gt-value { font-size: 24px; }
.gcols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.gcol { padding: 12px; min-height: 200px; }
.gcol .gsec-head { margin-bottom: 8px; }
.gcol .gsec-head .linkish { font-size: 12px; text-decoration: none; }
.gmini-list { display: flex; flex-direction: column; gap: 2px; max-height: 520px; overflow-y: auto; }
.gmini { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 9px; text-decoration: none; color: inherit; min-width: 0; }
.gmini:hover { background: var(--hover); }
.gmini-cover { width: 40px; height: 40px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; font-size: 13px; background: var(--hover); }
.gmini-cover.tall { width: 32px; height: 52px; }
.gmini-main { flex: 1; min-width: 0; }
.gmini-main b { display: block; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gmini-main small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gnone.sm { padding: 18px 8px; }
.gnone.sm p { margin-bottom: 10px; }
@media (max-width: 1000px) { .gcols { grid-template-columns: 1fr; } }
/* Videos grid extras */
.gv-ph { display: grid; place-items: center; height: 100%; color: var(--muted); }
.gv-pill { position: absolute; left: 8px; top: 8px; }
.gv-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; }
/* one Short */
.short-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.short-head h2 { margin: 0 0 4px; }
.short-head .hint a { color: var(--accent-2); }
.short-progress { margin-bottom: 14px; }
.short-steps { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.short-step { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.short-step i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; background: var(--hover); }
.short-step.done { color: var(--text); } .short-step.done i { background: #16a34a; color: #fff; }
.short-step.now { color: var(--text); font-weight: 650; } .short-step.now i { background: var(--accent); color: #fff; animation: livepulse 1.4s infinite; }
.short-step.bad i { background: #dc2626; color: #fff; }
.short-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.short-body.has-video { grid-template-columns: 360px minmax(0, 1fr); align-items: start; }
.short-player video { width: 100%; aspect-ratio: 9 / 16; border-radius: 14px; background: #000; display: block; position: sticky; top: 12px; }
.short-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cast-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cast-card { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.cast-card small { color: var(--muted); font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cast-img { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--hover); }
.cast-img img, .scene-img img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: pixelated; }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.scene-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.scene-img { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--hover); }
.scene-ph { display: grid; place-items: center; height: 100%; color: var(--muted); font-weight: 700; }
.scene-time, .scene-motion { position: absolute; font-size: 10.5px; font-weight: 650; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; }
.scene-time { left: 6px; top: 6px; } .scene-motion { right: 6px; bottom: 6px; text-transform: capitalize; }
.scene-card.failed .scene-img { outline: 2px solid #ef4444; }
.scene-text b { display: block; font-size: 12px; font-weight: 600; line-height: 1.35; }
.scene-text small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.scene-redo { align-self: flex-start; height: 26px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@media (max-width: 900px) { .short-body.has-video { grid-template-columns: 1fr; } .short-player video { position: static; max-height: 70vh; } }
/* Make a Short wizard */
.ms-steps { display: flex; gap: 18px; margin: 4px 0 14px; }
.ms-step { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
.ms-step i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; background: var(--hover); }
.ms-step.on { color: var(--text); } .ms-step.on i { background: var(--accent); color: #fff; }
.ms-step.done i { background: #16a34a; color: #fff; }
.ms-main { min-height: 280px; }
.ms-src { margin: 0 0 10px; }
.ms-search { margin-bottom: 8px; }
.ms-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.ms-card { display: grid; grid-template-columns: 28px minmax(0, 1fr) 220px; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 1px solid var(--border); background: none; color: var(--text); text-align: left; cursor: pointer; }
.ms-card:hover, .ms-card.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.ms-card b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-card small { color: var(--muted); font-size: 11.5px; }
.ms-card audio { width: 220px; height: 32px; }
.ms-upload { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 10px; border: 2px dashed var(--border-strong); border-radius: 14px; color: var(--muted); }
.ms-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ms-style { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: none; color: var(--text); text-align: left; cursor: pointer; }
.ms-style .gmini-cover { width: 100%; height: 80px; }
.ms-style:hover, .ms-style.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.ms-style small { color: var(--muted); font-size: 11.5px; }
.ms-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.ms-summary > div { padding: 10px 12px; border-radius: 10px; background: var(--hover); }
.ms-summary small { display: block; color: var(--muted); font-size: 11.5px; }
.make-short-card { margin: 0 0 8px; }
@media (max-width: 700px) { .ms-card { grid-template-columns: 28px minmax(0, 1fr); } .ms-card audio { display: none; } }

.ms-drawers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ms-drawer { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: none; color: var(--text); text-align: left; cursor: pointer; }
.ms-drawer small { color: var(--muted); font-size: 11.5px; }
.ms-drawer.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.ms-drawer:disabled { opacity: .45; cursor: default; }

.key-test { min-height: 120px; }
.key-test-ok { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.key-test-img { max-width: 100%; max-height: 360px; border-radius: 10px; image-rendering: pixelated; display: block; }
.key-test-text { margin: 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--hover); border-radius: 8px; }

/* Generate fills the screen: full width, columns stretch to the bottom */
.gen-inner { max-width: none; }
.gcols { min-height: calc(100vh - 330px); }
.gcol { min-height: 100%; display: flex; flex-direction: column; }
.gcol .gmini-list { flex: 1; max-height: none; }
.gcol .gmini-cover { width: 48px; height: 48px; }
.gcol .gmini-cover.tall { width: 40px; height: 64px; }
.gcol .gmini { padding: 9px 8px; }
.gcol .gmini-main b { font-size: 14px; }
.gstyles { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.gvideos { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.gjobs .gjob { grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) 150px 160px 110px 80px 150px 80px; }
.gclaude { grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); }
.short-body.has-video { grid-template-columns: 420px minmax(0, 1fr); }
.scene-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* status-page line charts */
.lchart-wrap { width: 100%; }
.lchart { width: 100%; height: 190px; display: block; }
.lc-grid { stroke: var(--line); stroke-width: 1; }
.lc-ax { fill: var(--muted); font-size: 11px; }
.lc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-dot { stroke: var(--panel); stroke-width: 2; opacity: 0; }
.lc-dot:hover { opacity: 1; }
.lchart:hover .lc-dot { opacity: .9; }
.lc-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.lc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tts-row.img { grid-template-columns: minmax(260px, 1fr) 140px 104px 70px 90px; }
.key-active { margin-left: 4px; }

/* the bin only shows up while a board is being dragged: a floating drop zone at the top */
.bin-bar { position: fixed; left: 50%; top: 78px; transform: translate(-50%, -12px); z-index: 60; width: min(560px, 90vw); height: 54px; margin: 0;
  justify-content: center; border-radius: 14px; border: 2px dashed rgba(248, 113, 113, .6); background: rgba(40, 14, 14, .92);
  backdrop-filter: blur(8px); box-shadow: 0 14px 40px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.bin-bar .spacer, .bin-bar .bin-open { display: none; }
.bin-bar svg { width: 18px; height: 18px; }
.bin-bar b { font-size: 15px; }
body.dragging-channel .bin-bar { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.bin-bar.hot { background: rgba(127, 29, 29, .95); border-style: solid; }

.ms-model { margin-left: 0; align-self: flex-start; }

/* boards that make Shorts: a light green tint, and the Long-form / Shorts switch on the board */
.pipe-seg { margin-left: 6px; }
.pipe-seg button.on.shorts { background: rgba(74, 222, 128, .2); color: #86efac; }
.board.shorts-board .list { border-color: rgba(74, 222, 128, .45); box-shadow: 0 0 0 1px rgba(74, 222, 128, .12), 0 0 18px rgba(74, 222, 128, .14); }
.board.shorts-board .vcard { box-shadow: 0 0 0 1px rgba(74, 222, 128, .35), 0 0 10px rgba(74, 222, 128, .18); }

/* monetised (Phase 3) share of a views tile */
.k-mon { display: flex; align-items: center; gap: 5px; margin: 2px 0 4px; font-size: 12px; color: var(--muted); }
.k-mon b { color: var(--text); font-weight: 750; }
.k-mon-dot { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; font-size: 9.5px; font-weight: 800; color: #052e16; background: #4ade80; }

/* script prompts */
.sp-prompt { min-height: 280px; font-family: inherit; line-height: 1.45; resize: vertical; }

/* Script Prompt Assignment */
.spa .input { width: 100%; }
.spa-status { display: inline-block; padding: 5px 11px; border-radius: 6px; font-size: 13px; font-weight: 650; color: var(--muted); background: var(--hover); }
.spa-status.ok { color: #4ade80; background: rgba(74, 222, 128, .14); }
.spa-status.part { color: #fbbf24; background: rgba(251, 191, 36, .13); }
.spa-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--field, rgba(255,255,255,.02)); }
.spa-row.on { border-color: var(--border-strong, var(--border)); }
.spa-row > .muted { font-size: 12.5px; }
.spa-check { color: #4ade80; display: inline-flex; }
.spa-by { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.spa-list { max-height: 46vh; overflow-y: auto; }
.tpl-ed .input { width: 100%; }
.tpl-head { align-items: center; margin: 14px 0 8px; }
.tpl-prompt { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.tpl-bar { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.tpl-n { color: var(--muted); font-weight: 700; font-size: 13px; }
.tpl-keep { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.tpl-keep.on { color: #4ade80; }
.tpl-keep input { accent-color: #22c55e; }
.tpl-text { display: block; width: 100%; min-height: 150px; max-height: 50vh; resize: vertical; padding: 12px 14px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; line-height: 1.5; }
.tpl-foot { align-items: center; gap: 8px; margin-top: 6px; }
.spa-row .spacer, .tpl-bar .spacer, .tpl-head .spacer, .tpl-foot .spacer { flex: 1; }

/* Shorts are always green, so they're never mixed up with long-form */
.is-shorts { --shorts: 74, 222, 128; }
.spa-row.is-shorts, .spa-sec.is-shorts .spa-row { border-color: rgba(var(--shorts), .5); box-shadow: 0 0 14px rgba(var(--shorts), .16); }
.spa-sec { margin-top: 12px; }
.spa-sec.is-shorts { padding: 10px 12px 12px; border-radius: 12px; border: 1px solid rgba(var(--shorts), .4); background: rgba(var(--shorts), .05); box-shadow: 0 0 22px rgba(var(--shorts), .13); }
.spa-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.spa-none { margin-top: 8px; }
.spa-new { margin-top: 8px; }
.shorts-tag { font-size: 10.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: #86efac; background: rgba(74, 222, 128, .16); border-radius: 99px; padding: 2px 8px; }
.modal.is-shorts { border-color: rgba(74, 222, 128, .55); box-shadow: 0 0 0 1px rgba(74, 222, 128, .25), 0 0 40px rgba(74, 222, 128, .2), 0 20px 60px rgba(0,0,0,.5); }
.modal.is-shorts .tpl-prompt { border-color: rgba(74, 222, 128, .35); }
.tpl-kind button.on.shorts { background: rgba(74, 222, 128, .2); color: #86efac; }
.pipe-seg button.on.shorts { box-shadow: 0 0 12px rgba(74, 222, 128, .35); }

/* board labels: S = Shorts (green), B = backend product (yellow) */
.btags { display: inline-flex; gap: 3px; margin-left: 5px; vertical-align: 1px; white-space: nowrap; }
.btag { display: inline-grid; place-items: center; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 4px; font-size: 9.5px; font-weight: 800; line-height: 1; }
.btag.s { color: #052e16; background: #4ade80; }
.btag.b { color: #3b2a00; background: #facc15; }
.ch-title .btags { vertical-align: 4px; margin-left: 8px; }
.ch-title .btag { min-width: 20px; height: 20px; font-size: 12px; border-radius: 5px; }

/* topics in production: red 0-2, yellow 3-4, green 5+ */
.pill-count.topics.ok { color: #4ade80; background: rgba(74, 222, 128, .14); }
.pill-count.topics.low { color: #facc15; background: rgba(250, 204, 21, .14); }
.pill-count.topics.empty { color: #f87171; background: rgba(248, 113, 113, .14); }
.pill-count.topics .tp-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
/* 3-up lists: small titles, always shown in full (no "…") */
.cards .vcard .title { font-size: 8.5px; line-height: 1.2; padding-right: 8px; overflow-wrap: break-word; }

/* ---------- Automation whiteboard ---------- */
.auto-page { max-width: none; }
.auto-head h1 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.auto-head .hint { margin: 0 0 16px; max-width: 900px; }
.auto-board { display: flex; flex-direction: column; gap: 16px; padding: 18px; border-radius: 16px; border: 1px solid var(--border);
  background: radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1.2px) 0 0 / 22px 22px, var(--bg); overflow-x: auto; }
.ap-lane { display: flex; gap: 16px; align-items: stretch; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); min-width: max-content; }
.ap-lane.is-shorts { border-color: rgba(74, 222, 128, .45); box-shadow: 0 0 0 1px rgba(74, 222, 128, .1), 0 0 26px rgba(74, 222, 128, .12); }
.ap-lane-head { display: flex; align-items: flex-start; gap: 9px; width: 170px; flex: none; }
.ap-lane-head small { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.ap-board { cursor: pointer; font-size: 13.5px; line-height: 1.3; }
.ap-board:hover { text-decoration: underline; }
.ap-flow { display: flex; align-items: stretch; }
.ap-node { width: 230px; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--hover); }
.ap-node.auto { border-color: rgba(var(--accent-rgb), .55); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .15); }
.ap-lane.is-shorts .ap-node.auto { border-color: rgba(74, 222, 128, .55); }
.ap-node-head { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.ap-ic { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--card); color: var(--accent-2); }
.ap-auto { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 750; text-transform: uppercase; color: #4ade80; background: rgba(74, 222, 128, .14); padding: 2px 7px; border-radius: 99px; }
.ap-manual { margin-left: auto; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); background: var(--card); padding: 2px 7px; border-radius: 99px; }
.ap-list { font-size: 11px; color: var(--muted); }
.ap-list.warn { color: #fbbf24; }
.ap-cfg { text-align: left; font-size: 12px; padding: 6px 8px; border-radius: 8px; border: 1px dashed var(--border); background: var(--card); color: var(--text); cursor: pointer; }
.ap-cfg:hover { border-color: var(--accent-2); }
.ap-cfg.missing { color: #fbbf24; border-color: rgba(251, 191, 36, .5); }
.ap-cfg.static { cursor: default; border-style: solid; color: var(--muted); }
.ap-cards { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; }
.ap-empty { font-size: 11.5px; color: var(--faint, var(--muted)); padding: 6px 2px; }
.ap-card { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 5px 7px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); text-align: left; cursor: pointer; }
.ap-card:hover { border-color: var(--accent-2); }
.ap-card img { width: 34px; height: 20px; object-fit: cover; border-radius: 4px; flex: none; }
.ap-t { flex: 1; min-width: 0; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-st { flex: none; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; color: var(--muted); background: var(--hover); white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.ap-st.ok { color: #4ade80; background: rgba(74, 222, 128, .14); }
.ap-st.run { color: var(--accent-2); background: rgba(var(--accent-rgb), .15); animation: vpulse 1.4s ease-in-out infinite; }
.ap-st.warn { color: #fbbf24; background: rgba(251, 191, 36, .13); }
.ap-st.bad { color: #f87171; background: rgba(248, 113, 113, .13); }
.ap-arrow { width: 30px; flex: none; display: flex; align-items: center; }
.ap-arrow i { position: relative; display: block; width: 100%; height: 2px; background: var(--border-strong, var(--border)); }
.ap-arrow i::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--border-strong, var(--border)); border-right: 0; }
.ap-lane.is-shorts .ap-arrow i { background: rgba(74, 222, 128, .5); }
.ap-lane.is-shorts .ap-arrow i::after { border-left-color: rgba(74, 222, 128, .5); }

/* finished steps on cards: solid green pills */
.done-chip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 99px; font-size: 9px; font-weight: 750; color: #052e16; background: #4ade80; white-space: nowrap; }
.done-chip b { font-weight: 900; }
.vcard .foot { flex-wrap: wrap; row-gap: 3px; }
.vs-cover { width: 26px; height: 40px; object-fit: cover; border-radius: 5px; flex: none; }
.ap-card-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ap-by { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-by b { color: var(--text); font-weight: 650; }
.ap-by .avatar { width: 14px; height: 14px; font-size: 7px; }

/* vertical videos (Shorts) in the card: the whole 9:16 frame */
.mz.vertical { aspect-ratio: 9 / 16; height: min(480px, 62vh); width: auto; max-width: 100%; margin: 0 auto; }
.mz.vertical video { object-fit: contain; }

/* card window: pipeline strip */
.cm-strip { display: flex; align-items: center; gap: 0; padding: 8px 18px 10px; border-bottom: 1px solid var(--border); }
.cm-step { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 99px; border: 1px solid var(--border); background: var(--hover); color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cm-step-ic { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--card); font-size: 11px; font-weight: 800; }
.cm-step.done { color: #4ade80; border-color: rgba(74, 222, 128, .45); background: rgba(74, 222, 128, .1); }
.cm-step.done .cm-step-ic { background: #4ade80; color: #052e16; }
.cm-step.busy { color: var(--accent-2); border-color: rgba(var(--accent-rgb), .5); animation: vpulse 1.4s ease-in-out infinite; }
.cm-step.bad { color: #f87171; border-color: rgba(248, 113, 113, .5); background: rgba(248, 113, 113, .08); }
.cm-step.bad .cm-step-ic { background: #f87171; color: #2a0505; }
.cm-step-line { width: 26px; height: 2px; background: var(--border); }
.cm-step-line.done { background: rgba(74, 222, 128, .6); }
.cm-strip .spacer { flex: 1; }
.cm-warn { margin: 0; padding: 8px 18px; font-size: 12.5px; line-height: 1.4; color: #fde68a; background: rgba(234,179,8,.12); border-bottom: 1px solid rgba(234,179,8,.35); }
.cm-warn b { color: #facc15; }
/* activity: things the automation did */
.auto-av { display: inline-grid !important; place-items: center; background: #16a34a !important; color: #fff; }
.act.bad-act > div { color: #fca5a5; }
/* an empty thumbnail box takes little room when the card already has its video */
.compact-zone .mz:not(.has) { aspect-ratio: auto; min-height: 64px; }
.compact-zone .mz:not(.has) .mz-ic { display: none; }

/* hover sub-menus (Move ▸) */
.menu.submenu { max-height: 70vh; overflow-y: auto; min-width: 210px; }
.menu .has-sub .mi-chev { margin-left: auto; }

/* views graph: the monetised (Phase 3) line */
.hg-mon { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; font-size: 13px; color: var(--muted); }
.hg-mon b { color: #4ade80; font-size: 17px; font-weight: 800; }
.chart-tip .tip-mon { color: #4ade80; font-weight: 700; }

/* board language: a tint on the board card and a tag (EN blue, DE gold, FR violet, PL red) */
.ch-card.lang-en { background: linear-gradient(180deg, rgba(59,130,246,.16), rgba(59,130,246,.05)), var(--card); border-color: rgba(59,130,246,.38); }
.ch-card.lang-de { background: linear-gradient(180deg, rgba(234,179,8,.16), rgba(234,179,8,.05)), var(--card); border-color: rgba(234,179,8,.38); }
.ch-card.lang-fr { background: linear-gradient(180deg, rgba(139,92,246,.18), rgba(139,92,246,.05)), var(--card); border-color: rgba(139,92,246,.4); }
.ch-card.lang-pl { background: linear-gradient(180deg, rgba(239,68,68,.16), rgba(239,68,68,.05)), var(--card); border-color: rgba(239,68,68,.38); }
.btag.lang { font-size: 8.5px; letter-spacing: .02em; }
.btag.lang.en { color: #fff; background: #3b82f6; }
.btag.lang.de { color: #2a1f00; background: #eab308; }
.btag.lang.fr { color: #fff; background: #8b5cf6; }
.btag.lang.pl { color: #fff; background: #ef4444; }

/* the site admin's own row: a reminder that nobody else sees them */
.hidden-pill { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700;
  color: var(--muted); background: var(--hover); border: 1px dashed var(--border-strong, var(--border)); vertical-align: 2px; }

/* upload due today: a quiet label next to the schedule badge */
.badge.upload-today { color: #ff7a45; background: rgba(239,68,68,.12); border: 1px solid rgba(249,115,22,.45); font-size: 8px; font-weight: 800;
  letter-spacing: .05em; line-height: 1.2; padding: 1px 5px; white-space: nowrap; }
html[data-skin="paper"] .badge.upload-today { color: #c2410c; }
.ch-meta .badge.uploads, .ch-meta .badge.upload-today { flex: none; }
.ch-title .badge.upload-today { margin-left: 8px; vertical-align: 4px; font-size: 9.5px; padding: 2px 6px; }
/* a small amber "!" next to a board name: unread chat messages */
.chat-unread { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 5px; border-radius: 50%; vertical-align: 1px;
  font-size: 10.5px; font-weight: 900; line-height: 1; color: #1a1400; background: #f59e0b; cursor: help; }
.chat-unread.big { width: 18px; height: 18px; font-size: 12px; margin-left: 8px; vertical-align: 3px; }

/* Discord-style quick switcher */
.modal.finder-modal { width: min(660px, calc(100vw - 32px)); border-radius: 12px; }
.finder-top { padding: 16px 16px 8px; border-bottom: 0; }
.finder-input { font-size: 20px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 9px; background: var(--sunken); }
.finder-input:focus { border-color: rgba(var(--accent-rgb), .6); }
.finder-list { padding: 4px 12px 10px; }
.finder-group { font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--muted); padding: 12px 10px 6px; }
.finder-item { padding: 8px 10px; font-size: 15px; }
.finder-item b { font-weight: 650; }
.finder-label small { font-size: 12.5px; }
.finder-right { flex: none; color: var(--muted); font-size: 13px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder-foot { gap: 4px; flex-wrap: wrap; align-items: center; padding: 10px 16px 12px; font-size: 12.5px; color: var(--muted); border-top: 0; }
.finder-foot > b { color: #4ade80; }
.finder-pre { cursor: pointer; font-weight: 700; }
.finder-pre:hover { color: var(--text); }

.chat-unread { margin-right: 2px; }
.chat-unread:hover { filter: brightness(1.15); }

/* ---------- board chat, styled after a Discord text channel ---------- */
body.chat-open .main { margin-right: 420px; }
.chat-panel { position: fixed; top: 88px; right: 0; bottom: 0; width: 420px; z-index: 40; display: flex; flex-direction: column;
  background: #313338; color: #dbdee1; border-left: 1px solid #1f2023; font-size: 15px; }
.chat-panel.drop::after { content: 'Drop to upload'; position: absolute; inset: 8px; display: grid; place-items: center; border: 2px dashed #5865f2;
  border-radius: 10px; background: rgba(49,51,56,.92); color: #fff; font-weight: 700; font-size: 17px; }
.chat-top { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px 0 16px; border-bottom: 1px solid #1f2023; box-shadow: 0 1px 0 rgba(0,0,0,.2); flex: none; }
.chat-top-hash { font-size: 22px; color: #80848e; font-weight: 500; }
.chat-top .chat-name { color: #f2f3f5; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-top .icon-btn { color: #b5bac1; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 0 0 18px; overscroll-behavior: contain; }
.chat-scroll::-webkit-scrollbar { width: 8px; } .chat-scroll::-webkit-scrollbar-thumb { background: #1a1b1e; border-radius: 4px; }
.chat-welcome { padding: 40px 16px 8px; }
.chat-hash { width: 68px; height: 68px; border-radius: 50%; background: #41434a; display: grid; place-items: center; font-size: 42px; color: #fff; margin-bottom: 8px; }
.chat-welcome h2 { font-size: 26px; color: #f2f3f5; margin: 8px 0; line-height: 1.2; }
.chat-welcome p { color: #b5bac1; margin: 0; font-size: 14.5px; }
.chat-older { display: block; margin: 12px auto; background: #2b2d31; color: #b5bac1; border: 0; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.chat-day { display: flex; align-items: center; margin: 22px 16px 6px; height: 0; border-top: 1px solid #3f4147; justify-content: center; }
.chat-day span { background: #313338; padding: 0 6px; font-size: 12px; font-weight: 600; color: #949ba4; margin-top: -1px; transform: translateY(-50%); }
.chat-new { position: relative; margin: 14px 16px 2px; border-top: 1px solid #f23f43; height: 0; }
.chat-new span { position: absolute; right: 0; top: -9px; background: #f23f43; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 4px 1px 6px; border-radius: 0 4px 4px 0; line-height: 14px; }
.chat-msg { position: relative; padding: 2px 48px 2px 16px; margin-top: 17px; }
.chat-msg.grouped { margin-top: 0; }
.chat-msg:hover { background: #2e3035; }
.chat-msg.mentioned { background: rgba(250,168,26,.1); box-shadow: inset 2px 0 0 #f0b232; }
.chat-msg.mentioned:hover { background: rgba(250,168,26,.08); }
.chat-row { display: flex; gap: 16px; align-items: flex-start; }
.chat-av { width: 40px; height: 40px; flex: none; font-size: 15px; margin-top: 2px; cursor: default; }
.chat-gutter { width: 40px; flex: none; text-align: right; font-size: 10.5px; color: #949ba4; padding-top: 4px; visibility: hidden; white-space: nowrap; }
.chat-msg:hover .chat-gutter { visibility: visible; }
.chat-main { min-width: 0; flex: 1; }
.chat-head { display: flex; align-items: baseline; gap: 8px; line-height: 22px; }
.chat-head b { font-weight: 600; color: #f2f3f5; font-size: 15.5px; }
.chat-head small { color: #949ba4; font-size: 12px; }
.chat-body { line-height: 1.375; white-space: pre-wrap; overflow-wrap: anywhere; color: #dbdee1; }
.chat-body a, .chat-reply a { color: #00a8fc; text-decoration: none; } .chat-body a:hover { text-decoration: underline; }
.chat-body code { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 4px; padding: 0 3px; font-size: 13px; }
.chat-edited { color: #949ba4; font-size: 10px; }
.chat-mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; border: 0; font: inherit; }
.chat-mention.card { cursor: pointer; display: inline-flex; align-items: center; gap: 3px; vertical-align: baseline; }
.chat-mention:hover { background: #5865f2; color: #fff; }
.chat-mention.me { background: rgba(250,168,26,.25); color: #f0b232; }
.chat-reply { display: flex; align-items: center; gap: 5px; margin: 0 0 3px 56px; font-size: 13.5px; color: #b5bac1; min-width: 0; position: relative; white-space: nowrap; overflow: hidden; }
.chat-reply::before { content: ''; position: absolute; left: -36px; top: 50%; width: 30px; height: 12px; border: 2px solid #4e5058; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.chat-reply .avatar { width: 16px; height: 16px; font-size: 8px; flex: none; }
.chat-reply b { font-weight: 600; flex: none; }
.chat-reply span { overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.chat-reply .chat-mention { padding: 0 1px; }
.chat-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chat-img img { display: block; max-width: min(100%, 340px); max-height: 300px; border-radius: 8px; cursor: zoom-in; }
.chat-vid { max-width: 100%; max-height: 300px; border-radius: 8px; }
.chat-file { display: inline-flex; gap: 8px; align-items: center; background: #2b2d31; border: 1px solid #1e1f22; border-radius: 8px; padding: 10px 12px; color: #00a8fc; }
.chat-embeds { display: grid; gap: 6px; margin-top: 6px; }
.chat-embed { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; text-align: left; max-width: 360px; padding: 10px 12px;
  background: #2b2d31; border: 0; border-left: 4px solid #5865f2; border-radius: 4px; color: #dbdee1; cursor: pointer; font: inherit; }
.chat-embed:hover { background: #26272b; }
.chat-embed div { display: grid; gap: 3px; min-width: 0; }
.chat-embed small { color: #b5bac1; font-size: 12px; }
.chat-embed b { color: #00a8fc; font-size: 14.5px; }
.chat-embed span { color: #949ba4; font-size: 12px; }
.chat-embed img, .chat-embed video { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; flex: none; }
.chat-tools { position: absolute; right: 14px; top: -16px; display: none; background: #313338; border: 1px solid #26272b; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.chat-msg:hover .chat-tools { display: flex; }
.chat-tools button { width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 0; color: #b5bac1; cursor: pointer; border-radius: 4px; }
.chat-tools button:hover { background: #3a3c42; color: #dbdee1; }
.chat-tools button.danger:hover { color: #f23f43; }
.chat-edit { width: 100%; resize: none; background: #383a40; color: #dbdee1; border: 0; border-radius: 8px; padding: 10px 14px; font: inherit; line-height: 1.375; outline: 0; margin-top: 4px; }
.chat-edit-hint { font-size: 12px; color: #b5bac1; margin: 4px 0; } .chat-edit-hint a { color: #00a8fc; cursor: pointer; }
.chat-compose { position: relative; padding: 0 16px 20px; flex: none; }
.chat-replybar { display: flex; align-items: center; justify-content: space-between; background: #2b2d31; border-radius: 8px 8px 0 0; padding: 8px 12px; font-size: 13.5px; color: #b5bac1; }
.chat-replybar button { background: none; border: 0; color: #b5bac1; cursor: pointer; display: grid; }
.chat-pending { display: flex; gap: 10px; overflow-x: auto; background: #383a40; padding: 12px; border-radius: 8px 8px 0 0; border-bottom: 1px solid #2e3035; }
.chat-replybar:not([hidden]) + .chat-pending { border-radius: 0; }
.chat-pfile { position: relative; flex: none; width: 120px; background: #2b2d31; border-radius: 6px; padding: 8px; display: grid; gap: 6px; }
.chat-pfile img, .chat-pfile-ic { width: 104px; height: 80px; object-fit: cover; border-radius: 4px; display: grid; place-items: center; color: #b5bac1; background: #1e1f22; }
.chat-pfile small { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pfile button { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 6px; background: #313338; border: 1px solid #1e1f22; color: #f23f43; cursor: pointer; display: grid; place-items: center; }
.chat-box { display: flex; align-items: flex-start; gap: 4px; background: #383a40; border-radius: 8px; padding: 0 12px 0 6px; }
.chat-replybar:not([hidden]) ~ .chat-box, .chat-pending:not([hidden]) ~ .chat-box { border-radius: 0 0 8px 8px; }
.chat-plus { flex: none; margin: 9px 4px 0 2px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #b5bac1; color: #383a40; display: grid; place-items: center; cursor: pointer; }
.chat-plus:hover { background: #dbdee1; }
.chat-input { flex: 1; resize: none; background: none; border: 0; outline: 0; color: #dbdee1; font: inherit; line-height: 1.375; padding: 11px 6px; max-height: 220px; min-height: 44px; }
.chat-input::placeholder { color: #6d6f78; }
.chat-pick { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 12px); background: #2b2d31; border-radius: 8px; padding: 8px 0; box-shadow: 0 8px 16px rgba(0,0,0,.3); max-height: 320px; overflow-y: auto; }
.chat-pick-head { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #b5bac1; padding: 4px 12px 8px; letter-spacing: .02em; }
.chat-pick button { display: flex; align-items: center; gap: 10px; width: calc(100% - 16px); margin: 0 8px; padding: 6px 8px; border: 0; border-radius: 4px; background: none; color: #dbdee1; cursor: pointer; text-align: left; font: inherit; font-size: 14.5px; }
.chat-pick button.on { background: #404249; }
.chat-pick button b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pick button small { margin-left: auto; color: #949ba4; font-size: 12px; flex: none; }
.chat-pick img, .chat-pick-ic { width: 40px; height: 22.5px; object-fit: cover; border-radius: 3px; flex: none; display: grid; place-items: center; background: #1e1f22; color: #b5bac1; }
.chat-pick .avatar { width: 24px; height: 24px; font-size: 10px; flex: none; }
.chat-toggle { position: relative; }
.chat-toggle.on { border-color: #5865f2; color: #c9cdfb; }
.chat-count { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #f23f43; color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; margin-left: 2px; }
@media (max-width: 900px) { body.chat-open .main { margin-right: 0; } .chat-panel { width: 100%; top: 52px; z-index: 60; } }
.chat-panel [hidden], .chat-panel[hidden] { display: none !important; }

/* hover the right edge of the screen to peek at a panel (board chat, Home channel analytics) */
.peek-edge { position: fixed; top: 88px; right: 0; bottom: 0; width: 14px; z-index: 39; display: flex; align-items: center; justify-content: flex-end; }
.peek-edge[hidden] { display: none; }
.peek-edge.ana-edge { top: 52px; }
.peek-edge span { width: 5px; height: 64px; border-radius: 4px 0 0 4px; background: rgba(88,101,242,.35); display: grid; place-items: center; color: transparent; overflow: hidden;
  transition: width .18s ease, background .18s ease, color .18s ease; }
.peek-edge:hover span { width: 14px; background: #5865f2; color: #fff; }
.peek-edge.unread span { background: #f59e0b; }
.peekable { transform: translateX(calc(100% + 24px)); pointer-events: none; box-shadow: none;
  transition: transform .28s cubic-bezier(.22,1,.36,1), box-shadow .28s ease, visibility 0s linear .28s; visibility: hidden; }
.peekable.peeking { transform: none; pointer-events: auto; visibility: visible; box-shadow: -16px 0 40px rgba(0,0,0,.45);
  transition: transform .28s cubic-bezier(.22,1,.36,1), box-shadow .28s ease, visibility 0s; }
.chat-panel:not(.peekable) .chat-pin { display: none; }
.ana.ana-peek { position: fixed; top: 52px; right: 0; bottom: 0; width: clamp(330px, 28vw, 470px); z-index: 45; }
@media (prefers-reduced-motion: reduce) { .peekable, .peekable.peeking { transition: none; } }
/* chat pings: Discord-style pop-ups in the corner */
#pings { position: fixed; right: 16px; bottom: 16px; z-index: 9000; display: grid; gap: 8px; width: 340px; }
body.chat-open #pings { right: 436px; }
.ping-pop { position: relative; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 30px 10px 12px; border-radius: 8px; border: 0;
  background: #111214; color: #dbdee1; box-shadow: 0 8px 24px rgba(0,0,0,.45); cursor: pointer; font: inherit; animation: ping-in .2s ease-out; border-left: 3px solid #f0b232; }
.ping-pop:hover { background: #1a1b1e; }
@keyframes ping-in { from { transform: translateY(10px); opacity: 0; } }
.ping-av { width: 36px; height: 36px; flex: none; font-size: 13px; }
.ping-head { font-size: 13px; color: #b5bac1; } .ping-head b { color: #f2f3f5; }
.ping-text { font-size: 14px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ping-x { position: absolute; top: 6px; right: 6px; color: #80848e; display: grid; }
.ping-x:hover { color: #fff; }

/* board tiles: a white outline when its chat has unread messages, a red number when someone pinged you there */
.ch-card.chat-new-msgs { box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.chat-ping { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin-left: 5px; margin-right: 2px; border-radius: 9px; vertical-align: 1px;
  background: #f23f43; color: #fff; font-size: 11px; font-weight: 800; line-height: 1; box-shadow: 0 0 0 2px #fff; cursor: pointer; }

/* ---------- Home on phones: compact header, tidy stat tiles, channel list ---------- */
.mch-list { display: grid; }
.mch-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.mch-row:first-child { border-top: 0; }
.mch-row:active { background: var(--hover); }
.mch-name { flex: 1; min-width: 0; display: grid; }
.mch-name b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mch-name small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mch-num { display: grid; justify-items: end; flex: none; font-size: 15px; font-weight: 700; }
.mch-num > :first-child { color: #4ade80; }
.mch-num small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.mch-more { margin-top: 6px; width: 100%; padding: 9px; border-radius: 9px; border: 1px solid var(--border); background: var(--hover); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; }
@media (max-width: 760px) {
  .home { padding: 10px 12px 24px; }
  .home .hero { padding: 16px 16px 14px; gap: 10px; border-radius: 16px; }
  .home .hero .eyebrow { display: none; }
  .home .hero .team-name, .home .hero h1, .home .hero [contenteditable] { font-size: 26px !important; line-height: 1.1; margin: 0 0 10px; }
  .home .hero .you .avatar { width: 34px; height: 34px; font-size: 13px; }
  .home .hero .you-name { font-size: 16px; }
  .home .hero .greeting { font-size: 12.5px; }
  .home .hero-side { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
  .home .hero-date { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
  .home .hero-date b { font-size: 16px; }
  .home .skin-btn { padding: 6px 12px; font-size: 12.5px; }
  .home .kpis { gap: 8px; }
  .home .kpi { padding: 12px 12px 11px; border-radius: 14px; min-width: 0; }
  .home .k-label { font-size: 9.5px; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .home .k-value { font-size: 28px; margin: 6px 0 2px; }
  .home .k-mon, .home .k-sub { font-size: 11px; line-height: 1.35; }
  .home .kpis > .kpi:nth-child(5):last-child { grid-column: 1 / -1; }
  .home .tile { padding: 14px; border-radius: 14px; }
  .home #skins { display: none; } /* the Skin button in the header opens the same gallery */
  .home .hg-x span { font-size: 10px; }
}

/* Generate → videos: when each Short was last updated */
.gv-upd { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600;
  color: var(--muted); background: var(--hover); white-space: nowrap; }
.gv-upd.live { color: var(--accent-2, var(--accent)); background: rgba(var(--accent-rgb), .14); }

/* Generate on phones: columns never grow wider than the screen (long titles get "…" instead) */
.gcols > * { min-width: 0; }
.gmini-upd.live { color: var(--accent-2, var(--accent)); }
@media (max-width: 760px) { .gcols { grid-template-columns: minmax(0, 1fr) !important; } }

/* the film badge on Video Generation lists */
.auto-badge.video { gap: 1px; }
.auto-badge.warn { color: #fbbf24; background: rgba(245,158,11,.14); }

/* Backend → Recent generations */
.rg { padding: 0; overflow-x: auto; }
.rg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rg-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.rg-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rg-kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.rg-card a { display: grid; text-decoration: none; color: inherit; min-width: 0; }
.rg-card b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.rg-card small, .rg-when small, .rg-who small { color: var(--muted); font-size: 11.5px; }
.rg-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rg-who small { display: inline-flex; align-items: center; gap: 4px; }
.rg-auto { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--accent-2, var(--accent)); }
.rg-when { white-space: nowrap; color: var(--muted); }

/* Automation on phones: each board's steps stacked top to bottom, arrows pointing down */
@media (max-width: 760px) {
  .ap-lane { flex-direction: column; min-width: 0; padding: 12px; gap: 10px; }
  .ap-lane-head { width: auto; }
  .ap-flow { flex-direction: column; }
  .ap-node { width: auto; }
  .ap-arrow { width: auto; height: 22px; justify-content: center; }
  .ap-arrow i { width: 2px; height: 100%; }
  .ap-arrow i::after { right: -4px; top: auto; bottom: -1px; border: 5px solid transparent; border-top: 7px solid var(--border-strong, var(--border)); border-bottom: 0; }
  .ap-lane.is-shorts .ap-arrow i::after { border-top-color: rgba(74, 222, 128, .5); border-left-color: transparent; }
  .ap-cards { max-height: none; }
  .ap-st { max-width: 150px; }
}
/* one column (phone / narrow): no "fill the screen" heights. A panel sized as 100% of its own row makes iPhone Safari keep
   re-growing the layout, so the page crept down by itself. Also: no scroll anchoring on the pages that live-refresh. */
@media (max-width: 1000px) {
  .gcols { min-height: 0; }
  .gcol { min-height: 0; }
  .gcol .gmini-list { flex: none; max-height: 420px; }
}
.page, .home, .home-main { overflow-anchor: none; }

/* Automation: a board's reference videos */
.ap-refs { margin-top: 10px; }
.ap-refs-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 5px; }
.ap-refs-row { display: flex; gap: 6px; }
.ap-ref { position: relative; width: 42px; height: 64px; border-radius: 6px; overflow: hidden; background: var(--hover); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 18px; text-decoration: none; cursor: pointer; padding: 0; }
.ap-ref img { width: 100%; height: 100%; object-fit: cover; }
.ap-ref.add { border-style: dashed; background: transparent; }
.ap-ref.add:hover { color: var(--text); border-color: var(--text); }
.ap-ref-x { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff;
  font-size: 12px; line-height: 16px; padding: 0; cursor: pointer; display: none; }
.ap-ref:hover .ap-ref-x { display: block; }

/* regenerate button on cards in automated lists (shows on hover; always on phones) */
.vcard .regen-btn { position: absolute; top: 6px; right: 34px; width: 24px; height: 24px; border-radius: 6px; border: 0; background: var(--hover);
  color: var(--muted); display: none; align-items: center; justify-content: center; cursor: pointer; padding: 0; z-index: 2; }
.vcard:hover .regen-btn { display: flex; }
.vcard .regen-btn:hover { color: var(--text); background: var(--border); }
@media (hover: none) { .vcard .regen-btn { display: flex; } }

/* "Use as reference" buttons on cards (show on hover; always on phones) */
.vcard .ref-btns { display: none; gap: 5px; flex-wrap: wrap; margin: 0 0 6px; }
.vcard:hover .ref-btns { display: flex; }
@media (hover: none) { .vcard .ref-btns { display: flex; } }
.ref-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 7px; border-radius: 6px; border: 1px dashed var(--border);
  background: transparent; color: var(--muted); cursor: pointer; }
.ref-btn:hover { color: var(--text); border-color: var(--text); }

/* Short / Long-form tag on everything Generate makes, and the Stop button on running jobs */
.fmt-tag { display: inline-block; padding: 1px 6px; margin-right: 6px; border-radius: 5px; font-size: 10px; font-weight: 750; letter-spacing: .04em;
  text-transform: uppercase; vertical-align: 1px; line-height: 1.5; }
.fmt-tag.short { background: rgba(239, 68, 68, .16); color: #f87171; }
.fmt-tag.long { background: rgba(59, 130, 246, .16); color: #60a5fa; }
h2 .fmt-tag { font-size: 11px; vertical-align: 4px; }
.gmini-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.gj-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stop-btn { gap: 4px; padding: 3px 9px; font-size: 11.5px; color: #f87171; border-color: rgba(248, 113, 113, .35); }
.stop-btn:hover { background: rgba(239, 68, 68, .14); color: #fca5a5; }
.fmt-seg { margin-left: 0; }
/* long-form storyboards: 16:9 pictures */
.scene-grid.wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.scene-grid.wide .scene-img { aspect-ratio: 16 / 9; }
.scene-grid.wide .scene-img img { image-rendering: auto; }
.style-chip { display: inline-flex; align-items: center; margin-left: 6px; }
.style-chip .fmt-tag { margin-right: 4px; font-size: 9px; }

/* Style page: deep breakdown (tabs, look & feel groups, named palette, scene types, build plan, guide) */
.sd-tabs { margin: 6px 0 14px; flex-wrap: wrap; }
.sd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sd-group h3, .sd-summary h3, .sd-avoid h3 { margin: 0 0 8px; font-size: 14px; }
.sd-group .ga-row { grid-template-columns: 130px minmax(0, 1fr); }
.sd-summary p { margin: 0; line-height: 1.6; font-size: 14.5px; }
.sd-pal { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 14px; }
.sd-sw { display: flex; gap: 10px; align-items: center; text-align: left; padding: 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: inherit; cursor: pointer; min-width: 0; }
.sd-sw i { width: 42px; height: 42px; border-radius: 8px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.sd-sw div { min-width: 0; }
.sd-sw b, .sd-sw small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-sw small { color: var(--muted); font-size: 11.5px; }
.sd-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sd-scene { padding: 0; overflow: hidden; }
.sd-scene-pics { display: flex; }
.sd-scene-pics img { flex: 1; min-width: 0; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.sd-scene-body { padding: 10px 12px; }
.sd-scene-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.sd-scene-body p { margin: 6px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sd-freq { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); }
.sd-freq.often { background: rgba(139, 92, 246, .18); color: #c4b5fd; }
.sd-freq.rare { opacity: .75; }
.sd-plan-wrap { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.sd-plan-row { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.sd-plan-row small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.sd-prio { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; height: max-content; background: rgba(59, 130, 246, .16); color: #93c5fd; }
.sd-prio.p1 { background: rgba(139, 92, 246, .2); color: #c4b5fd; }
.sd-avoid ul { margin: 0; padding-left: 18px; line-height: 1.6; color: var(--muted); }
.sd-guide { max-width: 900px; line-height: 1.65; }
.sd-guide h2 { margin-top: 0; font-size: 18px; }
.sd-guide h3 { margin: 18px 0 6px; font-size: 15px; }
.sd-guide p, .sd-guide li { color: var(--muted); }
@media (max-width: 760px) { .sd-grid, .sd-plan-wrap { grid-template-columns: 1fr; } .sd-group .ga-row { grid-template-columns: 1fr; } }
.sd-fonts { font-size: 16px !important; line-height: 1.3; }
.sd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.sd-fmt { display: inline-block; padding: 1px 8px; margin-right: 6px; border: 1px solid var(--border); border-radius: 999px; font-size: 11.5px; }
.job-timer { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #93c5fd; font-variant-numeric: tabular-nums; }
.job-timer b { font-weight: 650; }
.sd-rules { margin-bottom: 12px; border-color: rgba(139, 92, 246, .35); }
.sd-rules ol { margin: 0; padding-left: 20px; line-height: 1.65; }
.sd-scene-pics { position: relative; }
.sd-drawn { position: absolute; left: 8px; top: 8px; font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fde68a; }
/* Library tab */
.lib-log pre { max-height: 260px; overflow: auto; font-size: 11.5px; line-height: 1.5; color: var(--muted); white-space: pre-wrap; margin: 6px 0 0; }
.lib-log summary { cursor: pointer; }
.lib-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.lib-specimen { font-size: 26px; margin-top: 6px; line-height: 1.2; }
.lib-treats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.lib-treat small { display: block; margin-top: 6px; line-height: 1.45; }
.lib-chip { display: inline-block; padding: 4px 10px; border: 2px solid; border-radius: 6px; font-size: 15px; text-transform: uppercase; }
.lib-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.lib-tpl { padding: 0; overflow: hidden; }
.lib-tpl.failed { opacity: .7; }
.lib-strip { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.lib-strip img { display: block; width: 100%; }
.lib-strip.ph { display: grid; place-items: center; min-height: 90px; color: var(--muted); font-size: 12px; padding: 10px; cursor: default; }
.lib-play { position: absolute; right: 10px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; border-radius: 999px; width: 30px; height: 30px; display: grid; place-items: center; font-size: 12px; }
.lib-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
@media (max-width: 760px) { .lib-tpls { grid-template-columns: 1fr; } }
/* board reference videos */
.bref-list { display: flex; flex-direction: column; gap: 10px; }
.bref { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; align-items: flex-start; }
.bref.first { border-color: rgba(236, 192, 92, .55); background: rgba(236, 192, 92, .06); }
.bref img { width: 168px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: block; }
.bref-main { min-width: 0; flex: 1; }
.bref-main b { display: block; }
@media (max-width: 600px) { .bref { flex-direction: column; } .bref img { width: 100%; } }
.bref-add { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.bref-add .input { flex: 1; min-width: 220px; }
.bref-main b .fmt-tag { vertical-align: 2px; }
