@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-cinema: #000000;
  --bg-app: #0a0a0b;
  --bg-panel: #111113;
  --bg-surface: #18181b;
  --bg-surface-hover: #222226;
  --bg-surface-active: #27272a;

  --border-subtle: #1f1f23;
  --border-default: #2b2b31;
  --border-strong: #3f3f46;

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent-primary: #fafafa;
  --accent-on-primary: #09090b;

  --accent-amber: #f59e0b;
  --accent-amber-soft: rgba(245, 158, 11, 0.14);
  --accent-amber-border: rgba(245, 158, 11, 0.34);
  --accent-amber-text: #fbbf24;

  --accent-green: #10b981;
  --accent-green-soft: rgba(16, 185, 129, 0.14);
  --accent-green-border: rgba(16, 185, 129, 0.34);
  --accent-green-text: #34d399;

  --accent-red: #ef4444;
  --accent-red-soft: rgba(239, 68, 68, 0.14);
  --accent-red-border: rgba(239, 68, 68, 0.34);
  --accent-red-text: #f87171;

  --font-sans: 'IBM Plex Sans Thai', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.78);
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}

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

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* Studio Header (48px - 52px Frame.io Chrome) */
.studio-header {
  height: 48px;
  padding: 0 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 30;
}

.studio-header.drive-header {
  height: 54px;
  padding: 0 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 0;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.studio-mark {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--accent-on-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

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

.breadcrumb-sep {
  color: var(--text-muted);
  font-size: 13px;
  user-select: none;
}

.breadcrumb-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

/* Clip Switcher Dropdown in Header */
.clip-switcher {
  position: relative;
  min-width: 0;
}

.clip-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  max-width: min(360px, 46vw);
  transition: background 0.14s ease, border-color 0.14s ease;
}
.clip-switcher-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}
.clip-switcher-btn span.clip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: 65dvh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  padding: 6px;
  display: none;
  z-index: 60;
}
.clip-dropdown.open {
  display: block;
}

.clip-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}
.clip-dropdown-item:hover {
  background: var(--bg-surface);
}
.clip-dropdown-item.active {
  background: var(--bg-surface-active);
}

.clip-dropdown-thumb {
  width: 28px;
  height: 48px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  background: var(--bg-cinema);
  flex-shrink: 0;
}

/* Live Status Indicator */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}
.live-pill.connected {
  color: var(--text-secondary);
}
.live-pill.connected .live-dot {
  background: var(--accent-green);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.btn:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-surface);
  border-color: transparent;
  color: var(--text-primary);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
}

.btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--accent-on-primary);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

.btn-approve {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #042f1e;
  font-weight: 600;
}
.btn-approve:hover:not(:disabled) {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

.btn-revision {
  background: var(--bg-surface);
  border-color: var(--accent-amber-border);
  color: var(--accent-amber-text);
  font-weight: 600;
}
.btn-revision:hover:not(:disabled) {
  background: var(--accent-amber-soft);
  border-color: var(--accent-amber);
}

.btn-revision-solid {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: #09090b;
  font-weight: 600;
}
.btn-revision-solid:hover:not(:disabled) {
  background: #d97706;
  border-color: #d97706;
}

.btn-danger-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn-danger-ghost:hover:not(:disabled) {
  background: var(--accent-red-soft);
  color: var(--accent-red-text);
}

.btn-sm {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.btn-lg {
  height: 40px;
  padding: 0 14px;
  font-size: 13.5px;
  border-radius: var(--radius-md);
}

/* Status Pill (Solid High-Contrast Tags) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}
.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-badge.approved {
  background: #16a34a;
  border-color: #22c55e;
  color: #ffffff;
}
.status-badge.approved::before {
  background: #dcfce7;
}
.status-badge.revision {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
}
.status-badge.revision::before {
  background: #fee2e2;
}
.status-badge.pending {
  background: #f59e0b;
  border-color: #fbbf24;
  color: #09090b;
}
.status-badge.pending::before {
  background: #09090b;
}

/* =========================================================
   FRAME.IO CINEMA SHELL (Used by Reviewer + Admin Inspector)
   ========================================================= */
.cinema-shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-cinema);
  overflow: hidden;
}

.cinema-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr clamp(380px, 36vw, 680px);
  transition: grid-template-columns 0.18s ease;
}

.cinema-body.panel-collapsed {
  grid-template-columns: 1fr 0px;
}
.cinema-body.panel-collapsed .cinema-sidebar {
  border-left: none;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.cinema-player-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-cinema);
}

