:root { color-scheme: light dark; }

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #0b0d10;
  color: #f2f2f2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#intro {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0d10;
  z-index: 100;
  text-align: center;
  transition: opacity 0.9s ease;
  opacity: 1;
}
#intro.hidden {
  opacity: 0;
  pointer-events: none;
}
#intro h1 { font-size: 2rem; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
#intro p { color: #9a9a9a; margin: 0; }

#auth-app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
#auth-app.hidden { display: none; }

.auth-card {
  width: 100%;
  max-width: 380px;
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 12px;
  padding: 2rem;
}

.auth-card h2 {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.8rem;
  color: #9a9a9a;
  margin-bottom: 0.35rem;
}
.field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: #0b0d10;
  border: 1px solid #2a2f38;
  border-radius: 8px;
  color: #f2f2f2;
  font-size: 0.95rem;
}
.field input:focus {
  outline: none;
  border-color: #5b8def;
}

button.primary {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: 8px;
  background: #5b8def;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.6; cursor: default; }
button.primary:hover:not(:disabled) { background: #4a7bdb; }

.switch-row {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: #9a9a9a;
}
.link {
  color: #5b8def;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
}
.link:hover { text-decoration: underline; }

#btn-resend-verify {
  display: block;
  margin: 0.75rem auto 0;
  text-align: center;
}
#btn-resend-verify.hidden { display: none; }

.message {
  margin-bottom: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
}
.message.error { background: #3a1c1c; color: #ff8a8a; }
.message.success { background: #1c3a24; color: #7ee6a0; }
.message.hidden { display: none; }

.panel.hidden { display: none; }

/* Dashboard */
#dashboard.hidden { display: none; }
#dashboard { min-height: 100vh; }

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #22262e;
  position: sticky;
  top: 0;
  background: #0b0d10;
  z-index: 10;
}
.dash-header h1 { font-size: 1.1rem; margin: 0; letter-spacing: -0.01em; flex-shrink: 0; }

.dash-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #9a9a9a;
  flex-shrink: 0;
}
.dash-header-top { display: flex; align-items: center; gap: 1rem; }

.quota { display: flex; align-items: center; gap: 0.75rem; width: 220px; }
.quota-bar {
  flex: 1;
  height: 6px;
  background: #22262e;
  border-radius: 999px;
  overflow: hidden;
}
.quota-fill { height: 100%; background: #5b8def; width: 0%; transition: width 0.3s ease; }
.quota-fill.warn { background: #e0a13c; }
.quota-fill.full { background: #e05c5c; }
#quota-label { font-size: 0.78rem; color: #9a9a9a; white-space: nowrap; }

.queue-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  max-width: 520px;
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
}
.queue-box-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7078;
  flex-shrink: 0;
}
.queue-box-items {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
}
.queue-bar-empty { color: #6b7078; font-size: 0.78rem; margin: 0; white-space: nowrap; }
.queue-bar-empty.hidden { display: none; }
.queue-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  background: #1c2027;
  border: 1px solid #2a2f38;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
  white-space: nowrap;
}
.queue-item-icon { flex-shrink: 0; }
.queue-item-label { color: #d0d0d0; }
.queue-item-status { color: #6b7078; }
.queue-item.status-running { border-color: #5b8def; }
.queue-item.status-running .queue-item-status { color: #5b8def; }
.queue-item.status-queued { opacity: 0.75; }
.queue-item.status-completed { border-color: #4caf50; }
.queue-item.status-completed .queue-item-status { color: #4caf50; }
.queue-item.status-failed { border-color: #e05c5c; }
.queue-item.status-failed .queue-item-status { color: #e05c5c; }
.queue-item-cancel {
  background: none;
  border: none;
  color: #6b7078;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.queue-item-cancel:hover { color: #e05c5c; }

.tab-bar {
  display: flex;
  justify-content: space-evenly;
  padding: 0 1.5rem;
  border-bottom: 1px solid #22262e;
  position: sticky;
  top: 61px;
  background: #0b0d10;
  z-index: 9;
}
.tab-btn {
  background: none;
  border: none;
  border-right: 1px solid #22262e;
  border-bottom: 2px solid transparent;
  color: #9a9a9a;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  cursor: pointer;
}
.tab-btn:last-child { border-right: none; }
.tab-btn:hover { color: #f2f2f2; }
.tab-btn.active { color: #f2f2f2; border-bottom-color: #5b8def; }

.tab-panel.hidden { display: none; }

.dash-main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

.dropzone {
  border: 2px dashed #2a2f38;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  color: #9a9a9a;
  margin-bottom: 1.25rem;
}
.dropzone.dragover { border-color: #5b8def; color: #f2f2f2; }
.dropzone button.primary { width: auto; padding: 0.6rem 1.25rem; margin-top: 0.75rem; }

.upload-list { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.upload-item {
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
}
.upload-item .upload-name { display: flex; justify-content: space-between; margin-bottom: 0.4rem; }
.upload-item .upload-pct { color: #9a9a9a; }
.upload-item .upload-bar { height: 4px; background: #22262e; border-radius: 999px; overflow: hidden; }
.upload-item .upload-bar-fill { height: 100%; background: #5b8def; width: 0%; }
.upload-item.error .upload-bar-fill { background: #e05c5c; width: 100%; }
.upload-item.error .upload-pct { color: #ff8a8a; }

.asset-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.asset-toolbar-right { display: flex; align-items: center; gap: 0.5rem; }
.filter-btn {
  background: none;
  border: 1px solid #2a2f38;
  color: #9a9a9a;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.filter-btn.active { border-color: #5b8def; color: #5b8def; }

.breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; flex-wrap: wrap; }
.breadcrumb button {
  background: none;
  border: none;
  color: #9a9a9a;
  cursor: pointer;
  font: inherit;
  padding: 0.1rem 0.2rem;
}
.breadcrumb button:last-child { color: #f2f2f2; cursor: default; }
.breadcrumb button:hover:not(:last-child) { color: #5b8def; }
.breadcrumb .sep { color: #4a4f58; }

.folder-card { cursor: pointer; }
.folder-card .asset-thumb { font-size: 3.5rem; }
.folder-card .folder-icon { color: #e0c04c; }
.folder-card.drag-over {
  border-color: #5b8def;
  background: #182035;
}
.folder-card.drag-over .asset-thumb { background: transparent; }

.asset-card[draggable="true"] { cursor: grab; }
.asset-card[draggable="true"]:active { cursor: grabbing; }

.breadcrumb button.drag-over {
  color: #5b8def;
  text-decoration: underline;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.asset-card {
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.asset-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0d10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a4f58;
  font-size: 2rem;
  overflow: hidden;
}
.asset-thumb img, .asset-thumb video { width: 100%; height: 100%; object-fit: contain; }
.play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.asset-info { padding: 0.6rem 0.75rem; }
.asset-name {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}
.asset-meta { font-size: 0.72rem; color: #9a9a9a; display: flex; justify-content: space-between; align-items: center; }

.asset-details {
  font-size: 0.72rem;
  color: #6b7078;
  margin-bottom: 0.35rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-details:hover { color: #9a9a9a; }

.job-status {
  font-size: 0.72rem;
  color: #5b8def;
  margin-bottom: 0.35rem;
}
.job-status.failed { color: #ff8a8a; cursor: help; }

.card-menu-wrap { position: relative; }
.card-menu-btn {
  background: none;
  border: none;
  color: #6b7078;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.1rem 0.35rem;
}
.card-menu-btn:hover { color: #f2f2f2; }
.card-menu {
  position: absolute;
  right: 0;
  bottom: 100%;
  margin-bottom: 0.25rem;
  background: #1c2027;
  border: 1px solid #2a2f38;
  border-radius: 8px;
  overflow: hidden;
  min-width: 110px;
  z-index: 20;
}
.card-menu.hidden { display: none; }
.card-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #f2f2f2;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
}
.card-menu button:hover { background: #262b34; }
.card-menu button.danger { color: #ff8a8a; }

.empty-state { color: #6b7078; text-align: center; padding: 2rem; }
.empty-state.hidden { display: none; }

/* Video Editor */
.editor-toolbar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.editor-toolbar select {
  background: #14171c;
  border: 1px solid #2a2f38;
  color: #f2f2f2;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

.editor-workspace { display: flex; gap: 1.5rem; align-items: flex-start; }
.editor-workspace.hidden { display: none; }
.editor-preview.hidden { display: none; }
.editor-preview-controls.hidden { display: none; }

.editor-picker { width: 240px; flex-shrink: 0; }
.editor-picker h3 { font-size: 0.85rem; color: #9a9a9a; margin: 0 0 0.75rem; font-weight: 500; }
.editor-asset-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 520px; overflow-y: auto; }
.editor-asset-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 8px;
  padding: 0.4rem;
  cursor: pointer;
}
.editor-asset-item:hover { border-color: #5b8def; }
.editor-asset-item img { width: 48px; height: 27px; object-fit: cover; border-radius: 4px; background: #0b0d10; flex-shrink: 0; }
.editor-asset-item span { font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.editor-main { flex: 1; min-width: 0; }
.editor-preview {
  width: 100%;
  height: 400px;
  background: #000;
  border-radius: 8px;
  display: block;
  object-fit: contain;
}
.editor-preview-controls { display: flex; align-items: center; gap: 0.75rem; margin: 0.75rem 0; flex-wrap: wrap; }
.editor-preview-controls button.link:disabled { opacity: 0.4; cursor: default; }
.editor-preview-controls button.primary { width: auto; padding: 0.5rem 1rem; }
#editor-trim-label { font-size: 0.8rem; color: #9a9a9a; }

.editor-track-toolbar { display: flex; gap: 0.5rem; margin: 0.75rem 0 0.5rem; }

.editor-timeline {
  overflow-x: auto;
  overflow-y: hidden;
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 8px;
}
.timeline-empty { color: #6b7078; font-size: 0.82rem; padding: 1rem; margin: 0; }

.track-row { display: flex; border-bottom: 1px solid #22262e; }
.track-row:last-child { border-bottom: none; }
.track-row.active .track-header { border-left-color: #5b8def; }

.track-header {
  position: sticky;
  left: 0;
  z-index: 2;
  flex-shrink: 0;
  width: 110px;
  background: #1c2027;
  border-right: 1px solid #22262e;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
  font-size: 0.72rem;
  color: #9a9a9a;
  cursor: pointer;
}
.track-label-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-remove {
  background: none;
  border: none;
  color: #6b7078;
  cursor: pointer;
  font-size: 0.68rem;
  flex-shrink: 0;
  padding: 0 0 0 0.3rem;
}
.track-remove:hover { color: #ff8a8a; }

.track-lane { position: relative; flex-shrink: 0; }
.track-lane.drag-over { background: #182035; }
.video-lane { height: 80px; }
.audio-lane { height: 40px; }

.ruler-row { cursor: default; }
.ruler-spacer { background: #14171c; border-right: 1px solid #22262e; cursor: default; }
.ruler-lane { height: 26px; background: #14171c; }
.ruler-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid #22262e;
  padding-left: 3px;
  font-size: 0.62rem;
  color: #6b7078;
  white-space: nowrap;
}

.timeline-clip-block {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  overflow: hidden;
  cursor: grab;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.25rem;
}
.video-clip { background: #26324a; border: 1px solid #3a5a9e; }
.video-clip.selected { border-color: #5b8def; box-shadow: 0 0 0 1px #5b8def; }
.audio-clip { background: #1c3a24; border: 1px solid #2f6b3f; cursor: default; }
.clip-block-name {
  font-size: 0.68rem;
  color: #f2f2f2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clip-block-remove {
  background: none;
  border: none;
  color: #9a9a9a;
  cursor: pointer;
  font-size: 0.65rem;
  flex-shrink: 0;
  padding: 0;
}
.clip-block-remove:hover { color: #ff8a8a; }

.editor-picker-hint { font-size: 0.7rem; color: #6b7078; margin: -0.5rem 0 0.75rem; }
.editor-asset-item .asset-type-badge { font-size: 0.6rem; color: #6b7078; margin-left: auto; flex-shrink: 0; }

.image-editor-workspace { display: flex; gap: 1.5rem; align-items: flex-start; margin-bottom: 1rem; }

.image-editor-canvas {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 520px;
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
}
.image-editor-canvas.panning { cursor: grabbing; }
.image-editor-canvas.panning .image-editor-preview { transition: none; }
.image-editor-preview {
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
  transition: transform 0.1s ease;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}
.image-editor-preview.hidden { display: none; }
.image-crop-overlay {
  position: absolute;
  border: 2px dashed #5b8def;
  background: rgba(91, 141, 239, 0.15);
  pointer-events: none;
}
.image-crop-overlay.hidden { display: none; }
.image-draw-overlay {
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
}
.image-draw-overlay.hidden { display: none; }

.image-editor-toolbar {
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 8px;
  padding: 1rem;
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.image-editor-toolbar .empty-state { margin: 0; }
.image-editor-toolbar-group { display: flex; align-items: center; gap: 0.5rem; }
.image-editor-toolbar-label { font-size: 0.78rem; color: #9a9a9a; margin-right: 0.25rem; }
.image-editor-toolbar button.link {
  width: auto;
  padding: 0.3rem 0.6rem;
  border: 1px solid #22262e;
  border-radius: 6px;
}
.image-editor-toolbar button.link:disabled { opacity: 0.4; cursor: default; }
.image-editor-toolbar.hidden { display: none; }
#image-editor-zoom-label { font-size: 0.8rem; color: #9a9a9a; min-width: 3.2rem; text-align: center; }

.image-mode-rail { border-left: 1px solid #22262e; border-right: 1px solid #22262e; padding: 0 1rem; }
.image-mode-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #9a9a9a;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.image-mode-btn:hover { color: #f2f2f2; }
.image-mode-btn.active { background: #1c2027; border-color: #2a2f38; color: #f2f2f2; }
.image-mode-btn:disabled { opacity: 0.4; cursor: default; }
.image-mode-panel { margin-top: 0.75rem; }
.image-mode-panel.hidden { display: none; }

.warp-mode-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #9a9a9a;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.warp-mode-btn:hover { color: #f2f2f2; }
.warp-mode-btn.active { background: #1c2027; border-color: #2a2f38; color: #f2f2f2; }
.warp-mode-btn:disabled { opacity: 0.4; cursor: default; }

/* Tier-gated feature, visually distinct from a plain "nothing to click yet" disabled state — a
   small lock icon plus an amber tint, so it reads as "unlock this" rather than "unavailable
   right now." Deliberately no upgrade prompt/tooltip yet, per the current scope — just the
   visual cue that something exists but is locked at the user's current tier. */
.tier-locked {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  border-color: #6b4a1f !important;
  color: #c9a26a !important;
}
.tier-locked::after {
  content: "🔒";
  margin-left: 0.35em;
  font-size: 0.85em;
}

.warp-liquify-canvas {
  position: absolute;
  top: 0;
  left: 0;
  cursor: none;
}
.warp-liquify-canvas.hidden { display: none; }

.warp-liquify-cursor {
  position: absolute;
  border: 2px solid #5b8def;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.warp-liquify-cursor.hidden { display: none; }

.warp-liquify-mode-btn {
  background: transparent;
  border: 1px solid #2a2f38;
  color: #9a9a9a;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.warp-liquify-mode-btn:hover { color: #f2f2f2; }
.warp-liquify-mode-btn.active { background: #1c2027; border-color: #5b8def; color: #f2f2f2; }

#warp-liquify-size-label, #warp-liquify-strength-label {
  font-size: 0.78rem;
  color: #9a9a9a;
  min-width: 2.5rem;
}

#warp-mesh-canvas { cursor: default; }

.warp-mesh-handles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.warp-mesh-handles.hidden { display: none; }

.warp-mesh-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: #5b8def;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}
.warp-mesh-handle:active { cursor: grabbing; background: #ff6b6b; }
.warp-mesh-handle.static {
  background: #6b7078;
  cursor: default;
  pointer-events: none;
}

.warp-mesh-density-btn, .warp-morph-density-btn {
  background: transparent;
  border: 1px solid #2a2f38;
  color: #9a9a9a;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.warp-mesh-density-btn:hover, .warp-morph-density-btn:hover { color: #f2f2f2; }
.warp-mesh-density-btn.active, .warp-morph-density-btn.active { background: #1c2027; border-color: #5b8def; color: #f2f2f2; }

#warp-canvas.hidden { display: none; }

.warp-morph-workspace {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}
.warp-morph-workspace.hidden { display: none; }
.warp-morph-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.warp-morph-pane h4 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: #9a9a9a;
}
.warp-morph-canvas-wrap {
  position: relative;
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 8px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.warp-morph-canvas-wrap canvas { max-width: 100%; max-height: 320px; display: block; }
.warp-morph-b-list {
  max-height: 140px;
  overflow-y: auto;
}
#warp-morph-blend-label { font-size: 0.78rem; color: #9a9a9a; min-width: 2.5rem; }
#warp-morph-status { font-size: 0.8rem; color: #9a9a9a; }
#image-editor-status { font-size: 0.8rem; color: #9a9a9a; }
input[type="range"]#slider-brightness,
input[type="range"]#slider-contrast,
input[type="range"]#slider-saturation {
  width: 120px;
}

.audio-waveform-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 8px;
  margin-bottom: 1rem;
  cursor: pointer;
}
.audio-waveform-scroll.hidden { display: none; }
.audio-waveform-canvas { display: block; height: 160px; }
.audio-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: #ff6b6b;
  pointer-events: none;
  z-index: 3;
}
.audio-trim-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  pointer-events: none;
  z-index: 2;
}
.audio-trim-marker-in { background: #4caf50; }
.audio-trim-marker-out { background: #ffa726; }
.audio-trim-shade {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 1;
}
#audio-zoom-label { font-size: 0.8rem; color: #9a9a9a; min-width: 5rem; text-align: center; }
#audio-trim-label { font-size: 0.8rem; color: #9a9a9a; }
#cutting-zoom-label { font-size: 0.8rem; color: #9a9a9a; min-width: 5rem; text-align: center; }

.image-editor-toolbar-group.hidden { display: none; }

.image-filter-group { flex-wrap: wrap; row-gap: 0.5rem; }

.dimension-input {
  width: 64px;
  background: #14171c;
  border: 1px solid #2a2f38;
  color: #f2f2f2;
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
}

.canvas-anchor-grid {
  display: grid;
  grid-template-columns: repeat(3, 16px);
  grid-template-rows: repeat(3, 16px);
  gap: 3px;
}
.anchor-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid #2a2f38;
  border-radius: 3px;
  background: #14171c;
  cursor: pointer;
}
.anchor-btn:hover { border-color: #5b8def; }
.anchor-btn.active { background: #5b8def; border-color: #5b8def; }

.image-draw-subtool-btn {
  background: transparent;
  border: 1px solid #2a2f38;
  color: #9a9a9a;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.image-draw-subtool-btn:hover { color: #f2f2f2; }
.image-draw-subtool-btn.active { background: #1c2027; border-color: #5b8def; color: #f2f2f2; }

.crop-preset-btn {
  border: 1px solid #2a2f38;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
}
.crop-preset-btn.active { background: #1c2027; border-color: #5b8def; color: #f2f2f2; }

#draw-freehand-size-label, #draw-text-size-label, #draw-text-rotation-label {
  font-size: 0.78rem;
  color: #9a9a9a;
  min-width: 2.5rem;
}
#draw-text-input {
  background: #14171c;
  border: 1px solid #2a2f38;
  color: #f2f2f2;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.82rem;
  width: 220px;
}

.capture-mode-toolbar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.capture-mode-btn {
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 6px;
  color: #9a9a9a;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.capture-mode-btn.active { border-color: #5b8def; color: #f2f2f2; }

.capture-stage {
  position: relative;
  min-height: 420px;
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.capture-preview { max-width: 100%; max-height: 420px; }
.capture-preview.hidden { display: none; }
.capture-audio-result.hidden { display: none; }
.capture-audio-result { display: flex; align-items: center; justify-content: center; width: 100%; padding: 2rem; }

.capture-meter {
  width: 60%;
  height: 12px;
  background: #0b0d10;
  border: 1px solid #22262e;
  border-radius: 6px;
  overflow: hidden;
}
.capture-meter.hidden { display: none; }
.capture-meter-fill {
  height: 100%;
  width: 0%;
  background: #5b8def;
  transition: width 0.1s ease;
}

.capture-controls { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
#capture-timer { font-size: 0.85rem; color: #9a9a9a; font-variant-numeric: tabular-nums; }

.transcript-search-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
#transcript-search-input {
  flex: 1;
  max-width: 420px;
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 6px;
  color: #f2f2f2;
  padding: 0.5rem 0.75rem;
  font: inherit;
}
#transcript-search-input:focus { outline: none; border-color: #5b8def; }
#transcript-search-results.hidden { display: none; }
.transcript-search-result {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
}
.transcript-search-result:hover { border-color: #5b8def; }
.transcript-search-result .result-name { font-size: 0.82rem; color: #f2f2f2; }
.transcript-search-result .result-snippet { font-size: 0.78rem; color: #9a9a9a; }

#transcript-preview-audio.hidden { display: none; }
#transcript-preview-audio { width: 100%; margin-bottom: 0.75rem; }

.transcript-segments {
  max-height: 320px;
  overflow-y: auto;
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 8px;
  padding: 0.5rem;
  margin-top: 0.75rem;
}
.transcript-segments.hidden { display: none; }
.transcript-segment {
  display: flex;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.transcript-segment:hover { background: #1c2027; }
.transcript-segment-time { color: #5b8def; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.transcript-segment-text { color: #d0d0d0; }
#transcript-status { font-size: 0.8rem; color: #9a9a9a; }

/* Export Video */
.export-workspace.hidden { display: none; }
.export-project-summary { color: #9a9a9a; font-size: 0.9rem; margin: 0 0 1rem; }
.export-actions { display: flex; align-items: center; gap: 1rem; }
.export-format-label { font-size: 0.8rem; color: #9a9a9a; }

.export-mode-toolbar { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.export-mode-btn {
  background: #14171c;
  border: 1px solid #22262e;
  border-radius: 6px;
  color: #9a9a9a;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.export-mode-btn.active { border-color: #5b8def; color: #f2f2f2; }
#export-mode-panel-image.hidden { display: none; }
#export-status { font-size: 0.85rem; color: #9a9a9a; }
.export-result { margin-top: 1rem; }
.export-result.hidden { display: none; }
.export-result p { color: #6fcf97; margin: 0 0 0.5rem; }
