/* ==========================================================================
   Smarty Pants — design system
   Direction (Mobbin references): Linear / AirOps app frame (sidebar flush on a soft
   canvas, pages in one inset panel), Frame.io review stage, Trello board for
   Workflow. One token set drives light and dark.
   ========================================================================== */

:root {
  color-scheme: light;
  --canvas: #f4f4f2;
  --bg: #f7f7f5;          /* subtle fill inside panels (inputs, hovers, wells) */
  --panel: #ffffff;
  --panel-2: #fbfbfa;
  --hover: #efefec;
  --active: #e9e9e6;
  --border: #e6e6e2;
  --border-strong: #d6d6d1;
  --text: #1c1c1a;
  --text-dim: #62625d;
  --text-muted: #9a9a93;
  --accent: #1d8fd6;
  --accent-ink: #0f6fae;
  --accent-soft: #e8f3fb;
  --focus: color-mix(in srgb, var(--accent) 28%, transparent);
  --sidebar-w: 236px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-xs: 0 1px 2px rgba(20, 20, 18, 0.05);
  --shadow: 0 1px 2px rgba(20, 20, 18, 0.04), 0 2px 8px rgba(20, 20, 18, 0.04);
  --shadow-lg: 0 12px 32px rgba(20, 20, 18, 0.14), 0 2px 6px rgba(20, 20, 18, 0.06);
  --overlay: rgba(18, 18, 16, 0.42);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-brand: var(--font);
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  /* brand */
  --brand-yellow: #ffc72c;
  --brand-yellow-dark: #c98f00;
  --brand-blue: var(--accent);
  --brand-blue-dark: var(--accent-ink);

  /* status */
  --good: #16a34a;
  --good-soft: #e9f7ee;
  --warn: #c27803;
  --warn-soft: #fdf4e3;
  --critical: #d93636;
  --critical-soft: #fdecec;

  /* charts */
  --grid: #ececE8;
  --baseline: #cfcfc9;
  --seq-450: #1d8fd6;
  --seq-300: #6fb6e6;
  --seq-150: #c1e0f5;
  --chart-pants: #d9a400;
  --chart-world: #8e5bb0;
  --chart-smartys: #2d2f33;
  --badge-pants: #f1c40f;
  --badge-world: #9b59b6;
  --badge-smartys: #2d2f33;
  --tooltip-bg: #1c1c1a;
  --tooltip-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0e0e0f;
    --bg: #1a1a1c;
    --panel: #151516;
    --panel-2: #19191b;
    --hover: #222225;
    --active: #2a2a2e;
    --border: #262629;
    --border-strong: #34343a;
    --text: #ededeb;
    --text-dim: #a3a39d;
    --text-muted: #6f6f6a;
    --accent: #3aa6ec;
    --accent-ink: #7cc4f2;
    --accent-soft: #14283a;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
    --overlay: rgba(0, 0, 0, 0.6);
    --good: #3ecf73;
    --good-soft: #10261a;
    --warn: #f2b33d;
    --warn-soft: #2b2212;
    --critical: #ff6b6b;
    --critical-soft: #2e1515;
    --grid: #26262a;
    --baseline: #3a3a40;
    --seq-450: #4fb0ee;
    --seq-300: #2f7fb8;
    --seq-150: #1a3a55;
    --chart-pants: #f1c40f;
    --chart-world: #c08ee0;
    --chart-smartys: #c9cdd3;
    --tooltip-bg: #ededeb;
    --tooltip-text: #151516;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0e0e0f;
  --bg: #1a1a1c;
  --panel: #151516;
  --panel-2: #19191b;
  --hover: #222225;
  --active: #2a2a2e;
  --border: #262629;
  --border-strong: #34343a;
  --text: #ededeb;
  --text-dim: #a3a39d;
  --text-muted: #6f6f6a;
  --accent: #3aa6ec;
  --accent-ink: #7cc4f2;
  --accent-soft: #14283a;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --overlay: rgba(0, 0, 0, 0.6);
  --good: #3ecf73;
  --good-soft: #10261a;
  --warn: #f2b33d;
  --warn-soft: #2b2212;
  --critical: #ff6b6b;
  --critical-soft: #2e1515;
  --grid: #26262a;
  --baseline: #3a3a40;
  --seq-450: #4fb0ee;
  --seq-300: #2f7fb8;
  --seq-150: #1a3a55;
  --chart-pants: #f1c40f;
  --chart-world: #c08ee0;
  --chart-smartys: #c9cdd3;
  --tooltip-bg: #ededeb;
  --tooltip-text: #151516;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}
button, input, select, textarea { font-family: inherit; }
a { color: var(--accent-ink); }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
#app { min-height: 100vh; }

svg.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.card-fallback-icon { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }

/* ---------------------------------------------------------------- Shell */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--canvas);
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  transition: width 0.2s ease, padding 0.2s ease, opacity 0.15s ease;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 0;
}
.sidebar .brand:hover { background: var(--hover); }
.sidebar .brand img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; }

.nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 -4px;
  padding: 0 4px;
  scrollbar-width: thin;
}
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.1s ease, color 0.1s ease;
}
.sidebar .nav-item svg.icon { color: var(--text-muted); transition: color 0.1s ease; }
.sidebar .nav-item:hover { background: var(--hover); color: var(--text); }
.sidebar .nav-item:hover svg.icon { color: var(--text-dim); }
.sidebar .nav-item.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.sidebar .nav-item.active svg.icon { color: var(--accent); }
.nav-search { justify-content: space-between; margin-bottom: 6px; }
.nav-search-left { display: flex; align-items: center; gap: 9px; }
.nav-kbd {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 5px;
  padding: 1px 5px;
  font-family: var(--font);
}
.nav-section-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 14px 8px 4px;
  letter-spacing: 0;
}
.nav-divider { height: 1px; background: var(--border); margin: 8px 6px; }

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}
.sidebar .nav-account { flex: 1; min-width: 0; height: 34px; }
.nav-account-name { overflow: hidden; text-overflow: ellipsis; }
.nav-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.nav-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.foot-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.foot-icon-btn:hover { background: var(--hover); color: var(--text); }

.sidebar-toggle {
  position: fixed;
  top: 18px;
  left: calc(var(--sidebar-w) - 10px);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  z-index: 40;
  opacity: 0;
  transition: left 0.2s ease, opacity 0.15s ease, color 0.1s ease;
}
.shell:hover .sidebar-toggle, body.sidebar-closed .sidebar-toggle { opacity: 1; }
.sidebar-toggle:hover { color: var(--text); }
body.sidebar-closed .sidebar { width: 0; padding-left: 0; padding-right: 0; opacity: 0; pointer-events: none; }
body.sidebar-closed .sidebar-toggle { left: 10px; }

/* The page: one inset panel beside the sidebar, scrolling on its own. */
.main {
  flex: 1;
  min-width: 0;
  height: calc(100vh - 16px);
  margin: 8px 8px 8px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow-y: auto;
  padding: 28px 40px 56px;
  position: relative;
}
body.sidebar-closed .main { margin-left: 8px; }

/* ---------------------------------------------------------------- Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.page-header-main { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.page-header-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--page-color, var(--text-dim));
  background: color-mix(in srgb, var(--page-color, var(--text-dim)) 12%, var(--panel));
  margin-top: 1px;
}
.page-header-text h1 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-header-text .sub { color: var(--text-dim); font-size: 13.5px; margin: 3px 0 0; }
.queue-header { align-items: center; }
.queue-header-actions { flex-shrink: 0; display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- Buttons */
button.primary,
button.secondary,
.select-toggle-btn,
.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
button.primary {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 80%, #000);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, var(--shadow-xs);
}
button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
button.primary:active { background: color-mix(in srgb, var(--accent) 80%, #000); }
button.primary:disabled { opacity: 0.5; cursor: default; }
button.primary:focus-visible, button.secondary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }

button.secondary, .select-toggle-btn {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.select-toggle-btn { width: auto; }
button.secondary:hover, .select-toggle-btn:hover { background: var(--hover); }
button.secondary:disabled { opacity: 0.5; cursor: default; }
.select-toggle-btn.active { background: var(--text); border-color: var(--text); color: var(--panel); }

.back-link {
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.back-link:hover { color: var(--text); }
.banner-link { text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-weight: 500; }
.bulk-link { color: var(--accent-ink); cursor: pointer; font-weight: 500; }
.bulk-link:hover { text-decoration: underline; }

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
}
.row-action:hover { background: var(--hover); color: var(--text); }

/* ---------------------------------------------------------------- Inputs */
.input,
.team-field input,
.ol-link-row input,
.ed-rate-input,
.ed-login-input,
.rv-credit-row select,
.modal-body textarea,
.modal-body select,
.modal-body input[type="date"],
.modal-body input[type="time"],
.modal-body input[type="text"],
.modal-body input[type="file"] {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
textarea.input, .modal-body textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 64px; line-height: 1.5; }
.modal-body input[type="file"] { padding: 6px 8px; height: auto; }
.input:focus,
.team-field input:focus,
.ol-link-row input:focus,
.ed-rate-input:focus,
.ed-login-input:focus,
.modal-body textarea:focus,
.modal-body select:focus,
.modal-body input:focus,
.rv-credit-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
select.input { padding-right: 28px; }
.error { color: var(--critical); font-size: 13px; min-height: 16px; margin: -2px 0 6px; }
.error:empty { margin: 0; min-height: 0; }
.hint { font-size: 12.5px; color: var(--text-dim); }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.inline-form .input { width: auto; flex: 1; min-width: 160px; }
.inline-form button { width: auto; }
.toggle-inline { display: inline-flex; align-items: center; cursor: pointer; }
.toggle-inline input { width: 16px; height: 16px; cursor: pointer; }

/* ---------------------------------------------------------------- Tabs (segmented) */
.tabs {
  display: inline-flex;
  gap: 2px;
  margin: 0 0 20px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-wrap: wrap;
}
.tab {
  height: 28px;
  padding: 0 12px;
  border-radius: 7px;
  border: none !important;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.1s ease, color 0.1s ease;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.tab .tab-count {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-count { color: var(--text-dim); }

/* ---------------------------------------------------------------- Panels, tiles */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.panel h2 { font-size: 14.5px; font-weight: 600; margin: 0 0 2px; letter-spacing: -0.01em; }
.panel .panel-sub { font-size: 13px; color: var(--text-dim); margin: 0 0 14px; }
.panel-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.panel-head-row h2 { margin: 0; }
.panel-head-row button { width: auto; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 15px;
  position: relative;
  overflow: hidden;
}
.stat-tile .label { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.stat-tile .value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.stat-tile .delta { font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.stat-tile .delta.up { color: var(--good); }
.stat-tile .delta.down { color: var(--critical); }
.stat-tile.accent::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-color, var(--accent));
}
.stat-tile.accent .label { padding-left: 14px; }

.banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
  color: color-mix(in srgb, var(--warn) 80%, var(--text));
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.banner svg.icon { margin-top: 2px; }

.empty-state {
  margin: 56px auto 0;
  max-width: 360px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13.5px;
}
.empty-state .big {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.empty-state .big svg { width: 26px; height: 26px; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.status-dot.off { background: var(--text-muted); }

.pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
}
.badge-neutral, .badge-good, .badge-critical {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-neutral { background: var(--bg); color: var(--text-dim); box-shadow: 0 0 0 1px var(--border) inset; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-critical { background: var(--critical-soft); color: var(--critical); }

.live-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--good); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); animation: live-pulse 1.8s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: toast-in 0.18s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------------------------------------------------------------- Tables */
.people-table, .role-grid { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 4px; }
.people-table th, .role-grid th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.people-table td, .role-grid td { padding: 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.people-table tr:last-child td, .role-grid tr:last-child td { border-bottom: none; }
.people-table tbody tr:hover td, .role-grid tbody tr:hover td { background: var(--panel-2); }
.people-name-cell { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.people-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.people-avatar-fallback { display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; }
.role-grid-wrap { overflow-x: auto; margin-top: 4px; }
.role-check-cell { text-align: center; }
.role-check-cell input { width: 15px; height: 15px; cursor: pointer; }
.role-check-cell input:disabled { cursor: default; opacity: 0.5; }
.table-toggle { font-size: 12.5px; color: var(--text-dim); cursor: pointer; margin-top: 10px; display: inline-flex; gap: 4px; }
.table-toggle:hover { color: var(--text); }
.table-scroll { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 10px; display: none; }
table.data-table th { font-weight: 500; color: var(--text-muted); }
table.data-table th, table.data-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data-table.show { display: table; }

/* ---------------------------------------------------------------- Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 16px;
  z-index: 300;
  overflow-y: auto;
  animation: fade-in 0.12s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  animation: pop-in 0.14s ease both;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.modal-header input {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 6px 4px;
  border-radius: 6px;
}
.modal-header input:focus { background: var(--bg); outline: none; }
.modal-close {
  cursor: pointer;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: var(--text); background: var(--hover); }
.modal-body { padding: 12px 18px; display: flex; flex-direction: column; }
.modal-label { font-size: 12.5px; font-weight: 500; color: var(--text-dim); margin: 14px 0 6px; }
.modal-label:first-child { margin-top: 0; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--border); margin-top: 6px; }
.modal-footer button.secondary, .modal-footer button.primary { width: auto; }

/* ---------------------------------------------------------------- Search palette */
.search-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  animation: fade-in 0.1s ease both;
}
.search-box {
  width: 100%;
  max-width: 620px;
  max-height: 64vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: 0 16px;
  animation: pop-in 0.14s ease both;
}
.search-input-row { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.search-input-row input { flex: 1; border: none; background: transparent; color: var(--text); font-size: 15px; }
.search-input-row input:focus { outline: none; }
.search-esc { font-size: 11px; font-weight: 500; color: var(--text-muted); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.search-results { overflow-y: auto; padding: 6px; }
.search-empty { padding: 22px 12px; text-align: center; color: var(--text-dim); font-size: 13.5px; }
.search-group { margin-bottom: 4px; }
.search-group-label { font-size: 12px; font-weight: 500; color: var(--text-muted); padding: 8px 10px 4px; }
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}
.search-result svg.icon { color: var(--text-muted); }
.search-result:hover { background: var(--hover); }
.search-result-title { font-size: 13.5px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-sub { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* ---------------------------------------------------------------- Login (v0-style) */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  padding: 24px;
}
.login-overlay { display: none; }
.login-content { width: 100%; max-width: 360px; animation: pop-in 0.25s ease both; }
.login-logo { display: none; }
.login-card { text-align: center; }
.login-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: block;
  margin: 0 auto 18px;
  box-shadow: var(--shadow), 0 0 0 1px var(--border);
}
.login-icon-badge { display: none; }
.login-card h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; color: var(--text); }
.login-card > p { color: var(--text-dim); font-size: 13.5px; margin: 0 0 24px; line-height: 1.5; }
.login-input-wrap { position: relative; margin-bottom: 10px; }
.login-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  pointer-events: none;
}
.login-card input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.login-card .error { font-size: 13px; margin-bottom: 10px; }
.login-submit { height: 40px !important; margin-top: 4px; font-size: 14px !important; border-radius: 10px !important; background: var(--text) !important; border-color: var(--text) !important; color: var(--panel) !important; }
.login-submit:hover { opacity: 0.9; }
.login-submit.busy { opacity: 0.6; }
.login-hint { margin: 18px 0 0 !important; font-size: 12.5px !important; color: var(--text-muted) !important; }

/* ---------------------------------------------------------------- Hub */
.hub-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.hub-top h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 4px; }
.hub-top .sub { color: var(--text-dim); margin: 0; font-size: 13.5px; }
.hub-clock { text-align: right; display: flex; align-items: center; gap: 12px; }
.hub-clock-time { font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text-dim); order: 2; }
.hub-clock-sub {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  box-shadow: var(--shadow-xs);
}
.hub-section { margin-top: 28px; }
.hub-section-label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 10px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.hub-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.hub-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.hub-card-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hub-card-icon svg { width: 17px; height: 17px; }
.hub-card-body { min-width: 0; flex: 1; }
.hub-card-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-card-title { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.hub-card-desc { color: var(--text-dim); font-size: 13px; margin: 3px 0 0; line-height: 1.45; }
.hub-card-stat {
  color: var(--text);
  font-size: 12.5px;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.hub-card-go { color: var(--text-muted); flex-shrink: 0; opacity: 0; transition: opacity 0.12s ease, transform 0.12s ease; }
.hub-card:hover .hub-card-go { opacity: 1; transform: translateX(2px); }

/* ---------------------------------------------------------------- Queue grid (asset cards) */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  padding: 8px 8px 8px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.bulk-bar #bulk-count { font-weight: 600; }
.bulk-delete-btn {
  margin-left: auto;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--critical);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 0 12px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
}
.bulk-delete-btn:hover:not(:disabled) { filter: brightness(0.93); }
.bulk-delete-btn:disabled { opacity: 0.45; cursor: default; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px 16px; }
.card {
  background: transparent;
  border: none;
  border-radius: var(--radius);
  overflow: visible;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}
.card .thumb {
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 0 1px var(--border);
  transition: box-shadow 0.12s ease, transform 0.12s ease;
}
.card:hover .thumb { box-shadow: 0 0 0 1px var(--border-strong), var(--shadow); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .accent-bar { display: none; }
.card .body { padding: 10px 2px 0; }
.card .title { font-weight: 500; font-size: 13.5px; margin: 0 0 5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.card.selected .thumb { box-shadow: 0 0 0 2px var(--accent); }
.card.select-mode .thumb::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.12); }
.card-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(20, 20, 18, 0.45);
  border: 1.5px solid #fff;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.card.selected .card-checkbox { background: var(--accent); border-color: var(--accent); }
.card.is-revision .thumb { box-shadow: 0 0 0 1.5px var(--warn); }
.revision-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: 6px;
  padding: 0 7px;
  margin-bottom: 6px;
}
.card .pill { height: 18px; font-size: 11px; }

/* ---------------------------------------------------------------- History / notes list */
.history-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.history-list .note-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.history-list .note-item:hover { background: var(--panel-2); }
.history-list .note-item:last-child { border-bottom: none; }
.history-list .text { flex: 1; }
.notes-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.note-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.note-item:last-child { border-bottom: none; }
.note-item .ts { flex-shrink: 0; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; color: var(--accent-ink); cursor: pointer; }
.note-item .text { flex: 1; font-size: 13.5px; line-height: 1.45; }
.note-item .del { flex-shrink: 0; color: var(--text-muted); cursor: pointer; }
.note-item .del:hover { color: var(--critical); }
.note-thumb { width: 44px; height: 25px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); flex-shrink: 0; cursor: pointer; }

/* ---------------------------------------------------------------- Review (Frame.io stage) */
.main.main-review { padding: 0; overflow: hidden; display: flex; background: var(--panel); }
#review-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rv-shell { display: flex; flex-direction: column; flex: 1; min-width: 0; height: 100%; }
.rv-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}
.rv-back { margin: 0; height: 28px; padding: 0 8px; border-radius: 6px; }
.rv-back:hover { background: var(--hover); }
.rv-title { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; color: var(--text); }
.rv-body { flex: 1; display: flex; min-height: 0; min-width: 0; }
.rv-stage { flex: 1; min-width: 0; width: 100%; display: flex; flex-direction: column; background: #0b0b0d; }
.rv-video-wrap { flex: 1; min-height: 0; min-width: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 20px; }
.rv-video-wrap video { max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; width: auto; height: auto; background: #000; cursor: pointer; border-radius: 4px; }
.rv-video-wrap:fullscreen { padding: 0; }
.rv-video-wrap:fullscreen video { max-height: 100vh; border-radius: 0; }
video { width: 100%; border-radius: var(--radius-sm); background: #000; display: block; }
.rv-speed-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-weight: 600;
  font-size: 30px;
  padding: 12px 24px;
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(6px);
}
.rv-speed-flash.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.rv-transport {
  flex-shrink: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 14px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  color: var(--text);
}
.rv-tbtn {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  height: 32px;
  min-width: 32px;
  padding: 0 6px;
  border-radius: 7px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.rv-tbtn:hover { background: var(--hover); }
.rv-tbtn-skip { flex-direction: column; gap: 0; line-height: 1; }
.rv-tbtn-skip svg { display: block; }
.rv-tbtn-skip span { font-size: 8px; font-weight: 700; margin-top: -1px; }
.rv-tbtn-skip-fwd svg, .rv-tbtn-skip-fwd span { transform: scaleX(-1); }
.rv-time { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--text-dim); flex-shrink: 0; min-width: 92px; }
.rv-scrubber { flex: 1; min-width: 60px; accent-color: var(--brand-yellow); cursor: pointer; height: 4px; }
.rv-speed-badge {
  font-weight: 600;
  font-size: 12px;
  color: #1c1c1a;
  background: var(--brand-yellow);
  border-radius: 6px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  flex-shrink: 0;
  min-width: 36px;
  font-variant-numeric: tabular-nums;
}
.rv-kbd-hint { font-size: 11.5px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.rv-kbd-hint kbd { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; font-family: inherit; font-size: 11px; color: var(--text); }
.rv-mute { flex-shrink: 0; }

.rv-sidebar { width: 360px; flex-shrink: 0; border-left: 1px solid var(--border); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.rv-prev-notes { padding: 12px 14px; margin: 12px 12px 0; border-radius: 10px; background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--border)); flex-shrink: 0; }
.rv-prev-notes h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: #f2b33d; }
.rv-prev-notes .hint { font-size: 12px; color: var(--text-dim); margin: 0 0 8px; }
.rv-prev-notes-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.rv-prev-notes-list li { font-size: 12.5px; color: var(--text); }
.rv-prev-notes-list .ts { font-weight: 600; color: #f2b33d; margin-right: 6px; font-variant-numeric: tabular-nums; }
.rv-sidebar-head { padding: 14px 16px 10px; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.rv-sidebar-head h3 { margin: 0 0 3px; font-size: 13.5px; font-weight: 600; }
.rv-sidebar-head .hint { font-size: 12px; color: var(--text-dim); margin: 0; }
.rv-sidebar .notes-list { flex: 1; overflow-y: auto; padding: 8px 10px; margin: 0; list-style: none; }
.rv-sidebar .note-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  align-items: flex-start;
}
.rv-sidebar .note-item .ts {
  background: #f5c542;
  color: #1c1c1a;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11.5px;
  height: 19px;
  display: inline-flex;
  align-items: center;
}
.rv-composer { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.rv-composer input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  font-size: 13.5px;
  background: var(--bg);
  color: var(--text);
}
.rv-composer input:focus { outline: none; border-color: var(--accent); }
.rv-composer button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rv-composer button:hover { filter: brightness(1.08); }
.rv-composer .rv-shot-btn { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.rv-shot-btn:hover { background: var(--hover) !important; }
.rv-shot-preview:not([hidden]) { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-dim); flex-shrink: 0; }
.rv-shot-preview img { width: 48px; height: 27px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); flex-shrink: 0; }
.rv-shot-preview span:not(.rv-shot-clear) { flex: 1; }
.rv-shot-clear { cursor: pointer; color: var(--text-dim); flex-shrink: 0; padding: 2px 4px; }
.rv-shot-clear:hover { color: var(--critical); }
.rv-sidebar-actions { padding: 0 12px 14px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.send-btn {
  width: 100%;
  height: 38px;
  border-radius: 9px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.send-btn:disabled { opacity: 0.45; cursor: default; }
.send-btn:hover:not(:disabled) { filter: brightness(1.08); }
.approve-btn {
  width: 100%;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.approve-btn:disabled { opacity: 0.45; cursor: default; }
.approve-btn:hover:not(:disabled) { background: var(--hover); }
.rv-credit-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.rv-credit-row select { width: auto; max-width: 58%; height: 30px; background: var(--bg); }
.video-title { font-size: 18px; font-weight: 600; margin: 4px 0 2px; }
.video-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 14px; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 24px; margin-top: 20px; align-items: start; }
.add-note-row { display: flex; gap: 8px; margin-top: 14px; }
.notes-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; max-height: 70vh; }

/* ---------------------------------------------------------------- Analytics */
.a-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-dim); margin-bottom: 8px; flex-wrap: wrap; }
.a-legend span { display: inline-flex; align-items: center; gap: 6px; }
.a-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.a-connect-rows { display: flex; flex-direction: column; gap: 6px; }
.a-connect-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chart-wrap { position: relative; }
#a-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1.5;
  opacity: 0;
  transform: translate(-50%, -110%);
  white-space: nowrap;
  z-index: 5;
  box-shadow: var(--shadow-lg);
}
.video-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.video-row:last-child { border-bottom: none; }
.video-row .rank { width: 20px; color: var(--text-muted); font-weight: 500; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.video-row .thumb { width: 72px; height: 40px; border-radius: 6px; flex-shrink: 0; object-fit: cover; background-size: cover; background-position: center; box-shadow: 0 0 0 1px var(--border); }
.video-row .title { flex: 1; font-size: 13.5px; font-weight: 500; min-width: 0; }
.video-row .chan { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.video-row .num { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }
.video-row .num.rev { color: var(--good); font-weight: 600; }

/* ---------------------------------------------------------------- My Queue (editor view) */
.my-shell { min-height: 100vh; background: var(--canvas); }
.my-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 20px;
}
.my-topbar-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; }
.my-topbar-logo { height: 24px; width: 24px; border-radius: 6px; display: block; }
.my-topbar-actions { display: flex; align-items: center; gap: 4px; }
.my-theme-toggle, .my-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
}
.my-theme-toggle:hover, .my-logout:hover { color: var(--text); background: var(--hover); }
.my-body {
  max-width: 820px;
  margin: 0 auto 24px;
  padding: 28px 32px 48px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.my-panel { margin-top: 4px; }
.my-todo-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.my-todo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.my-todo-row:last-child { border-bottom: none; }
.my-todo-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.my-todo-title { font-weight: 500; font-size: 13.5px; }
.my-todo-due { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.my-todo-row.overdue .my-todo-due { color: var(--critical); }
.my-todo-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--accent-ink); text-decoration: none; flex-shrink: 0; }
.my-todo-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Day-to-Day */
.dt-group { margin-top: 20px; }
.dt-group:first-child { margin-top: 0; }
.dt-group-header { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.dt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.1s ease;
}
.dt-row:hover { background: var(--panel-2); border-color: var(--border-strong); }
.dt-row-arrow { color: var(--text-muted); font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }

