/* KORTA Studio — Luxury Broadcast Control Room Design System */

:root {
  --bg-canvas: #07070b;
  --bg-rail: #0b0b12;
  --bg-panel: #101019;
  --bg-elevated: #161622;
  --bg-hover: #1d1d2d;
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --highlight-top: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --ink-primary: #f7f6fb;
  --ink-secondary: #9f9db2;
  --ink-muted: #65637a;

  --accent-live: #ff2a85;
  --accent-live-hover: #ff4796;
  --accent-live-soft: rgba(255, 42, 133, 0.16);
  --accent-vice-grad: linear-gradient(125deg, #ff2a85 0%, #ff6b4a 55%, #ffcf5c 100%);

  --accent-gold: #ffcf5c;
  --accent-gold-soft: rgba(255, 207, 92, 0.14);

  --accent-ok: #22e6f2;
  --accent-ok-soft: rgba(34, 230, 242, 0.14);

  --accent-chat: #22e6f2;

  --font-sans: "Plus Jakarta Sans", "Inter", "Segoe UI Variable", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

.mono, .mono-val, .mono-cost, .mono-tag, .mono-badge, .mono-sub {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* SHELL */
.studio-shell {
  display: grid;
  grid-template-columns: 236px 1fr;
  height: 100vh;
  width: 100vw;
}

/* LEFT RAIL */
.rail {
  background: var(--bg-rail);
  border-right: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  gap: 18px;
  min-height: 0;
}

.rail-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
}

.brand-edition {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
  background: var(--accent-gold-soft);
  padding: 1px 6px;
  border-radius: 5px;
}

.rail-nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 0 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  border-radius: 9px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out), transform 130ms var(--ease-out);
}

.nav-item:active {
  transform: scale(0.98);
}

@media (hover: hover) and (pointer: fine) {
  .nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink-primary);
  }
}

.nav-item.active {
  background: var(--bg-elevated);
  border-color: var(--border-hairline);
  color: var(--ink-primary);
  box-shadow: var(--highlight-top);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.nav-label {
  flex: 1;
}

.nav-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--ink-secondary);
}

.nav-pill-live.has-live {
  background: var(--accent-live-soft);
  color: #ff6b68;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ink-muted);
}

.status-dot.ok {
  background: var(--accent-ok);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot.partial {
  background: var(--accent-gold);
}

/* QUOTA CARD */
.quota-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quota-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quota-plan {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-primary);
}

.mono-tag {
  font-size: 10px;
  color: var(--accent-gold);
  background: var(--accent-gold-soft);
  padding: 2px 6px;
  border-radius: 5px;
}

.quota-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.mono-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
}

.quota-sub {
  font-size: 11px;
  color: var(--ink-secondary);
}

.quota-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.quota-bar-fill {
  height: 100%;
  background: var(--accent-gold);
  border-radius: 999px;
  transition: width 300ms var(--ease-out);
}

.cost-divider {
  height: 1px;
  background: var(--border-hairline);
  margin: 4px 0 2px;
}

.mono-cost {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-ok);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out), transform 140ms var(--ease-out), opacity 150ms var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-full { width: 100%; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 13.5px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; }

.btn-primary {
  background: var(--accent-live);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) { background: var(--accent-live-hover); }
}

.btn-surface {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--ink-primary);
  box-shadow: var(--highlight-top);
}

@media (hover: hover) and (pointer: fine) {
  .btn-surface:hover:not(:disabled) { background: var(--bg-hover); }
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-hairline);
  color: var(--ink-secondary);
}

@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover:not(:disabled) {
    background: rgba(255,255,255,0.04);
    color: var(--ink-primary);
    border-color: var(--border-strong);
  }
}

.btn-danger-ghost {
  background: transparent;
  border-color: rgba(229, 57, 53, 0.28);
  color: #f87171;
}

@media (hover: hover) and (pointer: fine) {
  .btn-danger-ghost:hover:not(:disabled) { background: var(--accent-live-soft); }
}

/* MAIN STAGE */
.stage {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.view-pad {
  flex: 1;
  overflow-y: auto;
  padding: 26px 32px 48px;
}

.narrow-stage {
  max-width: 980px;
}

/* LIVE 2-COLUMN STAGE + DOCK */
.live-layout {
  display: grid;
  grid-template-columns: 1fr 376px;
  flex: 1;
  min-height: 0;
}

.live-center {
  overflow-y: auto;
  padding: 24px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.stage-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.stage-subtitle {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  max-width: 660px;
}

.stage-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-secondary);
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  padding: 6px 11px;
  border-radius: 999px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-ok);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}

