/* ==========================================================================
   M&H Studio — Obsidian Pro Design System
   Inspired by Apple Pro Apps, Linear, Shopify Polaris & Frame.io v4
   Zero emojis · Zero gradients · Hairline borders · Restraint & clarity
   ========================================================================== */

:root {
  --bg: #0a0a0b;
  --surface: #111113;
  --surface-2: #16161a;
  --surface-3: #1e1e23;
  --hover: rgba(255, 255, 255, 0.045);
  --active: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #f4f4f6;
  --text-2: #a1a1aa;
  --text-3: #71717a;

  --white: #f5f5f7;
  --white-ink: #09090b;

  --green: #30d158;
  --green-bg: rgba(48, 209, 88, 0.13);
  --green-bd: rgba(48, 209, 88, 0.38);

  --amber: #ff9f0a;
  --amber-bg: rgba(255, 159, 10, 0.14);
  --amber-bd: rgba(255, 159, 10, 0.42);

  --red: #ff453a;
  --red-bg: rgba(255, 69, 58, 0.13);
  --red-bd: rgba(255, 69, 58, 0.38);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }
.muted { color: var(--text-2); }
.mb-10 { margin-bottom: 10px; }

/* Custom subtle scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

/* ---------- Login Screen ---------- */
.login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-brand p { margin: 2px 0 0; font-size: 12px; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--white);
  color: var(--white-ink);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand-mark.sm {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin: 12px 0 6px;
}

.error-banner {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--red-bg);
  border: 1px solid var(--red-bd);
  color: #ffb4ae;
  font-size: 12px;
}

/* ---------- Inputs & Buttons ---------- */
.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus { border-color: var(--border-strong); }
.input::placeholder { color: var(--text-3); }
.input-sm { padding: 6px 10px; font-size: 12.5px; }

.select-sm {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 500;
  padding: 8px 14px;
  transition: background 0.14s ease, border-color 0.14s ease, opacity 0.14s ease, transform 0.08s ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }

.btn-white {
  background: var(--white);
  color: var(--white-ink);
  font-weight: 600;
}
.btn-white:hover:not(:disabled) { background: #ffffff; }

.btn-subtle {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-subtle:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border-strong); }

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

.btn-xs { padding: 6px 11px; font-size: 12.5px; min-height: 30px; }
.btn-sm { padding: 7px 14px; font-size: 13px; min-height: 34px; }
.btn-lg { padding: 11px 20px; font-size: 14px; min-height: 42px; border-radius: 9px; }
.btn-full { width: 100%; margin-top: 14px; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.active { background: var(--active); color: var(--text); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- App Shell & Topbar ---------- */
.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 42px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.topbar-stage {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 6px;
}

@media (max-width: 1440px) {
  .topbar-title-sep, .topbar-stage .stage-title, .topbar-stage .user-name { display: none; }
  .user-name { display: none; }
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.top-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: 9px;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.13s ease, color 0.13s ease;
}

.nav-item:hover { color: var(--text); }
.nav-item.active {
  background: var(--surface-3);
  color: var(--text);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--white);
  color: var(--white-ink);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  margin-left: 4px;
  border-left: 1px solid var(--border);
}

.user-name {
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
}

/* ---------- Review 3-Column Studio Layout ---------- */
.review-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 368px;
  overflow: hidden;
  transition: grid-template-columns 0.18s ease;
}

.review-layout.rail-collapsed {
  grid-template-columns: 0px minmax(0, 1fr) 368px;
}

@media (min-width: 1480px) {
  .review-layout { grid-template-columns: 296px minmax(0, 1fr) 392px; }
  .review-layout.rail-collapsed { grid-template-columns: 0px minmax(0, 1fr) 392px; }
}

.review-layout > * { min-width: 0; min-height: 0; }