/* ---------------------------------------------------------------- Editors */
.ed-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; align-items: start; }
.ed-col { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; min-height: 80px; }
.ed-col-header { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 600; font-size: 13.5px; }
.ed-col-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ed-color); flex-shrink: 0; }
.ed-col-name { flex: 1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-col-count { color: var(--text-muted); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }
.ed-col-cards { min-height: 40px; border-radius: 8px; transition: background-color 0.12s ease; }
.ed-col-cards.drag-over { background: color-mix(in srgb, var(--ed-color) 10%, transparent); outline: 1.5px dashed var(--ed-color); outline-offset: -2px; }
.ed-empty { color: var(--text-muted); font-size: 12.5px; padding: 14px 8px; text-align: center; }
.ed-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: grab;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.1s ease, border-color 0.1s ease;
}
.ed-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.ed-card.dragging { opacity: 0.35; }
.ed-card.is-overdue { border-color: color-mix(in srgb, var(--critical) 50%, var(--border)); }
.ed-card-accent { height: 3px; width: 100%; }
.ed-card-body { padding: 9px 11px 10px; }
.ed-card-title-input {
  display: block;
  width: 100%;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  margin: 0 0 6px -4px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 2px 4px;
}
.ed-card-title-input:hover { border-color: var(--border); }
.ed-card-title-input:focus { outline: none; border-color: var(--accent); background: var(--bg); }
.ed-card-title-input:disabled { opacity: 0.6; }
.ed-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; margin-bottom: 7px; }
.ed-card-chip { color: #fff; font-weight: 500; border-radius: 5px; padding: 1px 6px; }
.ed-card-overdue { color: var(--critical); font-weight: 600; }
.ed-card-moved { color: var(--text-muted); font-weight: 500; }
.ed-card-due-row { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; font-size: 11px; color: var(--text-dim); }
.ed-card-due-icon { flex-shrink: 0; }
.ed-card-due-input { border: 1px solid var(--border); background: var(--bg); color: var(--text-dim); border-radius: 6px; padding: 2px 4px; font-size: 11px; max-width: 120px; }
.ed-card-due-input:disabled { opacity: 0.6; }
.ed-card-due-auto { color: var(--text-muted); font-style: italic; white-space: nowrap; }
.ed-card-due-clear, .ed-card-done, .ed-card-remove {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ed-card-due-clear { width: 18px; height: 18px; }
.ed-card-done:hover { color: var(--good); border-color: var(--good); }
.ed-card-remove:hover, .ed-card-due-clear:hover { color: var(--critical); border-color: var(--critical); }
.ed-card-actions { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ed-card-link { color: var(--accent-ink); text-decoration: none; font-weight: 500; margin-right: auto; }
.ed-card-link:hover { text-decoration: underline; }
.ed-card-move { height: 24px; padding: 0 4px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel); color: var(--text-dim); font-size: 11px; max-width: 90px; }
.ed-pending-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; font-size: 13px; }
.ed-pending-title { flex: 1 1 auto; font-weight: 500; }
.ed-pending-time { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.ed-month-nav { display: flex; align-items: center; gap: 8px; width: fit-content; margin-bottom: 14px; font-weight: 500; }
.ed-month-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
}
.ed-month-btn:hover { background: var(--hover); }
button.secondary.ed-export-btn { width: auto; margin-left: 8px; height: 30px; font-size: 12.5px; }
.ed-pay-rows { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ed-pay-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ed-pay-row:last-child { border-bottom: none; }
.ed-pay-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ed-color); flex-shrink: 0; }
.ed-pay-name { font-weight: 600; min-width: 80px; }
.ed-pay-count { color: var(--text-dim); flex: 1 1 auto; }
.ed-pay-rate-wrap, .ed-pay-login-wrap { display: flex; align-items: center; gap: 5px; color: var(--text-dim); font-size: 12.5px; }
.ed-rate-input { width: 76px; height: 30px; }
.ed-login-input { width: 110px; height: 30px; }
.ed-pay-total { font-weight: 600; min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.ed-login-gen { cursor: pointer; color: var(--text-muted); display: flex; }
.ed-login-gen:hover { color: var(--text); }

/* ---------------------------------------------------------------- Team */
.team-hint { font-size: 13px; color: var(--text-dim); margin: 0 0 16px; line-height: 1.6; }
.team-list { display: flex; flex-direction: column; gap: 12px; }
.team-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--panel); }
.team-card.is-paused { opacity: 0.62; }
.team-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.team-card-head-name { font-weight: 600; font-size: 14px; }
.team-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
}
.team-status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.team-status-pill.is-active { background: var(--good-soft); color: var(--good); }
.team-status-pill.is-paused { background: var(--bg); color: var(--text-dim); border-color: var(--border); }
.team-share-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
  color: color-mix(in srgb, var(--warn) 80%, var(--text));
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.team-share-warning svg { flex-shrink: 0; margin-top: 1px; }
.team-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.team-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.team-field em { font-style: normal; color: var(--text-muted); font-weight: 400; }
.team-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.team-resolved-name { font-size: 12.5px; color: var(--text-muted); }
.team-card-actions { display: flex; gap: 8px; }
.team-card-actions button { width: auto; height: 30px; font-size: 13px; }
.team-advanced { border-top: 1px dashed var(--border); margin-top: 14px; padding-top: 14px; }
.team-color-row { display: flex; align-items: center; gap: 8px; }
.team-color-row input[type="color"] { width: 36px; height: 34px; padding: 3px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; flex-shrink: 0; }
.team-color-row input[type="text"] { flex: 1 1 auto; }
.team-var-chip {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 5px;
  font-size: 11.5px;
  font-family: var(--mono);
  margin: 2px 3px 2px 0;
  cursor: help;
}
.team-preview-box { margin-top: 12px; }
.team-preview-embed { border-left: 4px solid var(--preview-color, #5865f2); background: var(--bg); border-radius: 6px; padding: 12px 14px; }
.team-preview-content { font-size: 13px; margin-bottom: 8px; }
.team-preview-author { font-size: 12px; color: var(--text-dim); font-weight: 600; margin-bottom: 4px; }
.team-preview-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.team-preview-footer { font-size: 11px; color: var(--text-muted); }
.team-save-btn, .team-remove-btn { width: auto !important; }

/* ---------------------------------------------------------------- Bot Settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.settings-checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5; cursor: pointer; }
.settings-checkbox-row input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }
.settings-checkbox-row em { font-style: normal; color: var(--text-dim); }

/* ---------------------------------------------------------------- Calendar */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 14px; flex-wrap: wrap; }
.cal-toolbar .tabs { margin: 0; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav-btn { height: 30px !important; padding: 0 10px !important; font-size: 13px !important; width: auto !important; }
.cal-title { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; margin-left: 8px; }
.cal-chip {
  --chip-color: var(--accent);
  font-size: 11.5px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--chip-color) 14%, var(--panel));
  color: var(--text);
  border-left: 2px solid var(--chip-color);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-chip:hover { background: color-mix(in srgb, var(--chip-color) 22%, var(--panel)); }
.cal-more { font-size: 11px; color: var(--text-muted); cursor: pointer; font-weight: 500; padding: 1px 4px; }
.cal-more:hover { color: var(--text); }
.cal-month { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cal-month-headrow { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--panel-2); }
.cal-month-headcell { padding: 8px 10px; text-align: left; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.cal-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(104px, 1fr); }
.cal-month-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; cursor: pointer; min-width: 0; display: flex; flex-direction: column; }
.cal-month-cell:nth-child(7n) { border-right: none; }
.cal-month-cell:hover { background: var(--panel-2); }
.cal-month-cell.cal-dim { background: var(--bg); }
.cal-month-cell.cal-dim .cal-month-daynum { color: var(--text-muted); }
.cal-month-daynum { font-size: 12.5px; font-weight: 500; margin-bottom: 4px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-month-cell.cal-today .cal-month-daynum { background: var(--critical); color: #fff; font-weight: 600; }
.cal-month-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-timeline-headrow, .cal-allday-row { display: grid; border-bottom: 1px solid var(--border); background: var(--panel); }
.cal-timeline-headrow { border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; background: var(--panel-2); }
.cal-allday-row { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.cal-timeline-headcell { padding: 8px 4px; text-align: center; font-size: 12px; font-weight: 500; color: var(--text-muted); border-left: 1px solid var(--border); }
.cal-timeline-headcell span { display: block; font-size: 17px; font-weight: 600; margin-top: 1px; color: var(--text); }
.cal-timeline-headcell.cal-today span { color: var(--critical); }
.cal-allday-row { padding: 4px 0; }
.cal-allday-cell { border-left: 1px solid var(--border); padding: 2px 4px; min-height: 22px; }
.cal-timeline-scroll { max-height: 65vh; overflow-y: auto; border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); background: var(--panel); }
.cal-timeline-body { display: grid; position: relative; padding-top: 8px; }
.cal-hour-labels { position: relative; }
.cal-hour-label { font-size: 11px; color: var(--text-muted); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.cal-day-col { position: relative; border-left: 1px solid var(--border); }
.cal-hour-line { position: absolute; left: 0; right: 0; height: 1px; background: var(--border); }
.cal-block {
  position: absolute;
  left: 3px;
  right: 3px;
  --chip-color: var(--accent);
  background: color-mix(in srgb, var(--chip-color) 16%, var(--panel));
  border-left: 3px solid var(--chip-color);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11.5px;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  color: var(--text);
}
.cal-block:hover { background: color-mix(in srgb, var(--chip-color) 24%, var(--panel)); }
.cal-block strong { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------------------------------------------------------------- Outliers */
.ol-link-panel { margin-bottom: 16px; }
.ol-link-row { display: flex; gap: 8px; margin-bottom: 12px; }
.ol-link-row input { flex-grow: 1; height: 36px; }
.ol-link-row button { width: auto; }
.ol-channel-tab { display: inline-flex; align-items: center; gap: 7px; padding: 0 8px 0 4px !important; }
.ol-pill-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ol-pill-avatar-fallback { display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; }
.ol-pill-warning { color: var(--critical); display: inline-flex; }
.ol-pill-remove { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 5px; color: var(--text-muted); }
.ol-pill-remove:hover { background: var(--critical-soft); color: var(--critical); }
.ol-pill-idea-select { border: 1px solid var(--border); background: var(--panel); color: var(--text-dim); border-radius: 6px; font-size: 11.5px; padding: 1px 4px; max-width: 120px; }
.ol-pill-idea-select:focus { outline: none; border-color: var(--accent); }
.ol-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ol-toolbar .tabs { margin: 0; }
.ol-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  width: 240px;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}
.ol-search input { flex-grow: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 13.5px; }
.ol-checked-label { font-size: 12.5px; color: var(--text-muted); }
.ol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 16px; }
.ol-card { position: relative; display: flex; flex-direction: column; }
.ol-thumb-wrap { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--bg); box-shadow: 0 0 0 1px var(--border); }
.ol-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.ol-card:hover .ol-thumb { transform: scale(1.02); }
.ol-duration { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, 0.78); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.ol-save-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.ol-card:hover .ol-save-btn { opacity: 1; }
.ol-card-body { padding-top: 9px; display: flex; flex-direction: column; gap: 3px; }
.ol-card-title { font-size: 13.5px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ol-card-channel { font-size: 12px; color: var(--text-muted); }
.ol-card-mult { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.ol-mult { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; }
.ol-mult-views { color: var(--accent-ink); background: var(--accent-soft); }
.ol-mult-pace { color: var(--good); background: var(--good-soft); }
.ol-mult-label, .ol-mult-sep { color: var(--text-muted); font-weight: 400; }
.ol-card-mult-pending { color: var(--text-muted); font-weight: 400; font-style: italic; }
.ol-card-stats { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Game Radar — same
   card language as Outliers (.ol-*) above, but the thumbnail is a square game icon
   instead of a 16:9 video frame, since that's what Roblox actually gives us. */
.gr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 16px; }
.gr-card { position: relative; display: flex; flex-direction: column; }
.gr-icon-wrap {
  position: relative; display: flex; width: 100%; aspect-ratio: 1 / 1;
  border-radius: 14px; overflow: hidden; background: var(--bg); box-shadow: 0 0 0 1px var(--border);
}
.gr-icon-link { display: block; width: 100%; height: 100%; }
.gr-icon { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.gr-card:hover .gr-icon { transform: scale(1.02); }
.gr-icon-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--text-muted); }
.gr-mult-pill {
  position: absolute; top: 7px; left: 7px; color: #fff; background: var(--good);
  font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; line-height: 1.3;
}
.gr-dismiss-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.gr-card:hover .gr-dismiss-btn { opacity: 1; }
.gr-card-body { padding-top: 9px; display: flex; flex-direction: column; gap: 3px; }
.gr-card-title { font-size: 13.5px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gr-card-title a { color: inherit; text-decoration: none; }
.gr-card-title a:hover { text-decoration: underline; }
.gr-card-stats { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.gr-card-meta { font-size: 11.5px; color: var(--text-muted); }

/* ---------------------------------------------------------------- Inspiration (masonry-feel grid) */
.insp-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.insp-toolbar .tabs { margin: 0; }
.insp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.insp-card { background: transparent; border: none; border-radius: 12px; overflow: hidden; position: relative; }
.insp-thumb-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--bg); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.insp-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.insp-card:hover .insp-thumb { transform: scale(1.03); }
.insp-badge { position: absolute; left: 7px; top: 7px; color: #fff; font-size: 10.5px; font-weight: 600; height: 18px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: 999px; backdrop-filter: blur(4px); }
.insp-badge-outlier { background: rgba(22, 163, 74, 0.88); }
.insp-badge-extension { background: rgba(29, 143, 214, 0.88); }
.insp-badge-manual { background: rgba(142, 91, 176, 0.88); }
.insp-delete-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s;
  cursor: pointer;
}
.insp-card:hover .insp-delete-btn { opacity: 1; }
.insp-card-body { padding: 8px 2px 4px; }
.insp-card-title { font-size: 13px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.insp-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ---------------------------------------------------------------- Account */
.account-panel h2 { margin-bottom: 4px; }
.account-avatar-row { display: flex; align-items: center; gap: 16px; }
.account-avatar-preview {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.account-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.account-avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-avatar-actions button { width: auto; }
.account-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.account-panel button.primary, .account-panel button.secondary { width: auto; }
.totp-secret {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
  word-break: break-all;
}

/* ---------------------------------------------------------------- Idea Coach */
.idea-channel-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.idea-channel-bar .input { width: auto; }
.idea-channel-bar button { width: auto; }
.idea-pitch-panel { max-width: 680px; }
.idea-pitch h2 { margin: 0 0 8px; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.idea-pitch p { margin: 0 0 10px; font-size: 14px; line-height: 1.55; }
.idea-pitch-tags { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.idea-rationale { color: var(--text-dim) !important; font-size: 13px !important; display: flex; align-items: flex-start; gap: 6px; }
.idea-source { color: var(--text-muted) !important; font-size: 12.5px !important; }
.idea-reason-input { margin: 12px 0; min-height: 72px; }
.idea-decide-actions { display: flex; gap: 8px; }
.idea-decide-actions button { width: auto; flex: 1; }
.idea-history-list { display: flex; flex-direction: column; }
.idea-history-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.idea-history-row:last-child { border-bottom: none; }
.idea-history-main { flex: 1; min-width: 0; }
.idea-history-title { font-size: 13.5px; font-weight: 500; }
.idea-history-reason { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.idea-history-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.idea-thumbnail-block { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 4px 0 12px; }
.idea-thumbnail-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.idea-thumbnail-concept { font-size: 13px !important; margin: 0 0 10px !important; line-height: 1.5; }
.idea-thumb-refs { display: flex; gap: 8px; flex-wrap: wrap; }
.idea-thumb-ref { display: block; width: 104px; height: 58px; border-radius: 7px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); flex-shrink: 0; }
.idea-thumb-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.idea-history-thumb { width: 48px; height: 27px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }

/* ---------------------------------------------------------------- Mobile */
.mobile-topbar, .mobile-nav-backdrop, .mobile-nav-close { display: none; }
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  body { background: var(--panel); }
  .shell { flex-direction: column; }
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 12px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 70;
    flex-shrink: 0;
  }
  .hamburger-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-topbar-logo { height: 24px; width: 24px; border-radius: 6px; cursor: pointer; }
  .mobile-topbar-name { font-weight: 600; font-size: 14px; }
  .sidebar-toggle { display: none; }
  .mobile-nav-backdrop { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 90; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  body.mobile-nav-open .mobile-nav-backdrop { opacity: 1; pointer-events: auto; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    width: 280px;
    max-width: 84vw;
    background: var(--canvas);
    padding: 14px 12px;
    box-shadow: var(--shadow-lg);
    z-index: 95;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  body.sidebar-closed .sidebar { width: 280px; padding: 14px 12px; opacity: 1; pointer-events: auto; }
  body.mobile-nav-open .sidebar { transform: translateX(0); }
  .mobile-nav-close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text-dim); cursor: pointer; flex-shrink: 0; }
  .mobile-nav-close:hover { background: var(--hover); color: var(--text); }
  .sidebar .nav-item { height: 38px; font-size: 14.5px; }
  .main, body.sidebar-closed .main { margin: 0; height: auto; min-height: calc(100vh - 52px); border: none; border-radius: 0; box-shadow: none; padding: 20px 16px 40px; overflow: visible; }
  .page-header { margin-bottom: 16px; }
  .page-header-text h1 { font-size: 19px; }
  .queue-header { flex-wrap: wrap; }
  .tabs { display: flex; overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
  .tab { flex-shrink: 0; }
  .review-layout { grid-template-columns: 1fr; }
  .modal-overlay { padding: 24px 12px; }
  .login-shell { padding: 16px; }
  .hub-clock-time { display: none; }
  .hub-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 12px; }
  .account-form-grid { grid-template-columns: 1fr; }
  .ol-search { width: 100%; }
  .my-body { border: none; border-radius: 0; padding: 20px 16px 40px; margin: 0; }
  .cal-month-grid { grid-auto-rows: minmax(64px, 1fr); }
  .cal-month-daynum { font-size: 11px; }
  .cal-chip { font-size: 9.5px; }
}
@media (max-width: 900px) {
  .main.main-review { height: auto; overflow: visible; }
  .rv-body { flex-direction: column; }
  .rv-stage { height: 46vh; }
  .rv-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 60vh; }
  .rv-kbd-hint { display: none; }
}
@media (max-width: 480px) {
  .rv-topbar { padding: 0 10px; gap: 8px; }
  .rv-transport { gap: 4px; padding: 0 8px; }
  .rv-tbtn { min-width: 28px; padding: 0 4px; }
  .rv-time { min-width: 58px; font-size: 11px; }
  .rv-scrubber { min-width: 36px; }
  .rv-speed-badge { min-width: 28px; padding: 0 5px; font-size: 11px; }
}

/* ==========================================================================
   Workflow — kanban board, 1:1 with Trello's web board (Mobbin reference set:
   board view, list actions, card detail modal, archived items, filter drawer).
   Trello's own surface tokens, in light and dark.
   ========================================================================== */
:root {
  --tr-list: #f1f2f4;
  --tr-card: #ffffff;
  --tr-text: #172b4d;
  --tr-subtle: #44546f;
  --tr-subtlest: #626f86;
  --tr-hover: #091e4224;
  --tr-neutral: #091e420f;
  --tr-neutral-hover: #091e4224;
  --tr-border: #091e4224;
  --tr-input-bg: #ffffff;
  --tr-input-border: #8590a2;
  --tr-blue: #0c66e4;
  --tr-blue-hover: #0055cc;
  --tr-blue-text: #ffffff;
  --tr-focus: #388bff;
  --tr-surface: #ffffff;
  --tr-modal: #ffffff;
  --tr-modal-side: #f7f8f9;
  --tr-shadow: 0 1px 1px #091e4240, 0 0 1px #091e424f;
  --tr-overlay-shadow: 0 8px 12px #091e4226, 0 0 1px #091e424f;
  --tr-placeholder: #091e4224;
  --tr-green: #1f845a;
  --tr-red: #c9372c;
  --tr-yellow: #f5cd47;
  --tr-yellow-ink: #533f04;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tr-list: #101204;
    --tr-card: #22272b;
    --tr-text: #b6c2cf;
    --tr-subtle: #9fadbc;
    --tr-subtlest: #8c9bab;
    --tr-hover: #a6c5e229;
    --tr-neutral: #a1bdd914;
    --tr-neutral-hover: #a6c5e229;
    --tr-border: #a6c5e229;
    --tr-input-bg: #22272b;
    --tr-input-border: #738496;
    --tr-blue: #579dff;
    --tr-blue-hover: #85b8ff;
    --tr-blue-text: #1d2125;
    --tr-focus: #85b8ff;
    --tr-surface: #282e33;
    --tr-modal: #22272b;
    --tr-modal-side: #1d2125;
    --tr-shadow: 0 1px 1px #03040480, 0 0 1px #03040480;
    --tr-overlay-shadow: 0 8px 12px #0304045c, 0 0 1px #03040480;
    --tr-placeholder: #a6c5e229;
  }
}
:root[data-theme="dark"] {
  --tr-list: #101204;
  --tr-card: #22272b;
  --tr-text: #b6c2cf;
  --tr-subtle: #9fadbc;
  --tr-subtlest: #8c9bab;
  --tr-hover: #a6c5e229;
  --tr-neutral: #a1bdd914;
  --tr-neutral-hover: #a6c5e229;
  --tr-border: #a6c5e229;
  --tr-input-bg: #22272b;
  --tr-input-border: #738496;
  --tr-blue: #579dff;
  --tr-blue-hover: #85b8ff;
  --tr-blue-text: #1d2125;
  --tr-focus: #85b8ff;
  --tr-surface: #282e33;
  --tr-modal: #22272b;
  --tr-modal-side: #1d2125;
  --tr-shadow: 0 1px 1px #03040480, 0 0 1px #03040480;
  --tr-overlay-shadow: 0 8px 12px #0304045c, 0 0 1px #03040480;
  --tr-placeholder: #a6c5e229;
}

/* ---------------------------------------------------------------- Board frame */
.main.main-board { padding: 0; overflow: hidden; display: flex; flex-direction: column; background: #0079bf; border: none; }
.tb-board {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: var(--tr-text);
  background-size: cover;
  background-position: center;
}
.tb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  padding: 12px 10px 12px 16px;
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.tb-header-left, .tb-header-right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.tb-board-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: 3px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.tb-board-name:hover { background: rgba(255, 255, 255, 0.2); }
.tb-view-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 3px;
  background: #dcdfe4;
  color: #172b4d;
  font-size: 14px;
  font-weight: 500;
}
.tb-hbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 3px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.tb-hbtn:hover { background: rgba(255, 255, 255, 0.2); }
.tb-hbtn.active { background: #dcdfe4; color: #172b4d; }
.tb-hbtn-icon { width: 32px; padding: 0; justify-content: center; }
.tb-filter-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--tr-blue); color: var(--tr-blue-text); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.tb-hbtn.active .tb-filter-count { background: #0c66e4; color: #fff; }
.tb-drive-dot { width: 8px; height: 8px; border-radius: 50%; background: #8590a2; flex-shrink: 0; }
.tb-drive-dot.on { background: #4bce97; box-shadow: 0 0 0 2px rgba(75, 206, 151, 0.3); }
.tb-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  margin-right: 4px;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.tb-search:focus-within { background: var(--tr-input-bg); color: var(--tr-subtle); box-shadow: inset 0 0 0 2px var(--tr-focus); }
.tb-search input { border: none; background: transparent; color: inherit; font-size: 14px; width: 150px; outline: none; }
.tb-search:focus-within input { color: var(--tr-text); }
.tb-search input::placeholder { color: rgba(255, 255, 255, 0.85); }
.tb-search:focus-within input::placeholder { color: var(--tr-subtlest); }
.tb-members { display: flex; align-items: center; padding: 0 8px 0 12px; }
.tb-members .tb-avatar { margin-left: -4px; }
.tb-avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
  object-fit: cover;
  user-select: none;
  line-height: 1;
}
.tb-avatar-ring { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.18); }
.tb-avatar-more { background: #dcdfe4 !important; color: #172b4d; font-size: 11px; }
.tb-avatar-empty { background: var(--tr-neutral); color: var(--tr-subtle); }
.tb-banner { margin: 8px 12px 0; padding: 8px 12px; border-radius: 8px; background: #fff7d6; color: #533f04; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.tb-canvas { position: relative; flex: 1; min-height: 0; }
.tb-loading, .tb-empty { padding: 40px; color: #fff; font-weight: 500; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }

/* ---------------------------------------------------------------- Lists */
.tb-lists {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: rgba(255, 255, 255, 0.5) rgba(0, 0, 0, 0.16);
}
.tb-lists::-webkit-scrollbar { height: 12px; }
.tb-lists::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.16); border-radius: 6px; margin: 0 12px; }
.tb-lists::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.5); border-radius: 6px; }
.tb-list {
  width: 272px;
  flex-shrink: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--tr-list);
  border-radius: 12px;
  box-shadow: var(--tr-shadow);
  color: var(--tr-text);
}
.tb-list.is-tinted { background: color-mix(in srgb, var(--list-tint) 34%, var(--tr-list)); }
:root[data-theme="dark"] .tb-list.is-tinted { background: color-mix(in srgb, var(--list-tint) 26%, var(--tr-list)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tb-list.is-tinted { background: color-mix(in srgb, var(--list-tint) 26%, var(--tr-list)); } }
.tb-list.list-dragging { opacity: 0.45; transform: rotate(2deg); }
.tb-list-head { display: flex; align-items: flex-start; gap: 4px; padding: 8px 8px 0 12px; cursor: grab; }
.tb-list-head:active { cursor: grabbing; }
.tb-list-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 6px 8px 6px 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: var(--tr-text);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.tb-list-title-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  margin: 0 0 0 -8px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: var(--tr-input-bg);
  color: var(--tr-text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 0 0 2px var(--tr-focus);
  outline: none;
}
.tb-list-btn, .tb-icon-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--tr-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tb-icon-btn { border-radius: 3px; }
.tb-list-btn:hover, .tb-icon-btn:hover { background: var(--tr-hover); color: var(--tr-text); }
.tb-cards {
  list-style: none;
  margin: 0;
  padding: 4px 8px 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--tr-hover) transparent;
}
.tb-cards::-webkit-scrollbar { width: 8px; }
.tb-cards::-webkit-scrollbar-thumb { background: var(--tr-hover); border-radius: 4px; }
.tb-list-foot { padding: 6px 8px 8px; }
.tb-add-card {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--tr-subtle);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.tb-add-card:hover { background: var(--tr-hover); color: var(--tr-text); }

.tb-add-list-wrap { width: 272px; flex-shrink: 0; }
.tb-add-list {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(4px);
  text-align: left;
}
.tb-add-list:hover { background: rgba(255, 255, 255, 0.32); }

/* composers */
.tb-list-composer { background: var(--tr-list); border-radius: 12px; padding: 8px; box-shadow: var(--tr-shadow); }
.tb-composer-input, .tb-input {
  width: 100%;
  height: 36px;
  padding: 8px 12px;
  border: none;
  border-radius: 3px;
  background: var(--tr-input-bg);
  color: var(--tr-text);
  font-size: 14px;
  box-shadow: inset 0 0 0 1px var(--tr-input-border);
  outline: none;
}
.tb-composer-input:focus, .tb-input:focus { box-shadow: inset 0 0 0 2px var(--tr-focus); }
.tb-input:disabled { opacity: 0.5; }
.tb-card-composer { list-style: none; }
.tb-composer-card {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: var(--tr-card);
  color: var(--tr-text);
  font-size: 14px;
  line-height: 20px;
  box-shadow: var(--tr-shadow);
  resize: none;
  outline: none;
  overflow: hidden;
}
.tb-composer-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.tb-btn-primary, .tb-btn-subtle, .tb-btn-danger {
  height: 32px;
  padding: 0 12px;
  border-radius: 3px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
}
.tb-btn-primary { background: var(--tr-blue); color: var(--tr-blue-text); }
.tb-btn-primary:hover { background: var(--tr-blue-hover); }
.tb-btn-subtle { background: var(--tr-neutral); color: var(--tr-text); }
.tb-btn-subtle:hover { background: var(--tr-neutral-hover); }
.tb-btn-subtle.sm { height: 32px; padding: 0 10px; }
.tb-btn-danger { background: var(--tr-red); color: #fff; }
.tb-btn-danger:hover { filter: brightness(0.92); }
.tb-w-full { width: 100%; }
.tb-upload { cursor: pointer; }
.tb-link { background: none; border: none; padding: 0; color: var(--tr-subtle); font-size: 12px; text-decoration: underline; cursor: pointer; }
.tb-link:hover { color: var(--tr-text); }
.tb-link.danger:hover { color: var(--tr-red); }
.tb-flex-1 { flex: 1; }

/* ---------------------------------------------------------------- Cards */
.tb-card {
  position: relative;
  background: var(--tr-card);
  border-radius: 8px;
  box-shadow: var(--tr-shadow);
  cursor: pointer;
  color: var(--tr-text);
  overflow: hidden;
  scroll-margin: 8px;
  flex-shrink: 0;
}
.tb-card:hover { box-shadow: inset 0 0 0 2px var(--tr-focus), var(--tr-shadow); }
.tb-card.dragging { background: var(--tr-placeholder); box-shadow: none; }
.tb-card.dragging > * { visibility: hidden; }
.tb-card-static { cursor: default; }
.tb-card-static:hover { box-shadow: var(--tr-shadow); }
.tb-card-cover-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background-size: cover; background-position: center; background-color: var(--tr-neutral); border-radius: 8px 8px 0 0; }
.tb-card-cover-color { height: 36px; }
.tb-card-body { padding: 8px 12px 4px; min-height: 36px; }
.tb-card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.tb-label {
  display: inline-block;
  height: 8px;
  min-width: 40px;
  max-width: 40px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: height 0.1s ease, max-width 0.1s ease;
}
.tb-label.expanded { height: 16px; min-width: 56px; max-width: 100%; padding: 0 8px; }
.tb-card-labels:hover .tb-label { filter: brightness(0.94) saturate(1.05); }
.tb-card-title { font-size: 14px; line-height: 20px; margin-bottom: 4px; overflow-wrap: anywhere; display: block; }
.tb-card-done { color: #22a06b; display: inline-flex; vertical-align: -3px; margin-right: 4px; }
.tb-card-foot { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.tb-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 0; }
.tb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--tr-subtle);
}
.tb-badge svg.icon { vertical-align: 0; }
.tb-due.done { background: var(--tr-green); color: #fff; }
.tb-due.overdue { background: var(--tr-red); color: #fff; }
.tb-due.soon { background: var(--tr-yellow); color: var(--tr-yellow-ink); }
.tb-chk.done { background: var(--tr-green); color: #fff; }
.tb-card-members { display: flex; gap: 2px; margin-left: auto; padding-bottom: 2px; }
.tb-card-edit {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--tr-card);
  color: var(--tr-subtle);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--tr-shadow);
}
.tb-card:hover .tb-card-edit { display: flex; }
.tb-card-edit:hover { background: var(--tr-list); color: var(--tr-text); }
.tb-card-cover-img ~ .tb-card-edit, .tb-card-cover-color ~ .tb-card-edit { top: 8px; right: 8px; }

/* ---------------------------------------------------------------- Popovers */
.tb-popover {
  position: fixed;
  z-index: 700;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  background: var(--tr-surface);
  color: var(--tr-text);
  border-radius: 8px;
  box-shadow: var(--tr-overlay-shadow);
  padding: 12px;
  font-size: 14px;
  animation: pop-in 0.1s ease both;
}
.tb-pop-head { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; margin: -4px 0 8px; }
.tb-pop-head h3 { margin: 0; text-align: center; font-size: 14px; font-weight: 600; color: var(--tr-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-pop-body > .tb-input { margin-bottom: 4px; }
.tb-pop-list { display: flex; flex-direction: column; margin: 0 -12px; }
.tb-pop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--tr-text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.tb-pop-item:hover { background: var(--tr-hover); }
.tb-pop-item.active { background: var(--tr-neutral); font-weight: 600; }
.tb-pop-item.danger { color: var(--tr-red); }
.tb-pop-item.disabled, .tb-pop-item:disabled { color: var(--tr-subtlest); cursor: default; background: transparent; }
.tb-pop-item.with-icon svg.icon { color: var(--tr-subtle); }
.tb-pop-item.rich { align-items: flex-start; padding: 8px 12px; }
.tb-pop-item.rich strong { display: block; font-weight: 500; }
.tb-pop-item.rich small { display: block; font-size: 12px; color: var(--tr-subtle); margin-top: 1px; }
.tb-rich-ico { width: 20px; display: inline-flex; justify-content: center; color: var(--tr-subtle); padding-top: 2px; }
.tb-pop-item.member { padding: 4px 12px; }
.tb-member-check { margin-left: auto; color: var(--tr-subtle); }
.tb-pop-sep { border: 0; border-top: 1px solid var(--tr-border); margin: 8px 0; }
.tb-pop-section-title { font-size: 12px; font-weight: 600; color: var(--tr-subtle); margin: 12px 0 6px; }
.tb-pop-foot { display: flex; justify-content: space-between; gap: 8px; }
.tb-pop-foot.col { flex-direction: column; margin-top: 12px; }
.tb-pop-btn-subtle {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 3px;
  background: var(--tr-neutral);
  color: var(--tr-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.tb-pop-btn-subtle:hover { background: var(--tr-neutral-hover); }
.tb-swatch-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 8px; }
.tb-swatch { height: 32px; border-radius: 4px; border: none; cursor: pointer; padding: 0; }
.tb-swatch:hover { filter: brightness(0.92); }
.tb-swatch.selected { box-shadow: 0 0 0 2px var(--tr-surface), 0 0 0 4px var(--tr-focus); }
.tb-board-item { gap: 12px; }
.tb-board-thumb { width: 40px; height: 32px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.tb-board-thumb.lg { width: 48px; height: 40px; border-radius: 4px; }

/* labels popover */
.tb-label-pick { display: flex; flex-direction: column; gap: 4px; }
.tb-label-pick-row { display: flex; align-items: center; gap: 8px; }
.tb-label-bar {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 3px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tb-label-bar:hover { filter: brightness(0.93); }
.tb-check-row .tb-label-bar { height: 24px; cursor: pointer; }
.tb-label-preview-wrap { margin: -4px -12px 4px; padding: 32px; background: var(--tr-list); display: flex; justify-content: center; }
.tb-label-bar.lg { flex: 0 1 auto; min-width: 100%; justify-content: flex-start; cursor: default; }
.tb-label-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.tb-label-swatch { height: 32px; border: none; border-radius: 3px; cursor: pointer; padding: 0; }
.tb-label-swatch:hover { filter: brightness(0.92); }
.tb-label-swatch.selected { box-shadow: 0 0 0 2px var(--tr-surface), 0 0 0 4px var(--tr-focus); }

/* custom checkbox, Trello style */
.tb-chk-box { position: relative; display: inline-flex; width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.tb-chk-box input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.tb-chk-box span { width: 16px; height: 16px; border-radius: 3px; background: var(--tr-input-bg); box-shadow: inset 0 0 0 2px var(--tr-subtle); transition: background 0.1s ease; }
.tb-chk-box input:checked + span {
  background: var(--tr-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17l9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
  box-shadow: none;
}
.tb-chk-box input:focus-visible + span { outline: 2px solid var(--tr-focus); outline-offset: 2px; }
.tb-chk-box input:disabled + span { opacity: 0.5; }
.tb-date-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tb-select-field { display: block; background: var(--tr-neutral); border-radius: 3px; padding: 6px 12px; margin-bottom: 8px; cursor: pointer; }
.tb-select-field:hover { background: var(--tr-neutral-hover); }
.tb-select-field span { display: block; font-size: 12px; color: var(--tr-subtle); }
.tb-select-field select { width: 100%; background: transparent; border: none; color: var(--tr-text); font-size: 14px; padding: 0; outline: none; cursor: pointer; }
.tb-select-field select option { background: var(--tr-surface); color: var(--tr-text); }

/* ---------------------------------------------------------------- Right drawer (Filter / Menu) */
.tb-drawer-overlay { position: absolute; inset: 0; z-index: 48; display: none; }
.tb-drawer-overlay.open { display: block; }
.tb-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 92%;
  z-index: 49;
  background: var(--tr-surface);
  color: var(--tr-text);
  box-shadow: var(--tr-overlay-shadow);
  padding: 0 12px 16px;
  overflow-y: auto;
  transform: translateX(105%);
  transition: transform 0.18s ease;
  font-size: 14px;
}
.tb-drawer.open { transform: translateX(0); }
.tb-drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  height: 52px;
  margin: 0 -12px 4px;
  padding: 0 10px;
  border-bottom: 1px solid var(--tr-border);
  background: var(--tr-surface);
}
.tb-drawer-head h3 { margin: 0; text-align: center; font-size: 16px; font-weight: 600; color: var(--tr-subtle); }
.tb-drawer-body { padding-top: 8px; }
.tb-filter-section { margin: 8px 0 20px; }
.tb-filter-section h4 { font-size: 12px; font-weight: 600; color: var(--tr-subtle); margin: 0 0 8px; }
.tb-filter-hint { font-size: 12px; color: var(--tr-subtlest); margin: 6px 0 0; }
.tb-check-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; cursor: pointer; color: var(--tr-text); }
.tb-check-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--tr-blue); flex-shrink: 0; cursor: pointer; }
.tb-due-ico { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tr-neutral); color: var(--tr-subtle); flex-shrink: 0; }
.tb-due-ico.overdue { background: var(--tr-red); color: #fff; }
.tb-due-ico.soon { background: var(--tr-yellow); color: var(--tr-yellow-ink); }
.tb-due-ico.done { background: var(--tr-green); color: #fff; }
.tb-menu-about { display: flex; align-items: center; gap: 12px; padding: 8px 0 4px; }
.tb-menu-about strong { display: block; font-size: 14px; }
.tb-menu-about span:not(.tb-board-thumb) { display: block; font-size: 12px; color: var(--tr-subtle); margin-top: 2px; }
.tb-bg-mini { width: 20px; height: 20px; border-radius: 3px; flex-shrink: 0; }
.tb-count-pill { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--tr-neutral); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; color: var(--tr-subtle); }
.tb-bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tb-bg-tile { height: 64px; border: none; border-radius: 8px; cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.tb-bg-tile:hover { filter: brightness(0.92); }
.tb-bg-tile.selected { box-shadow: 0 0 0 2px var(--tr-surface), 0 0 0 4px var(--tr-focus); }
.tb-drive-row { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.tb-archive-item { margin: 0 0 14px; }
.tb-archive-actions { font-size: 12px; margin: 6px 4px 0; color: var(--tr-subtle); }
.tb-archive-empty { text-align: center; padding: 40px 0; color: var(--tr-subtle); }
.tb-archive-empty p { margin: 8px 0 0; }

/* ---------------------------------------------------------------- Card detail modal */
.tb-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
  overflow-y: auto;
}
.tb-modal {
  width: 100%;
  max-width: 1040px;
  background: var(--tr-modal);
  color: var(--tr-text);
  border-radius: 12px;
  box-shadow: var(--tr-overlay-shadow);
  overflow: hidden;
  font-size: 14px;
}
.tb-modal.fresh { animation: pop-in 0.14s ease both; }
.tb-modal-top {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 56px;
  padding: 0 12px 0 24px;
  border-bottom: 1px solid var(--tr-border);
}
.tb-list-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 6px 0 8px;
  border: none;
  border-radius: 3px;
  background: var(--tr-neutral);
  color: var(--tr-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.tb-list-pill:hover { background: var(--tr-neutral-hover); }
.tb-modal-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--tr-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tb-modal-icon:hover { background: var(--tr-neutral-hover); color: var(--tr-text); }
.tb-modal-cover { height: 116px; }
.tb-modal-cover.img { height: 200px; background-size: contain; background-position: center; background-repeat: no-repeat; background-color: var(--tr-list); }
.tb-archived-banner { display: flex; align-items: center; gap: 8px; padding: 12px 24px; background: #fff7d6; color: #533f04; font-size: 14px; }
.tb-modal-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); }
.tb-modal-main { padding: 20px 24px 28px; min-width: 0; }
.tb-modal-side { background: var(--tr-modal-side); border-left: 1px solid var(--tr-border); padding: 20px 20px 28px; min-width: 0; }
.tb-modal-titlerow { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.tb-complete {
  width: 20px;
  height: 20px;
  margin-top: 6px;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--tr-subtle);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.tb-complete:hover { box-shadow: inset 0 0 0 1.5px var(--tr-text); }
.tb-complete.done { background: #22a06b; box-shadow: none; }
.tb-modal-title {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--tr-text);
  font-size: 22px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: -0.01em;
  padding: 0 6px;
  margin-left: -6px;
  border-radius: 3px;
  resize: none;
  overflow: hidden;
  outline: none;
}
.tb-modal-title:focus { background: var(--tr-input-bg); box-shadow: inset 0 0 0 2px var(--tr-focus); }
.tb-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px 32px; }
.tb-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 3px;
  border: 1px solid var(--tr-border);
  background: transparent;
  color: var(--tr-subtle);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.tb-chip-btn:hover { background: var(--tr-neutral); color: var(--tr-text); }
.tb-modal-meta { display: flex; flex-wrap: wrap; gap: 16px 24px; margin: 0 0 24px 32px; }
.tb-modal-meta:empty { display: none; }
.tb-meta-group h4 { font-size: 12px; font-weight: 600; color: var(--tr-subtle); margin: 0 0 6px; }
.tb-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tb-round-add, .tb-square-add {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--tr-neutral);
  color: var(--tr-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tb-round-add { border-radius: 50%; }
.tb-square-add { border-radius: 3px; }
.tb-round-add:hover, .tb-square-add:hover { background: var(--tr-neutral-hover); color: var(--tr-text); }
.tb-label-lg { height: 32px; min-width: 48px; padding: 0 12px; border: none; border-radius: 3px; font-size: 14px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tb-label-lg:hover { filter: brightness(0.93); }
.tb-date-btn { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px 0 4px; border: none; border-radius: 3px; background: var(--tr-neutral); color: var(--tr-text); cursor: pointer; font-size: 14px; }
.tb-date-btn:hover { background: var(--tr-neutral-hover); }
.tb-date-btn .tb-badge { background: transparent !important; color: var(--tr-text) !important; font-size: 14px; height: 32px; }
.tb-due-state { margin-left: 4px; height: 18px; padding: 0 4px; border-radius: 3px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; }
.tb-due.done .tb-due-state { background: var(--tr-green); color: #fff; }
.tb-due.overdue .tb-due-state { background: var(--tr-red); color: #fff; }
.tb-due.soon .tb-due-state { background: var(--tr-yellow); color: var(--tr-yellow-ink); }

.tb-section { margin: 0 0 26px; }
.tb-section-head, .tb-side-head { display: flex; align-items: center; gap: 8px; min-height: 32px; margin-bottom: 8px; }
.tb-section-head h3, .tb-side-head h3 { flex: 1; margin: 0; font-size: 16px; font-weight: 600; color: var(--tr-text); }
.tb-side-head h3 { font-size: 14px; }
.tb-section-icon { width: 24px; display: inline-flex; justify-content: center; color: var(--tr-subtle); flex-shrink: 0; }
.tb-section-body { margin-left: 32px; }
.tb-desc-view { font-size: 14px; line-height: 20px; overflow-wrap: anywhere; cursor: pointer; }
.tb-desc-view a { color: var(--tr-blue); }
.tb-desc-placeholder {
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  border: none;
  border-radius: 3px;
  background: var(--tr-neutral);
  color: var(--tr-text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: block;
}
.tb-desc-placeholder:hover { background: var(--tr-neutral-hover); }
.tb-desc-editor, .tb-chk-input {
  width: 100%;
  min-height: 132px;
  padding: 8px 12px;
  border: none;
  border-radius: 3px;
  background: var(--tr-input-bg);
  color: var(--tr-text);
  font-size: 14px;
  line-height: 20px;
  box-shadow: inset 0 0 0 1px var(--tr-input-border);
  resize: vertical;
  outline: none;
}
.tb-chk-input { min-height: 56px; resize: none; }
.tb-desc-editor:focus, .tb-chk-input:focus { box-shadow: inset 0 0 0 2px var(--tr-focus); }
.tb-inline-actions { display: flex; gap: 8px; margin-top: 8px; }
.tb-progress { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.tb-progress-pct { width: 32px; text-align: center; font-size: 11px; color: var(--tr-subtle); flex-shrink: 0; }
.tb-progress-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--tr-neutral); overflow: hidden; }
.tb-progress-fill { height: 100%; border-radius: 4px; background: var(--tr-blue); transition: width 0.15s ease, background 0.15s ease; }
.tb-progress-fill.done { background: #22a06b; }
.tb-chk-items { display: flex; flex-direction: column; }
.tb-chk-item { display: flex; align-items: center; gap: 16px; min-height: 36px; padding: 4px 4px 4px 4px; border-radius: 8px; }
.tb-chk-item:hover { background: var(--tr-neutral); }
.tb-chk-text { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.tb-chk-text.done { text-decoration: line-through; color: var(--tr-subtle); }
.tb-chk-del { opacity: 0; width: 28px; height: 28px; }
.tb-chk-item:hover .tb-chk-del { opacity: 1; }
.tb-chk-add { margin: 8px 0 0 36px; }

.tb-comment-composer textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: var(--tr-input-bg);
  color: var(--tr-text);
  font-size: 14px;
  line-height: 20px;
  box-shadow: var(--tr-shadow);
  resize: none;
  outline: none;
  display: block;
  transition: min-height 0.12s ease;
}
.tb-comment-composer.active textarea { min-height: 88px; box-shadow: inset 0 0 0 2px var(--tr-focus); }
.tb-comment-actions { display: none; margin-top: 8px; }
.tb-comment-composer.active .tb-comment-actions { display: flex; }
.tb-activity { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.tb-act { display: flex; gap: 10px; align-items: flex-start; }
.tb-act-main { flex: 1; min-width: 0; font-size: 14px; }
.tb-act-line strong { font-weight: 600; }
.tb-act-time { font-size: 12px; color: var(--tr-subtle); }
.tb-act-line .tb-act-time { margin-left: 4px; text-decoration: underline; text-underline-offset: 2px; }
.tb-comment-bubble { margin-top: 4px; padding: 8px 12px; border-radius: 8px; background: var(--tr-card); box-shadow: var(--tr-shadow); overflow-wrap: anywhere; line-height: 20px; }
.tb-act-links { margin-top: 4px; }
.tb-archived-banner svg { flex-shrink: 0; }

@media (max-width: 900px) {
  .tb-modal-split { grid-template-columns: 1fr; }
  .tb-modal-side { border-left: none; border-top: 1px solid var(--tr-border); }
  .tb-modal-overlay { padding: 0; }
  .tb-modal { border-radius: 0; min-height: 100vh; }
  .tb-modal-actions, .tb-modal-meta, .tb-section-body, .tb-chk-add { margin-left: 0; }
  .tb-search input { width: 110px; }
}
@media (max-width: 760px) {
  .main.main-board { height: calc(100vh - 52px); min-height: 0; padding: 0; }
  .tb-header { padding: 8px; }
  .tb-view-pill, .tb-members { display: none; }
  .tb-search { display: none; }
  .tb-list, .tb-add-list-wrap { width: 85vw; max-width: 300px; }
  .tb-lists { scroll-snap-type: x mandatory; }
  .tb-list { scroll-snap-align: center; }
}
#tb-label-create { margin-top: 8px; }
.rv-sidebar .notes-list > :not(.note-item) { padding: 10px 6px; color: var(--text-dim); font-size: 13px; }
.idea-pitch-panel button.primary { width: auto; min-width: 200px; }


/* ==========================================================================
   Components added after the first redesign pass (Queue rows, History rows, Team table,
   Settings toggles, customizable Hub, Idea Coach pitch grid + Manage modal, Outliers
   filter/manage). Their rules ride on the same design tokens as everything above.
   ========================================================================== */
:root { --panel-hover: var(--hover); }
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.queuerow {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.12s ease;
}
.queuerow:hover { border-color: var(--brand-blue); }
.queuerow.selected { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.queue-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.queuerow.selected .queue-checkbox { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.queue-thumb {
  width: 96px;
  height: 56px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #2b2f38, #14161a) center/cover no-repeat;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.queue-thumb-play {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.queue-thumb-play::after {
  content: '';
  width: 0;
  height: 0;
  margin-left: 2px;
  border-style: solid;
  border-width: 6px 0 6px 9px;
  border-color: transparent transparent transparent #14161a;
}
.queue-row-body { flex: 1; min-width: 0; }
.queue-row-body .title { font-weight: 600; font-size: 14.5px; margin: 0 0 6px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-row-body .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); flex-wrap: wrap; }
.queue-row-badges, .queue-row-actions { flex-shrink: 0; }
.queue-approve-btn { padding: 8px 16px; font-size: 12.5px; }
@media (max-width: 620px) {
  .queuerow { flex-wrap: wrap; }
  .queue-row-body { flex-basis: 100%; order: 1; }
  .queue-row-badges { order: 2; }
  .queue-row-actions { order: 3; margin-left: auto; }
}
.history-rows { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.hrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px 18px;
}
.hrow-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.hrow-main .text { font-size: 13.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow-main .text strong { color: var(--text); font-weight: 600; }
.hrow-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hrow-date { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.login-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin: 0 0 6px; }
.note-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rv-back-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.rv-back-btn:hover { color: var(--text); background: var(--border); }
.rv-topbar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rv-topbar-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-subtitle { margin: 0; font-size: 12.5px; color: var(--text-dim); }
.rv-topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
@media (max-width: 480px) {
  .rv-topbar-actions button { padding: 7px 12px; font-size: 12.5px; }
}
.a-stat-grid .stat-tile { border-radius: var(--radius); padding: 18px 20px; }
.a-stat-grid .stat-tile .label { text-transform: none; letter-spacing: normal; font-size: 12.5px; }
.a-period-select-wrap { position: relative; display: inline-flex; }
.a-period-select-wrap::after {
  content: '▾';
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--text-dim); pointer-events: none;
}
.my-stat-grid .stat-tile .label { text-transform: none; letter-spacing: normal; }
.my-todo-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.a-bar { cursor: pointer; }
button.warning {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #f3dfb0;
  background: #fff8ea;
  color: #b56a15;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}
button.warning:hover { background: #fdefce; }
button.warning:disabled { opacity: 0.5; cursor: default; }
.toggle-switch { display: inline-flex; align-items: center; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-switch .track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d7dae0;
  position: relative;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.toggle-switch .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 17, 20, 0.25);
  transition: transform 0.15s ease;
}
.toggle-switch input:checked + .track { background: var(--brand-blue); }
.toggle-switch input:checked + .track .knob { transform: translateX(16px); }
.toggle-switch input:disabled + .track { opacity: 0.5; cursor: default; }
.dt-group-count { font-size: 12.5px; font-weight: 400; color: var(--text-dim); }
.ed-stat-grid .stat-tile .label { text-transform: none; letter-spacing: normal; }
.team-table-wrap { overflow-x: auto; }
.team-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 4px; }
.team-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.team-table td { padding: 10px; border-bottom: 1px solid var(--border); }
.team-row:last-of-type td { border-bottom: none; }
.team-row.is-paused { color: var(--text-dim); }
.team-name-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.team-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
}
.team-share-icon { color: var(--brand-yellow-dark); display: inline-flex; vertical-align: -2px; margin-left: 4px; }
.team-videos-cell { color: var(--text-dim); }
.team-edit-row td { padding: 0 0 14px; border-bottom: 1px solid var(--border); }
.team-edit-row:last-of-type td { border-bottom: none; }
.team-edit-row .team-card { margin: 4px 10px 0; }
.settings-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  align-items: start;
}
.settings-panel {
  margin-bottom: 0;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-panel h2 { font-size: 14.5px; margin: 0; }
.settings-panel .panel-sub { margin: 0; }
.settings-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.settings-toggle-label { font-size: 13.5px; font-weight: 600; }
.settings-toggle-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.5; }
.modal-box.wide { max-width: 640px; }
.cal-today-label { color: #EFA500; font-weight: 700; font-size: 11px; }
.hub-greeting { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.hub-subtitle { color: var(--text-dim); font-size: 13px; margin: 0; }
.hub-subtitle #hub-clock-time { font-variant-numeric: tabular-nums; }
.hub-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
.hub-status-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.hub-status-badge.is-online { background: #e8f8ea; color: #1a9c46; }
.hub-status-badge.is-offline { background: #fdeaea; color: #d64545; }
.hub-top-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hub-card.is-dragging { opacity: 0.4; }
.hub-card-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -18px -18px 2px;
  padding: 5px 0 3px;
  border-radius: 16px 16px 0 0;
  color: var(--text-muted);
  cursor: grab;
}
.hub-card-drag-handle:hover { background: var(--bg); color: var(--text-dim); }
.hub-card-drag-handle:active { cursor: grabbing; }
.hub-card-move-btns { display: flex; gap: 4px; flex-shrink: 0; }
.hub-move-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  cursor: pointer;
}
.hub-move-btn:hover:not(:disabled) { border-color: var(--brand-blue); color: var(--brand-blue); }
.hub-move-btn:disabled { opacity: 0.35; cursor: default; }
.hub-edit-hint { font-size: 12px; color: var(--text-muted); margin-top: 14px; }
.hub-card-icon-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hub-card-badge { flex-shrink: 0; }
.ol-channel-filter { margin-bottom: 14px; }
.ol-manage-add-row { display: flex; gap: 10px; margin-bottom: 10px; }
.ol-manage-add-row input { flex-grow: 1; }
.ol-manage-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.ol-manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-top: 1px solid var(--border);
}
.ol-manage-row:first-child { border-top: none; }
.ol-manage-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.ol-manage-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ol-manage-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-blue); color: #fff; font-size: 11px; font-weight: 700;
}
.ol-manage-error { color: var(--critical); display: inline-flex; flex-shrink: 0; }
.ol-manage-idea-select {
  max-width: 160px;
  padding: 6px 8px;
  font-size: 12px;
}
.ol-thumb-link { display: block; width: 100%; height: 100%; }
.ol-mult-pill {
  position: absolute; top: 7px; right: 7px; color: #fff;
  font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  line-height: 1.3;
}
.insp-tile {
  position: relative;
  display: block;
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--border);
}
.insp-tile-img { width: 100%; display: block; }
.insp-badge-outlier { background: rgba(46,204,113,0.9); }
.insp-badge-extension { background: rgba(30,167,225,0.9); }
.insp-badge-manual { background: rgba(155,89,182,0.9); }
.insp-tile:hover .insp-delete-btn { opacity: 1; }
.insp-tile-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 11px 9px;
  background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0));
  pointer-events: none;
}
.insp-tile-title {
  font-size: 12.5px; font-weight: 600; line-height: 1.35; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.insp-tile-sub { font-size: 10.5px; color: rgba(255,255,255,0.85); margin-top: 2px; }
.account-panels { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.role-admin-everything {
  text-align: left;
  color: var(--good);
  font-weight: 600;
  background: color-mix(in srgb, var(--good) 10%, transparent);
}
.role-select {
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.role-select:hover { background: var(--bg); border-color: var(--border); }
.role-select:focus { outline: none; background: var(--bg); border-color: var(--brand-blue); }
.idea-col { max-width: 1180px; }
.idea-pitch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.idea-pitch-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
}
.idea-pitch-card-art {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.idea-pitch-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.idea-thumb-art-0 { background: color-mix(in srgb, var(--brand-blue) 12%, var(--panel)); }
.idea-thumb-art-1 { background: color-mix(in srgb, var(--brand-yellow) 18%, var(--panel)); }
.idea-thumb-art-2 { background: color-mix(in srgb, var(--critical) 12%, var(--panel)); }
.idea-thumb-play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(20, 22, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.idea-pitch-card-body { padding: 12px 14px 2px; flex-grow: 1; }
.idea-pitch-card-title { font-size: 15.5px; font-weight: 700; color: var(--text); line-height: 1.32; margin-bottom: 4px; }
.idea-pitch-card-byline { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.idea-pitch-card-details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.idea-pitch-card-details-toggle:hover { color: var(--text-dim); }
.idea-pitch-card-details-toggle svg { transition: transform 0.15s ease; flex-shrink: 0; }
.idea-pitch-card-details-toggle.is-open svg { transform: rotate(90deg); }
.idea-pitch-card-details[hidden] { display: none; }
.idea-pitch-card-pitch {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.45;
  margin-bottom: 8px;
}
.idea-pitch-card-thumbnote { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; margin-bottom: 8px; }
.idea-pitch-card-thumbnote strong { color: var(--text-dim); }
.idea-pitch-card-rationale {
  color: var(--good);
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 4px;
}
.idea-pitch-card-actions { display: flex; gap: 6px; padding: 10px 14px 14px; margin-top: auto; }
.idea-pitch-card-actions[hidden] { display: none; }
.idea-pitch-card-actions button { flex: 1; padding: 8px 4px; font-size: 12px; }
.idea-pitch-card-note { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.idea-pitch-card-note[hidden] { display: none; }
.idea-pitch-card-note textarea { min-height: 60px; }
.idea-pitch-card-note-actions { display: flex; gap: 8px; justify-content: flex-end; }
.idea-pitch-card-note-actions button { width: auto; }
.idea-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.idea-panel-head h2 { margin: 0; }
.idea-panel-sub { font-size: 12.5px; color: var(--text-dim); margin-bottom: 12px; line-height: 1.4; }
.empty-state.small { padding: 18px 0; font-size: 13px; }
.idea-manage-tabs { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--border); }
.idea-manage-tab {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.idea-manage-tab:hover { color: var(--text); }
.idea-manage-tab.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }
.idea-manage-body { max-height: 60vh; overflow-y: auto; }
.idea-suggested-list { display: flex; flex-direction: column; gap: 2px; }
.idea-suggested-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-top: 1px solid var(--border);
}
.idea-suggested-row:first-child { border-top: none; }
.idea-suggested-thumb { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.idea-suggested-thumb-empty { background: var(--bg); }
.idea-suggested-main { flex: 1; min-width: 0; }
.idea-suggested-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.idea-suggested-subs { font-weight: 500; color: var(--text-dim); }
.idea-suggested-reason { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.idea-suggested-actions { display: flex; gap: 8px; flex-shrink: 0; }
.idea-suggested-actions button { width: auto; padding: 7px 14px; font-size: 12.5px; }
.idea-material-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.idea-material-form-row { display: flex; gap: 8px; }
.idea-material-form button { align-self: flex-start; }
.idea-material-list { display: flex; flex-direction: column; gap: 2px; }
.idea-material-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 4px;
  border-top: 1px solid var(--border);
}
.idea-material-row:first-child { border-top: none; }
.idea-material-main { flex: 1; min-width: 0; }
.idea-material-title-row { display: flex; align-items: center; gap: 8px; }
.idea-material-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.idea-material-preview { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.4; }
.idea-material-row button { width: auto; padding: 6px 9px; flex-shrink: 0; }


/* ---- Fit-ups for the newer markup, in this design system ---- */
.hub-card { flex-direction: column; align-items: stretch; gap: 10px; position: relative; min-height: 132px; }
.hub-card-icon-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hub-card-title { margin-top: 2px; }
.hub-card-desc { margin-top: -6px; }
.hub-card.is-editing { cursor: default; border-style: dashed; }
.hub-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.badge-warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--warn-soft);
  color: var(--warn);
}
.cal-month-daynum { width: auto; min-width: 22px; padding: 0 4px; border-radius: 11px; gap: 4px; justify-content: flex-start; }
.cal-month-cell.cal-today .cal-month-daynum { padding: 0 8px 0 7px; width: fit-content; }
.cal-month-cell.cal-today .cal-today-label { color: #fff; font-weight: 500; font-size: 11px; }
.cal-today-label { color: var(--critical); font-weight: 500; font-size: 11px; }
.a-period-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
  padding: 0 30px 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}
.a-period-select-wrap select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.hub-status-badge.is-online { background: var(--good-soft); color: var(--good); }
.hub-status-badge.is-offline { background: var(--critical-soft); color: var(--critical); }

/* ==========================================================================
   Proof-watch — Frame.io-style stage (Mobbin: Frame.io review screens)
   ========================================================================== */
:root { --pw-accent: #7b6cf6; --pw-yellow: #f5c542; }
.main.main-review { background: var(--panel); }
/* Proof-watch surface tokens — light like Frame.io's light theme, dark like its default. */
:root {
  --pw-stage: #e9e9ed; --pw-video-bg: #000; --pw-track: rgba(20, 20, 30, 0.14); --pw-buffer: rgba(20, 20, 30, 0.22);
  --pw-handle: #ffffff; --pw-chip-bg: #1c1c1a; --pw-chip-text: #ffffff; --pw-spin-track: rgba(20, 20, 30, 0.15); --pw-spin-head: #3b3b45;
  --pw-menu-bg: #ffffff; --pw-menu-border: #e3e3e8; --pw-menu-text: #1c1c1a; --pw-menu-dim: #6b6b75; --pw-menu-hover: #f1f1f4;
  --pw-kbd-bg: #f1f1f4; --pw-kbd-border: #d8d8de; --pw-yellow-ink: #8a5d00;
  --pw-waveform-bar: #2fb87b; --pw-range-band: rgba(123, 108, 246, 0.22); --pw-range-draft: rgba(123, 108, 246, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pw-stage: #0b0b0d; --pw-track: rgba(255, 255, 255, 0.12); --pw-buffer: rgba(255, 255, 255, 0.22);
    --pw-chip-bg: #ffffff; --pw-chip-text: #111111; --pw-spin-track: rgba(255, 255, 255, 0.16); --pw-spin-head: #ffffff;
    --pw-menu-bg: #1f2024; --pw-menu-border: #2f3036; --pw-menu-text: #eceef1; --pw-menu-dim: #8b8e96; --pw-menu-hover: #2a2b31;
    --pw-kbd-bg: #2a2b31; --pw-kbd-border: #3a3b41; --pw-yellow-ink: #f5c542;
    --pw-waveform-bar: #3ddb93; --pw-range-band: rgba(123, 108, 246, 0.3); --pw-range-draft: rgba(123, 108, 246, 0.45);
  }
}
:root[data-theme="dark"] {
  --pw-stage: #0b0b0d; --pw-track: rgba(255, 255, 255, 0.12); --pw-buffer: rgba(255, 255, 255, 0.22);
  --pw-chip-bg: #ffffff; --pw-chip-text: #111111; --pw-spin-track: rgba(255, 255, 255, 0.16); --pw-spin-head: #ffffff;
  --pw-menu-bg: #1f2024; --pw-menu-border: #2f3036; --pw-menu-text: #eceef1; --pw-menu-dim: #8b8e96; --pw-menu-hover: #2a2b31;
  --pw-kbd-bg: #2a2b31; --pw-kbd-border: #3a3b41; --pw-yellow-ink: #f5c542;
  --pw-waveform-bar: #3ddb93; --pw-range-band: rgba(123, 108, 246, 0.3); --pw-range-draft: rgba(123, 108, 246, 0.45);
}
#review-body { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pw-loading { align-items: center; justify-content: center; }
.pw { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; height: 100%; color: var(--text); }
.pw-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--pw-spin-track); border-top-color: var(--pw-spin-head); animation: pw-spin 0.8s linear infinite; }
@keyframes pw-spin { to { transform: rotate(360deg); } }
.pw-page-error { margin: auto; text-align: center; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-dim); }
.pw-page-error h2 { margin: 6px 0 0; color: var(--text); font-size: 17px; }
.pw-page-error p { margin: 0 0 8px; font-size: 13.5px; }
.pw-page-error button { width: auto; }
.pw-page-error-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--warn); }

/* top bar */
.pw-top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 12px 0 10px; border-bottom: 1px solid var(--border); background: var(--panel); flex-shrink: 0; min-width: 0; }
.pw-top-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.pw-crumbs { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); }
.pw-crumb { cursor: pointer; }
.pw-crumb:hover { color: var(--text); }
.pw-crumb-sep { opacity: 0.6; }
.pw-proj { display: inline-flex; align-items: center; gap: 5px; color: var(--text-dim); }
.pw-proj::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--proj); }
.pw-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pw-title { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.pw-rev { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; background: color-mix(in srgb, var(--pw-yellow) 22%, transparent); color: var(--pw-yellow-ink); font-size: 11px; font-weight: 600; flex-shrink: 0; }
.pw-top-meta { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.pw-top-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pw-btn { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid transparent; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.pw-btn:disabled { opacity: 0.55; cursor: default; }
.pw-btn-ghost { background: var(--bg); border-color: var(--border); color: var(--text); }
.pw-btn-ghost:hover:not(:disabled) { background: var(--hover); }
.pw-btn-ghost.is-empty { color: var(--text-dim); }
.pw-btn-primary { background: var(--accent); color: #fff; }
.pw-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.pw-btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.pw-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pw-yellow); color: #1c1c1a; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.pw-count:empty { display: none; }
.pw-icon-btn { width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--text-dim); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.pw-icon-btn:hover { background: var(--hover); color: var(--text); }
.pw-icon-btn.sm { width: 24px; height: 24px; border-radius: 6px; }

/* layout */
.pw-body { flex: 1; display: flex; min-height: 0; min-width: 0; }
.pw-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--pw-stage); position: relative; }
.pw-stage:fullscreen { background: #000; --pw-stage: #000; }
.pw-viewer { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 16px; }
.pw-stage:fullscreen .pw-viewer { padding: 0; }
.pw-viewer video { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; background: var(--pw-video-bg); border-radius: 4px; cursor: pointer; outline: none; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18); }
.pw-big-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 68px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.55); color: #fff; backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding-left: 4px;
  transition: transform 0.12s ease, background 0.12s ease;
}
.pw-big-play:hover { background: rgba(0, 0, 0, 0.72); transform: translate(-50%, -50%) scale(1.05); }
.pw-big-play[hidden] { display: none; }
.pw-buffering { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.pw-buffering[hidden] { display: none; }
.pw-flash {
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%) translateY(-6px);
  padding: 6px 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.72); color: #fff;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.pw-flash.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pw-video-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--text-dim); font-size: 13px; background: color-mix(in srgb, var(--pw-stage) 88%, transparent); padding: 24px; }
