:root {
  color-scheme: dark;
  --bg: #090614;
  --panel: rgba(24, 14, 46, 0.82);
  --panel-strong: rgba(36, 18, 70, 0.94);
  --line: rgba(203, 172, 255, 0.18);
  --text: #f8f3ff;
  --muted: #b9a7d6;
  --hot: #d946ef;
  --cyan: #36e4ff;
  --violet: #8b5cf6;
  --good: #54f4b7;
  --warn: #f8c35f;
  --shadow: 0 24px 80px rgba(104, 58, 183, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(217, 70, 239, 0.18), transparent 28rem),
    radial-gradient(circle at 78% 2%, rgba(54, 228, 255, 0.12), transparent 24rem),
    linear-gradient(145deg, #07040f 0%, #11051d 48%, #070411 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 360px);
  gap: 24px;
  align-items: center;
  min-height: 120px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: logo-neon 5.4s ease-in-out infinite;
}

.logo-symbol {
  width: 42px;
  height: 42px;
  overflow: visible;
}

.logo-symbol rect {
  fill: rgba(255, 255, 255, 0.04);
  stroke: rgba(54, 228, 255, 0.72);
  stroke-width: 2;
}

.logo-symbol circle {
  fill: var(--hot);
  filter: drop-shadow(0 0 10px rgba(217, 70, 239, 0.9));
}

.logo-symbol path {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.9;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.status-card,
.card,
.preview-card,
.rail {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(28, 16, 55, 0.88), rgba(12, 9, 26, 0.78));
  box-shadow: 0 18px 52px rgba(104, 58, 183, 0.16);
  backdrop-filter: blur(18px);
}

.status-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 8px;
}

.status-card span:not(.pulse) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.pulse {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--good);
  box-shadow: 0 0 0 8px rgba(84, 244, 183, 0.12), 0 0 24px rgba(84, 244, 183, 0.85);
  animation: pulse 1.8s ease-in-out infinite;
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 26px 0 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab,
.primary,
.ghost,
.tool {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tab {
  flex: 0 0 auto;
  padding: 0 18px;
}

.tab.active,
.primary {
  border-color: rgba(54, 228, 255, 0.5);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(217, 70, 239, 0.78));
  box-shadow: 0 10px 26px rgba(217, 70, 239, 0.16);
}

.tab:hover,
.primary:hover,
.ghost:hover,
.tool:hover {
  transform: translateY(-1px);
  border-color: rgba(54, 228, 255, 0.55);
}

.workspace {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
  position: relative;
}

.workspace::before {
  content: "";
  position: absolute;
  inset: -20px;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 18%, rgba(54, 228, 255, 0.08), transparent 24rem),
    radial-gradient(circle at 78% 42%, rgba(217, 70, 239, 0.1), transparent 28rem);
  filter: blur(12px);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 610px;
  padding: 14px;
  border-radius: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 4px auto 8px;
  border-radius: 8px;
  color: #070411;
  font-weight: 950;
  background: linear-gradient(135deg, var(--cyan), var(--hot));
  box-shadow: 0 0 36px rgba(217, 70, 239, 0.45);
}

.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric strong {
  display: block;
  margin-top: 6px;
  word-break: break-word;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(320px, 450px) 1fr;
  gap: 14px;
}

.subtitle-grid {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: start;
}

.card,
.preview-card {
  border-radius: 8px;
  padding: 18px;
}

.main-card {
  min-height: 560px;
}

.subtitle-card {
  min-height: 0;
}

.section-title,
.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.section-title span,
.preview-head span {
  font-size: 1.08rem;
  font-weight: 850;
}

.section-title small,
.preview-head small,
.note {
  color: var(--muted);
}

.progress-line {
  height: 5px;
  overflow: hidden;
  margin: -8px 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.progress-line span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--hot));
  box-shadow: 0 0 18px rgba(217, 70, 239, 0.45);
  transition: width 280ms ease;
}

.progress-line.detailed {
  margin-bottom: 8px;
}