/* COMMAND DECK */
.command-deck {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.url-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.url-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 4px 6px 4px 8px;
  height: 42px;
  transition: border-color 150ms var(--ease-out);
}

.url-input-wrap:focus-within {
  border-color: rgba(229, 169, 60, 0.65);
}

.platform-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.platform-chip.twitch { color: #c084fc; border-color: rgba(192,132,252,0.3); }
.platform-chip.kick { color: #4ade80; border-color: rgba(74,222,128,0.3); }
.platform-chip.youtube { color: #f87171; border-color: rgba(248,113,113,0.3); }
.platform-chip.tiktok { color: #38bdf8; border-color: rgba(56,189,248,0.3); }
.platform-chip.demo { color: var(--accent-gold); border-color: rgba(229,169,60,0.35); }

.url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink-primary);
  font: inherit;
  font-size: 13.5px;
  min-width: 0;
}

.url-input::placeholder { color: var(--ink-muted); }

.controls-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.control-label {
  font-size: 12px;
  color: var(--ink-secondary);
  font-weight: 500;
}

.seg-control {
  display: inline-flex;
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out), transform 120ms var(--ease-out);
}

.seg-btn:active { transform: scale(0.96); }

.seg-btn.active {
  background: var(--bg-elevated);
  color: var(--ink-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.studio-select, .studio-input, .studio-textarea {
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  color: var(--ink-primary);
  font: inherit;
  font-size: 13px;
  border-radius: 8px;
  padding: 7px 11px;
  outline: none;
  transition: border-color 140ms var(--ease-out);
}

.studio-select:focus, .studio-input:focus, .studio-textarea:focus {
  border-color: rgba(229, 169, 60, 0.65);
}

.studio-input { width: 100%; height: 38px; }
.studio-textarea { width: 100%; resize: vertical; }
.full-w { width: 100%; }

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle-chip input { display: none; }

.toggle-track {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  position: relative;
  transition: background-color 160ms var(--ease-out);
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  transition: transform 160ms var(--ease-out);
}

.toggle-chip input:checked + .toggle-track { background: var(--accent-live); }
.toggle-chip input:checked + .toggle-track::after { transform: translateX(14px); }

/* BROADCAST MONITORS GRID */
.monitors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
}

.empty-monitors {
  grid-column: 1 / -1;
  background: var(--bg-panel);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  padding: 44px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.empty-monitors h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.empty-monitors p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  max-width: 480px;
}

.empty-platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 4px;
}

.monitor-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.monitor-viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #060709;
  overflow: hidden;
}

.monitor-frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.monitor-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-secondary);
  font-size: 12.5px;
  background: radial-gradient(circle at 50% 45%, #161922, #07080b);
}

.monitor-hud-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.monitor-hud-top > * { pointer-events: auto; }

.tally-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--ink-primary);
}

.tally-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-live);
  animation: tallyPulse 1.6s ease-in-out infinite;
}

@keyframes tallyPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

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

.hud-btn {
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--ink-primary);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 140ms var(--ease-out), transform 120ms var(--ease-out);
}

.hud-btn:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .hud-btn:hover { background: rgba(24, 27, 36, 0.92); }
}

.monitor-pending-banner {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(229, 169, 60, 0.94);
  color: #09090b;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 7px;
}

.monitor-body {
  padding: 13px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.monitor-info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.monitor-channel {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 7px;
}

.monitor-stream-title {
  font-size: 12px;
  color: var(--ink-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.monitor-stats {
  text-align: right;
  font-size: 11px;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.monitor-stats strong {
  color: var(--ink-primary);
}

/* CANVAS HYPE OSCILLOSCOPE */
.hype-scope-box {
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hype-scope-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-secondary);
}

.hype-scope-canvas {
  width: 100%;
  height: 54px;
  display: block;
}

.monitor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.monitor-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.monitor-error {
  font-size: 11.5px;
  color: #fca5a5;
  background: rgba(229, 57, 53, 0.12);
  border: 1px solid rgba(229, 57, 53, 0.25);
  border-radius: 8px;
  padding: 7px 10px;
}

/* RIGHT CLIPS DOCK */
.clips-dock {
  background: var(--bg-rail);
  border-left: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dock-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

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

.dock-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.dock-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-secondary);
}

.mono-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
  background: var(--accent-gold-soft);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.dock-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-pill {
  border: 1px solid var(--border-hairline);
  background: var(--bg-panel);
  color: var(--ink-secondary);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out);
}

.filter-pill.active {
  background: var(--ink-primary);
  color: var(--bg-canvas);
  border-color: var(--ink-primary);
}

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

/* CLIP ITEM CARD */
.clip-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
  border-radius: 11px;
  padding: 10px;
  display: flex;
  gap: 11px;
  transition: border-color 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .clip-card:hover { border-color: var(--border-strong); }
}