.pw-video-error[hidden] { display: none; }
.pw-video-error strong { color: var(--text); font-size: 15px; }
.pw-video-error svg { color: var(--pw-yellow-ink); }
.pw-video-error .pw-btn { margin-top: 6px; }

/* controls */
.pw-controls { flex-shrink: 0; background: var(--panel); border-top: 1px solid var(--border); padding: 0 12px 6px; user-select: none; }
.pw-timeline { position: relative; height: 56px; cursor: pointer; touch-action: none; }
.pw-timeline.is-range-arming { cursor: crosshair; }
.pw-track { position: absolute; left: 0; right: 0; top: 8px; height: 40px; border-radius: 8px; background: var(--pw-track); overflow: hidden; transition: height 0.1s ease, top 0.1s ease; }
.pw-timeline:hover .pw-track, .pw-timeline.is-scrubbing .pw-track { top: 6px; height: 44px; }
.pw-waveform { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pw-track.is-loading-wave { background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--pw-waveform-bar) 60%, transparent), transparent); background-size: 60px 100%; animation: pw-wave-shimmer 1.1s linear infinite; }
@keyframes pw-wave-shimmer { from { background-position: -60px 0; } to { background-position: 160px 0; } }
.pw-ranges { position: absolute; left: 0; right: 0; top: 8px; height: 40px; pointer-events: none; }
.pw-range-band { position: absolute; top: 0; height: 100%; min-width: 3px; border-radius: 6px; background: var(--pw-range-band); pointer-events: auto; cursor: pointer; }
.pw-range-band:hover { background: var(--pw-range-draft); }
.pw-range-draft { position: absolute; top: 8px; height: 40px; border-radius: 6px; background: var(--pw-range-draft); pointer-events: none; }
.pw-range-draft[hidden] { display: none; }
.pw-buffered { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--pw-buffer) 70%, transparent); width: 0; }
/* Played portion stays unfilled so the waveform reads end to end — the pin playhead marks the position. */
.pw-progress { position: absolute; left: 0; top: 0; bottom: 0; background: transparent; width: 0; z-index: 1; }
/* Pin playhead: a thin white line through the whole timeline, capped with a waveform-green teardrop. */
.pw-handle { position: absolute; left: 0; top: 0; bottom: -2px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--pw-handle); box-shadow: 0 0 3px rgba(0, 0, 0, 0.45); pointer-events: none; z-index: 4; }
.pw-handle::before {
  content: ''; position: absolute; left: 50%; top: -9px; width: 18px; height: 18px; margin-left: -9px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); transform-origin: 50% 50%;
  background: var(--pw-waveform-bar); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); transition: transform 0.1s ease;
}
.pw-timeline:hover .pw-handle::before, .pw-timeline.is-scrubbing .pw-handle::before { transform: rotate(-45deg) scale(1.12); }
.pw-hover { position: absolute; bottom: 56px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; z-index: 3; }
.pw-hover[hidden] { display: none; }
.pw-hover span:first-child { padding: 2px 6px; border-radius: 5px; background: var(--pw-chip-bg); color: var(--pw-chip-text); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pw-hover-note { max-width: 220px; padding: 3px 7px; border-radius: 5px; background: rgba(0, 0, 0, 0.85); color: #fff; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-hover-note:empty { display: none; }
.pw-markers { position: absolute; inset: 0; pointer-events: none; }
.pw-marker {
  position: absolute; top: 2px; transform: translateX(-50%); pointer-events: auto;
  min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px 8px 8px 2px; border: none;
  background: var(--pw-yellow); color: #1c1c1a; font-size: 9.5px; font-weight: 800; line-height: 16px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transition: transform 0.1s ease;
}
.pw-marker::after { content: ''; position: absolute; left: 50%; top: 18px; width: 1px; height: 16px; background: var(--pw-yellow); opacity: 0.7; }
.pw-marker:hover, .pw-marker.active { transform: translateX(-50%) scale(1.18); z-index: 2; }
.pw-marker.active { background: var(--pw-chip-bg); color: var(--pw-chip-text); }
.pw-marker.has-shot { background: #6fd3ff; }

/* ---- Automated QC flags (black flashes, clipped audio, offline-media slate, music
   over the mic) — see src/qcDetect.js. Deliberately red/critical-toned throughout so
   they read as "unconfirmed machine findings," never mistaken for a teammate's note
   (purple handle/bands) or the waveform (green). ---- */
.pw-qc-ranges { position: absolute; left: 0; right: 0; top: 8px; height: 40px; pointer-events: none; }
.pw-qc-range-band { position: absolute; top: 0; height: 100%; min-width: 3px; border-radius: 6px; background: color-mix(in srgb, var(--critical) 20%, transparent); border: 1px solid color-mix(in srgb, var(--critical) 40%, transparent); pointer-events: auto; cursor: pointer; }
.pw-qc-range-band:hover { background: color-mix(in srgb, var(--critical) 32%, transparent); }
.pw-qc-markers { position: absolute; inset: 0; pointer-events: none; }
.pw-qc-marker {
  position: absolute; top: 48px; transform: translateX(-50%); pointer-events: auto;
  width: 16px; height: 16px; padding: 0; border: none; border-radius: 50%;
  background: color-mix(in srgb, var(--critical) 16%, var(--panel)); color: var(--critical); cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transition: transform 0.1s ease;
}
.pw-qc-marker::after { content: ''; position: absolute; left: 50%; bottom: 16px; width: 1px; height: 8px; background: var(--critical); opacity: 0.6; }
.pw-qc-marker:hover { transform: translateX(-50%) scale(1.2); z-index: 2; }

.pw-qc { margin: 10px 12px 0; flex-shrink: 0; }
.pw-qc-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.pw-qc-bar-text { display: flex; align-items: center; gap: 6px; color: var(--text-dim); min-width: 0; }
.pw-qc-bar-text svg { flex-shrink: 0; color: var(--critical); }
.pw-qc-progress { flex-direction: column; align-items: stretch; gap: 6px; }
.pw-qc-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pw-qc-eta { flex-shrink: 0; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.pw-qc-track { height: 4px; border-radius: 2px; background: var(--pw-track); overflow: hidden; }
.pw-qc-fill { height: 100%; border-radius: 2px; background: var(--pw-accent); transition: width 2s linear; }
.pw-qc-phase { font-size: 11.5px; color: var(--text-dim); }
.pw-qc-box { border: 1px solid color-mix(in srgb, var(--critical) 30%, var(--border)); background: color-mix(in srgb, var(--critical) 6%, var(--panel)); border-radius: 10px; }
.pw-qc-box summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text); }
.pw-qc-box summary::-webkit-details-marker { display: none; }
.pw-qc-box summary svg:first-child { color: var(--critical); flex-shrink: 0; }
.pw-qc-box summary span { flex: 1; }
.pw-qc-list { list-style: none; margin: 0; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 4px; }
.pw-qc-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 7px; min-width: 0; }
.pw-qc-row:hover { background: var(--hover); }
.pw-qc-row.flash { animation: pw-flash-row-critical 0.7s ease; }
@keyframes pw-flash-row-critical { 0% { background: color-mix(in srgb, var(--critical) 25%, transparent); } 100% { background: transparent; } }
.pw-qc-jump { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; border: none; background: none; padding: 0; cursor: pointer; color: inherit; font: inherit; text-align: left; }
.pw-qc-jump svg { color: var(--critical); flex-shrink: 0; align-self: flex-start; margin-top: 2px; }
.pw-qc-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pw-qc-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.pw-qc-type { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pw-qc-time { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
.pw-qc-detail { font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pw-qc-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.pw-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 40px; }
.pw-bar-left, .pw-bar-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
.pw-ctl { position: relative; height: 32px; min-width: 32px; padding: 0 6px; border: none; border-radius: 7px; background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; font-family: inherit; }
.pw-ctl:hover { background: var(--hover); }
.pw-ctl-sm { color: var(--text-dim); }
.pw-ctl-num { position: absolute; font-size: 7.5px; font-weight: 800; top: 50%; left: 50%; transform: translate(-50%, -38%); }
.pw-speed { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 42px; }
.pw-speed.is-fast { color: #1c1c1a; background: var(--pw-yellow); }
.pw-vol { display: flex; align-items: center; }
.pw-vol-slider { -webkit-appearance: none; appearance: none; width: 0; opacity: 0; height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--text) var(--fill, 100%), var(--pw-track) var(--fill, 100%)); cursor: pointer; transition: width 0.15s ease, opacity 0.15s ease, margin 0.15s ease; }
.pw-vol:hover .pw-vol-slider, .pw-vol-slider:focus { width: 72px; opacity: 1; margin: 0 8px 0 2px; }
.pw-vol-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--text); }
.pw-vol-slider::-moz-range-thumb { width: 12px; height: 12px; border: none; border-radius: 50%; background: var(--text); }
.pw-time { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text); margin-left: 6px; white-space: nowrap; }
.pw-time-sep { color: var(--text-muted); margin: 0 4px; }
#pw-dur { color: var(--text-muted); }