.cinema-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--bg-cinema);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.cinema-viewport video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--bg-cinema);
}

.viewport-play-overlay {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(17, 17, 19, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.cinema-viewport.paused .viewport-play-overlay {
  opacity: 1;
  transform: scale(1);
}

/* Bespoke Transport Bar (Frame.io Scrubber + Controls) */
.transport-bar {
  background: var(--bg-app);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  user-select: none;
}

.scrubber-hit {
  position: relative;
  height: 24px;
  padding: 9px 14px;
  cursor: pointer;
  touch-action: none;
}

.scrubber-track {
  position: relative;
  height: 4px;
  width: 100%;
  border-radius: 999px;
  background: #27272a;
  transition: height 0.12s ease;
}

.scrubber-hit:hover .scrubber-track,
.scrubber-hit.dragging .scrubber-track {
  height: 6px;
}

.scrubber-buffered {
  position: absolute;
  inset: 0 auto 0 0;
  background: #3f3f46;
  border-radius: 999px;
  pointer-events: none;
}

.scrubber-played {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--text-primary);
  border-radius: 999px;
  pointer-events: none;
}

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

.scrubber-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  min-width: 6px;
  border-radius: 999px;
  background: var(--accent-amber);
  pointer-events: auto;
  cursor: pointer;
  opacity: 0.92;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.scrubber-marker:hover {
  transform: scaleY(1.35);
  opacity: 1;
}
.scrubber-marker.resolved {
  background: var(--accent-green);
  opacity: 0.55;
}

.scrubber-thumb {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-primary);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55);
  transition: transform 0.12s ease;
}

.scrubber-hit:hover .scrubber-thumb,
.scrubber-hit.dragging .scrubber-thumb {
  transform: translate(-50%, -50%) scale(1);
}

.scrubber-tooltip {
  position: absolute;
  bottom: 26px;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
  white-space: nowrap;
}
.scrubber-hit:hover .scrubber-tooltip,
.scrubber-hit.dragging .scrubber-tooltip {
  opacity: 1;
}

.transport-controls {
  height: 42px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

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

.transport-center {
  justify-content: center;
}

.transport-right {
  justify-content: flex-end;
}

.tc-readout {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
}

.tc-readout .tc-dur {
  color: var(--text-muted);
}

.volume-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.volume-slider {
  width: 64px;
  accent-color: var(--text-primary);
  cursor: pointer;
}

.speed-btn {
  font-family: var(--font-mono);
  font-size: 11.5px;
  min-width: 44px;
}

.loop-btn.active {
  color: var(--accent-amber-text);
  background: var(--accent-amber-soft);
}

/* Right Docked Comments & Details Panel (360px) */
.cinema-sidebar {
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.panel-tabs-wrap {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.panel-tab {
  height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.14s ease, color 0.14s ease;
}
.panel-tab:hover {
  color: var(--text-primary);
}
.panel-tab.active {
  background: var(--bg-surface-active);
  color: var(--text-primary);
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.panel-tab.active .tab-count {
  color: var(--text-secondary);
}

.panel-subbar {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

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

.chip-tab {
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.chip-tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}
.chip-tab.active {
  background: var(--bg-surface-active);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.subbar-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 12px;
  height: 26px;
  padding: 0 8px;
  max-width: 180px;
}

.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.panel-empty {
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
}

.panel-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
}

/* Editorial Frame.io Comment Rows */
.comment-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  border-left: 3px solid var(--rc, transparent);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.comment-row:hover {
  background: rgba(255, 255, 255, 0.025);
}
.comment-row.active-cue {
  background: var(--rc-soft, rgba(245, 158, 11, 0.08));
  border-left-color: var(--rc, var(--accent-amber));
}
.comment-row.resolved {
  opacity: 0.58;
}

.comment-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

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

.avatar-mono {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rc-solid, var(--bg-surface-active));
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.reviewer-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.reviewer-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.reviewer-role {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.25;
}

.timecode-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--accent-amber-soft);
  border: 1px solid var(--accent-amber-border);
  color: var(--accent-amber-text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease;
}
.timecode-pill:hover {
  background: rgba(245, 158, 11, 0.24);
}
.comment-row.resolved .timecode-pill {
  background: var(--accent-green-soft);
  border-color: var(--accent-green-border);
  color: var(--accent-green-text);
}

.comment-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  padding-left: 34px;
}
.comment-row.resolved .comment-body {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.comment-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 34px;
  font-size: 11px;
  color: var(--text-muted);
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Approvals & File Info Tab */
.details-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.details-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.approval-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  background: var(--accent-green-soft);
  border: 1px solid var(--accent-green-border);
  margin-bottom: 8px;
}

.spec-grid {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 7px 12px;
  font-size: 12.5px;
}
.spec-key {
  color: var(--text-muted);
}
.spec-val {
  color: var(--text-primary);
  word-break: break-word;
}

/* Bottom Frame.io Composer & Action Dock */
.panel-composer-dock {
  position: relative;
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

/* Compact Anchored Reviewer Popover (Over Comment Dock on Desktop) */
.popover-scrim {
  display: none;
}

.reviewer-popover {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 60;
  background: #141417;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 -14px 42px rgba(0, 0, 0, 0.82);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.reviewer-popover.open {
  display: flex;
  animation: popoverUp 0.14s ease-out;
}

@keyframes popoverUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reviewer-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.reviewer-compact-list {
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: none;
  overflow: visible;
}

.reviewer-compact-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.reviewer-compact-item.full-width {
  grid-column: 1 / -1;
}
.reviewer-compact-item:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}
.reviewer-compact-item.is-last {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--accent-amber-border);
}
.reviewer-compact-item.is-last:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.18);
}