.progress-detail {
  min-height: 18px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.progress-detail strong {
  color: var(--cyan);
  font-weight: 800;
}

.field,
.control-stack label {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 0.92rem;
}

input[type="url"],
input[type="text"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  outline: none;
}

input[type="url"],
input[type="text"],
select {
  min-height: 48px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  min-height: 150px;
  padding: 12px 14px;
  line-height: 1.5;
}

input[type="range"] {
  accent-color: var(--hot);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.primary,
.ghost,
.tool,
.action-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.compact-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compact-actions .primary,
.compact-actions .ghost,
.compact-actions .action-label {
  width: 100%;
}

.compact-actions .export-action {
  grid-column: 1 / -1;
}

.sub-actions {
  margin-top: 10px;
}

.sub-actions .ghost {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.result-box {
  min-height: 142px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.result-box p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.status-lines {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.status-lines span,
.size-row span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.status-lines strong,
.size-row strong {
  color: var(--text);
}

.source-grid {
  display: grid;
  gap: 10px;
}

.source {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.source small {
  color: var(--muted);
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 158px;
  border: 1px dashed rgba(54, 228, 255, 0.45);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(54, 228, 255, 0.08), rgba(217, 70, 239, 0.08)),
    rgba(0, 0, 0, 0.18);
}

.dropzone.compact {
  min-height: 104px;
}

.clean-upload {
  min-height: 76px;
  margin-top: 2px;
  border-style: dashed;
  background:
    linear-gradient(135deg, rgba(54, 228, 255, 0.06), rgba(217, 70, 239, 0.055)),
    rgba(0, 0, 0, 0.2);
}

.dropzone span {
  font-weight: 850;
}

.dropzone small {
  color: var(--muted);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.dropzone input::file-selector-button {
  min-height: 38px;
  margin-right: 10px;
  border: 1px solid rgba(54, 228, 255, 0.4);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.edit-toolbar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 18px;
}

.edit-toolbar + .control-stack {
  margin-top: 16px;
}

.edit-toolbar .mini-tool {
  width: 100%;
}

.icon-tool {
  display: inline-grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: 0;
  color: #05030a;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(54, 228, 255, 0.62));
  border-color: rgba(54, 228, 255, 0.48);
}

.edit-toolbar .mini-tool.active {
  border-color: rgba(54, 228, 255, 0.88);
  color: #05030a;
  background: linear-gradient(135deg, var(--cyan), var(--hot));
  box-shadow: 0 0 22px rgba(54, 228, 255, 0.2);
}

.active-tool-hint {
  margin: -8px 0 16px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.icon-tool svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.35;
}

.range-control {
  display: grid;
  grid-template-columns: minmax(84px, 0.8fr) minmax(120px, 1.7fr) 34px;
  gap: 10px;
  align-items: center;
}

.range-control > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.reset-knob {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid rgba(203, 172, 255, 0.22);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.05);
  line-height: 1;
}

.reset-knob:hover {
  border-color: rgba(54, 228, 255, 0.72);
  background: rgba(54, 228, 255, 0.1);
}

.resize-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.resize-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.resize-grid label:nth-child(3) {
  grid-column: 1 / -1;
}

.resize-grid input,
.resize-grid select {
  width: 100%;
}

.preview-card {
  min-height: 560px;
}

.editor-preview {
  min-height: 520px;
}

.canvas-zoom-shell {
  max-height: min(68vh, 700px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

canvas {
  display: block;
  width: 100%;
  height: min(62vh, 620px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  object-fit: contain;
  touch-action: none;
}

.canvas-zoom-shell #canvas {
  width: calc(var(--photo-zoom, 1) * 100%);
  height: auto;
  max-width: none;
  border: 0;
  border-radius: 0;
}

#canvas[data-tool="brush"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M18 3l7 7-13 13H5v-7L18 3z' fill='white' stroke='%2305030a' stroke-width='2'/%3E%3Cpath d='M16 5l7 7' stroke='%2305030a' stroke-width='2'/%3E%3C/svg%3E") 5 24, crosshair;
}

#canvas[data-tool="erase"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M5 20l11-11 8 8-7 7H9l-4-4z' fill='white' stroke='%2305030a' stroke-width='2'/%3E%3Cpath d='M14 24h10' stroke='%2305030a' stroke-width='2'/%3E%3C/svg%3E") 8 22, cell;
}

#canvas[data-tool="blur"],
#canvas[data-tool="remove"],
#canvas[data-tool="push"],
#canvas[data-tool="pinch"],
#canvas[data-tool="expand"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Ccircle cx='17' cy='17' r='12' fill='none' stroke='white' stroke-width='4'/%3E%3Ccircle cx='17' cy='17' r='12' fill='none' stroke='%2305030a' stroke-width='2'/%3E%3Cpath d='M17 11v12M11 17h12' stroke='%2305030a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 17 17, crosshair;
}

.metadata-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(203, 172, 255, 0.14);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.preview-pane {
  display: grid;
  grid-template-rows: 30px auto auto;
}

.compare-grid small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.compare-grid canvas {
  height: min(46vh, 460px);
}

.preview-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 22px;
  margin-bottom: 8px;
  position: relative;
}

.preview-title-row small {
  margin-bottom: 0;
}

.mini-actions {
  display: inline-flex;
  gap: 6px;
  position: absolute;
  top: 42px;
  right: 12px;
  z-index: 4;
}

.placeholder-actions {
  visibility: hidden;
  pointer-events: none;
}

.mini-tool {
  min-height: 34px;
  width: 38px;
  padding: 0;
  border-radius: 8px;
  font-size: 0.78rem;
}

.icon-tool svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-tool.active {
  color: #05030a;
  border-color: rgba(54, 228, 255, 0.85);
  background: linear-gradient(135deg, var(--cyan), var(--hot));
}

.protect-canvas-wrap {
  position: relative;
}

.protect-canvas-wrap #compressOriginalCanvas {
  border: 2px solid rgba(54, 228, 255, 0.48);
  box-shadow: inset 0 0 0 1px rgba(217, 70, 239, 0.18), 0 0 22px rgba(54, 228, 255, 0.08);
}

#protectOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  background: transparent;
  box-shadow: none;
}

.protect-canvas-wrap.protecting #protectOverlay {
  pointer-events: auto;
  cursor: crosshair;
}