/* rail */
.pw-rail { width: 372px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--border); }
.pw-rail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 48px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.pw-rail-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.pw-rail-count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--bg); color: var(--text-dim); font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; }
.pw-credit { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.pw-credit select { height: 28px; max-width: 150px; border-radius: 7px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12.5px; padding: 0 6px; font-family: inherit; }
.pw-prev { margin: 10px 12px 0; border-radius: 10px; background: color-mix(in srgb, var(--pw-yellow) 8%, var(--panel)); border: 1px solid color-mix(in srgb, var(--pw-yellow) 26%, var(--border)); padding: 8px 12px; flex-shrink: 0; max-height: 34%; overflow: auto; }
.pw-prev summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--pw-yellow-ink); display: flex; align-items: center; gap: 6px; list-style: none; }
.pw-prev summary::-webkit-details-marker { display: none; }
.pw-prev summary span { margin-left: auto; color: var(--text-muted); font-weight: 500; }
.pw-prev p { margin: 6px 0; font-size: 12px; color: var(--text-dim); }
.pw-prev ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pw-prev li { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.pw-notes { list-style: none; margin: 0; padding: 8px; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pw-notes-empty { margin: auto; padding: 24px; text-align: center; color: var(--text-dim); font-size: 12.5px; display: flex; flex-direction: column; align-items: center; gap: 6px; line-height: 1.5; }
.pw-notes-empty strong { color: var(--text); font-size: 13.5px; }
.pw-notes-empty-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--text-muted); margin-bottom: 4px; }
.pw-note { display: flex; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; transition: background 0.1s ease, border-color 0.1s ease; }
.pw-note:hover { background: var(--panel-2); }
.pw-note.active { background: color-mix(in srgb, var(--pw-accent) 10%, var(--panel)); border-color: color-mix(in srgb, var(--pw-accent) 35%, transparent); }
.pw-note.flash { animation: pw-flash-row 0.7s ease; }
@keyframes pw-flash-row { 0% { background: color-mix(in srgb, var(--pw-yellow) 22%, transparent); } 100% { background: transparent; } }
.pw-avatar { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; background: var(--pw-accent); color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; object-fit: cover; }
.pw-note-main { flex: 1; min-width: 0; }
.pw-note-head { display: flex; align-items: center; gap: 6px; height: 22px; }
.pw-note-author { font-size: 12.5px; font-weight: 600; }
.pw-note-num { font-size: 11.5px; color: var(--text-muted); }
.pw-note-time { font-size: 11.5px; color: var(--text-muted); }
.pw-note-del { margin-left: auto; opacity: 0; }
.pw-note:hover .pw-note-del { opacity: 1; }
.pw-note-body { font-size: 13.5px; line-height: 1.5; margin-top: 2px; overflow-wrap: anywhere; }
.pw-ts { display: inline-flex; align-items: center; height: 19px; padding: 0 6px; margin-right: 6px; border-radius: 5px; border: none; background: var(--pw-yellow); color: #1c1c1a; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; vertical-align: 1px; font-family: inherit; flex-shrink: 0; }
.pw-ts:hover { filter: brightness(1.08); }
.pw-ts-lg { height: 24px; padding: 0 8px; margin: 0; font-size: 12px; }
.pw-ts-static { cursor: default; }
.pw-ts-static:hover { filter: none; }
.pw-note-shot { display: block; margin-top: 8px; padding: 0; border: none; background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden; max-width: 220px; box-shadow: 0 0 0 1px var(--border); }
.pw-note-shot img { display: block; width: 100%; }
.pw-note.is-clip { background: color-mix(in srgb, var(--pw-yellow) 7%, transparent); }
.pw-note-whole { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--pw-yellow-ink); background: color-mix(in srgb, var(--pw-yellow) 25%, transparent); border-radius: 5px; padding: 1px 6px; }
.pw-replies { list-style: none; margin: 8px 0 0; padding: 0 0 0 20px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.pw-reply { display: flex; gap: 8px; }
.pw-reply .pw-avatar { width: 20px; height: 20px; font-size: 10px; }
.pw-reply .pw-note-text { font-size: 12.5px; }
.pw-reply-row { margin-top: 8px; }
.pw-reply-toggle { border: none; background: none; color: var(--text-muted); font-size: 11.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; font-family: inherit; }
.pw-reply-toggle:hover { color: var(--pw-accent); }
.pw-reply-composer { display: flex; align-items: flex-end; gap: 6px; margin-top: 6px; padding-left: 20px; }
.pw-reply-composer[hidden] { display: none; }
.pw-reply-input { flex: 1; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); color: var(--text); font-size: 12.5px; padding: 6px 8px; resize: none; outline: none; font-family: inherit; min-height: 18px; max-height: 100px; }
.pw-reply-input:focus { border-color: var(--pw-accent); }
.pw-reply-send { width: 26px; height: 26px; border-radius: 7px; border: none; background: var(--pw-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }

/* composer */
.pw-composer { margin: 8px 12px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); padding: 10px 10px 8px; flex-shrink: 0; transition: border-color 0.12s ease, box-shadow 0.12s ease; }
.pw-kind-toggle { display: flex; gap: 4px; margin-bottom: 8px; }
.pw-kind-btn { border: 1px solid var(--border); background: var(--panel-2); color: var(--text-dim); font-size: 11.5px; font-weight: 600; border-radius: 7px; padding: 4px 9px; cursor: pointer; font-family: inherit; transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease; }
.pw-kind-btn:hover { color: var(--text); }
.pw-kind-btn.active { background: var(--pw-accent); border-color: var(--pw-accent); color: #fff; }
.pw-composer.active { border-color: var(--pw-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pw-accent) 22%, transparent); }
.pw-composer textarea { width: 100%; border: none; background: transparent; color: var(--text); font-size: 13.5px; line-height: 1.5; resize: none; outline: none; padding: 0 2px; min-height: 22px; max-height: 160px; font-family: inherit; display: block; }
.pw-composer-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.pw-composer-hint { flex: 1; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity 0.12s ease; }
.pw-composer.active .pw-composer-hint { opacity: 1; }
.pw-send { width: 30px; height: 30px; border-radius: 8px; border: none; background: var(--pw-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin-left: auto; }
.pw-send:disabled { opacity: 0.35; cursor: default; }
.pw-shot-preview { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--text-dim); }
.pw-shot-preview[hidden] { display: none; }
.pw-shot-preview img { width: 64px; height: 36px; object-fit: cover; border-radius: 5px; box-shadow: 0 0 0 1px var(--border); }
.pw-shot-preview span { flex: 1; }

