.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
:root {
  --ink: #10110f;
  --ink-soft: #181a17;
  --panel: #1d1f1b;
  --panel-raised: #242620;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #f3f1e9;
  --muted: #9fa398;
  --paper: #e9e5da;
  --lime: #c7f65b;
  --lime-soft: rgba(199, 246, 91, .13);
  --coral: #ff765e;
  --blue: #78a7ff;
  --radius: 14px;
  --rail-width: 64px;
  --topbar-height: 70px;
  font-family: "Segoe UI Variable", "Segoe UI", Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--ink);
}

* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
[hidden] { display: none !important; }

html, body { width: 100%; min-height: 100%; margin: 0; }

body {
  min-width: 320px;
  overflow: hidden;
  background:
    radial-gradient(circle at 40% -20%, rgba(199, 246, 91, .05), transparent 28rem),
    var(--ink);
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.app-shell { min-height: var(--app-height, 100vh); display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); }

.rail {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  height: var(--app-height, 100vh);
  padding: 14px 9px;
  border-right: 1px solid var(--line);
  background: #0c0d0b;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  color: var(--lime);
  background: var(--lime);
  transform: rotate(-2deg);
}

.brand-mark svg { width: 30px; height: 30px; }
.rail nav, .rail-bottom { display: grid; gap: 8px; }
.rail-bottom { margin-top: auto; }

.rail-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #777c72;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.rail-button:hover, .rail-button.is-active { color: var(--text); background: rgba(255, 255, 255, .07); }
.rail-button:hover { transform: translateY(-1px); }
.rail-button.is-active::before {
  content: "";
  position: absolute;
  left: -9px;
  width: 3px;
  height: 20px;
  border-radius: 0 5px 5px 0;
  background: var(--lime);
}
.rail-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  z-index: 50;
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--ink);
  background: var(--text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: .16s ease;
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(0); }

.workspace { min-width: 0; height: var(--app-height, 100vh); display: grid; grid-template-rows: var(--topbar-height) minmax(0, 1fr); }
.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  height: var(--topbar-height);
  padding: 10px 18px 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 15, .9);
  backdrop-filter: blur(16px);
}

.project-title-wrap { min-width: 0; display: grid; gap: 3px; }
.eyebrow, .step-kicker { color: var(--muted); font-family: Consolas, monospace; font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.project-title {
  width: min(360px, 38vw);
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 17px;
  font-weight: 650;
}
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.history-actions { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; }
.history-actions .icon-button { width: 28px; height: 28px; }
.history-actions .icon-button:disabled { cursor: not-allowed; opacity: .3; }
.runtime-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #777; box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.runtime-badge.is-ready .status-dot { background: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.runtime-badge.is-warning .status-dot { background: var(--coral); }
.auth-button.is-authenticated { color: var(--lime); border-color: rgba(199,246,91,.35); background: var(--lime-soft); }
.quota-badge { padding: 6px 8px; border: 1px solid rgba(120,167,255,.3); border-radius: 7px; color: var(--blue); background: rgba(120,167,255,.08); font: 700 9px Consolas, monospace; white-space: nowrap; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button svg { width: 17px; height: 17px; fill: currentColor; }
.button-primary { color: var(--ink); background: var(--lime); box-shadow: 0 5px 20px rgba(199, 246, 91, .09); }
.button-primary:hover { background: #d6ff79; }
.button-primary:disabled { opacity: .45; cursor: wait; transform: none; }
.button-ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.035); }
.button-dark { color: var(--text); background: var(--ink); }
.button-wide { min-width: 190px; }
.icon-button {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 18px;
  cursor: pointer;
}
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }

.studio-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 254px minmax(400px, 1fr) 360px;
  overflow: hidden;
}
.settings-panel, .inspector { min-height: 0; background: var(--ink-soft); }
.settings-panel { border-right: 1px solid var(--line); }
.inspector { border-left: 1px solid var(--line); }
.panel-scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.panel-section { padding: 20px 17px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-heading.compact { margin-bottom: 13px; }
.section-heading h2, .drawer-header h2, .modal-card h2 { margin: 4px 0 0; font-size: 15px; letter-spacing: -.015em; }

.field { position: relative; display: grid; gap: 7px; margin: 0 0 12px; }
.field > span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .025em; }
.field input, .field select, .effect-row input, .effect-row select, .inspector input, .inspector select, .inspector textarea {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #141612;
  font-size: 11px;
}
.field textarea, .inspector textarea { min-height: 70px; padding-block: 9px; resize: vertical; }
.field input:hover, .field select:hover, .inspector input:hover, .inspector select:hover { border-color: var(--line-strong); }
.field.has-error input, .field.has-error select, .field.has-error textarea, .file-picker.has-error input { border-color: #ff6f61; box-shadow: 0 0 0 1px rgba(255,111,97,.35); }
.field.has-error::after, .file-picker.has-error::after { content: "!"; position: absolute; top: -5px; right: -5px; z-index: 6; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: #fff; background: #e54b3d; font: 900 10px/1 sans-serif; cursor: help; }
.field.has-error:hover::before, .file-picker.has-error:hover::before { content: attr(data-validation-error); position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30; width: max-content; max-width: 230px; padding: 7px 9px; border-radius: 7px; color: #fff; background: #a92f27; box-shadow: 0 7px 22px rgba(0,0,0,.35); font: 700 9px/1.4 sans-serif; }
.file-picker { position: relative; }
select { color-scheme: dark; }
.field-row { display: flex; align-items: end; gap: 7px; }
.field-row .field { flex: 1; }
.field-separator { padding-bottom: 20px; color: var(--muted); }
.field-help { margin: 9px 1px 14px; color: #858a80; font-size: 10px; line-height: 1.5; }
.range-control { display: grid; grid-template-columns: minmax(70px,1fr) 66px; align-items: center; gap: 7px; }
.range-control input[type="range"] { min-height: 20px; padding: 0; accent-color: var(--lime); }
.range-control .range-number { min-height: 32px; padding-inline: 7px; font-family: Consolas, monospace; text-align: right; }
.field output { float: right; margin-left: 5px; color: var(--lime); font-family: Consolas, monospace; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #121310; }
.segmented button, .view-switcher button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 720;
  cursor: pointer;
}
.segmented button.is-active { color: var(--ink); background: var(--lime); }
.segmented button:disabled { opacity: .35; cursor: not-allowed; }

.profile-list { display: grid; gap: 7px; }
.profile-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: left;
  background: rgba(255,255,255,.02);
  cursor: pointer;
}
.profile-card:hover, .profile-card.is-active { border-color: rgba(199,246,91,.42); background: var(--lime-soft); }
.profile-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 7px; color: var(--lime); background: rgba(199,246,91,.09); }
.profile-card strong, .profile-card small { display: block; }
.profile-card strong { font-size: 11px; }
.profile-card small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.radio-mark { width: 11px; height: 11px; border: 1px solid var(--muted); border-radius: 50%; }
.profile-card.is-active .radio-mark { border: 3px solid var(--lime); }

.effect-stack { display: grid; gap: 8px; }
.effect-row { padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.effect-row-head { display: grid; grid-template-columns: auto minmax(0,1fr) 27px; align-items: center; gap: 7px; }
.effect-row-head .icon-button { width: 27px; height: 27px; font-size: 14px; }
.effect-params-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin-top: 8px; }
.effect-params-grid label { display: grid; gap: 4px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.effect-params-grid input, .effect-params-grid select { min-height: 30px; }
.empty-note { margin: 0; color: #6e7269; font-size: 10px; line-height: 1.45; }

.editor-area { min-width: 0; min-height: 0; display: grid; grid-template-rows: 48px minmax(240px, 1fr) minmax(230px, 35%); background: #20221e; }
.preview-toolbar, .timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(16,17,15,.42);
}
.view-switcher { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; }
.view-switcher button { min-height: 25px; padding: 0 10px; }
.view-switcher button.is-active { color: var(--text); background: rgba(255,255,255,.08); }
.canvas-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-family: Consolas, monospace; font-size: 9px; }
.meta-divider { width: 1px; height: 12px; background: var(--line-strong); }
.fx-preview-badge { padding: 3px 6px; border: 1px solid rgba(199,246,91,.35); border-radius: 5px; color: var(--lime); background: var(--lime-soft); font-size: 8px; font-weight: 800; letter-spacing: .06em; }

.canvas-viewport {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  padding: 24px 32px;
  background-color: #2b2e28;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.018) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.018) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.018) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.018) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}
.canvas-stage {
  position: relative;
  z-index: 0;
  isolation: isolate;
  width: 1px;
  height: 1px;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  color: #191a17;
  background: #000;
  box-shadow: 0 20px 55px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.08);
}
.safe-area { position: absolute; inset: 6%; z-index: 9; border: 1px dashed rgba(16,17,15,.14); pointer-events: none; }
.canvas-stage.is-playing .safe-area { display: none; }
.stage-content { position: absolute; inset: 0; }
.stage-layer { position: absolute; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; border: 0; color: inherit; background: transparent; cursor: move; touch-action: none; user-select: none; }
.stage-layer.is-selected { outline: 2px solid var(--coral); outline-offset: 2px; }
.stage-layer-content { position: relative; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.stage-layer img, .stage-layer video, .stage-effect-canvas { width: 100%; height: 100%; object-fit: fill; }
.stage-layer video { pointer-events: none; background: #0b0c0a; }
.stage-effect-canvas { position: absolute; inset: 0; pointer-events: none; }
.stage-layer-text { width: 100%; height: 100%; display: grid; align-content: center; padding: .3em .5em; font-weight: 800; line-height: 1.04; text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; user-select: text; outline: 0; }
.stage-subtitle-preview { position: absolute; display: block; align-content: center; border: 0; font-weight: 800; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; overflow: hidden; pointer-events: auto; cursor: move; touch-action: none; user-select: none; }
.stage-subtitle-preview.is-selected { outline: 2px solid var(--lime); outline-offset: 2px; }
.stage-subtitle-preview .is-highlighted { color: var(--subtitle-highlight); }
.stage-subtitle-preview.is-placeholder { color: rgba(16,17,15,.62) !important; background: transparent !important; font-family: Consolas, monospace !important; font-size: clamp(8px,1vw,12px) !important; }
.stage-layer.is-selected .stage-layer-text:empty::before { content: "Metni buraya yaz…"; color: currentColor; opacity: .32; font-size: .55em; }
html[lang="en"] .stage-layer.is-selected:not(.is-background) .stage-layer-text:empty::before { content: "Type your text here…"; }
.stage-layer.is-background .stage-layer-text:empty::before { content: none; }
.preview-unavailable { position: absolute; right: 6px; bottom: 6px; z-index: 12; padding: 3px 5px; border-radius: 4px; color: #fff; background: rgba(16,17,15,.72); font: 7px Consolas, monospace; pointer-events: none; }
.preview-approximation { position: absolute; left: 6px; bottom: 6px; z-index: 12; padding: 3px 5px; border-radius: 4px; color: var(--ink); background: rgba(199,246,91,.8); font: 7px Consolas, monospace; pointer-events: none; }
.stage-handle { position: absolute; z-index: 20; display: grid; place-items: center; width: 17px; height: 17px; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--coral); box-shadow: 0 2px 8px rgba(0,0,0,.35); touch-action: none; }
.stage-rotate-handle { top: 7px; left: 50%; font: 700 11px/1 sans-serif; transform: translateX(-50%); cursor: grab; }
.stage-resize-handle { right: -9px; bottom: -9px; cursor: nwse-resize; }
.audio-preview-deck { display: none; }
.stage-placeholder { width: 100%; height: 100%; display: grid; place-items: center; gap: 4px; padding: 10px; color: rgba(16,17,15,.62); background: rgba(16,17,15,.08); border: 1px dashed rgba(16,17,15,.2); text-align: center; }
.stage-placeholder strong { font-size: clamp(9px, 1.2vw, 14px); }
.stage-placeholder small { max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(6px, .8vw, 10px); }
.stage-empty { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; text-align: center; padding: 30px; }
.stage-empty[hidden] { display: none; }
.stage-empty strong { margin-top: 13px; font-size: clamp(15px, 2vw, 24px); letter-spacing: -.04em; }
.stage-empty p { margin: 6px 0 15px; color: rgba(16,17,15,.6); font-size: clamp(9px, 1vw, 12px); }
.empty-glyph { position: relative; width: 56px; height: 45px; }
.empty-glyph span { position: absolute; width: 32px; height: 32px; border: 2px solid var(--ink); border-radius: 4px; background: var(--lime); }
.empty-glyph span:nth-child(1) { left: 0; top: 8px; transform: rotate(-9deg); }
.empty-glyph span:nth-child(2) { right: 0; top: 6px; transform: rotate(8deg); background: var(--coral); }
.empty-glyph span:nth-child(3) { left: 13px; top: 0; background: var(--paper); }

.timeline-shell { min-height: 0; display: grid; grid-template-rows: 45px 34px minmax(0,1fr); overflow: hidden; border-top: 1px solid var(--line); background: #141613; }
.timeline-toolbar { gap: 12px; padding: 0 12px; }
.transport { display: flex; align-items: center; gap: 8px; }
.transport-button { display: grid; place-items: center; width: 29px; height: 29px; padding: 0; border: 0; border-radius: 50%; color: var(--ink); background: var(--lime); cursor: pointer; }
.transport-button svg { width: 16px; height: 16px; fill: currentColor; }
.transport-button.is-playing svg { display: none; }
.transport-button.is-playing::after { content: "Ⅱ"; font-size: 11px; font-weight: 800; }
.timecode { min-width: 54px; color: var(--text); font-family: Consolas, monospace; font-size: 10px; }
.audio-toggle { min-height: 24px; padding: 0 7px; border: 1px solid rgba(199,246,91,.35); border-radius: 6px; color: var(--lime); background: var(--lime-soft); font: 700 7px Consolas, monospace; cursor: pointer; }
.audio-toggle.is-muted { color: var(--muted); border-color: var(--line); background: transparent; }
.preview-volume { display: grid; grid-template-columns: auto 54px 42px; align-items: center; gap: 4px; color: var(--muted); font: 700 7px Consolas,monospace; }
.preview-volume input[type="range"] { width: 54px; height: 3px; accent-color: var(--lime); }
.preview-volume input[type="number"], .scrubber-number { min-height: 24px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: #10120f; font: 8px Consolas,monospace; }
.preview-volume input[type="number"] { width: 42px; }
.timeline-navigation { display: grid; grid-template-columns: 88px minmax(0,1fr) 54px; align-items: center; border-bottom: 1px solid var(--line); }
.timeline-navigation label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 5px; padding: 0 7px; color: var(--muted); font: 700 7px Consolas,monospace; }
.scrubber { width: 100%; min-width: 40px; height: 3px; margin: 0; accent-color: var(--lime); cursor: ew-resize; }
.scrubber-number { width: 52px; min-height: 25px; padding: 4px; }
.add-menu { display: flex; gap: 4px; }
.add-menu button { min-height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; cursor: pointer; }
.add-menu button:hover { color: var(--text); border-color: var(--line-strong); }
.timeline-body { position: relative; min-height: 0; display: grid; grid-template-rows: 22px minmax(0,1fr); overflow: hidden; }
.timeline-ruler { display: grid; grid-template-columns: 88px repeat(5, 1fr); align-items: center; padding-right: 67px; border-bottom: 1px solid var(--line); color: #62665e; font-family: Consolas, monospace; font-size: 8px; cursor: ew-resize; }
.timeline-ruler span:not(:first-child) { border-left: 1px solid var(--line); padding-left: 4px; }
.tracks { min-height: 0; overflow-y: auto; }
.timeline-playhead { position: absolute; top: 0; bottom: 0; left: 88px; z-index: 8; width: 1px; background: var(--coral); pointer-events: none; box-shadow: 0 0 0 1px rgba(255,106,89,.08); }
.timeline-playhead::before { content: ""; position: absolute; top: 0; left: -5px; width: 11px; height: 8px; border-radius: 2px 2px 5px 5px; background: var(--coral); }
.timeline-playhead i { position: absolute; top: 8px; left: -3px; width: 7px; height: 7px; border: 1px solid #171813; border-radius: 50%; background: var(--coral); }
.track-group { border-bottom: 1px solid rgba(255,255,255,.055); }
.track-row { display: grid; grid-template-columns: 88px minmax(0,1fr) 54px; align-items: center; min-height: 43px; border-bottom: 1px solid rgba(255,255,255,.055); cursor: pointer; }
.track-row:hover, .track-row.is-selected { background: rgba(255,255,255,.035); }
.track-label { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0 7px; }
.track-reorder { flex: 0 0 10px; padding: 8px 0; border: 0; color: #686c64; background: transparent; font-size: 11px; line-height: 1; cursor: grab; }
.track-reorder:active { cursor: grabbing; }
.track-row.is-dragging { opacity: .42; }
.track-row.is-drop-before { box-shadow: inset 0 2px 0 var(--lime); }
.track-row.is-drop-after { box-shadow: inset 0 -2px 0 var(--lime); }
.track-type { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px; color: var(--ink); background: var(--blue); font-size: 9px; font-weight: 900; }
.track-type.text { background: var(--coral); }.track-type.audio { background: var(--lime); }.track-type.video { background: #aa8cff; }
.track-type.subtitle { color: var(--text); background: #4c5668; }
.track-copy { min-width: 0; }
.track-copy strong, .track-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-copy strong { font-size: 9px; }.track-copy small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.track-lane { position: relative; height: 27px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 20% 100%; }
.track-bar { position: absolute; top: 5px; bottom: 5px; min-width: 8px; border-radius: 4px; background: var(--blue); opacity: .78; cursor: grab; touch-action: none; }
.track-row.is-selected .track-bar { opacity: 1; box-shadow: 0 0 0 1px rgba(255,255,255,.5); }
.track-trim { position: absolute; top: 0; bottom: 0; width: 7px; background: rgba(255,255,255,.72); cursor: ew-resize; }
.track-trim-start { left: 0; border-radius: 4px 0 0 4px; }
.track-trim-end { right: 0; border-radius: 0 4px 4px 0; }
.track-bar.text { background: var(--coral); }.track-bar.audio { background: var(--lime); }.track-bar.video { background: #aa8cff; }
.subtitle-track-row { display: grid; grid-template-columns: 88px minmax(0,1fr) 54px; align-items: center; min-height: 36px; background: rgba(0,0,0,.12); cursor: pointer; }
.subtitle-track-row:hover, .subtitle-track-row.is-selected { background: rgba(255,255,255,.035); }
.subtitle-track-row .track-label { padding-left: 18px; }
.subtitle-lane { height: 25px; overflow: hidden; }
.subtitle-cue-bar { position: absolute; top: 3px; bottom: 3px; min-width: 5px; overflow: hidden; padding: 0 5px; border: 1px solid rgba(199,246,91,.3); border-radius: 4px; color: var(--text); background: rgba(78,96,51,.78); font-size: 8px; line-height: 17px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.subtitle-cue-bar:hover, .subtitle-track-row.is-selected .subtitle-cue-bar { border-color: var(--lime); background: rgba(78,96,51,.96); }
.subtitle-lane-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 8px; }
.track-delete { width: 24px; height: 24px; justify-self: center; border: 0; color: #73776e; background: transparent; cursor: pointer; }
.track-delete:hover { color: var(--coral); }
.track-actions { display: flex; align-items: center; justify-content: center; gap: 1px; }
.track-visibility { width: 24px; height: 24px; padding: 0; border: 0; color: var(--lime); background: transparent; font-size: 13px; cursor: pointer; }
.track-visibility:hover { color: #fff; }
.track-row.is-preview-hidden, .subtitle-track-row.is-preview-hidden { opacity: .48; }
.track-row.is-preview-hidden .track-bar, .subtitle-track-row.is-preview-hidden .subtitle-cue-bar { filter: grayscale(1); }
.tracks-empty { position: absolute; inset: 22px 0 0; display: grid; place-items: center; padding: 20px; color: #686c64; font-size: 10px; text-align: center; }
.tracks-empty[hidden] { display: none; }

.inspector-empty { display: grid; justify-items: center; padding: 70px 25px 20px; text-align: center; }
.inspector-glyph { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: 13px; color: var(--lime); background: rgba(255,255,255,.03); font-size: 21px; }
.inspector-empty h2 { margin: 16px 0 5px; font-size: 14px; }
.inspector-empty p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.inspector-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 17px; border-bottom: 1px solid var(--line); background: rgba(24,26,23,.94); backdrop-filter: blur(12px); }
.inspector-header-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.inspector-header h2 { margin: 0; max-width: 225px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.inspector-section { padding: 16px; border-bottom: 1px solid var(--line); }
.inspector-section h3 { margin: 0 0 12px; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.inspector-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.inspector-grid .field { margin: 0; }
.inspector-grid .span-2 { grid-column: 1 / -1; }
.checkbox-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; color: var(--muted); font-size: 10px; }
.checkbox-field input { width: 16px; min-height: auto; accent-color: var(--lime); }
.file-picker { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.file-picker input[type="text"] { min-width: 0; }
.file-picker button { border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: rgba(255,255,255,.05); font-size: 10px; cursor: pointer; }
.inspector-action { min-height: 33px; border: 1px solid rgba(199,246,91,.3); border-radius: 8px; color: var(--lime); background: var(--lime-soft); font-size: 9px; font-weight: 800; cursor: pointer; }
.inspector-action:hover { border-color: var(--lime); }
.danger-link { border: 0; color: var(--coral); background: transparent; font-size: 10px; cursor: pointer; }
.add-effect-select { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; margin-top: 9px; }
.add-effect-select button { min-width: 92px; padding: 0 11px; border: 0; border-radius: 8px; color: var(--ink); background: var(--lime); font-size: 9px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.inspector-disclosure { padding: 0; }
.inspector-disclosure > summary { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 12px 34px 12px 16px; color: var(--text); cursor: pointer; list-style: none; transition: color .16s ease, background .16s ease, box-shadow .16s ease; }
.inspector-disclosure > summary::-webkit-details-marker { display: none; }
.inspector-disclosure > summary::after { content: "+"; position: absolute; right: 16px; color: var(--muted); font-size: 16px; font-weight: 400; }
.inspector-disclosure[open] > summary::after { content: "−"; color: var(--lime); }
.inspector-disclosure > summary:hover { color: #fff; background: rgba(255,255,255,.028); }
.inspector-disclosure > summary > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 800; }
.inspector-disclosure > summary > small { max-width: 145px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.inspector-disclosure[open] > summary { border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(199,246,91,.055), rgba(255,255,255,.015)); box-shadow: inset 3px 0 0 rgba(199,246,91,.72); }
.inspector-disclosure-body { display: grid; gap: 10px; padding: 14px 16px 16px; background: linear-gradient(180deg, rgba(255,255,255,.012), transparent 55px); }
.inspector-disclosure.has-error > summary { color: #ff8175; box-shadow: inset 3px 0 0 #ff6f61; }
.inspector-disclosure.has-error > summary::before { content: "!"; position: absolute; right: 34px; display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; color: #fff; background: #e54b3d; font: 900 9px/1 sans-serif; }
.inspector-disclosure.has-error > summary:hover::after { content: attr(data-validation-error); right: 12px; top: calc(100% + 5px); z-index: 40; width: max-content; max-width: 230px; padding: 7px 9px; border-radius: 7px; color: #fff; background: #a92f27; font: 700 9px/1.4 sans-serif; }
.nested-disclosure { border: 1px solid var(--line); border-radius: 8px; }
.nested-disclosure > summary { min-height: 40px; padding: 9px 30px 9px 11px; }
.nested-disclosure > summary::after { right: 11px; }
.nested-disclosure > .inspector-disclosure-body { padding: 10px; }
.info-tip { position: relative; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 3px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--blue); font: 800 9px/1 sans-serif; cursor: help; vertical-align: middle; }
.info-tip::after { content: attr(data-info); position: absolute; right: -6px; bottom: calc(100% + 7px); z-index: 60; visibility: hidden; width: max-content; max-width: 220px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--text); background: #0f110e; box-shadow: 0 8px 24px rgba(0,0,0,.4); font: 500 9px/1.4 sans-serif; opacity: 0; pointer-events: none; }
.info-tip:hover::after, .info-tip:focus::after { visibility: visible; opacity: 1; }
.subtitle-section { display: block; }
.subtitle-section-head, .subtitle-track-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.subtitle-section-head > span { color: var(--muted); font-size: 9px; }
.subtitle-accuracy-help { margin: 0; padding: 8px; border-left: 2px solid var(--blue); color: var(--muted); background: rgba(126,187,255,.06); font-size: 8px; line-height: 1.5; }
.subtitle-section .inspector-action:disabled { cursor: not-allowed; opacity: .4; }
.subtitle-track-card { padding: 0; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(0,0,0,.12); }
.subtitle-track-card.is-selected { border-color: var(--lime); box-shadow: 0 0 0 1px rgba(199,246,91,.18); }
.subtitle-track-actions { display: flex; justify-content: space-between; }
.subtitle-quick-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.subtitle-quick-grid .field { margin: 0; }
.subtitle-file-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; }
.subtitle-add-cue { width: 100%; margin-top: 8px; }
.subtitle-cue-editor { border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.12); }
.subtitle-cue-editor summary { padding: 8px; color: var(--text); font-size: 9px; font-weight: 700; cursor: pointer; }
.subtitle-cue-list { display: grid; gap: 6px; max-height: 420px; overflow: auto; padding: 0 8px 8px; }
.subtitle-cue-row { display: grid; grid-template-columns: 18px 52px 52px minmax(80px,1fr) 20px; align-items: end; gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; }
.subtitle-cue-row label { display: grid; gap: 3px; color: var(--muted); font-size: 7px; }
.subtitle-cue-row input, .subtitle-cue-row textarea { min-width: 0; padding: 6px; font-size: 9px; }
.subtitle-cue-number { align-self: center; color: var(--muted); font: 8px Consolas,monospace; }
.subtitle-cue-text textarea { resize: vertical; }
.subtitle-select-button { padding: 0; border: 0; color: var(--lime); background: transparent; font: 700 9px Consolas,monospace; cursor: pointer; }
.subtitle-advanced { color: var(--muted); font-size: 8px; line-height: 1.5; }
.subtitle-advanced summary { color: var(--text); cursor: pointer; }
.subtitle-advanced p { margin: 7px 0 0; }
.effect-row.is-disabled { opacity: .48; }
.effect-row.is-disabled .effect-params-grid { pointer-events: none; }
.effect-toggle { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.effect-toggle input { width: 14px; min-height: 14px; padding: 0; accent-color: var(--lime); }
.effect-color-picker { min-height: 29px; border: 1px solid rgba(126,187,255,.35); border-radius: 7px; color: var(--blue); background: rgba(126,187,255,.08); font-size: 8px; font-weight: 800; cursor: crosshair; }
.canvas-stage.is-color-picking, .canvas-stage.is-color-picking * { cursor: crosshair !important; }

.render-drawer, .modal { position: fixed; inset: 0; z-index: 100; visibility: hidden; opacity: 0; transition: visibility .22s, opacity .22s; }
.render-drawer.is-open, .modal.is-open { visibility: visible; opacity: 1; }
.drawer-backdrop, .modal-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(5,6,5,.68); backdrop-filter: blur(4px); }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  width: min(470px, 100%);
  height: 100%;
  border-left: 1px solid var(--line-strong);
  background: #181a17;
  box-shadow: -28px 0 70px rgba(0,0,0,.3);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.22,.8,.25,1);
}
.render-drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-header, .drawer-footer, .modal-card header, .modal-card footer { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { min-height: 0; overflow-y: auto; padding: 20px; }
.drawer-footer { gap: 9px; border-top: 1px solid var(--line); border-bottom: 0; }
.render-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-bottom: 16px; }
.summary-card { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.summary-card span, .summary-card strong { display: block; }.summary-card span { color: var(--muted); font-size: 8px; text-transform: uppercase; }.summary-card strong { margin-top: 4px; font-family: Consolas, monospace; font-size: 10px; }
.drop-zone { display: grid; justify-items: center; padding: 24px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; background: rgba(255,255,255,.018); cursor: pointer; transition: .18s ease; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--lime); background: var(--lime-soft); }
.drop-zone strong { margin-top: 9px; font-size: 12px; }.drop-zone span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.drop-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink); background: var(--lime); font-size: 21px; }
.asset-list { display: grid; gap: 7px; margin-top: 12px; }
.asset-item { display: grid; grid-template-columns: 28px minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.asset-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: var(--ink); background: var(--blue); font-size: 9px; font-weight: 800; }
.asset-copy { min-width: 0; }.asset-copy strong, .asset-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.asset-copy strong { font-size: 10px; }.asset-copy small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.asset-state { color: var(--lime); font-size: 9px; }
.asset-add { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--text); background: rgba(255,255,255,.05); font-size: 8px; cursor: pointer; }
.asset-add:hover { border-color: var(--lime); color: var(--lime); }
.render-progress { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.02); }
.progress-heading { display: flex; justify-content: space-between; font-size: 10px; font-weight: 700; }.progress-heading span:last-child { font-family: Consolas, monospace; color: var(--lime); }
.progress-track { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 9px; background: rgba(255,255,255,.08); }.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--lime); transition: width .3s ease; }
.render-progress p { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.render-result { margin-top: 16px; }.render-result video { display: block; width: 100%; border-radius: 10px; background: #000; }.render-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }.render-result-actions .button { flex: 1 1 44%; text-decoration: none; }
.subtitle-output-options { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid rgba(199,246,91,.22); border-radius: 9px; background: var(--lime-soft); }
.subtitle-output-options > strong { font-size: 10px; }.subtitle-output-options > small { grid-column: 1 / -1; color: var(--muted); font-size: 8px; }

.modal { display: grid; place-items: center; padding: 20px; }
.modal-card { position: relative; display: grid; grid-template-rows: auto minmax(0,1fr) auto; width: min(820px, 100%); height: min(680px, 88vh); border: 1px solid var(--line-strong); border-radius: 14px; background: #181a17; box-shadow: 0 30px 90px rgba(0,0,0,.45); transform: translateY(10px) scale(.985); transition: transform .2s ease; }
.modal.is-open .modal-card { transform: none; }
.modal-card textarea { width: calc(100% - 40px); height: calc(100% - 30px); margin: 15px 20px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; color: #d8e8ba; background: #0f100e; font: 11px/1.55 Consolas, monospace; resize: none; }
.modal-card footer { border-top: 1px solid var(--line); border-bottom: 0; }.modal-card footer > span { color: var(--muted); font-size: 9px; }
.admin-card { width: calc(100vw - 32px); height: calc(var(--app-height, 100vh) - 32px); max-width: 1500px; }
.library-card { width: min(980px, 100%); height: min(760px, 92vh); }
.tts-card { width: min(620px, 100%); height: auto; min-height: 0; max-height: calc(var(--app-height, 100dvh) - 40px); overflow: hidden; }
.tts-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); min-height: 0; overflow-y: auto; align-content: start; gap: 12px; padding: 22px; }
.tts-form .field { margin: 0; }
.tts-form .span-2 { grid-column: 1 / -1; }
.tts-form textarea { width: 100%; min-height: 150px; margin: 0; font: inherit; resize: vertical; }
.tts-advanced { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tts-advanced summary { cursor: pointer; font-weight: 650; }
.tts-advanced .inspector-grid { margin-top: 12px; }
.admin-body { min-height: 0; overflow: hidden; display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 18px; padding: 20px; }
.admin-tabs, .library-tabs { display: grid; align-content: start; gap: 6px; }
.admin-tabs button, .library-tabs button { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.02); text-align: left; cursor: pointer; }
.admin-tabs button:hover, .library-tabs button:hover, .admin-tabs button.is-active, .library-tabs button.is-active { color: var(--text); border-color: rgba(199,246,91,.42); background: var(--lime-soft); }
.admin-panel { min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(260px,.8fr) minmax(380px,1.4fr); align-content: start; gap: 18px; padding-right: 6px; }
.admin-panel[data-admin-panel="renders"], .admin-panel[data-admin-panel="tts"], .admin-panel[data-admin-panel="account"] { grid-template-columns: 1fr; }
.admin-panel[hidden] { display: none; }
.admin-create-form, .admin-password-form, .admin-users-section, .admin-renders-section { display: grid; align-content: start; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.018); }
.admin-create-form .field, .admin-password-form .field { margin: 0; }
.admin-password-form { max-width: 540px; }
.admin-users-section { min-width: 0; }
.admin-renders-section { min-width: 0; }
.library-body { min-height: 0; overflow: hidden; display: grid; grid-template-columns: 160px minmax(0,1fr); grid-template-rows: auto auto minmax(0,1fr); gap: 14px 18px; padding: 20px; }
.library-tabs { grid-row: 1 / -1; }
.library-save-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.02); }
.library-save-row strong, .library-save-row small { display: block; }
.library-save-row strong { font-size: 11px; }.library-save-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.library-progress { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.library-progress > div { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.library-progress .progress-track { margin: 0; }.library-progress .progress-track i { display: block; width: 0; height: 100%; background: var(--lime); transition: width .2s ease; }
.library-list { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 8px; }
.library-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.12); }
.library-item strong, .library-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-item strong { font-size: 11px; }.library-item small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.library-item-actions { display: flex; gap: 6px; }.library-item-actions button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: rgba(255,255,255,.04); font-size: 8px; cursor: pointer; }.library-item-actions button[data-library-delete] { color: var(--coral); }
.admin-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 3px; }
.admin-section-heading h3 { margin: 3px 0 0; font-size: 12px; }
.admin-section-heading > span { color: var(--muted); font-size: 8px; }
.admin-users { display: grid; gap: 7px; }
.admin-user { display: grid; grid-template-columns: minmax(105px,1fr) 78px 92px auto; align-items: center; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.12); }
.admin-user-copy { min-width: 0; }
.admin-user-copy strong, .admin-user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-copy strong { font-size: 10px; }.admin-user-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.admin-user input[type="number"] { width: 78px; min-height: 30px; }
.admin-user [data-admin-profile] { width: 92px; min-height: 30px; }
.admin-user-actions { display: flex; gap: 4px; }
.admin-user button { min-height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: rgba(255,255,255,.04); font-size: 8px; cursor: pointer; }
.admin-user button[data-admin-delete] { color: var(--coral); }
.admin-role { padding: 5px 7px; border-radius: 6px; color: var(--lime); background: var(--lime-soft); font: 700 8px Consolas, monospace; }
.info-dot { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 4px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font: 700 8px/1 sans-serif; cursor: help; }
.admin-render-controls { display: grid; grid-template-columns: minmax(150px,220px) minmax(140px,190px) 1fr; align-items: end; gap: 9px; }
.admin-render-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 8px; }
.admin-render-controls select { min-height: 32px; }
.admin-render-controls small { align-self: center; color: var(--muted); font-size: 8px; line-height: 1.45; text-align: right; }
.admin-renders { display: grid; gap: 7px; }
.admin-render { display: grid; grid-template-columns: minmax(145px,.9fr) minmax(185px,1.2fr) minmax(170px,1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.12); }
.admin-render-copy, .admin-render-meta { min-width: 0; }
.admin-render-copy strong, .admin-render-copy small, .admin-render-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-render-copy strong { font-size: 10px; }.admin-render-copy small, .admin-render-meta span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.admin-render-status { display: inline-block; width: max-content; padding: 4px 6px; border-radius: 6px; color: var(--lime); background: var(--lime-soft); font: 700 8px Consolas,monospace; }
.admin-render-status.is-failed { color: var(--coral); background: rgba(255,106,89,.1); }
.admin-render-actions { display: flex; gap: 5px; }
.admin-render-actions button { min-height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: rgba(255,255,255,.04); font-size: 8px; cursor: pointer; }
.admin-render-actions button[data-admin-render-delete] { color: var(--coral); }
.admin-render-template { grid-column: 1 / -1; max-height: 250px; overflow: auto; margin: 2px 0 0; padding: 11px; border: 1px solid var(--line); border-radius: 8px; color: #d8e8ba; background: #0f100e; font: 9px/1.5 Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.login-card { width: min(400px, 100%); height: auto; min-height: 470px; grid-template-rows: auto 1fr; }
.login-form { display: grid; align-content: start; gap: 10px; padding: 26px; }
.login-form > p { margin: 0 0 10px; color: var(--muted); font-size: 10px; line-height: 1.55; text-align: center; }
.login-form .field { margin: 0; }
.login-form .button { margin-top: 5px; }
.login-lock { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 5px; border: 1px solid rgba(199,246,91,.35); border-radius: 15px; color: var(--lime); background: var(--lime-soft); font-size: 30px; transform: rotate(-8deg); }
.login-message { min-height: 16px; color: var(--coral) !important; }

.login-page {
  overflow: auto;
  background:
    radial-gradient(circle at 50% 5%, rgba(199,246,91,.1), transparent 34rem),
    linear-gradient(135deg, #0d0e0c, #141610 55%, #0c0d0b);
}
.login-gate { display: grid; min-height: var(--app-height, 100vh); place-items: center; padding: 28px 18px; }
.login-panel { width: min(420px, 100%); padding: 34px; border: 1px solid var(--line-strong); border-radius: 18px; background: rgba(29,31,27,.94); box-shadow: 0 28px 90px rgba(0,0,0,.42); }
.login-brand { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 26px; border-radius: 13px; color: var(--lime); background: var(--lime); transform: rotate(-2deg); }
.login-brand svg { width: 36px; height: 36px; }
.login-panel h1 { margin: 8px 0 9px; font-size: clamp(25px, 5vw, 34px); letter-spacing: -.04em; }
.login-lead { margin: 0 0 24px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.login-panel .login-form { padding: 0; }
.login-panel .login-message { margin: 2px 0 0; text-align: left; }
.login-submit { width: 100%; min-height: 42px; justify-content: center; }
.login-footnote { margin: 22px 0 0; color: #777c72; font-size: 9px; line-height: 1.5; text-align: center; }
.login-footnote code { color: #a9ada3; }

.toast-region { position: fixed; right: 18px; top: 18px; z-index: 200; display: grid; gap: 8px; width: min(340px, calc(100vw - 36px)); pointer-events: none; }
.toast { padding: 11px 13px; border: 1px solid var(--line-strong); border-left: 3px solid var(--lime); border-radius: 9px; color: var(--text); background: #23251f; box-shadow: 0 12px 35px rgba(0,0,0,.28); font-size: 10px; line-height: 1.45; animation: toast-in .2s ease; }
.toast.is-error { border-left-color: var(--coral); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px); } }

@media (max-width: 1180px) {
  .studio-grid { grid-template-columns: 230px minmax(400px,1fr) 320px; }
  .add-menu button { padding-inline: 6px; font-size: 0; }
  .add-menu button::first-letter { font-size: 12px; }
}

@media (max-width: 950px) {
  body { overflow: auto; }
  .workspace, .rail { height: auto; min-height: var(--app-height, 100vh); }
  .studio-grid { grid-template-columns: 220px minmax(0,1fr); grid-template-rows: minmax(620px, calc(var(--app-height, 100vh) - var(--topbar-height))) auto; overflow: visible; }
  .inspector { grid-column: 1 / -1; min-height: 360px; border-top: 1px solid var(--line); border-left: 0; }
  .inspector-empty { padding-top: 40px; }
  .editor-area { min-height: 620px; }
}

@media (max-width: 700px) {
  :root { --rail-width: 0px; --topbar-height: 62px; }
  .app-shell { display: block; }
  .rail { position: fixed; right: 10px; bottom: 10px; left: 10px; z-index: 40; flex-direction: row; justify-content: center; width: auto; height: 52px; min-height: 0; padding: 4px; border: 1px solid var(--line-strong); border-radius: 13px; background: rgba(12,13,11,.94); backdrop-filter: blur(16px); }
  .brand-mark, .rail-bottom { display: none; }.rail nav { display: flex; }
  .rail-button.is-active::before { left: 50%; top: auto; bottom: -4px; width: 18px; height: 2px; transform: translateX(-50%); }
  .workspace { padding-bottom: 68px; }
  .topbar { padding-inline: 12px; }
  .project-title { width: 40vw; font-size: 14px; }.eyebrow { display: none; }
  .hide-mobile, .runtime-badge { display: none; }
  #copy-button, #paste-button { display: none; }
  .auth-button { width: 36px; padding: 0; overflow: hidden; font-size: 0; }
  .auth-button::before { content: "⌁"; font-size: 17px; }
  .studio-grid { display: flex; flex-direction: column; }
  .settings-panel { order: 2; max-height: none; border-top: 1px solid var(--line); border-right: 0; }
  .editor-area { order: 1; min-height: 580px; grid-template-rows: 44px 300px 235px; }
  .inspector { order: 3; }
  .canvas-viewport { padding: 16px; }.canvas-stage { width: min(90%, 500px); }
  .timeline-toolbar { gap: 7px; }.add-menu button { width: 25px; padding: 0; font-size: 0; }.add-menu button::first-letter { font-size: 14px; }
  .drawer-footer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .modal-card footer > span { display: none; }
  .admin-card { width: calc(100vw - 16px); height: calc(var(--app-height, 100vh) - 16px); }
  .admin-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); padding: 12px; }
  .admin-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-panel { grid-template-columns: 1fr; }
  .admin-password-form, .admin-users-section, .admin-renders-section { grid-column: 1; grid-row: auto; }
  .library-body { grid-template-columns: 1fr; grid-template-rows: auto auto auto minmax(0,1fr); padding: 12px; }
  .library-tabs { grid-row: auto; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .library-save-row { align-items: flex-start; flex-direction: column; }
  .admin-user { grid-template-columns: minmax(100px,1fr) 72px; }
  .admin-user [data-admin-profile] { grid-column: 1 / -1; width: 100%; }
  .admin-user-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .admin-render-controls { grid-template-columns: 1fr 1fr; }.admin-render-controls small { grid-column: 1 / -1; text-align: left; }
  .admin-render { grid-template-columns: 1fr 1fr; }.admin-render-actions { justify-content: flex-end; }
  .subtitle-file-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .subtitle-cue-row { grid-template-columns: 20px 1fr 1fr 22px; }
  .subtitle-cue-text { grid-column: 2 / 4; }
}

@media (max-width: 460px) {
  .login-panel { padding: 26px 22px; }
  .asset-item { grid-template-columns: 28px minmax(0,1fr) auto; }
  .asset-state { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.language-picker { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; font-size: 12px; }
.language-picker .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.language-picker select { width: auto; min-width: 85px; min-height: 36px; padding: 7px 10px; border: 1px solid var(--border, #343630); border-radius: 10px; background: var(--surface, #1c1e19); color: inherit; font: inherit; cursor: pointer; }
.language-picker select:focus-visible { outline: 2px solid #d6ff74; outline-offset: 3px; }
.login-panel > .language-picker { float: right; }
.chat-toolbar > .language-picker { margin-inline-end: auto; }
@media (max-width: 760px) {
  .chat-toolbar { flex-wrap: wrap; gap: 8px; }
  .chat-toolbar > .language-picker { order: 2; }
  .add-menu button > [data-i18n]::first-letter { font-size: 14px; }
}