.protect-meta {
  margin-top: 8px;
  color: var(--muted);
}

.size-row {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.control-stack {
  display: grid;
  gap: 16px;
}

.subtitle-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.subtitle-settings label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.subtitle-settings label:nth-child(1),
.subtitle-settings label:nth-child(2),
.subtitle-settings label:nth-child(3),
.subtitle-settings label:nth-child(4) {
  grid-column: 1 / -1;
}

.subtitle-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subtitle-actions .primary,
.subtitle-actions .ghost {
  width: 100%;
}

.video-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto;
  gap: 14px;
}

.video-studio-grid:not(.has-video-project) .video-inspector,
.video-studio-grid:not(.has-video-project) .video-timeline-card {
  display: none;
}

.video-stage-card,
.video-inspector,
.video-timeline-card {
  min-height: auto;
}

.video-stage-card {
  position: relative;
  padding-top: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.video-stage-card.drag-over .video-preview-wrap,
.video-stage-card.drag-over .video-empty-project {
  border-color: rgba(54, 228, 255, 0.78);
  background: rgba(54, 228, 255, 0.08);
  box-shadow: 0 0 28px rgba(54, 228, 255, 0.14);
}

.video-command-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  margin-bottom: 14px;
}

.video-studio-grid:not(.has-video-project) .video-command-bar {
  margin-top: 22px;
}

.video-studio-grid:not(.has-video-project) .video-pill-control,
.video-studio-grid:not(.has-video-project) #toggleVideoInspector,
.video-studio-grid:not(.has-video-project) #renderVideoPreview,
.video-studio-grid:not(.has-video-project) .video-save-chip,
.video-studio-grid:not(.has-video-project) .progress-line {
  display: none;
}

.video-icon-action,
.video-pill-control {
  display: inline-grid;
  place-items: center;
  min-width: 66px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  cursor: pointer;
}