/* note tags, assignee, filter bar */
.pw-note-tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.pw-tag { --tag: var(--text-muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; padding: 1px 6px; border-radius: 5px; color: var(--tag); background: color-mix(in srgb, var(--tag) 14%, transparent); }
.pw-tag-music { --tag: #b07cf0; }
.pw-tag-audio { --tag: #4aa8f0; }
.pw-tag-sfx { --tag: #e879b8; }
.pw-tag-pacing { --tag: #f0954a; }
.pw-tag-text { --tag: #3fbf9a; }
.pw-tag-visual { --tag: #e0b43c; }
.pw-assign { margin-left: auto; height: 22px; min-width: 22px; padding: 0 5px; border-radius: 6px; border: none; background: transparent; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; cursor: pointer; font-family: inherit; opacity: 0; max-width: 130px; }
.pw-assign span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-assign:not(.is-set) { display: none; }
.pw-note:hover .pw-assign { display: inline-flex; }
.pw-note:hover .pw-assign, .pw-assign.is-set { opacity: 1; }
.pw-assign:hover { background: var(--hover); color: var(--text); }
.pw-assign.is-set { background: color-mix(in srgb, var(--pw-accent) 14%, transparent); color: var(--pw-accent); }
.pw-assign + .pw-note-del { margin-left: 0; }
.pw-note-head { min-width: 0; }
.pw-note-whole, .pw-note-author { white-space: nowrap; flex-shrink: 0; }
.pw-note-time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pw-note-filter { display: flex; gap: 4px; padding: 8px 12px 0; flex-wrap: wrap; flex-shrink: 0; align-items: center; }
.pw-note-filter[hidden] { display: none; }
.pw-filter-chip { --tag: var(--text-dim); height: 24px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--border); background: transparent; color: var(--text-dim); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-family: inherit; }
.pw-filter-chip span { color: var(--text-muted); font-weight: 500; }
.pw-filter-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--tag) 50%, var(--border)); }
.pw-filter-chip.active { background: color-mix(in srgb, var(--tag) 16%, transparent); border-color: color-mix(in srgb, var(--tag) 55%, transparent); color: var(--text); }
.pw-filter-chip:not([class*="pw-tag-"]).active { --tag: var(--pw-accent); }
.pw-filter-sep { width: 1px; height: 14px; background: var(--border); margin: 0 2px; }
.pw-notes-empty .pw-btn { margin-top: 4px; }

/* offline notes */
.pw-offline { display: flex; align-items: center; gap: 8px; margin: 8px 12px 0; padding: 7px 10px; border-radius: 9px; font-size: 12.5px; line-height: 1.4; color: var(--text-dim); background: var(--bg); border: 1px solid var(--border); flex-shrink: 0; }
.pw-offline[hidden] { display: none; }
.pw-offline span { flex: 1; }
.pw-offline .icon { flex-shrink: 0; }
.pw-offline.is-offline { color: var(--pw-yellow-ink); background: color-mix(in srgb, var(--pw-yellow) 10%, var(--panel)); border-color: color-mix(in srgb, var(--pw-yellow) 30%, var(--border)); }
.pw-note.is-pending { opacity: 0.75; border-style: dashed; border-color: var(--border); }
.pw-note-pending { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--pw-yellow-ink); white-space: nowrap; }

/* Tidy suggestion */
.pw-tidy-suggest { margin-bottom: 8px; padding: 8px 10px; border-radius: 9px; background: color-mix(in srgb, var(--pw-accent) 9%, var(--panel)); border: 1px solid color-mix(in srgb, var(--pw-accent) 30%, var(--border)); }
.pw-tidy-suggest[hidden] { display: none; }
.pw-tidy-head { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--pw-accent); text-transform: uppercase; letter-spacing: 0.03em; }
.pw-tidy-text { font-size: 13.5px; line-height: 1.5; margin: 4px 0 8px; white-space: pre-wrap; }
.pw-tidy-actions { display: flex; justify-content: flex-end; gap: 6px; }
#pw-tidy-btn:disabled { opacity: 0.35; cursor: default; }
#pw-tidy-btn.is-busy svg { animation: pw-spin 1s linear infinite; }

/* views: Edit / Notes / Watch */
.pw-views { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); flex-shrink: 0; }
.pw-view-btn { height: 26px; padding: 0 10px; border: none; border-radius: 6px; background: transparent; color: var(--text-dim); font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-family: inherit; }
.pw-view-btn:hover { color: var(--text); }
.pw-view-btn.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--border); }
.pw-view-watch .pw-rail { display: none; }
@media (min-width: 901px) {
  .pw-view-notes .pw-rail { width: clamp(372px, 46%, 640px); }
  .pw-view-notes .pw-note-body { font-size: 14.5px; }
  .pw-view-notes .pw-notes { padding: 8px 12px; }
}