.reviewer-compact-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.reviewer-compact-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reviewer-compact-role {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.reviewer-last-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-amber-soft);
  color: var(--accent-amber-text);
  flex-shrink: 0;
}

.reviewer-custom-inline {
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-app);
}
.reviewer-custom-inline .form-input {
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.composer-box {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}
.composer-box:focus-within,
.composer-box.highlight {
  border-color: var(--accent-amber);
  background: var(--bg-surface-hover);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.composer-tc {
  padding: 3px 7px;
  margin-bottom: 2px;
  border-radius: var(--radius-xs);
  background: var(--accent-amber-soft);
  border: 1px solid var(--accent-amber-border);
  color: var(--accent-amber-text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
  cursor: pointer;
}
.composer-tc:hover {
  background: rgba(245, 158, 11, 0.24);
}

.composer-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
  padding: 3px 0;
  resize: none;
  min-height: 24px;
  max-height: 84px;
  overflow-y: auto;
  outline: none;
}
.composer-input::placeholder {
  color: var(--text-muted);
}
.composer-input:focus-visible {
  outline: none;
}

.composer-send-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-active);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}
.composer-send-btn:hover:not(:disabled),
.composer-box.has-text .composer-send-btn {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: #09090b;
}

.dock-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* =========================================================
   ADMIN DRIVE MEDIA BROWSER
   ========================================================= */
.drive-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
}

.drive-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

.drive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.drive-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.drive-tab {
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.drive-tab:hover {
  color: var(--text-primary);
}
.drive-tab.active {
  background: var(--bg-surface-active);
  color: var(--text-primary);
  font-weight: 600;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box svg {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  height: 34px;
  padding: 0 12px 0 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-panel);
  font-size: 13px;
  min-width: 240px;
}
.search-input:focus {
  border-color: var(--border-strong);
}

/* Compact Drop Strip */
.drop-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-default);
  background: var(--bg-panel);
  margin-bottom: 18px;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.drop-strip:hover,
.drop-strip.drag-over {
  border-color: var(--text-primary);
  background: var(--bg-surface);
}

.drop-strip-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drop-strip-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  display: grid;
  place-items: center;
  color: var(--text-primary);
  flex-shrink: 0;
}

.global-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 10, 11, 0.86);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.global-drop-overlay.open {
  display: flex;
}
.global-drop-box {
  border: 2px dashed var(--text-primary);
  border-radius: var(--radius-xl);
  background: var(--bg-panel);
  padding: 44px 56px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Upload Progress */
.upload-progress-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.upload-progress-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.upload-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
}
.progress-track {
  height: 4px;
  background: var(--bg-surface-active);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--text-primary);
  transition: width 0.15s ease;
}