.video-icon-action input {
  display: none;
}

.video-icon-action span {
  font-size: 1.05rem;
  line-height: 1;
}

.video-icon-action small,
.video-pill-control {
  color: var(--muted);
}

.video-icon-action:hover,
.video-pill-control:hover {
  border-color: rgba(54, 228, 255, 0.42);
  color: var(--text);
  background: rgba(54, 228, 255, 0.08);
}

.video-icon-action.has-history {
  border-color: rgba(217, 70, 239, 0.55);
  box-shadow: 0 0 18px rgba(217, 70, 239, 0.22);
}

.video-pill-control {
  display: flex;
  gap: 8px;
  min-width: 130px;
}

.video-pill-control select {
  width: auto;
  min-width: 86px;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
}

.video-save-chip {
  display: block;
  width: fit-content;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.video-preview-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(58vh, 620px);
  margin-top: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.035), transparent 66%);
}

.project-recovery {
  position: absolute;
  top: 76px;
  right: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  width: min(520px, calc(100% - 20px));
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(54, 228, 255, 0.35);
  border-radius: 8px;
  background: rgba(8, 6, 16, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

.project-recovery[hidden] {
  display: none;
}

.project-recovery span {
  min-width: 0;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
}

.video-preview-wrap video {
  width: 100%;
  max-height: min(64vh, 660px);
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: #05030a;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.45);
}

.video-studio-grid:not(.has-video-project) .video-preview-wrap video,
.video-studio-grid.has-video-project .video-empty-project {
  display: none;
}

.video-empty-project {
  display: grid;
  place-items: center;
  gap: 8px;
  width: min(520px, 92%);
  min-height: 220px;
  padding: 32px;
  border: 1px dashed rgba(54, 228, 255, 0.34);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 70, 239, 0.18), transparent 58%),
    rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.video-empty-project:hover {
  border-color: rgba(54, 228, 255, 0.7);
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 70, 239, 0.24), transparent 58%),
    rgba(54, 228, 255, 0.055);
  transform: translateY(-1px);
}

.video-empty-project span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.video-empty-project strong {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

.video-empty-project small {
  max-width: 340px;
  color: var(--muted);
  font-size: 0.9rem;
}

.video-title-overlay {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 9%;
  color: white;
  font-size: 44px;
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.85), 0 0 20px rgba(217, 70, 239, 0.35);
  pointer-events: none;
}