.clip-thumb-box {
  position: relative;
  width: 64px;
  height: 108px;
  border-radius: 8px;
  overflow: hidden;
  background: #07080b;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid var(--border-hairline);
}

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

.clip-dur-chip {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(9, 9, 11, 0.84);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
}

.clip-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.clip-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-secondary);
}

.score-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
}

.score-pill.high {
  background: rgba(229, 169, 60, 0.22);
  color: #fbbf24;
  border: 1px solid rgba(229, 169, 60, 0.35);
}

.score-pill.mid {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
}

.clip-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

.clip-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.mini-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  color: var(--ink-primary);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 140ms var(--ease-out), transform 120ms var(--ease-out);
}

.mini-btn:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .mini-btn:hover { background: var(--bg-hover); }
}

.mini-btn.danger { color: #f87171; }

.clip-progress-card {
  background: var(--bg-panel);
  border: 1px solid rgba(229, 57, 53, 0.28);
  border-radius: 11px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-track {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-live);
  border-radius: 999px;
  transition: width 260ms var(--ease-out);
}

/* HISTORY STRIP */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-heading {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.count-muted {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  margin-left: 4px;
}

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

.history-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* GALLERY, VOD, BRAND, SETTINGS */
.gallery-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-toolbar .studio-input { width: 250px; }

.clips-gallery {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.gallery-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: 13px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-thumb {
  position: relative;
  aspect-ratio: 9 / 14;
  background: #06070a;
  cursor: pointer;
}

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

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

.panel-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
  border-radius: 14px;
  padding: 20px;
}

.card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.card-desc {
  margin: 4px 0 16px;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

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

.settings-stack {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.key-status {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.key-status.ok { color: var(--accent-ok); }
.key-status.err { color: #f87171; }

.settings-footer-bar {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* VOD */
.vod-card { margin-top: 20px; display: flex; flex-direction: column; gap: 18px; }
.vod-tabs { display: inline-flex; gap: 4px; background: var(--bg-canvas); border: 1px solid var(--border-hairline); border-radius: 9px; padding: 3px; align-self: flex-start; }
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 34px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-canvas);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: border-color 150ms var(--ease-out);
}
.dropzone:hover { border-color: var(--accent-gold); color: var(--ink-primary); }
.vod-actions { display: flex; justify-content: flex-end; }

/* BRAND & SUBTITLE SHOWCASE */
.brand-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
}

.presets-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.preset-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: 11px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preset-preview {
  height: 62px;
  border-radius: 8px;
  background: linear-gradient(135deg, #161925, #0a0c12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

.preset-preview.pulse_gold .hl { color: #e5a93c; }
.preset-preview.neon_kinetic .hl { color: #34d399; }
.preset-preview.gta_vice .hl { color: #ff4d8d; }
.preset-preview.editorial_clean span { background: rgba(9,9,11,0.82); padding: 4px 10px; border-radius: 6px; font-weight: 600; font-size: 14px; }

.brand-create-row, .brand-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.brands-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 8px;
}

.brand-row-item {
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-row-item img {
  width: 68px;
  height: 30px;
  object-fit: contain;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  padding: 3px;
}

/* ACTIVITY LOG */
.activity-feed {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
}

.activity-row {
  display: grid;
  grid-template-columns: 76px 76px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 12.5px;
}

.activity-row:nth-child(odd) { background: rgba(255,255,255,0.02); }
.act-time { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); }
.act-cat { font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.act-cat.success { color: var(--accent-ok); }
.act-cat.warn { color: var(--accent-gold); }
.act-cat.error { color: #f87171; }
.act-cat.info { color: var(--accent-chat); }

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease-out);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), var(--highlight-top);
  border-radius: 16px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.96);
  transition: transform 200ms var(--ease-out);
}

.modal-backdrop.open .modal-dialog { transform: scale(1); }
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 960px; }

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title-row { display: flex; align-items: center; gap: 10px; }
.modal-title { margin: 0; font-size: 17px; font-weight: 700; }
.modal-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-secondary); }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--ink-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover { background: var(--bg-elevated); color: var(--ink-primary); }

.modal-body { padding: 18px 20px; overflow-y: auto; }

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions { display: flex; gap: 8px; }

/* FACECAM CROP EDITOR */
.crop-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #06070a;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  user-select: none;
  touch-action: none;
}

.crop-stage img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.crop-box {
  position: absolute;
  border: 2px solid var(--accent-gold);
  background: rgba(229, 169, 60, 0.14);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
}

.crop-box-label {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-gold);
  color: #09090b;
  padding: 2px 7px;
  border-radius: 4px;
}

.crop-handle {
  position: absolute;
  width: 13px;
  height: 13px;
  background: #fff;
  border: 2px solid var(--accent-gold);
  border-radius: 3px;
}

.crop-handle.nw { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle.ne { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle.sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle.se { bottom: -7px; right: -7px; cursor: nwse-resize; }

/* CLIP INSPECTOR */
.clip-inspector-grid {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 22px;
}

.clip-player-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vertical-player-frame {
  background: #050608;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  aspect-ratio: 9 / 16;
  max-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vertical-player-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-actions { display: flex; flex-direction: column; gap: 8px; }
.clip-editor-col { display: flex; flex-direction: column; gap: 11px; }
.editor-footer-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

/* TOAST STACK */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 120;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5), var(--highlight-top);
  color: var(--ink-primary);
  padding: 11px 15px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  max-width: 360px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

.toast-item.visible { opacity: 1; transform: translateY(0); }
.toast-item.error { border-color: rgba(229,57,53,0.45); color: #fecaca; }
.toast-item.success { border-color: rgba(34,197,94,0.4); }

@media (max-width: 1180px) {
  .live-layout { grid-template-columns: 1fr; }
  .clips-dock { border-left: none; border-top: 1px solid var(--border-hairline); max-height: 44vh; }
  .brand-grid, .clip-inspector-grid { grid-template-columns: 1fr; }
}

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


/* --- AUTH SCREEN, PLANS, ACCOUNT & ADMIN PANEL --- */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, rgba(229, 57, 53, 0.14), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(229, 169, 60, 0.12), transparent 50%),
              #09090b;
}
.auth-screen.open {
  display: flex;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: #121318;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}
.auth-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
}
.auth-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-muted, #9ca3af);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-error {
  min-height: 18px;
  font-size: 12px;
  color: #f87171;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.plan-card {
  background: #121318;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-card.featured {
  border-color: rgba(229, 169, 60, 0.55);
  box-shadow: 0 0 0 1px rgba(229, 169, 60, 0.25);
}
.plan-card.current {
  border-color: rgba(52, 211, 153, 0.55);
}
.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.plan-title {
  font-size: 16px;
  font-weight: 700;
}
.plan-price {
  font-size: 28px;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
}
.plan-price span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted, #9ca3af);
}
.plan-tagline {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted, #9ca3af);
}
.plan-features {
  margin: 4px 0 8px;
  padding-left: 16px;
  font-size: 12.5px;
  color: #d4d4d8;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.badge-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(229, 169, 60, 0.16);
  color: #e5a93c;
}
.sessions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  font-size: 13px;
}
.empty-inline {
  font-size: 12.5px;
  color: var(--text-muted, #9ca3af);
  padding: 8px 0;
}
.admin-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.admin-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted, #9ca3af);
}