/* rail tabs + panes */
.pw-rail-tabs { display: flex; gap: 2px; min-width: 0; }
.pw-rail-tab { height: 30px; padding: 0 9px; border: none; border-radius: 7px; background: transparent; color: var(--text-dim); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-family: inherit; position: relative; white-space: nowrap; }
.pw-rail-tab:hover { background: var(--hover); color: var(--text); }
.pw-rail-tab.active { background: var(--bg); color: var(--text); }
.pw-rail-tab.has-news::after { content: ''; position: absolute; top: 5px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--pw-accent); }
.pw-rail-tab.is-busy::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--pw-spin-track); border-top-color: var(--pw-spin-head); animation: pw-spin 0.8s linear infinite; order: 2; }
.pw-rail-count[hidden] { display: none; }
.pw-rail-count.is-warn { background: color-mix(in srgb, var(--pw-yellow) 30%, transparent); color: var(--pw-yellow-ink); }
.pw-pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.pw-pane.active { display: flex; }
.pw-pane[data-pane="checks"], .pw-pane[data-pane="exports"] { overflow-y: auto; padding-bottom: 12px; }
.pw-pane-empty { margin: 32px auto; max-width: 240px; text-align: center; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pw-pane-empty[hidden] { display: none; }

/* full-size note box: the composer, lifted into a centered panel */
.pw-composer-backdrop { position: fixed; inset: 0; z-index: 690; background: rgba(0, 0, 0, 0.5); animation: fade-in 0.12s ease both; }
.pw-composer-backdrop[hidden] { display: none; }
.pw-composer.is-full { position: fixed; z-index: 700; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 32px)); height: min(560px, calc(100vh - 64px)); margin: 0; padding: 14px 14px 10px; display: flex; flex-direction: column; background: var(--panel); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.pw-composer.is-full textarea { flex: 1; max-height: none; font-size: 15px; line-height: 1.6; padding: 4px 2px; }
.pw-composer.is-full .pw-composer-hint { opacity: 1; }

/* the site's main menu, tucked away on the review page for room (not saved) */
@media (min-width: 761px) {
  body.pw-nav-tucked .sidebar { width: 0; padding-left: 0; padding-right: 0; opacity: 0; pointer-events: none; }
  body.pw-nav-tucked .sidebar-toggle { left: 10px; opacity: 1; }
  body.pw-nav-tucked .main { margin-left: 8px; }
  /* the menu toggle sits over the page's top-left corner while the menu is away */
  body.pw-nav-tucked .pw-top, body.sidebar-closed .pw-top { padding-left: 34px; }
}