.video-overlay-image,
.motion-track-point {
  position: absolute;
  left: var(--track-x, 50%);
  top: var(--track-y, 50%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
}

.video-overlay-image {
  width: var(--overlay-size, 140px);
  max-width: 44%;
  border-radius: 8px;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
}

.motion-track-point {
  width: 22px;
  height: 22px;
  border: 2px solid var(--cyan);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(54, 228, 255, 0.85);
}

.video-title-overlay.top {
  top: 9%;
  bottom: auto;
}

.video-title-overlay.center {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

.video-title-overlay.tracked {
  left: var(--track-x, 50%);
  right: auto;
  top: var(--track-y, 50%);
  bottom: auto;
  width: max-content;
  max-width: 78%;
  transform: translate(-50%, -50%);
}

.video-transport,
.video-tool-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.video-transport {
  display: none;
}

.video-tool-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-inspector .metadata-panel {
  margin-top: 0;
}

.inspector-toggle {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.video-inspector {
  grid-column: 1;
  grid-row: 4;
  padding: 10px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  transition: transform 180ms ease, opacity 180ms ease, max-height 180ms ease;
}

.video-inspector .section-title {
  cursor: pointer;
}

.video-inspector.collapsed {
  max-height: 58px;
  overflow: hidden;
  opacity: 0.86;
}

.video-inspector.collapsed .inspector-toggle {
  transform: rotate(90deg);
}

.video-inspector.collapsed .metadata-panel,
.video-inspector.collapsed .video-controls,
.video-inspector.collapsed .video-tool-row {
  display: none;
}

.video-controls {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.video-controls .range-control,
.video-controls label:nth-child(7),
.video-controls label:nth-child(10) {
  grid-column: auto;
}

.video-controls label {
  flex: 0 0 176px;
  min-width: 0;
}

.video-controls .range-control {
  flex-basis: 210px;
}

.video-timeline-card,
.motion-tracker-card {
  grid-column: 1;
}

.video-stage-card {
  grid-column: 1;
  grid-row: 1;
}

.video-timeline-card {
  grid-row: 2;
  padding: 4px 0 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.motion-tracker-card {
  grid-column: 1;
  grid-row: 5;
}

.motion-tracker-card.dormant-tool {
  display: none;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0 22px;
}

.timeline-shell {
  position: relative;
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding: 0 22px 10px;
}

.timeline-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: end;
  margin-top: 2px;
  padding: 0 22px;
  opacity: 0.58;
  transition: opacity 160ms ease;
}

.timeline-toolbar:hover,
.timeline-toolbar:focus-within {
  opacity: 1;
}

.timeline-toolbar label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.timeline-toolbar input {
  width: min(118px, 26vw);
  accent-color: rgba(255, 255, 255, 0.72);
}

.transition-palette {
  display: flex;
  gap: 8px;
  margin: 10px 22px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.transition-palette button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 850;
  cursor: grab;
}

.transition-palette button:active,
.transition-palette button.dragging-effect {
  cursor: grabbing;
  border-color: rgba(217, 70, 239, 0.72);
  box-shadow: 0 0 16px rgba(217, 70, 239, 0.24);
}

.timeline-ruler {
  position: relative;
  min-height: 136px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: crosshair;
  touch-action: pan-x;
}

.timeline-ruler .playhead,
.audio-playhead {
  display: none;
}

.timeline-master-playhead {
  position: absolute;
  top: 0;
  bottom: 8px;
  left: var(--playhead-x, 22px);
  width: 1px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 14px rgba(217, 70, 239, 0.62);
  pointer-events: none;
  z-index: 20;
}

.timeline-ruler .trim-fill {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: var(--trim-start, 0%);
  right: calc(100% - var(--trim-end, 100%));
  border: 1px solid rgba(54, 228, 255, 0.74);
  border-radius: 8px;
  background: rgba(54, 228, 255, 0.12);
  pointer-events: none;
  z-index: 2;
}

.timeline-ruler .playhead,
.timeline-ruler .split-marker,
.timeline-ruler .hover-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--playhead, 0%);
  width: 2px;
  background: var(--hot);
  box-shadow: 0 0 18px rgba(217, 70, 239, 0.65);
  pointer-events: none;
  z-index: 5;
}

.timeline-ruler .split-marker {
  display: none;
  left: var(--split-marker, -10%);
  background: var(--cyan);
}

.timeline-ruler .hover-playhead {
  left: var(--hover-playhead, -10%);
  width: 1px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
  opacity: var(--hover-opacity, 0);
}

.timeline-ruler .hover-playhead,
.audio-hover-playhead,
.timeline-tooltip {
  display: none;
}

.timeline-tooltip {
  position: absolute;
  top: 7px;
  left: var(--hover-playhead, 0%);
  z-index: 7;
  min-width: 54px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(5, 3, 10, 0.88);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  opacity: var(--hover-opacity, 0);
  pointer-events: none;
  transform: translateX(-50%);
}

.timeline-thumbs {
  position: absolute;
  inset: 12px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  z-index: 1;
  background: transparent;
  border-radius: 8px;
}

.timeline-cuts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.timeline-cut {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: var(--cut-left, -10%);
  width: 2px;
  border: 0;
  border-right: 2px solid rgba(217, 70, 239, 0.92);
  background: transparent;
  box-shadow: 0 0 10px rgba(217, 70, 239, 0.72);
  transform: translateX(-1px);
}

.timeline-cut::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 50%;
  background: rgba(217, 70, 239, 0.84);
  transform: translateX(-50%);
}

.timeline-cut.audio-cut {
  border-right-color: rgba(245, 158, 11, 0.9);
  background: transparent;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.72);
}

.timeline-cut.audio-cut::after {
  background: rgba(245, 158, 11, 0.86);
}