/* 9:16 Media Card Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.media-card {
  background: var(--bg-panel);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.media-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.media-card.status-approved {
  border-color: #22c55e;
}
.media-card.status-approved:hover {
  border-color: #4ade80;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}
.media-card.status-revision {
  border-color: #ef4444;
}
.media-card.status-revision:hover {
  border-color: #f87171;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
}
.media-card.status-pending {
  border-color: #f59e0b;
}
.media-card.status-pending:hover {
  border-color: #fbbf24;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.media-thumb-box {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--bg-cinema);
  overflow: hidden;
}
.media-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.media-hover-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.media-card:hover .media-hover-play {
  opacity: 1;
}
.media-hover-play-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(17, 17, 19, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
}

.media-top-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.media-bottom-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 22px 8px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.duration-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.78);
  color: var(--text-primary);
}

.media-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.media-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.media-card-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
}

.media-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

/* =========================================================
   MODALS (Neutral Carbon Studio Modals)
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 2;
}

.modal-title {
  font-size: 15.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-panel);
  position: sticky;
  bottom: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text-primary);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--border-strong);
}
.form-textarea {
  min-height: 88px;
  resize: vertical;
}

/* Time Range Picker in Revision Modal */
.time-range-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.time-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.time-input-pill {
  width: 78px;
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13.5px;
  background: var(--bg-app);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 5px 6px;
  color: var(--accent-amber-text);
}
.time-input-pill:disabled {
  opacity: 0.45;
  color: var(--text-muted);
}

.range-slider {
  width: 100%;
  accent-color: var(--accent-amber);
  cursor: pointer;
}

/* Reviewer Picker Grid */
.reviewer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.reviewer-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  cursor: pointer;
  text-align: left;
  min-height: 48px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.reviewer-option:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}
.reviewer-option.selected {
  border-color: var(--text-primary);
  background: var(--bg-surface-active);
  box-shadow: inset 0 0 0 1px var(--text-primary);
}
.reviewer-option.full-width {
  grid-column: 1 / -1;
}

.reviewer-option-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.reviewer-option-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.reviewer-option-role {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}
.reviewer-option-check {
  color: var(--text-primary);
  opacity: 0;
  flex-shrink: 0;
}
.reviewer-option.selected .reviewer-option-check {
  opacity: 1;
}

/* Activity Bell & Popover */
.activity-wrap {
  position: relative;
}
.activity-wrap .btn-icon {
  position: relative;
}
.bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-panel);
}
.activity-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  display: none;
  flex-direction: column;
  z-index: 80;
  overflow: hidden;
}
.activity-popover.open {
  display: flex;
}
.activity-popover-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.activity-list {
  max-height: 360px;
  overflow-y: auto;
}
.activity-item {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.12s ease;
}
.activity-item:hover {
  background: var(--bg-surface);
}
.activity-item:last-child {
  border-bottom: none;
}

.media-card-reviewers {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Share Modal */
.share-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}
.qr-frame {
  background: #ffffff;
  padding: 10px;
  border-radius: var(--radius-md);
}
.qr-frame img {
  display: block;
  width: 184px;
  height: 184px;
}
.url-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.url-copy-row input {
  flex: 1;
  min-width: 0;
  height: 32px;
  background: var(--bg-app);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.16s ease-out;
}
.toast.success {
  border-color: var(--accent-green-border);
}
.toast.error {
  border-color: var(--accent-red-border);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-drive {
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.desktop-only {
  display: inline-flex;
}

/* =========================================================
   MOBILE & TABLET RESPONSIVE (< 900px)
   ========================================================= */
@media (max-width: 899px) {
  .desktop-only {
    display: none !important;
  }

  .studio-header {
    padding: 0 10px;
  }
  .studio-header.drive-header {
    padding: 0 12px;
  }

  .cinema-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .cinema-body,
  .cinema-body.panel-collapsed {
    grid-template-columns: 1fr;
  }
  .cinema-body.panel-collapsed .cinema-sidebar {
    opacity: 1;
    pointer-events: auto;
    border-left: none;
  }

  .cinema-viewport {
    height: 58dvh;
    min-height: 300px;
    flex: none;
  }

  .volume-wrap {
    display: none;
  }

  .cinema-sidebar {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    min-height: 360px;
  }

  .panel-scroll {
    max-height: none;
    overflow: visible;
  }

  .panel-composer-dock {
    position: sticky;
    bottom: 0;
    z-index: 40;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--bg-panel);
  }
  .panel-composer-dock.popover-open,
  .panel-composer-dock:has(.reviewer-popover.open) {
    z-index: 130;
  }

  .popover-scrim.open {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(0, 0, 0, 0.65);
    display: block;
  }

  .reviewer-popover {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    max-height: 78dvh;
  }

  .reviewer-compact-list {
    max-height: none;
    overflow: visible;
    padding: 10px;
    gap: 6px;
  }

  .reviewer-compact-item {
    min-height: 44px;
    padding: 8px 10px;
  }

  .dock-cta-row .btn-lg {
    height: 44px;
  }

  .reviewer-grid {
    grid-template-columns: 1fr;
  }

  .drive-container {
    padding: 14px;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
    gap: 12px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }

  .toast-container {
    bottom: 126px;
    left: 12px;
    right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