/* Left Queue Rail */
.queue-rail {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rail-header {
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 9px;
  color: var(--text-3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px 9px 32px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
}

.search-input:focus { border-color: var(--border-strong); }
.search-input::placeholder { color: var(--text-3); }

.rail-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  background: var(--bg);
  padding: 4px;
  border-radius: 9px;
  border: 1px solid var(--border);
}

.rail-tab {
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 7px 10px;
  min-height: 34px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: background 0.12s, color 0.12s;
}

.rail-tab:hover { color: var(--text); background: var(--hover); }
.rail-tab.active { background: var(--surface-3); color: var(--text); font-weight: 600; }

.tab-n {
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2);
}
.rail-tab.active .tab-n { background: rgba(255, 255, 255, 0.14); color: var(--text); }

.ad-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ad-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.ad-item:hover { background: var(--hover); }
.ad-item.active {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.ad-thumb {
  width: 42px;
  height: 54px;
  border-radius: 6px;
  background: #000;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 11px;
}

.ad-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-item-body {
  flex: 1;
  min-width: 0;
}

.ad-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ad-item-code {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-item-title {
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.ad-item-meta {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Subtle Semantic Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-ready { background: var(--green-bg); color: var(--green); }
.tag-note { background: var(--amber-bg); color: var(--amber); }
.tag-goy { background: var(--red-bg); color: var(--red); }
.tag-neutral { background: var(--surface-3); color: var(--text-2); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  display: inline-block;
  flex-shrink: 0;
}
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }
.dot-white { background: var(--white); }

/* ---------- Center Cinema Stage (Full-Bleed Frame.io Size) ---------- */
.cinema-stage {
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.empty-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg);
}

.empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 4px;
}

.stage-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stage-bar {
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.asset-spec-pill {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 1520px) {
  .stage-editor, .asset-spec-pill { display: none; }
}

.stage-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.stage-meta h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.meta-sep { color: var(--text-3); }

.stage-title {
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-editor {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.seg-group {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 6px 14px;
  min-height: 30px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface-3); color: var(--text); }
.seg-btn .ver-tag { font-size: 11px; color: var(--text-3); margin-left: 3px; font-weight: 400; }

.ver-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0 4px 0 10px;
  color: var(--text-2);
  transition: border-color 0.12s, background 0.12s;
}
.ver-pill-wrap:hover { border-color: var(--text-3); background: var(--surface-3); color: var(--text); }
.ver-ico { flex-shrink: 0; color: var(--text-3); }

.btn-adcopy {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
}
.btn-adcopy:hover { background: var(--surface-3); border-color: var(--text-3); }
.btn-adcopy.has-copy { border-color: var(--green-bd); background: rgba(48, 209, 88, 0.08); }

/* Clean Preloaded Static Ad Copy Bar (replaces video transport bar for static image ads) */
.static-copy-bar {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  margin: 6px 12px 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.scb-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.scb-meta {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}

.scb-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.scb-preview {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: pointer;
}
.scb-preview:hover { color: var(--text); }
.scb-preview.empty { color: var(--text-3); font-style: italic; }

.ver-select {
  height: 32px;
  background: transparent;
  border: none;
  padding: 0 24px 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23d4d4d8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}
.ver-select option { background: #141418; color: #f4f4f5; }

/* Video Player Canvas (Edge-to-edge full-height like Frame.io) */
.player-canvas {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #000;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.player-canvas video,
.player-canvas #static-player {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 100%;
  object-fit: contain;
  display: block;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.play-circle {
  width: 52px;
  height: 52px;
  border-radius: 99px;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.play-circle.playing { opacity: 0; transform: scale(0.92); pointer-events: none; }
.play-overlay:hover .play-circle:not(.playing) { transform: scale(1.06); }

.no-video {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-2);
  background: #000;
}

/* Compare Mode */
.compare-canvas {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.compare-pane {
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.compare-head {
  padding: 6px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.compare-pane video {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
}

.compare-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Frame.io Scrubber + Dedicated Marker & Draggable Range-Bracket Lane */
.transport-block {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1px 12px 4px;
  background: var(--bg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.scrubber-wrap {
  position: relative;
  height: 12px;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.scrubber-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  transition: height 0.12s ease;
}

.scrubber-wrap:hover .scrubber-track { height: 6px; }

.scrubber-buf {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 99px;
  pointer-events: none;
}

.scrubber-ranges {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scrubber-range {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(255, 159, 10, 0.42);
  border-radius: 99px;
}

.scrubber-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: #6366f1;
  border-radius: 99px;
  pointer-events: none;
}

.scrubber-active-range {
  position: absolute;
  top: -1px;
  bottom: -1px;
  background: var(--amber);
  border-radius: 99px;
  pointer-events: none;
  z-index: 2;
}

.scrubber-thumb {
  position: absolute;
  top: 50%;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--white);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  z-index: 4;
}

/* Marker & Draggable Bracket Lane right below track (0px when empty = max video height!) */
.marker-lane {
  position: relative;
  height: 0;
  overflow: hidden;
  width: 100%;
  user-select: none;
  touch-action: none;
  transition: height 0.12s ease;
}
.marker-lane.has-items {
  height: 20px;
  overflow: visible;
}

.scrubber-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.marker-pin-group {
  position: absolute;
  top: 1px;
  height: 16px;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.marker-avatar {
  width: 16px;
  height: 16px;
  border-radius: 99px;
  background: #ec4899;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg);
  pointer-events: auto;
  cursor: pointer;
  transform: translateX(-50%);
  flex-shrink: 0;
  transition: transform 0.12s ease;
  z-index: 3;
}
.marker-avatar:hover { transform: translateX(-50%) scale(1.22); }
.marker-avatar.resolved { background: var(--green); color: #09090b; }

.marker-span-line {
  position: absolute;
  top: 50%;
  left: 0;
  height: 2.5px;
  transform: translateY(-50%);
  background: #ec4899;
  border-radius: 99px;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0.85;
}
.marker-span-line.resolved { background: var(--green); }

/* Active Draggable Frame.io Range Bracket [ || ] x */
.range-bracket {
  position: absolute;
  top: 1px;
  height: 16px;
  display: flex;
  align-items: center;
  z-index: 8;
  min-width: 14px;
}

.rb-bar {
  flex: 1;
  height: 100%;
  min-width: 2px;
  background: rgba(255, 159, 10, 0.22);
  border-top: 1.5px solid var(--amber);
  border-bottom: 1.5px solid var(--amber);
  cursor: grab;
}
.rb-bar:active { cursor: grabbing; }

.rb-handle {
  width: 7px;
  height: 100%;
  background: var(--white);
  border: 1.5px solid var(--amber);
  border-radius: 2px;
  cursor: ew-resize;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.1s ease, background 0.1s ease;
}
.rb-handle:hover, .rb-handle.dragging {
  background: var(--amber);
  transform: scaleY(1.12);
}

.rb-clear {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 99px;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.rb-clear:hover { background: rgba(255, 255, 255, 0.38); }

.scrubber-hover-tip {
  position: absolute;
  bottom: 22px;
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 12;
}

.transport-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.transport-left, .transport-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.t-btn {
  height: 34px;
  min-width: 32px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.t-btn:hover { background: var(--surface-2); color: var(--text); }
.t-btn.active { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }

.t-play {
  width: 36px;
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.t-play:hover { background: var(--surface-3); border-color: var(--border-strong); }

.t-step { padding: 0 6px; font-variant-numeric: tabular-nums; }

.t-pill {
  background: var(--surface);
  border-color: var(--border);
  padding: 0 9px;
  color: var(--text);
}
.t-pill:hover { background: var(--surface-2); border-color: var(--border-strong); }

.tc-display {
  height: 34px;
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  padding: 0 9px;
  white-space: nowrap;
  margin-left: 2px;
}

.tc-sep { color: var(--text-3); margin: 0 4px; }

/* At <=1440px, match Frame.io single-timecode pill (duration is already shown above video) so all big 34px controls fit with 0 clipping */
@media (max-width: 1460px) {
  .tc-sep, #tc-dur { display: none; }
}

/* Frame.io Clean Speed Popover */
.speed-popover-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.speed-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 84px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  z-index: 30;
}

.spd-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: background 0.12s, color 0.12s;
}

.spd-btn:hover { background: var(--hover); color: var(--text); }
.spd-btn.active {
  background: var(--white);
  color: var(--white-ink);
  font-weight: 700;
}

/* Smooth Inline Sound Volume Control */
.vol-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 8px 0 2px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.vol-control .t-btn {
  height: 30px;
  min-width: 28px;
  padding: 0 4px;
  border: none;
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 58px;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(to right, #f4f4f5 var(--vol-pct, 100%), rgba(255, 255, 255, 0.2) var(--vol-pct, 100%));
  outline: none;
  cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 99px;
  background: #ffffff;
  border: 1.5px solid rgba(0, 0, 0, 0.4);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.vol-slider::-webkit-slider-thumb:hover { transform: scale(1.16); }

.vol-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 99px;
  background: #ffffff;
  border: 1.5px solid rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

@media (min-width: 1480px) {
  .vol-slider { width: 78px; }
  .transport-left, .transport-right { gap: 6px; }
  .t-step { padding: 0 9px; }
}

/* EXACT 1:1 Frame.io Bottom-Pinned Right-Panel Composer */
.frame-composer {
  flex-shrink: 0;
  background: #141418;
  border-top: 1px solid var(--border-strong);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fc-input-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.fc-input-line textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 26px;
  max-height: 112px;
  padding: 2px 0;
}

.fc-input-line textarea::placeholder { color: var(--text-3); }

.fc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fc-tools-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fc-ico-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.fc-ico-btn:hover { background: var(--hover); color: var(--text); }
.fc-ico-btn.active { color: #818cf8; background: rgba(99, 102, 241, 0.14); }

.fc-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: #6366f1;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, transform 0.08s ease;
}
.fc-send-btn:hover { background: #4f46e5; }
.fc-send-btn:active { transform: scale(0.95); }

.tc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.tc-chip.active {
  background: rgba(234, 179, 8, 0.16);
  border-color: rgba(234, 179, 8, 0.25);
  color: #eab308;
}

.micro-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
}
.micro-check input { width: 15px; height: 15px; accent-color: #6366f1; margin: 0; }

/* ---------- Right Decision & Frame.io Comments Rail ---------- */
.inspector-rail {
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Compact Decision Bar at Top */
.decision-card {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.dec-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  min-height: 40px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.08s ease;
}

.dec-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.dec-btn:active { transform: scale(0.975); }

.dec-ready.active { background: var(--green-bg); border-color: var(--green-bd); color: var(--green); }
.dec-note.active { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber); }
.dec-goy.active { background: var(--red-bg); border-color: var(--red-bd); color: var(--red); }

.general-note-box { display: flex; flex-direction: column; gap: 4px; }
.general-note-head { display: flex; align-items: center; justify-content: space-between; }
.micro-label { font-size: 11px; font-weight: 500; color: var(--text-3); }
.save-indicator { font-size: 10.5px; color: var(--text-3); }

.general-note-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  resize: vertical;
  outline: none;
  min-height: 82px;
  max-height: 220px;
  overflow-y: auto;
  transition: border-color 0.14s ease;
}
.general-note-input:focus { border-color: var(--border-strong); }
.general-note-input::placeholder { color: var(--text-3); }

.staged-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-2);
}
.staged-bar-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.staged-bar.st-ready { border-color: var(--green-bd); background: rgba(48, 209, 88, 0.06); }
.staged-bar.st-note { border-color: var(--amber-bd); background: rgba(255, 159, 10, 0.06); }
.staged-bar.st-goy { border-color: var(--red-bd); background: rgba(255, 69, 58, 0.06); }

/* Right Inspector Frame.io-Style Comments / Ad Copy Tabs */
.inspector-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 8px 12px 0;
  flex-shrink: 0;
}

.insp-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.insp-tab:hover { color: var(--text-2); background: var(--hover); }
.insp-tab.active { background: var(--surface-3); color: var(--text); border-color: var(--border); }

.copy-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--green);
}

.tab-body-flex {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.copy-panel {
  padding: 12px;
  gap: 10px;
  overflow-y: auto;
}

.copy-field { display: flex; flex-direction: column; gap: 5px; }
.copy-field-grow { flex: 1; min-height: 150px; }

.copy-textarea {
  width: 100%;
  flex: 1;
  min-height: 150px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  resize: vertical;
  outline: none;
  overflow-y: auto;
}
.copy-textarea:focus { border-color: var(--border-strong); }

.copy-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.link-btn-xs {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 11px;
  padding: 0;
  cursor: pointer;
}
.link-btn-xs:hover { color: var(--text); text-decoration: underline; }

.btn-copy-ico { width: 24px; height: 24px; }

/* Frame.io Comment Cards */
.note-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.note-author-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.note-avatar {
  width: 22px;
  height: 22px;
  border-radius: 99px;
  background: #ec4899;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.note-author { font-size: 12.5px; font-weight: 600; color: var(--text); }
.note-time { font-size: 11px; color: var(--text-3); }
.note-num { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }

.note-inline-body {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

.note-inline-body .note-tc-btn {
  margin-right: 6px;
  vertical-align: baseline;
}

.note-foot {
  margin-top: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.note-card.highlight {
  border-color: var(--amber-bd);
  background: rgba(255, 159, 10, 0.06);
}

/* Frame Notes Feed */
.notes-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-head {
  padding: 10px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.notes-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.count-chip {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-2);
}

.notes-filters {
  display: flex;
  align-items: center;
  gap: 4px;
}

.seg-mini {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px;
}

.seg-mini-btn {
  background: transparent;
  border: none;
  color: var(--text-3);
  padding: 4px 10px;
  min-height: 28px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
}
.seg-mini-btn:hover { color: var(--text-2); }
.seg-mini-btn.active { background: var(--surface-3); color: var(--text); }

.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes-empty {
  margin: auto 0;
  padding: 24px 14px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
}

.note-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  transition: border-color 0.14s ease;
}

.note-card:hover { border-color: var(--border-strong); }
.note-card.resolved { opacity: 0.56; }

.note-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.note-tc-btn {
  background: var(--amber-bg);
  color: var(--amber);
  border: none;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}
.note-tc-btn.general { background: var(--surface-3); color: var(--text-2); font-family: var(--font-sans); }

.note-hook-lbl {
  font-size: 11px;
  color: var(--text-3);
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.65;
  transition: opacity 0.12s;
}
.note-card:hover .note-actions { opacity: 1; }

.note-act-btn {
  background: transparent;
  border: none;
  color: var(--text-3);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 11px;
}
.note-act-btn:hover { background: var(--hover); color: var(--text); }
.note-act-btn.done { color: var(--green); }
.note-act-btn.del:hover { color: var(--red); }

.note-body {
  font-size: 12.5px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.note-replies {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 1.5px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reply-item {
  font-size: 12px;
  color: var(--text-2);
}

.inline-editor {
  margin-top: 6px;
  display: flex;
  gap: 5px;
}

/* Quiet Collapsible Copy Footer */
.copy-footer {
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.copy-toggle {
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}
.copy-toggle:hover { color: var(--text); background: var(--hover); }
.copy-toggle.open .chev { transform: rotate(180deg); }
.copy-toggle .chev { transition: transform 0.15s ease; }

.copy-drawer {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---------- Page Views (Send & Launch / Launch Sheet / Pulse) ---------- */
.page-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--bg);
}

.dispatch-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sheet-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dispatch-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.page-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.empty-dispatch {
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-dispatch-icon {
  width: 44px;
  height: 44px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-dispatch h3 { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.empty-dispatch p { margin: 0 0 8px; max-width: 420px; font-size: 13px; }

.dispatch-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dispatch-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-head-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
}

/* Apple-style Toggle Switch */
.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
}

.toggle-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 20px;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
  margin: 0;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 99px;
  background: var(--text-2);
  transition: transform 0.16s ease, background 0.16s ease;
}

.toggle-switch:checked {
  background: var(--white);
  border-color: var(--white);
}

.toggle-switch:checked::after {
  transform: translateX(14px);
  background: var(--white-ink);
}

/* Dispatch Rows */
.dispatch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.disp-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.disp-thumb {
  width: 40px;
  height: 52px;
  border-radius: 6px;
  background: #000;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.disp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.disp-body { flex: 1; min-width: 0; }

.disp-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.disp-code { font-weight: 600; font-size: 13px; letter-spacing: -0.01em; }
.disp-title { color: var(--text-2); font-size: 12.5px; }

.acct-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.disp-notes-preview {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
}

.disp-general {
  color: var(--text);
  background: var(--surface-2);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 2px solid var(--amber);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.disp-note-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.disp-tc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  flex-shrink: 0;
}

.disp-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.skills-extra-wrap { margin-top: 2px; }

.prompt-preview {
  font-size: 12px;
  color: var(--text-2);
}
.prompt-preview summary {
  cursor: pointer;
  user-select: none;
  color: var(--text-3);
}
.prompt-preview summary:hover { color: var(--text-2); }
.prompt-preview pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
  color: var(--text-2);
}

/* Recent Dispatches */
.recent-section {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recent-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.batch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.batch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}

.batch-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.delivery-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.delivery-chip.sent { border-color: var(--green-bd); color: var(--green); }
.delivery-chip.pending { border-color: var(--amber-bd); color: var(--amber); }
.delivery-chip.failed { border-color: var(--red-bd); color: var(--red); }

/* ---------- Launch Sheet Table (Shopify Polaris Clean) ---------- */
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.sheet-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sheet-search { width: 185px; }
.sel-col { width: 38px !important; padding-left: 12px !important; padding-right: 6px !important; }
.disabled-link { opacity: 0.38; pointer-events: none; cursor: not-allowed; }

.table-card { overflow-x: auto; }

.launch-table {
  width: 100%;
  border-collapse: collapse;
}

.launch-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.launch-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 12.5px;
}

.launch-table tr:last-child td { border-bottom: none; }
.launch-table tbody tr:hover td { background: var(--hover); }

.tc-col { text-align: center !important; width: 48px; }
.tr-col { text-align: right !important; }

.chk {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  margin: 0;
  transition: background 0.12s, border-color 0.12s;
}

.chk:checked {
  background: var(--green);
  border-color: var(--green);
}

.chk:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #09090b;
  border-bottom: 2px solid #09090b;
  transform: rotate(-45deg) translate(1px, -1px);
}

.tbl-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Factory Pulse ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.kpi-label { font-size: 11.5px; color: var(--text-3); }
.kpi-val { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }

.pulse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.pulse-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

/* ---------- Modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  width: 100%;
  z-index: 1;
}

.modal-sm { max-width: 380px; }
.modal-video { max-width: 720px; max-height: 92vh; overflow-y: auto; }
.modal-copy { max-width: 640px; max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

.copy-modal-box {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copy-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.copy-box-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cm-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cm-name-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

.cm-copy-pre {
  margin: 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 46vh;
  overflow-y: auto;
}

.cm-copy-pre.empty { color: var(--text-3); font-style: italic; }

.cm-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; }

.modal-video-el {
  width: 100%;
  max-height: 62vh;
  background: #000;
  border-radius: 8px;
}

.copy-preview {
  margin: 10px 0 0;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  white-space: pre-wrap;
}

.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-2);
}

kbd {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
}

/* ---------- Clean Top-Right Toast (Never overlaps video, header pills, or composer) ---------- */
.toast {
  position: fixed;
  top: 50px;
  right: 16px;
  z-index: 100;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.toast.ok { border-color: var(--green-bd); }
.toast.err { border-color: var(--red-bd); color: #ffb4ae; }