.timeline-thumb {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 18px 0 0;
  cursor: pointer;
  font: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.timeline-thumb:hover {
  border-color: rgba(54, 228, 255, 0.55);
}

.clip-transition-slot {
  position: relative;
  flex: 0 0 14px;
  align-self: stretch;
  margin-top: 18px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(54, 228, 255, 0.9);
  display: grid;
  place-items: center;
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  transition: flex-basis 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.clip-transition-slot::before {
  content: "";
  position: absolute;
  top: 8%;
  bottom: 8%;
  left: 50%;
  width: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.38), 0 0 12px rgba(54, 228, 255, 0.52);
  transform: translateX(-50%);
}

.clip-transition-slot.effect-target,
.clip-transition-slot.has-transition {
  flex-basis: 34px;
  background: rgba(54, 228, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(54, 228, 255, 0.52), 0 0 16px rgba(54, 228, 255, 0.22);
}

.clip-transition-slot.has-transition::before {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.42), 0 0 14px rgba(54, 228, 255, 0.68);
}

.timeline-thumb.dragging {
  opacity: 0.42;
  transform: scale(0.96);
}

.timeline-thumb.drop-target {
  box-shadow: inset 0 0 0 2px rgba(54, 228, 255, 0.9), 0 0 18px rgba(54, 228, 255, 0.28);
}

.timeline-thumb.overlay-target {
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.95), 0 0 18px rgba(245, 158, 11, 0.32);
}

.timeline-thumb.is-pip img {
  transform: scale(0.78) translate(12%, -8%);
  transform-origin: right top;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.78), 0 10px 22px rgba(0, 0, 0, 0.45);
}

.timeline-thumb img {
  width: 100%;
  height: calc(100% - 18px);
  object-fit: cover;
  display: block;
  opacity: 0.9;
  border-radius: 0;
  background: #05030a;
}

.timeline-thumb span {
  position: absolute;
  left: 6px;
  bottom: 5px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
}

.clip-pip-toggle {
  position: absolute;
  top: 24px;
  right: 6px;
  z-index: 2;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.78);
  color: #10050f;
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 160ms ease;
}

.timeline-thumb:hover .clip-pip-toggle,
.timeline-thumb:focus-visible .clip-pip-toggle,
.timeline-thumb.is-pip .clip-pip-toggle {
  opacity: 1;
}

.timeline-thumb small {
  position: absolute;
  right: 6px;
  bottom: 5px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(5, 3, 10, 0.68);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.68rem;
  font-weight: 850;
}

.shot-face-line {
  position: absolute;
  top: 1px;
  left: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  pointer-events: none;
}

.shot-face-line strong,
.shot-face-line em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
}

.shot-face-line em {
  color: rgba(255, 255, 255, 0.42);
  font-style: normal;
}

.timeline-thumb::after {
  display: none;
}

.timeline-thumb:hover::after,
.timeline-thumb:focus-visible::after {
  display: none;
}