/* GTA VI Sunset Primary Button + Guided Onboarding Modal */
.btn-primary {
  background: var(--accent-vice-grad) !important;
  color: #09070d !important;
  font-weight: 700 !important;
  border: 0 !important;
  box-shadow: 0 8px 24px rgba(255, 42, 133, 0.28);
}
.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.auth-screen {
  background:
    radial-gradient(ellipse 65% 50% at 75% 18%, rgba(255, 42, 133, 0.2), transparent 62%),
    radial-gradient(ellipse 50% 45% at 20% 85%, rgba(255, 130, 68, 0.14), transparent 64%),
    #07070b !important;
}
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 5, 10, 0.76);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.onboarding-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, #141422 0%, #0d0d16 100%);
  border: 1px solid rgba(255, 42, 133, 0.35);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72), 0 0 40px rgba(255, 42, 133, 0.12);
}
.ob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ob-step-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ok);
  background: var(--accent-ok-soft);
  padding: 3px 9px;
  border-radius: 999px;
}
.ob-skip {
  background: none;
  border: 0;
  color: var(--ink-secondary);
  font-size: 12.5px;
  cursor: pointer;
}
.ob-skip:hover { color: var(--ink-primary); }
.ob-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 20px;
}
.ob-progress-fill {
  height: 100%;
  width: 33%;
  background: var(--accent-vice-grad);
  transition: width 240ms var(--ease-out);
}
.ob-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ob-desc {
  margin: 0 0 16px;
  font-size: 14.5px;
  color: var(--ink-secondary);
  line-height: 1.55;
}
.ob-tip {
  background: rgba(255, 207, 92, 0.08);
  border: 1px solid rgba(255, 207, 92, 0.22);
  color: #f6e3b4;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 22px;
}
.ob-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