/* menus / confirm / shortcuts / lightbox */
.pw-menu { position: fixed; z-index: 800; min-width: 180px; padding: 6px; border-radius: 12px; background: var(--pw-menu-bg); border: 1px solid var(--pw-menu-border); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22); color: var(--pw-menu-text); font-size: 13px; animation: pop-in 0.1s ease both; }
.pw-menu.wide { width: 320px; padding: 14px; }
.pw-menu-title { font-size: 11.5px; font-weight: 600; color: var(--pw-menu-dim); padding: 4px 8px 6px; }
.pw-menu.wide .pw-menu-title { padding: 0 0 10px; }
.pw-menu-item { width: 100%; height: 32px; padding: 0 8px; border: none; border-radius: 7px; background: transparent; color: inherit; font-size: 13px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-family: inherit; }
.pw-menu-item:hover { background: var(--pw-menu-hover); }
.pw-menu-item.on { font-weight: 600; }
.pw-confirm { display: flex; flex-direction: column; gap: 8px; }
.pw-confirm strong { font-size: 14px; }
.pw-confirm > span { font-size: 12.5px; color: var(--pw-menu-dim); line-height: 1.5; }
.pw-confirm ul { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.pw-confirm li { display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-confirm li.more { color: var(--pw-menu-dim); }
.pw-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.pw-menu .pw-btn-ghost { background: var(--pw-menu-hover); border-color: var(--pw-menu-border); color: var(--pw-menu-text); }
.pw-keys { display: flex; flex-direction: column; gap: 8px; }
.pw-key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--pw-menu-text); }
.pw-kbds { display: inline-flex; align-items: center; gap: 4px; }
.pw-kbds i { font-style: normal; color: var(--pw-menu-dim); }
.pw-keys kbd { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 5px; background: var(--pw-kbd-bg); border: 1px solid var(--pw-kbd-border); border-bottom-width: 2px; font-family: inherit; font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; color: var(--pw-menu-text); }
.pw-lightbox { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, 0.88); display: flex; align-items: center; justify-content: center; padding: 40px; cursor: zoom-out; animation: fade-in 0.12s ease both; }
.pw-lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.pw-lightbox-close { position: absolute; top: 16px; right: 16px; color: #fff; }
.pw-draw-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, 0.9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; animation: fade-in 0.12s ease both; }
.pw-draw-toolbar { display: flex; align-items: center; gap: 8px; background: var(--pw-menu-bg); border: 1px solid var(--pw-menu-border); border-radius: 10px; padding: 6px 8px; }
.pw-draw-colors { display: flex; gap: 6px; margin-right: 4px; }
.pw-draw-color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2) inset; }
.pw-draw-color.active { border-color: var(--pw-accent); }
.pw-draw-spacer { flex: 1; min-width: 12px; }
.pw-draw-canvas-wrap { position: relative; max-width: 92vw; max-height: 78vh; border-radius: 6px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.pw-draw-base { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.pw-draw-strokes { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }

@media (max-width: 1100px) {
  .pw-top-meta, .pw-ctl-sm, .pw-composer-hint { display: none; }
  .pw-composer.is-full .pw-composer-hint { display: block; }
  .pw-rail { width: 320px; }
  .pw-credit > span, .pw-view-btn span { display: none; }
  .pw-view-btn { padding: 0 8px; }
}
@media (max-width: 900px) {
  /* A fixed-height screen, like a video app: the player stays put at the top, only the
     note list scrolls, and the note box stays pinned at the bottom. */
  .main.main-review { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .pw-body { flex-direction: column; }
  .pw-stage { flex: none; }
  .pw-viewer { flex: none; height: min(56.25vw, 40vh); padding: 0; }
  .pw-view-watch .pw-stage { flex: 1; min-height: 0; }
  .pw-view-watch .pw-viewer { flex: 1; height: auto; min-height: 0; }
  .pw-rail { width: 100%; flex: 1; min-height: 0; border-left: none; border-top: 1px solid var(--border); }
  .pw-top-actions .pw-btn span:not(.pw-count) { display: none; }
  .pw-top-actions .pw-btn { padding: 0 10px; }
  .pw-vol-slider, #rv-download, #pw-keys { display: none; }
}
@media (max-width: 760px) {
  .pw-views { display: none; } /* one stacked column already; no room in the top bar */
  .pw-view-watch .pw-rail { display: flex; } /* a Watch view saved on a laptop can't hide the notes here */
  .pw-top { height: 50px; padding-right: 8px; gap: 8px; }
  .pw-rail-head { height: 44px; padding: 0 8px 0 10px; }
  .pw-rail-tab { padding: 0 8px; }
  .pw-timeline { height: 48px; }
  .pw-bar { padding: 0 4px; }
  .pw-ctl { min-width: 36px; height: 40px; }
  .pw-bar-left, .pw-bar-right { gap: 0; }
  #pwx-export-btn { display: none; } /* renders are a desk job; the Exports tab still shows them */
  .pw-time { font-size: 12px; margin-left: 2px; white-space: nowrap; }
  /* one swipeable row of filter chips instead of several wrapped rows */
  .pw-note-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 8px 10px 2px; }
  .pw-note-filter::-webkit-scrollbar { display: none; }
  .pw-filter-chip { flex-shrink: 0; height: 28px; }
  .pw-notes { padding: 6px; }
  .pw-composer { margin: 6px 8px; margin-bottom: calc(8px + env(safe-area-inset-bottom)); }
  /* 16px stops iPhones zooming the page in when a text box gets focus */
  .pw-composer textarea, .pw-reply-input, .pw-credit select { font-size: 16px; }
  .pw-composer.is-full { left: 0; top: 0; transform: none; width: 100%; height: 100vh; height: 100dvh; border-radius: 0; border: none; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  /* Room is tight: the note box is one row until you tap into it. */
  .pw-composer:not(.active):not(.is-full) .pw-kind-toggle { display: none; }
  .pw-composer:not(.active):not(.is-full) { padding-top: 8px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .pw-note-filter { display: none; }
  .pw-viewer { height: min(56.25vw, 28vh); }
  .pw-timeline { height: 40px; }
}
/* Touch screens have no hover, so controls that only appear on hover stay visible. */
@media (hover: none) {
  .pw-note-del { opacity: 0.6; }
  .pw-assign:not(.is-set) { display: inline-flex; opacity: 0.6; }
}

/* ==========================================================================
   Idea Coach — YouTube web UI (Mobbin: YouTube home feed + watch page)
   ========================================================================== */
:root {
  --yt-bg: #ffffff; --yt-text: #0f0f0f; --yt-text2: #606060; --yt-chip: #f2f2f2; --yt-chip-hover: #e5e5e5;
  --yt-chip-on: #0f0f0f; --yt-chip-on-text: #ffffff; --yt-border: #e5e5e5; --yt-desc: #f2f2f2; --yt-red: #ff0033;
  --yt-hover: rgba(0, 0, 0, 0.05); --yt-menu: #ffffff; --yt-menu-shadow: 0 4px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,0,0,.04);
  --yt-font: 'Roboto', 'Inter', Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --yt-bg: #0f0f0f; --yt-text: #f1f1f1; --yt-text2: #aaaaaa; --yt-chip: #272727; --yt-chip-hover: #3f3f3f;
    --yt-chip-on: #f1f1f1; --yt-chip-on-text: #0f0f0f; --yt-border: #3f3f3f; --yt-desc: #272727;
    --yt-hover: rgba(255, 255, 255, 0.1); --yt-menu: #282828; --yt-menu-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --yt-bg: #0f0f0f; --yt-text: #f1f1f1; --yt-text2: #aaaaaa; --yt-chip: #272727; --yt-chip-hover: #3f3f3f;
  --yt-chip-on: #f1f1f1; --yt-chip-on-text: #0f0f0f; --yt-border: #3f3f3f; --yt-desc: #272727;
  --yt-hover: rgba(255, 255, 255, 0.1); --yt-menu: #282828; --yt-menu-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
}
.main.main-yt { background: var(--yt-bg); padding: 0; color: var(--yt-text); }
.yt { font-family: var(--yt-font); color: var(--yt-text); min-height: 100%; }
.yt-masthead { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 16px 0 20px; background: var(--yt-bg); }
.yt-brand { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; letter-spacing: -0.03em; white-space: nowrap; flex-shrink: 0; }
.yt-logo { width: 30px; height: 21px; border-radius: 6px; background: var(--yt-red); color: #fff; display: inline-flex; align-items: center; justify-content: center; padding-left: 2px; }
.yt-search { flex: 1; max-width: 560px; margin: 0 auto; display: flex; height: 40px; }
.yt-search input { flex: 1; min-width: 0; height: 40px; padding: 0 16px; border: 1px solid var(--yt-border); border-right: none; border-radius: 40px 0 0 40px; background: var(--yt-bg); color: var(--yt-text); font-size: 16px; font-family: var(--yt-font); outline: none; }
.yt-search input:focus { border-color: #1c62b9; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); }
.yt-search button { width: 64px; height: 40px; border: 1px solid var(--yt-border); border-radius: 0 40px 40px 0; background: var(--yt-chip); color: var(--yt-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.yt-search button:hover { background: var(--yt-chip-hover); }
.yt-mast-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.yt-pill-btn { height: 36px; padding: 0 16px; border-radius: 18px; border: none; background: var(--yt-chip); color: var(--yt-text); font-size: 14px; font-weight: 500; font-family: var(--yt-font); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.yt-pill-btn:hover { background: var(--yt-chip-hover); }
.yt-pill-btn:disabled { opacity: 0.5; cursor: default; }
.yt-pill-btn .yt-avatar { margin-left: -8px; }
.yt-pill-btn.yt-create { padding-left: 12px; }
.yt-pill-btn.on.warn, .yt-pill-btn.warn { background: #fef0d4; color: #7a4d00; }
.yt-pill-btn.danger { background: #cc0000; color: #fff; }
.yt-pill-btn.danger:hover { background: #a80000; }
:root[data-theme="dark"] .yt-pill-btn.warn, :root[data-theme="dark"] .yt-pill-btn.on.warn { background: #3d2e0f; color: #ffcf6e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .yt-pill-btn.warn { background: #3d2e0f; color: #ffcf6e; } }
.yt-icon-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: transparent; color: var(--yt-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.yt-icon-btn:hover { background: var(--yt-hover); }
.yt-icon-btn.round { width: 36px; height: 36px; background: var(--yt-chip); }
.yt-icon-btn.round:hover { background: var(--yt-chip-hover); }
.yt-text-btn { height: 36px; padding: 0 14px; border-radius: 18px; border: none; background: transparent; color: var(--yt-text); font-size: 14px; font-weight: 500; font-family: var(--yt-font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.yt-text-btn:hover { background: var(--yt-hover); }
.yt-text-btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; margin-top: 6px; margin-left: -10px; }
.yt-avatar { border-radius: 50%; color: #fff; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--yt-font); }
.yt-muted { color: var(--yt-text2); font-size: 13px; line-height: 1.45; }

/* chips */
.yt-chips { position: sticky; top: 56px; z-index: 15; display: flex; gap: 12px; padding: 12px 24px; background: var(--yt-bg); overflow-x: auto; scrollbar-width: none; }
.yt-chips::-webkit-scrollbar { display: none; }
.yt-chip { height: 32px; padding: 0 12px; border-radius: 8px; border: none; background: var(--yt-chip); color: var(--yt-text); font-size: 14px; font-weight: 500; font-family: var(--yt-font); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.yt-chip:hover { background: var(--yt-chip-hover); }
.yt-chip.on { background: var(--yt-chip-on); color: var(--yt-chip-on-text); }
.yt-chip span { font-size: 12px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.yt-chip.sm { height: 28px; font-size: 12.5px; padding: 0 10px; }

/* grid */
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px 16px; padding: 12px 24px 48px; }
.yt-card { cursor: pointer; min-width: 0; border-radius: 12px; outline: none; }
.yt-card:focus-visible .yt-thumb { box-shadow: 0 0 0 3px #1c62b9; }
.yt-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--yt-chip); transition: border-radius 0.2s ease; }
.yt-card:hover .yt-thumb { border-radius: 0; }
.yt-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-thumb-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: flex-start; padding: 8% 7%; }
.yt-thumb-fallback span { color: #fff; font-family: Impact, 'Arial Black', 'Roboto', sans-serif; font-weight: 900; font-size: clamp(18px, 2.2vw, 30px); line-height: 1.02; text-transform: uppercase; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 0 18px rgba(0, 0, 0, 0.25); -webkit-text-stroke: 1px rgba(0, 0, 0, 0.35); max-width: 72%; overflow-wrap: anywhere; }
.yt-thumb-fallback span.big { font-size: clamp(28px, 4.4vw, 64px); -webkit-text-stroke: 2px rgba(0, 0, 0, 0.35); }
.yt-duration { position: absolute; right: 8px; bottom: 8px; height: 20px; padding: 0 5px; border-radius: 4px; background: rgba(0, 0, 0, 0.8); color: #fff; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; letter-spacing: 0.02em; }
.yt-status { position: absolute; left: 8px; top: 8px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 500; text-transform: capitalize; display: inline-flex; align-items: center; background: rgba(0, 0, 0, 0.8); color: #fff; }
.yt-status.good { background: #0b8043; }
.yt-status.critical { background: #cc0000; }
.yt-status.warn { background: #f29900; color: #1f1300; }
.yt-hover-actions { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; opacity: 0; transform: translateX(4px); transition: opacity 0.15s ease, transform 0.15s ease; }
.yt-card:hover .yt-hover-actions, .yt-card:focus-within .yt-hover-actions { opacity: 1; transform: none; }
.yt-hover-btn { width: 36px; height: 36px; border-radius: 4px; border: none; background: rgba(0, 0, 0, 0.8); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.yt-hover-btn:hover { background: rgba(0, 0, 0, 0.92); }
.yt-hover-btn.good:hover { color: #6ee7a0; }
.yt-hover-btn.warn:hover { color: #ffcf6e; }
.yt-hover-btn.bad:hover { color: #ff8080; }
.yt-card-info { display: flex; gap: 12px; padding-top: 12px; position: relative; }
.yt-card-text { flex: 1; min-width: 0; padding-right: 24px; }
.yt-card-title { margin: 0 0 4px; font-size: 16px; font-weight: 500; line-height: 22px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-card-channel, .yt-card-meta { font-size: 14px; color: var(--yt-text2); line-height: 20px; }
.yt-card-channel { display: flex; align-items: center; gap: 4px; }
.yt-card-channel svg { opacity: 0.8; }
.yt-card-channel:hover { color: var(--yt-text); }
.yt-kebab { position: absolute; right: -8px; top: 8px; width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; color: var(--yt-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; }
.yt-card:hover .yt-kebab, .yt-kebab:focus { opacity: 1; }
.yt-kebab:hover { background: var(--yt-hover); }
.yt-card.skeleton { cursor: default; }
.yt-card.skeleton .yt-thumb, .yt-avatar.sk, .yt-sk-lines i { background: linear-gradient(90deg, var(--yt-chip) 25%, var(--yt-chip-hover) 37%, var(--yt-chip) 63%); background-size: 400% 100%; animation: yt-shimmer 1.4s ease infinite; }
.yt-avatar.sk { width: 36px; height: 36px; }
.yt-sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.yt-sk-lines i { height: 16px; border-radius: 4px; display: block; }
.yt-sk-lines i.short { width: 55%; }
@keyframes yt-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.yt-generating { margin: 4px 24px 0; padding: 10px 14px; border-radius: 12px; background: var(--yt-desc); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.yt-empty { text-align: center; padding: 72px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.yt-empty h3 { margin: 12px 0 0; font-size: 20px; font-weight: 500; }
.yt-empty p { margin: 0 0 12px; color: var(--yt-text2); font-size: 14px; max-width: 420px; line-height: 1.5; }
.yt-empty-art { width: 120px; height: 120px; border-radius: 50%; background: var(--yt-chip); display: flex; align-items: center; justify-content: center; color: var(--yt-text2); }
.yt-empty-art svg { width: 48px; height: 48px; }

/* menus */
.yt-menu { position: fixed; z-index: 900; min-width: 220px; padding: 8px 0; border-radius: 12px; background: var(--yt-menu); color: var(--yt-text); box-shadow: var(--yt-menu-shadow); font-family: var(--yt-font); font-size: 14px; animation: pop-in 0.1s ease both; max-height: calc(100vh - 16px); overflow-y: auto; }
.yt-menu-title { padding: 8px 16px 8px; font-size: 14px; font-weight: 500; color: var(--yt-text2); }
.yt-menu-list { display: flex; flex-direction: column; }
.yt-menu-list > button { height: 40px; padding: 0 16px; border: none; background: transparent; color: var(--yt-text); font-size: 14px; font-family: var(--yt-font); text-align: left; display: flex; align-items: center; gap: 16px; cursor: pointer; }
.yt-menu-list > button:hover { background: var(--yt-hover); }
.yt-menu-list > button svg:last-child:not(:first-child) { margin-left: auto; }
.yt-menu-list hr { border: none; border-top: 1px solid var(--yt-border); margin: 8px 0; }
.yt-newch { display: flex; gap: 8px; padding: 4px 12px 4px 16px; }
.yt-newch input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--yt-border); background: var(--yt-bg); color: var(--yt-text); font-family: var(--yt-font); font-size: 14px; outline: none; }
.yt-newch input:focus { border-color: #1c62b9; }
.yt-reason { padding: 8px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.yt-reason strong { font-size: 16px; font-weight: 500; }
.yt-reason-chips, .yt-count-row { display: flex; flex-wrap: wrap; gap: 8px; }
.yt-reason textarea { width: 100%; border: none; border-bottom: 1px solid var(--yt-border); background: transparent; color: var(--yt-text); font-size: 14px; font-family: var(--yt-font); padding: 6px 0; resize: vertical; outline: none; }
.yt-reason textarea:focus { border-bottom: 2px solid var(--yt-text); }
.yt-reason-actions { display: flex; justify-content: flex-end; gap: 8px; }
.shake { animation: yt-shake 0.35s ease; }
@keyframes yt-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.yt-toast { position: fixed; left: 24px; bottom: 24px; z-index: 1000; display: flex; align-items: center; gap: 24px; padding: 14px 16px 14px 20px; border-radius: 8px; background: #0f0f0f; color: #fff; font-family: var(--yt-font); font-size: 14px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3); animation: toast-in-left 0.2s ease both; max-width: calc(100vw - 48px); }
:root[data-theme="dark"] .yt-toast { background: #f1f1f1; color: #0f0f0f; }
.yt-toast button { border: none; background: transparent; color: #3ea6ff; font-weight: 500; font-size: 14px; cursor: pointer; padding: 6px 8px; border-radius: 16px; font-family: var(--yt-font); }
.yt-toast button:hover { background: rgba(62, 166, 255, 0.15); }
@keyframes toast-in-left { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* watch page */
.yt-watch { display: grid; grid-template-columns: minmax(0, 1fr) 402px; gap: 24px; padding: 24px 24px 48px; max-width: 1754px; margin: 0 auto; }
.yt-player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.yt-player .yt-thumb-img, .yt-player .yt-thumb-fallback { position: absolute; inset: 0; }
.yt-player-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 34%); pointer-events: none; }
.yt-player-concept { position: absolute; left: 16px; bottom: 14px; color: #fff; display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.yt-player-concept span { font-size: 12px; opacity: 0.85; display: inline-flex; align-items: center; gap: 5px; }
.yt-player-concept strong { font-size: 18px; font-weight: 500; }
.yt-player-ref { position: absolute; right: 12px; bottom: 14px; max-width: 45%; padding: 4px 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yt-player-back { position: absolute; left: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.55); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(4px); }
.yt-player-back:hover { background: rgba(0, 0, 0, 0.75); }
.yt-watch-title { margin: 12px 0 0; font-size: 20px; font-weight: 700; line-height: 28px; overflow-wrap: anywhere; }
.yt-owner-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.yt-owner { display: flex; align-items: center; gap: 12px; min-width: 0; }
.yt-owner-name { font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.yt-owner-name svg { color: var(--yt-text2); }
.yt-owner-sub { font-size: 12px; color: var(--yt-text2); }
.yt-subscribe { margin-left: 12px; height: 36px; padding: 0 16px; border-radius: 18px; background: var(--yt-chip-on); color: var(--yt-chip-on-text); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; text-transform: capitalize; }
.yt-subscribe.decided { background: var(--yt-chip); color: var(--yt-text); }
.yt-subscribe.decided.good { background: #e6f4ea; color: #0b8043; }
.yt-subscribe.decided.critical { background: #fce8e6; color: #c5221f; }
.yt-subscribe.decided.warn { background: #fef0d4; color: #7a4d00; }
:root[data-theme="dark"] .yt-subscribe.decided.good { background: #0f2e1c; color: #6ee7a0; }
:root[data-theme="dark"] .yt-subscribe.decided.critical { background: #3a1210; color: #ff9b95; }
:root[data-theme="dark"] .yt-subscribe.decided.warn { background: #3d2e0f; color: #ffcf6e; }
.yt-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.yt-seg { display: inline-flex; align-items: center; height: 36px; border-radius: 18px; background: var(--yt-chip); overflow: hidden; }
.yt-seg-btn { height: 36px; padding: 0 16px; border: none; background: transparent; color: var(--yt-text); font-size: 14px; font-weight: 500; font-family: var(--yt-font); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.yt-seg-btn:hover { background: var(--yt-chip-hover); }
.yt-seg-btn:disabled { opacity: 0.5; }
.yt-seg-btn.on.good svg { fill: currentColor; }
.yt-seg-btn.on.good { color: #0b8043; }
.yt-seg-btn.on.bad { color: #c5221f; }
.yt-seg-btn.on.bad svg { fill: currentColor; }
.yt-seg-div { width: 1px; height: 24px; background: var(--yt-border); }
.yt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.yt-desc { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--yt-desc); font-size: 14px; line-height: 20px; cursor: pointer; position: relative; }
.yt-desc.open { cursor: default; }
.yt-desc:not(.open):hover { background: var(--yt-chip-hover); }
.yt-desc-meta { font-weight: 500; }
.yt-desc p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.yt-desc-more { display: none; }
.yt-desc.open .yt-desc-more { display: block; }
.yt-desc h4 { margin: 16px 0 2px; font-size: 14px; font-weight: 500; }
.yt-desc:not(.open) > p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.yt-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px !important; }
.yt-tags span { color: #065fd4; }
:root[data-theme="dark"] .yt-tags span { color: #3ea6ff; }
.yt-desc-toggle { border: none; background: transparent; padding: 0; margin-top: 4px; font-weight: 500; font-size: 14px; color: var(--yt-text); cursor: pointer; font-family: var(--yt-font); }
.yt-comments { margin-top: 24px; }
.yt-comments h2 { margin: 0 0 20px; font-size: 20px; font-weight: 700; }
.yt-compose, .yt-comment { display: flex; gap: 16px; }
.yt-compose-main, .yt-comment-main { flex: 1; min-width: 0; }
.yt-compose textarea { width: 100%; border: none; border-bottom: 1px solid var(--yt-border); background: transparent; color: var(--yt-text); font-size: 14px; line-height: 20px; font-family: var(--yt-font); padding: 8px 0 6px; resize: none; outline: none; min-height: 36px; }
.yt-compose.active textarea { border-bottom: 2px solid var(--yt-text); padding-bottom: 5px; }
.yt-compose-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.yt-compose-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.yt-kbd-hint { font-size: 12px; color: var(--yt-text2); display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.yt-kbd-hint kbd { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 4px; background: var(--yt-chip); font-family: var(--yt-font); font-size: 11px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; color: var(--yt-text); margin-left: 6px; }
.yt-comment-head { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.yt-comment-head strong { font-weight: 500; }
.yt-comment-head > span:not([class^="badge"]) { color: var(--yt-text2); font-size: 12px; }
.yt-comment-text { margin-top: 4px; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.yt-secondary { min-width: 0; }
.yt-upnext-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-size: 16px; }
.yt-upnext-head strong { font-weight: 500; }
.yt-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--yt-text2); cursor: pointer; position: relative; }
.yt-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.yt-toggle i { width: 36px; height: 14px; border-radius: 7px; background: #909090; position: relative; transition: background 0.15s ease; }
.yt-toggle i::after { content: ''; position: absolute; left: -2px; top: -3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); transition: transform 0.15s ease; }
.yt-toggle input:checked + i { background: #99c3ff; }
.yt-toggle input:checked + i::after { transform: translateX(20px); background: #065fd4; }
.yt-upnext { display: flex; flex-direction: column; gap: 8px; }
.yt-compact { display: flex; gap: 8px; text-decoration: none; color: inherit; border-radius: 8px; }
.yt-compact:hover .yt-compact-title { color: var(--yt-text); }
.yt-thumb.sm { width: 168px; flex-shrink: 0; border-radius: 8px; }
.yt-compact:hover .yt-thumb.sm { border-radius: 8px; }
.yt-thumb.sm .yt-thumb-fallback span { font-size: 13px; -webkit-text-stroke: 0; }
.yt-thumb.sm .yt-status { height: 18px; font-size: 11px; padding: 0 5px; left: 4px; top: 4px; }
.yt-thumb.sm .yt-duration { right: 4px; bottom: 4px; height: 18px; font-size: 11px; }
.yt-compact-text { min-width: 0; padding-right: 8px; }
.yt-compact-title { font-size: 14px; font-weight: 500; line-height: 20px; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-compact-sub { font-size: 12px; color: var(--yt-text2); line-height: 18px; }

@media (max-width: 1100px) {
  .yt-watch { grid-template-columns: 1fr; }
  .yt-thumb.sm { width: 168px; }
}
@media (max-width: 760px) {
  .yt-masthead { gap: 8px; padding: 0 12px; }
  .yt-brand span:last-child, #yt-channel-btn > span:not(.yt-avatar) { display: none; }
  #yt-channel-btn .yt-avatar { margin-left: 0; }
  .yt-search button { width: 48px; }
  .yt-chips { padding: 12px; top: 56px; }
  .yt-grid { grid-template-columns: 1fr; gap: 24px; padding: 8px 0 40px; }
  .yt-thumb { border-radius: 0; }
  .yt-card-info { padding: 12px 12px 0; }
  .yt-watch { padding: 0 0 40px; gap: 16px; }
  .yt-player { border-radius: 0; }
  .yt-watch-title, .yt-owner-row, .yt-desc, .yt-comments, .yt-secondary { margin-left: 12px; margin-right: 12px; }
  .yt-kbd-hint { display: none; }
}
.yt-pill-btn.primary { background: var(--yt-chip-on); color: var(--yt-chip-on-text); }
.yt-pill-btn.primary:hover { opacity: 0.88; background: var(--yt-chip-on); }
.yt-toast { left: calc(var(--sidebar-w) + 32px); }
body.sidebar-closed .yt-toast { left: 24px; }
@media (max-width: 760px) { .yt-toast { left: 12px; right: 12px; bottom: 12px; } }
@media (max-width: 760px) {
  .yt-search { min-width: 0; }
  .yt-mast-right { gap: 4px; }
  .yt-pill-btn.yt-create { font-size: 0; gap: 0; padding: 0 9px; }
  #yt-channel-btn { padding: 0 8px; }
  #yt-channel-btn svg { display: none; }
  #idea-manage-btn { width: 36px; height: 36px; }
}
.pw-marker.multi { background: var(--pw-accent); color: #fff; padding: 0 5px; }

/* ===== Bot Settings: exact 8 AM preview (Discord mock) ===== */
:root {
  --dc-bg: #313338; --dc-text: #dbdee1; --dc-muted: #949ba4; --dc-head: #f2f3f5;
  --dc-embed: #2b2d31; --dc-border: #1e1f22; --dc-link: #00a8fc;
  --dc-mention-bg: rgba(88, 101, 242, .3); --dc-mention: #c9cdfb; --dc-code: #1e1f22;
}
.dp-panel { margin-bottom: 20px; }
.dp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dp-head h2 { margin: 0 0 2px; }
.dp-head .panel-sub { margin: 0; }
.dp-loading, .dp-empty { color: var(--text-dim); font-size: 13px; padding: 14px 0; }
.dp-muted { color: var(--text-dim); font-weight: 400; }
.dp-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.dp-stat { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; min-width: 0; }
.dp-stat-k { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.dp-stat-v { font-size: 15px; font-weight: 600; color: var(--text); }
.dp-warnings { margin-top: 12px; border: 1px solid #e8b44c; background: rgba(232, 180, 76, .12); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.dp-warnings svg { vertical-align: -2px; color: #c98a0c; }
.dp-note { font-size: 12px; color: var(--text-dim); margin: 12px 0 4px; }
.dp-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; margin-top: 8px; }
@media (max-width: 1000px) { .dp-cols { grid-template-columns: minmax(0, 1fr); } }
.dp-col-h { font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; margin: 6px 0 8px; }
.dp-dest { margin-bottom: 14px; }
.dp-dest-label { font-size: 13px; margin-bottom: 6px; color: var(--text); overflow-wrap: anywhere; }
.dp-dest-label svg { vertical-align: -1px; color: var(--text-dim); }
.dp-warn-inline { color: #d9534f; font-weight: 600; }
.dp-skipped { font-size: 12px; color: var(--text-dim); }
.dc-frame { background: var(--dc-bg); border-radius: 10px; padding: 14px 16px 16px 10px; color: var(--dc-text); font-family: "gg sans", "Noto Sans", Inter, system-ui, sans-serif; font-size: 15px; line-height: 1.375; overflow: hidden; }
.dc-msg { display: flex; gap: 12px; }
.dc-avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: #5865f2; color: #fff; display: grid; place-items: center; }
.dc-msg-main { min-width: 0; flex: 1; }
.dc-msg-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dc-name { color: var(--dc-head); font-weight: 600; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; line-height: 15px; }
.dc-time { color: var(--dc-muted); font-size: 12px; margin-left: 2px; }
.dc-content { margin-top: 2px; overflow-wrap: anywhere; }
.dc-mention { background: var(--dc-mention-bg); color: var(--dc-mention); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-ts { background: rgba(255, 255, 255, .06); border-radius: 3px; padding: 0 2px; }
.dc-link { color: var(--dc-link); text-decoration: none; }
.dc-link:hover { text-decoration: underline; }
.dc-embed { margin-top: 6px; max-width: 520px; background: var(--dc-embed); border-left: 4px solid var(--dc-bar); border-radius: 4px; padding: 8px 16px 14px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.dc-embed-author { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--dc-head); margin-top: 6px; }
.dc-embed-author img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.dc-embed-title { font-weight: 600; font-size: 15px; color: var(--dc-head); }
.dc-embed-desc { color: var(--dc-text); overflow-wrap: anywhere; }
.dc-embed-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.dc-field { flex: 1 1 100%; min-width: 0; }
.dc-field.inline { flex: 1 1 140px; }
.dc-field-name { font-weight: 600; color: var(--dc-head); margin-bottom: 2px; font-size: 14px; }
.dc-field-value { overflow-wrap: anywhere; }
.dc-embed-footer { font-size: 12px; color: var(--dc-muted); margin-top: 2px; }
.dc-buttons { margin-top: 8px; }
.dc-button { display: inline-flex; align-items: center; gap: 6px; background: #248046; color: #fff; font-size: 14px; font-weight: 500; padding: 5px 16px; border-radius: 4px; }
.dp-logwrap { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 12px; }
.dp-logwrap summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.dp-log { margin-top: 10px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.dp-log-row { display: grid; grid-template-columns: 150px 84px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; font-size: 12.5px; border-top: 1px solid var(--border); }
.dp-log-row:first-child { border-top: 0; }
.dp-log-row.blocked { background: rgba(217, 83, 79, .08); }
.dp-log-row.dup { background: rgba(232, 180, 76, .14); }
.dp-log-when { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.dp-log-what { overflow-wrap: anywhere; }
.dp-log-inst { color: var(--text-dim); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.dp-chip { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; text-align: center; }
.dp-chip.sched { background: rgba(66, 133, 244, .14); color: #3b78e7; }
.dp-chip.manual { background: var(--hover); color: var(--text-dim); }
@media (max-width: 640px) {
  .dp-head { flex-direction: column; }
  .dp-log-row { grid-template-columns: 1fr auto; }
  .dp-log-what, .dp-log-inst { grid-column: 1 / -1; }
  .dc-frame { padding: 12px 10px; font-size: 14px; }
  .dc-avatar { width: 32px; height: 32px; flex-basis: 32px; }
}

/* ===== Revision link controls (Review page) ===== */
.pw-revbox { margin: 10px 12px 0; flex-shrink: 0; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.pw-revbox.is-rev { border-color: rgba(230, 126, 34, .55); background: rgba(230, 126, 34, .08); }
.pw-revbox.suggest { border-style: dashed; }
.pw-revbox-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.pw-revbox.is-rev .pw-revbox-title { color: var(--text); }
.pw-revbox-title { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.pw-revbox-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-revbox-sub { color: var(--text-dim); font-size: 12px; margin-top: -2px; }
.pw-revbox select { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: inherit; }
.pw-revbox-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pw-revbox-actions button { width: auto; font-size: 12px; padding: 5px 10px; }
.revision-badge .rev-round { opacity: .8; font-weight: 500; margin-left: 3px; }

/* ===== Raw footage check ===== */
.dp-head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.footage-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap; line-height: 16px; }
.footage-chip svg { flex-shrink: 0; }
.footage-chip.ok { background: rgba(46, 160, 67, .14); color: #1f8a3a; }
.footage-chip.warn { background: rgba(230, 126, 34, .16); color: #b8620e; }
.footage-chip.bad { background: rgba(217, 83, 79, .14); color: #c23d38; }
.footage-chip.muted { background: var(--hover); color: var(--text-dim); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .footage-chip.ok { color: #5fd07c; }
  :root:not([data-theme="light"]) .footage-chip.warn { color: #f0a45b; }
  :root:not([data-theme="light"]) .footage-chip.bad { color: #f07b76; }
}
:root[data-theme="dark"] .footage-chip.ok { color: #5fd07c; }
:root[data-theme="dark"] .footage-chip.warn { color: #f0a45b; }
:root[data-theme="dark"] .footage-chip.bad { color: #f07b76; }
.fp-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.fp-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--border); font-size: 13px; }
.fp-row:first-child { border-top: 0; }
.fp-title { display: flex; flex-direction: column; min-width: 0; }
.fp-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fp-title .dp-muted { font-size: 12px; overflow-wrap: anywhere; }
.fp-who { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-status { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 11px; }
.fp-open { font-size: 12px; color: var(--text-dim); text-decoration: none; white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.fp-open:hover { color: var(--text); }
@media (max-width: 640px) {
  .fp-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .fp-acts { grid-column: 2 / -1; order: 4; }
  .dp-head-actions { justify-content: flex-start; }
}
.team-footage { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.team-footage-head { font-size: 13px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.team-footage-head em { font-weight: 400; color: var(--text-dim); font-style: normal; }
.ed-card-meta .footage-chip { font-size: 10.5px; padding: 1px 7px; }

.fp-toolbar { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; }
.fp-toolbar .dp-col-h { flex: 1; }
.fp-toolbar button { font-size: 12px; padding: 5px 10px; }
.fp-all { font-size: 12px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.fp-check, .fp-all input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.fp-acts { display: flex; align-items: center; gap: 10px; }
.fp-ping { width: auto; font-size: 12px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel); color: var(--text); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.fp-ping:hover { background: var(--hover); }
.fp-ping:disabled { opacity: .5; cursor: default; }

.fu-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.fu-head h2 { margin: 0 0 2px; }
.fu-head .panel-sub { margin: 0; }
.fu-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.fu-card.fu-new { border-style: dashed; }
.fu-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px; }
@media (max-width: 1150px) { .fu-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.fu-grid select { width: 100%; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--text); }
.fu-grid [data-fu-ping-custom] { margin-top: 6px; }
.fu-grid [data-fu-ping-custom][hidden] { display: none; }
@media (max-width: 800px) { .fu-grid { grid-template-columns: minmax(0, 1fr); } .fu-head { flex-direction: column; } }
.fu-chans-label { font-size: 12px; color: var(--text-dim); font-weight: 500; margin-bottom: -4px; }
.fu-chans { display: flex; flex-wrap: wrap; gap: 6px; }
.fu-chan { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; cursor: pointer; user-select: none; }
.fu-chan input { width: 13px; height: 13px; margin: 0; accent-color: var(--accent); }
.fu-chan.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.fu-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.fu-actions .team-card-actions button { width: auto; }
.fu-card[hidden] { display: none; }

/* ===== Card attachments + markdown ===== */
.tb-att-count { font-size: 12px; color: var(--tr-text-subtle, var(--text-dim)); background: var(--tr-neutral, var(--hover)); border-radius: 999px; padding: 1px 8px; }
.tb-att-links { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px 40px; }
.tb-att-link { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.tb-att-link a { color: var(--tr-link, #0c66e4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.tb-att-link-ico { color: var(--tr-text-subtle, var(--text-dim)); display: inline-flex; }
.tb-att-grid { display: flex; flex-direction: column; gap: 10px; margin-left: 40px; }
.tb-att-item { display: flex; gap: 12px; align-items: flex-start; }
.tb-att-thumb { width: 112px; height: 80px; flex: 0 0 112px; border-radius: 6px; overflow: hidden; border: 0; padding: 0; background: var(--tr-neutral, var(--hover)); cursor: zoom-in; }
.tb-att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-att-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tb-att-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-att-sub { font-size: 12px; color: var(--tr-text-subtle, var(--text-dim)); }
.tb-att-acts { display: flex; gap: 10px; font-size: 12px; }
.tb-att-acts a.tb-link { text-decoration: underline; color: inherit; }
@media (max-width: 640px) { .tb-att-links, .tb-att-grid { margin-left: 0; } }
.tb-img-viewer { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.85); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.tb-img-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: default; }
.tb-img-viewer-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.tb-desc-view p, .tb-comment-bubble p { margin: 0; }
.tb-desc-view ul, .tb-desc-view ol, .tb-comment-bubble ul, .tb-comment-bubble ol { margin: 4px 0; padding-left: 22px; }
.tb-desc-view .tb-md-h { margin: 8px 0 4px; font-size: 15px; }
.tb-desc-view .tb-md-gap { height: 8px; }
.tb-desc-view hr { border: 0; border-top: 1px solid var(--tr-border, var(--border)); margin: 8px 0; }
.tb-desc-view code { font-size: 12.5px; background: var(--tr-neutral, var(--hover)); padding: 1px 4px; border-radius: 4px; }

/* ===== Drop footage onto cards ===== */
.tb-card.tb-file-over { outline: 2px dashed #0c66e4; outline-offset: 2px; background: color-mix(in srgb, #0c66e4 10%, var(--tr-card, #fff)); }
.tb-card.tb-file-over::after { content: 'Drop to add to card'; position: absolute; inset: auto 8px 8px auto; font-size: 11px; font-weight: 700; color: #fff; background: #0c66e4; border-radius: 4px; padding: 2px 6px; pointer-events: none; }
.tb-card { position: relative; }
.tb-modal.tb-file-over { outline: 3px dashed #0c66e4; outline-offset: -6px; }
.tb-badge-footage { color: #1f845a; }
.tb-footage-body { margin-left: 40px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.tb-footage-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tb-footage-row a, .tb-footage-files a { color: var(--tr-link, #0c66e4); }
.tb-footage-sub { color: var(--tr-text-subtle, var(--text-dim)); font-size: 12px; }
.tb-footage-files { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 2px; }
.tb-footage-drop { border: 1.5px dashed var(--tr-border, var(--border)); border-radius: 8px; padding: 12px 14px; color: var(--tr-text-subtle, var(--text-dim)); display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
@media (max-width: 640px) { .tb-footage-body { margin-left: 0; } }


/* ===== Quick card editor (right-click a card) ===== */
.tb-quick { position: fixed; inset: 0; z-index: 900; }
.tb-quick-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.tb-quick-wrap { position: absolute; }
.tb-quick-card { list-style: none; margin: 0; padding: 0; }
.tb-quick-card .tb-card { cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.tb-quick-card .tb-card:hover { outline: none; }
.tb-quick-title { display: block; width: 100%; box-sizing: border-box; resize: none; overflow: hidden; border: 0; outline: none; padding: 0; margin: 0 0 4px; background: transparent; color: var(--tr-text); font: inherit; font-size: 14px; line-height: 20px; min-height: 20px; }
.tb-quick-title::selection { background: color-mix(in srgb, #579dff 45%, transparent); }
.tb-quick-save { margin-top: 12px; background: #579dff; color: #1d2125; border: 0; border-radius: 4px; padding: 7px 14px; font-weight: 600; font-size: 14px; cursor: pointer; width: auto; }
.tb-quick-save:hover { background: #85b8ff; }
.tb-quick-menu { position: absolute; top: 0; left: calc(100% + 8px); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tb-quick-menu.left { left: auto; right: calc(100% + 8px); align-items: flex-end; }
.tb-quick-menu.below { position: static; margin-top: 10px; flex-direction: row; flex-wrap: wrap; }
.tb-quick-btn { display: inline-flex; align-items: center; gap: 8px; width: auto; white-space: nowrap; background: #2c333a; color: #dee4ea; border: 0; border-radius: 4px; padding: 6px 12px 6px 10px; font-size: 14px; font-weight: 500; cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,.25); transition: transform .08s, background .12s; }
.tb-quick-btn:hover { background: #454f59; transform: translateX(3px); }
.tb-quick-menu.left .tb-quick-btn:hover { transform: translateX(-3px); }
.tb-quick-btn svg { flex-shrink: 0; opacity: .9; }
:root[data-theme="light"] .tb-quick-btn { background: #f1f2f4; color: #172b4d; }
:root[data-theme="light"] .tb-quick-btn:hover { background: #dcdfe4; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .tb-quick-btn { background: #f1f2f4; color: #172b4d; } :root:not([data-theme="dark"]) .tb-quick-btn:hover { background: #dcdfe4; } }
.tb-popover { z-index: 1000; }
.tb-pop-hint { font-size: 13px; color: var(--tr-subtle); margin: 0 0 10px; }
.tb-dest-row { display: flex; gap: 8px; }
.tb-dest-row .grow { flex: 1; min-width: 0; }
.tb-dest-row select { width: 100%; }
.tb-mirror-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--tr-subtle); margin-bottom: 4px; }

/* ===== Workflow: edge-to-edge board ===== */
.main.main-board { margin: 0; height: 100vh; border-radius: 0; box-shadow: none; border: 0; }
/* Review player: edge-to-edge too — no frame around the page, and the video fills the stage
   (only the unavoidable letterbox for a different aspect ratio remains, in the stage color). */
.main.main-review { margin: 0; height: 100vh; border-radius: 0; box-shadow: none; border: 0; }
@media (max-width: 900px) { .main.main-review { flex: none; height: 100vh; height: 100dvh; min-height: 0; } }
/* Under the 52px mobile top bar; a fixed-height screen so only the note list scrolls. */
@media (max-width: 760px) { .main.main-review { height: calc(100vh - 52px); height: calc(100dvh - 52px); min-height: 0; } }
.pw-viewer { padding: 0; }
.pw-viewer video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; border-radius: 0; box-shadow: none; background: var(--pw-stage); }
@media (max-width: 760px) { .main.main-board { height: calc(100vh - 52px); } }

/* ===== List card count + collapse (Trello) ===== */
.tb-list-count { flex-shrink: 0; align-self: center; font-size: 13px; font-weight: 500; color: var(--tr-subtle); padding: 0 2px; font-variant-numeric: tabular-nums; }
.tb-list-head .tb-list-btn { flex-shrink: 0; }
.tb-list.is-collapsed { width: 44px; cursor: pointer; align-self: flex-start; }
.tb-list-collapsed { width: 100%; border: 0; background: transparent; color: var(--tr-text); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0 14px; border-radius: 12px; cursor: pointer; min-height: 120px; }
.tb-list-collapsed:hover { background: var(--tr-neutral-hover, rgba(0,0,0,.06)); }
.tb-collapse-ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--tr-subtle); }
.tb-list-vtitle { writing-mode: vertical-rl; font-size: 14px; font-weight: 600; line-height: 1.2; max-height: 60vh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-list-vcount { writing-mode: vertical-rl; font-size: 13px; color: var(--tr-subtle); font-variant-numeric: tabular-nums; }
.tb-cards-hidden { display: none; }

/* ===== Create board / board settings fields ===== */
.tb-field-label { display: block; font-size: 12px; font-weight: 700; color: var(--tr-subtle); margin: 10px 0 4px; }
.tb-field-label .tb-req { color: #f87168; }
.tb-field-label .tb-opt { font-weight: 400; }
.tb-pop-hint.small { font-size: 12px; margin: 6px 0 12px; }
.tb-btn-subtle.danger { color: #f87168; }

@keyframes tbSheetIn { from { transform: translateY(8px) scale(.98); opacity: 0; } }

/* ===== Footage upload: progress panel (Dropbox / Chatbase / Fabric refs) ===== */
.tb-upload-panel { position: fixed; right: 20px; bottom: 20px; z-index: 1050; width: 380px; max-width: calc(100vw - 24px); background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.28); overflow: hidden; animation: tbSheetIn .16s ease-out; }
.tb-up-head { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; }
.tb-up-status { position: relative; width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; }
.tb-up-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tb-up-titles strong { font-size: 14px; }
.tb-up-titles span { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.tb-up-icon { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--text-dim); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; padding: 0; }
.tb-up-icon:hover { background: var(--hover); color: var(--text); }
.tb-up-overall { height: 3px; background: var(--hover); }
.tb-up-overall span { display: block; height: 100%; background: linear-gradient(90deg, #579dff, #0c66e4); transition: width .3s; }
.tb-upload-panel.collapsed .tb-up-body { display: none; }
.tb-up-body { max-height: 360px; overflow: auto; }
.tb-up-list { padding: 4px 0; }
.tb-up-item { display: flex; align-items: center; gap: 12px; padding: 8px 14px; }
.tb-up-item:hover { background: var(--hover); }
.tb-up-thumb { width: 52px; height: 32px; flex: 0 0 52px; border-radius: 6px; overflow: hidden; background: #1d2125; color: #9fadbc; display: grid; place-items: center; }
.tb-up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tb-up-meta { flex: 1; min-width: 0; }
.tb-up-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-up-line { font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-up-item.cancelled .tb-up-name, .tb-up-item.cancelled .tb-up-line { opacity: .55; }
.tb-up-right { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.tb-up-mini { position: relative; width: 28px; height: 28px; display: grid; place-items: center; }
.tb-up-item .cancel { width: 26px; height: 26px; opacity: 0; }
.tb-up-item:hover .cancel { opacity: 1; }
.tb-ring { width: 28px; height: 28px; transform: rotate(-90deg); }
.tb-up-status .tb-ring { width: 32px; height: 32px; }
.tb-ring circle { fill: none; stroke-width: 3; }
.tb-ring .bg { stroke: var(--hover); }
.tb-ring .fg { stroke: #0c66e4; stroke-linecap: round; transition: stroke-dashoffset .3s; }
.tb-ring-pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tb-up-mini .tb-ring-pct { font-size: 8px; }
.tb-up-badge { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.tb-up-badge.sm { width: 20px; height: 20px; }
.tb-up-badge.ok { background: #1f845a; }
.tb-up-badge.err { background: #c9372c; }
.tb-up-err { color: #e2483d; }
.tb-up-result { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 12px 12px; padding: 10px 12px; border-radius: 12px; background: var(--hover); }
.tb-up-result.ok { background: color-mix(in srgb, #1f845a 16%, var(--panel)); }
.tb-up-result > div:not(.tb-up-result-acts) { flex: 1; min-width: 0; }
.tb-up-result strong { display: block; font-size: 13px; }
.tb-up-result span:not(.tb-up-badge) { display: block; font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-up-result-acts { display: flex; gap: 6px; width: 100%; padding-left: 38px; }
.tb-up-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 7px; border: 0; background: var(--text); color: var(--panel); font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; width: auto; }
.tb-up-btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 30%, transparent); }
.tb-up-btn:hover { opacity: .9; }
@media (max-width: 560px) { .tb-upload-panel { right: 12px; bottom: 12px; } }

.tb-card.tb-drop-landed { animation: tbDropLanded .9s ease-out; }
@keyframes tbDropLanded { 0% { box-shadow: 0 0 0 3px #579dff; } 100% { box-shadow: 0 0 0 0 transparent; } }