.audio-lane {
  position: relative;
  display: block;
  min-height: 86px;
  padding: 8px 10px 8px 24px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: grab;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.audio-lane.dragging-audio {
  cursor: grabbing;
}

.audio-lane::before {
  display: none;
}

.audio-lane::after {
  content: attr(data-offset);
  position: absolute;
  right: 12px;
  top: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  pointer-events: none;
}

.audio-lane > div {
  position: sticky;
  left: 0;
  z-index: 6;
  width: max-content;
  min-width: 108px;
  margin-bottom: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(5, 3, 10, 0.82);
}

.audio-lane span {
  display: block;
  color: var(--text);
  font-weight: 900;
}

.audio-lane small {
  color: var(--muted);
  font-size: 0.76rem;
}

.audio-lane canvas {
  display: block;
  width: max(100%, var(--timeline-content-width, calc(1200px * var(--timeline-zoom, 1))));
  max-width: none;
  height: 66px;
  border-radius: 8px;
  background: rgba(5, 3, 10, 0.58);
  transform: translateX(var(--audio-offset, 0px));
  transition: transform 80ms linear;
}

.audio-playhead,
.audio-hover-playhead {
  display: none !important;
  opacity: 0 !important;
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: var(--playhead, 0%);
  width: 2px;
  background: var(--hot);
  box-shadow: 0 0 16px rgba(217, 70, 239, 0.7);
  pointer-events: none;
  z-index: 4;
}

.audio-hover-playhead {
  left: var(--hover-playhead, -10%);
  width: 1px;
  background: rgba(255, 255, 255, 0.78);
  opacity: var(--hover-opacity, 0);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
}

.audio-cuts {
  top: 8px;
  right: 10px;
  bottom: 8px;
  left: 10px;
}

.motion-tracker-card .video-tool-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-context-menu {
  position: absolute;
  z-index: 50;
  min-width: 154px;
  overflow: hidden;
  border: 1px solid rgba(54, 228, 255, 0.3);
  border-radius: 8px;
  background: rgba(8, 6, 16, 0.96);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
}

.video-context-menu button {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.video-context-menu button:hover {
  background: rgba(54, 228, 255, 0.12);
}

.timeline-ranges {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.auto-compress-card,
.compression-info {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 0;
  border: 1px solid rgba(54, 228, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.auto-compress-card summary,
.compression-info summary,
.more-actions summary {
  min-height: 42px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.auto-compress-card summary::-webkit-details-marker,
.compression-info summary::-webkit-details-marker,
.more-actions summary::-webkit-details-marker {
  display: none;
}

.auto-compress-card span,
.compression-info span {
  display: block;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  animation: slideDown 180ms ease both;
}

.more-actions {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.more-actions summary {
  min-height: 38px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.utility-panel[hidden] {
  display: none !important;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline video,
#subtitleVideoPreview {
  width: 100%;
  max-height: 350px;
  margin-top: 14px;
  border-radius: 8px;
  background: #05030a;
}

#subtitleVideoPreview {
  margin-top: 0;
}

.video-caption-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 70, 239, 0.14), transparent 60%),
    #05030a;
  border: 1px solid rgba(54, 228, 255, 0.22);
}

.subtitle-empty-project {
  display: grid;
  place-items: center;
  gap: 8px;
  width: min(440px, 90%);
  min-height: 190px;
  padding: 28px;
  border: 1px dashed rgba(54, 228, 255, 0.34);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.subtitle-empty-project:hover {
  border-color: rgba(54, 228, 255, 0.65);
  background: rgba(54, 228, 255, 0.055);
}

.subtitle-empty-project span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.subtitle-empty-project strong {
  font-size: clamp(1.5rem, 3vw, 2.7rem);
}

.subtitle-empty-project small {
  max-width: 300px;
  color: var(--muted);
  font-size: 0.86rem;
}

.video-caption-wrap:not(.has-subtitle-video) #subtitleVideoPreview,
.video-caption-wrap:not(.has-subtitle-video) #captionOverlay,
.video-caption-wrap.has-subtitle-video .subtitle-empty-project {
  display: none;
}

#captionOverlay {
  position: absolute;
  left: 50%;
  top: 86%;
  max-width: min(86%, 720px);
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  border-radius: 8px;
  color: white;
  background: rgba(0, 0, 0, 0.72);
  font-weight: 750;
  font-size: 24px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

#captionOverlay:active {
  cursor: grabbing;
}

#srtPreview {
  min-height: 160px;
  max-height: 220px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #e9dcff;
  background: rgba(0, 0, 0, 0.28);
  white-space: pre-wrap;
}

.subtitle-export {
  margin: 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.subtitle-export summary {
  padding: 10px 12px;
  color: var(--muted);
  cursor: pointer;
}

.subtitle-editor {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.subtitle-editor p {
  margin: 0;
  color: var(--muted);
}

.subtitle-edit-row {
  display: grid;
  grid-template-columns: 34px 76px 76px minmax(180px, 1fr) 74px;
  gap: 8px;
  align-items: start;
}

.subtitle-edit-row span {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  color: var(--muted);
  font-weight: 800;
}

.subtitle-edit-row input,
.subtitle-edit-row textarea {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.84rem;
}

.subtitle-edit-row textarea {
  min-height: 42px;
  resize: vertical;
}

.tiny-button {
  min-height: 38px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.language-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.language-cloud span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.86rem;
}

.info-slide {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 44px);
  background:
    radial-gradient(circle at 22% 26%, rgba(54, 228, 255, 0.28), transparent 24rem),
    radial-gradient(circle at 54% 32%, rgba(248, 243, 255, 0.1), transparent 18rem),
    radial-gradient(circle at 80% 20%, rgba(217, 70, 239, 0.28), transparent 26rem),
    linear-gradient(145deg, rgba(28, 16, 55, 0.92), rgba(8, 4, 18, 0.92));
  box-shadow: var(--shadow);
}

.info-slide h2 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 5rem);
  line-height: 0.95;
}

.info-slide p {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.profile-grid {
  display: grid;
  align-content: center;
  gap: 12px;
}

.profile-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.profile-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 8px;
}

.profile-grid strong {
  font-size: 1.02rem;
}

.timeline-bar {
  display: grid;
  grid-template-columns: 1fr 0.8fr 1.4fr;
  gap: 8px;
  margin-top: 16px;
}

.timeline-bar span {
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(54, 228, 255, 0.18), rgba(217, 70, 239, 0.28));
}

.flow {
  display: grid;
  gap: 12px;
}

.flow span {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.note {
  margin: 18px 0 0;
  line-height: 1.55;
}

@keyframes pulse {
  50% {
    transform: scale(1.2);
    opacity: 0.74;
  }
}

@keyframes logo-neon {
  0%,
  100% {
    text-shadow: 0 0 10px rgba(54, 228, 255, 0.24), 0 0 22px rgba(217, 70, 239, 0.16);
    opacity: 0.94;
  }
  48% {
    text-shadow: 0 0 18px rgba(54, 228, 255, 0.46), 0 0 34px rgba(217, 70, 239, 0.28);
    opacity: 1;
  }
  52% {
    text-shadow: 0 0 7px rgba(54, 228, 255, 0.16), 0 0 18px rgba(217, 70, 239, 0.1);
    opacity: 0.86;
  }
  56% {
    text-shadow: 0 0 20px rgba(54, 228, 255, 0.5), 0 0 40px rgba(217, 70, 239, 0.32);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .topbar,
  .workspace,
  .panel-grid,
  .info-slide {
    grid-template-columns: 1fr;
  }

  .rail {
    min-height: auto;
    flex-direction: row;
    overflow-x: auto;
  }

  .brand-mark {
    flex: 0 0 64px;
    margin: 0;
  }

  .metric {
    min-width: 120px;
  }

  .main-card,
  .preview-card {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 18px;
  }

  h1 {
    font-size: 2.3rem;
    line-height: 1;
  }

  .section-title,
  .preview-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edit-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .range-control {
    grid-template-columns: 1fr 34px;
  }

  .range-control > span {
    grid-column: 1 / -1;
  }

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

  .subtitle-settings,
  .subtitle-actions,
  .subtitle-edit-row,
  .video-studio-grid,
  .video-controls,
  .video-transport,
  .video-tool-row,
  .timeline-toolbar,
  .audio-lane {
    grid-template-columns: 1fr;
  }

  .timeline-ruler {
    min-height: 124px;
  }

  .timeline-thumbs {
    grid-auto-columns: minmax(74px, 1fr);
  }

  .video-inspector,
  .video-timeline-card,
  .motion-tracker-card {
    grid-column: 1;
    grid-row: auto;
  }

  .project-recovery {
    grid-template-columns: 1fr;
  }

  canvas {
    height: 420px;
  }
}

/* Unified image/video comparison: keep video panes side by side on phones. */
#compress.video-pix-mode .compare-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
#compress.video-pix-mode .compare-grid video , #compress.video-pix-mode #videoPixCanvas { width:100%;height:min(46vh,460px);object-fit:contain;background:#0b0814;border-radius:12px; }
#compress [hidden] { display:none !important; }
