.video-clip {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 84px;
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.video-preview {
  min-height: 124px;
  border-radius: 8px;
  background: #111827;
  overflow: hidden;
}

.video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 124px;
  color: #ffffff;
  font-weight: 800;
}

.clip-fields {
  display: grid;
  grid-template-rows: 36px minmax(78px, 1fr);
  gap: 10px;
}

.clip-fields textarea {
  width: 100%;
  resize: vertical;
  padding: 8px 10px;
}

.clip-actions {
  display: grid;
  grid-template-columns: 36px 36px;
  gap: 6px;
  align-content: start;
}

.export-output {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: #f9fafb;
  overflow: auto;
}


  .video-clip {
    grid-template-columns: 1fr;
  }

  .clip-actions {
    grid-template-columns: 36px 36px;
  }

/* Full video editor styles */
.hero,
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
}

h1 {
  font-size: 44px;
}

h2 {
  font-size: 20px;
}

p {
  margin: 8px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.carousel-shell {
  display: grid;
  gap: 16px;
}

.carousel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.carousel-head h2,
.carousel-head p {
  margin: 0;
}

.carousel-controls {
  display: flex;
  gap: 10px;
}

.carousel-controls .icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 28, 37, 0.92);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--shadow);
}

.carousel-controls .icon-button:hover {
  border-color: rgba(37, 244, 238, 0.58);
  color: var(--accent);
}

.blocks {
  display: grid;
  grid-auto-columns: clamp(340px, 58vw, 760px);
  grid-auto-flow: column;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 4px 18px;
  scroll-padding-inline: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.08);
}

.admin-list {
  display: grid;
  gap: 16px;
}

.block-card,
.panel,
.admin-block,
.login-panel,
.notice,
.empty {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(22, 30, 46, 0.14);
}

.block-card {
  position: relative;
  min-height: 365px;
  background:
    linear-gradient(135deg, rgba(37, 244, 238, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(254, 44, 85, 0.1), transparent 30%),
    var(--panel);
  scroll-snap-align: start;
}

.block-card::after {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot));
  content: "";
  opacity: 0.58;
}

.block-card,
.panel,
.admin-block,
.login-panel,
.notice,
.empty {
  padding: 18px;
}

.block-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.block-head h2 {
  font-size: 26px;
}

.badge {
  align-self: flex-start;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge.required {
  color: #061115;
  background: var(--accent);
}

.badge.optional {
  color: #ffffff;
  background: var(--accent-hot);
}

.upload-form,
.button-row,
.generate-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-form {
  margin-bottom: 16px;
  min-height: 128px;
  padding: 18px;
  border: 1px dashed rgba(154, 166, 181, 0.46);
  border-radius: 8px;
  background: rgba(5, 7, 10, 0.44);
}

input[type="file"] {
  max-width: 320px;
  color: var(--muted);
}

input[type="file"]::file-selector-button {
  min-height: 36px;
  margin-right: 10px;
  padding: 7px 12px;
  border: 1px solid rgba(37, 244, 238, 0.36);
  border-radius: 6px;
  background: rgba(37, 244, 238, 0.1);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

input,
textarea,
button {
  font: inherit;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #090d13;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: #cfd7e3;
  font-size: 14px;
  font-weight: 650;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: rgba(37, 244, 238, 0.08);
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button.primary,
.button.success {
  border-color: transparent;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot));
  color: #051015;
  box-shadow: 0 16px 34px rgba(37, 244, 238, 0.18);
}

.button.primary:hover,
.button.success:hover {
  background: var(--accent-strong);
}

.button.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.button.danger {
  border-color: #f2b8b5;
  color: var(--danger);
}

.editor {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) 1fr;
  gap: 18px;
  align-items: start;
}

.preview-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 560px;
  background: #030406;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #202735;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.preview-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.crop-box {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 2px solid #23d3ee;
  background: rgba(35, 211, 238, 0.08);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.32);
  cursor: move;
}

.edit-form,
.stack {
  display: grid;
  gap: 14px;
}

.control-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.generate-bar {
  position: static;
  bottom: auto;
  justify-content: flex-end;
  margin-top: 18px;
  padding: 14px;
  background: rgba(5, 7, 10, 0.88);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}


/* Stitch video editor redesign */
body.video-route {
  --video-bg: #131313;
  --video-surface-lowest: #0e0e0e;
  --video-surface-low: #1c1b1b;
  --video-surface: #201f1f;
  --video-surface-high: #2a2a2a;
  --video-surface-highest: #353534;
  --video-outline: #8c909f;
  --video-outline-variant: #424754;
  --video-on-surface: #e5e2e1;
  --video-on-surface-variant: #c2c6d6;
  --video-primary: #adc6ff;
  --video-primary-container: #4d8eff;
  --video-secondary: #4edea3;
  --video-secondary-container: #00a572;
  --video-tertiary: #ffb95f;
  --video-error: #ffb4ab;
  background: var(--video-bg);
  color: var(--video-on-surface);
  font-family: Geist, Inter, ui-sans-serif, system-ui, sans-serif;
}

body.video-route .site-footer {
  display: none;
}

body.video-route .page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.video-editor-shell {
  --video-timeline-footer-height: 320px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--video-timeline-footer-height, 320px);
  height: calc(100vh - var(--topbar-height, 65px));
  min-height: calc(100vh - var(--topbar-height, 65px));
  overflow: hidden;
  background: var(--video-bg);
  color: var(--video-on-surface);
}

.video-editor-shell h2,
.video-editor-shell p {
  margin: 0;
}

.video-editor-main {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--video-outline-variant);
}

.media-library-panel,
.inspector-panel,
.preview-panel {
  min-width: 0;
  min-height: 0;
}

.media-library-panel,
.inspector-panel {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  background: var(--video-surface-lowest);
}

.preview-panel {
  grid-column: 2;
  grid-row: 1;
}

.media-library-panel {
  border-right: 1px solid var(--video-outline-variant);
}

.inspector-panel {
  border-right: 1px solid var(--video-outline-variant);
  border-left: 0;
  gap: 16px;
  overflow-y: auto;
  padding: 16px;
  scrollbar-color: var(--video-outline-variant) var(--video-surface);
}

.library-tabs {
  display: flex;
  min-height: 40px;
  border-bottom: 1px solid var(--video-outline-variant);
  background: var(--video-surface-low);
}

.library-tab {
  display: inline-flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--video-on-surface-variant);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.library-tab {
  margin: 8px 0 8px 8px;
  padding: 0 10px;
}

.library-tab.active {
  background: var(--video-surface-highest);
  color: var(--video-on-surface);
}

.library-content {
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  scrollbar-color: var(--video-outline-variant) var(--video-surface);
}

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

.video-editor-shell .upload-form.media-upload-form {
  display: grid;
  min-height: 0;
  margin: 0;
  padding: 0;
  gap: 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.media-card {
  min-width: 0;
}

.media-source-card {
  position: relative;
  display: grid;
  gap: 7px;
}

.media-library-controls {
  margin-bottom: 12px;
}

.media-import-form {
  display: grid;
  gap: 8px;
}

.media-import-picker {
  position: relative;
  display: inline-flex;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  border: 1px dashed var(--video-outline-variant);
  border-radius: 4px;
  padding: 0 10px;
  color: var(--video-on-surface-variant);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
}

.media-import-picker:hover,
.media-import-picker:focus-within {
  border-color: var(--video-primary);
  background: var(--video-primary-soft);
  color: var(--video-primary);
}

.media-import-picker .material-symbols-outlined {
  font-size: 16px;
}

.media-file-label {
  position: relative;
  display: grid;
  gap: 6px;
  color: var(--video-on-surface);
  cursor: pointer;
}

.media-file-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  cursor: pointer;
}

.media-thumb,
.media-placeholder-tile {
  position: relative;
  isolation: isolate;
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--video-surface-highest);
}

.media-file-label:hover .media-thumb,
.media-placeholder-tile:hover {
  border-color: var(--video-outline-variant);
}

.media-thumb video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  opacity: 0.74;
}

.media-audio-thumb {
  gap: 8px;
  padding: 10px;
}

.media-audio-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 4px;
  background: rgb(255 255 255 / 0.08);
  color: var(--video-on-surface);
  font-size: 18px;
}

.media-audio-waveform {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(86%, 120px);
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  gap: 3px;
}

.media-audio-waveform span {
  display: block;
  height: 18px;
  border-radius: 999px;
  background: var(--video-primary);
  opacity: 0.72;
}

.media-audio-waveform span:nth-child(2n) {
  height: 28px;
}

.media-audio-waveform span:nth-child(3n) {
  height: 12px;
}

.media-tile-icon,
.media-placeholder-tile .material-symbols-outlined {
  color: var(--video-outline-variant);
  font-size: 20px;
}

.media-tile-icon-overlay {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  color: rgb(229 226 225 / 0.82);
}

.media-duration {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 3;
  border-radius: 3px;
  padding: 1px 4px;
  background: rgb(0 0 0 / 0.68);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
}

.media-title {
  min-width: 0;
  overflow: hidden;
  color: var(--video-on-surface);
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.media-add-button {
  display: inline-flex;
  min-width: 0;
  min-height: 28px;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow: hidden;
  border: 1px solid var(--video-outline-variant);
  border-radius: 4px;
  background: var(--video-surface-low);
  color: var(--video-on-surface-variant);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  line-height: 14px;
}

.media-add-button:hover,
.media-add-button:focus-visible {
  border-color: var(--video-primary);
  background: var(--video-primary-soft);
  color: var(--video-primary);
  outline: 0;
}

.media-add-button .material-symbols-outlined {
  flex: 0 0 auto;
  font-size: 15px;
}

.media-add-button span:not(.material-symbols-outlined) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-editor-shell .badge {
  width: fit-content;
  border: 1px solid var(--video-outline-variant);
  border-radius: 999px;
  padding: 2px 6px;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
}

.video-editor-shell .badge.required {
  border-color: rgb(255 180 171 / 0.52);
  background: rgb(255 180 171 / 0.12);
  color: var(--video-error);
}

.video-editor-shell .badge.optional {
  border-color: rgb(78 222 163 / 0.42);
  background: rgb(78 222 163 / 0.1);
  color: var(--video-secondary);
}

.media-admin-link,
.video-editor-shell .button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
  text-decoration: none;
}

.media-admin-link:hover {
  border-color: var(--video-primary);
  background: rgb(173 198 255 / 0.08);
  color: var(--video-primary);
}

.media-admin-link .material-symbols-outlined {
  font-size: 16px;
}

.media-empty-copy {
  margin-top: 12px;
  color: var(--video-on-surface-variant);
  font-size: 12px;
  line-height: 18px;
}

.media-admin-link {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--video-outline-variant);
  background: transparent;
  color: var(--video-on-surface-variant);
}

.preview-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  background: var(--video-surface-lowest);
}

.preview-window {
  position: relative;
  isolation: isolate;
  display: grid;
  align-self: stretch;
  justify-self: stretch;
  min-height: 0;
  margin: 16px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--video-outline-variant);
  border-radius: 8px;
  background: #000000;
}

.preview-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  place-items: center;
  color: rgb(194 198 214 / 0.52);
  font-family: Geist, monospace;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.preview-placeholder .material-symbols-outlined {
  font-size: 40px;
}

.preview-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.preview-panel:fullscreen {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100vw;
  height: 100vh;
  background: #000000;
}

.preview-panel:-webkit-full-screen {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100vw;
  height: 100vh;
  background: #000000;
}

.preview-panel:fullscreen .preview-window,
.preview-panel:-webkit-full-screen .preview-window {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #000000;
}

.preview-panel:fullscreen .transport-bar,
.preview-panel:-webkit-full-screen .transport-bar {
  border-top-color: rgb(255 255 255 / 0.16);
  background: rgb(0 0 0 / 0.9);
}

.preview-panel:fullscreen .transport-timecode,
.preview-panel:fullscreen .transport-progress-duration,
.preview-panel:-webkit-full-screen .transport-timecode,
.preview-panel:-webkit-full-screen .transport-progress-duration {
  color: rgb(255 255 255 / 0.72);
}

.preview-clip-label {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  max-width: calc(100% - 24px);
  overflow: hidden;
  border: 1px solid rgb(66 71 84 / 0.78);
  border-radius: 4px;
  padding: 4px 8px;
  background: rgb(0 0 0 / 0.52);
  color: var(--video-on-surface);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-subtitle-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.preview-tier-block-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.preview-tier-block {
  position: absolute;
  box-sizing: border-box;
  display: grid;
  min-width: 12%;
  min-height: 10%;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: calc(4px * var(--preview-subtitle-scale, 1));
  background: transparent;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.preview-tier-block.is-dragging {
  cursor: grabbing;
}

.preview-tier-block:hover,
.preview-tier-block:focus-visible,
.preview-tier-block.is-active {
  border-color: #006c49;
  outline: none;
}

.mini-tier-board {
  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-auto-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: var(--mini-tier-board-border-width, 1px) solid var(--mini-tier-board-border-color, #e0e3e5);
  border-radius: var(--mini-tier-board-border-radius, 12px);
  background: transparent;
}

.mini-tier-board-row {
  position: relative;
  display: grid;
  min-height: 0;
  grid-template-columns: var(--mini-tier-board-label-size, var(--mini-tier-board-label-width, max(20px, 14%))) minmax(0, 1fr);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--mini-tier-row-tile-background, #ffffff);
}

.mini-tier-board-row:first-child {
  border-radius: var(--mini-tier-board-inner-radius, 12px) var(--mini-tier-board-inner-radius, 12px) 0 0;
}

.mini-tier-board-row:last-child {
  border-radius: 0 0 var(--mini-tier-board-inner-radius, 12px) var(--mini-tier-board-inner-radius, 12px);
}

.mini-tier-board-row:only-child {
  border-radius: var(--mini-tier-board-inner-radius, 12px);
}

.mini-tier-board-row + .mini-tier-board-row::before {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 1px;
  background: var(--mini-tier-board-separator-color, #e0e3e5);
  content: "";
  pointer-events: none;
}

.mini-tier-board-label {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  background: var(--mini-tier-row-label-color, #c0c1ff);
  color: #111827;
  font-size: var(--mini-tier-board-label-font-size, clamp(9px, calc(13px * var(--preview-subtitle-scale, 1)), 96px));
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.mini-tier-board-items {
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  gap: calc(3px * var(--preview-subtitle-scale, 1));
  overflow: hidden;
  background: var(--mini-tier-row-tile-background, #ffffff);
  padding: calc(2px * var(--preview-subtitle-scale, 1));
}

.mini-tier-board-tile {
  flex: 0 1 auto;
  aspect-ratio: 1 / 1;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: calc(2px * var(--preview-subtitle-scale, 1));
  background: rgb(17 24 39 / 0.12);
}

.mini-tier-board-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-tier-block-resize-handle {
  position: absolute;
  z-index: 2;
  width: 12px;
  height: 12px;
  border: 1px solid #006c49;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.preview-tier-block-resize-n,
.preview-tier-block-resize-s {
  cursor: ns-resize;
}

.preview-tier-block-resize-e,
.preview-tier-block-resize-w {
  cursor: ew-resize;
}

.preview-tier-block-resize-n {
  top: -6px;
  left: calc(50% - 6px);
}

.preview-tier-block-resize-e {
  top: calc(50% - 6px);
  right: -6px;
}

.preview-tier-block-resize-s {
  bottom: -6px;
  left: calc(50% - 6px);
}

.preview-tier-block-resize-w {
  top: calc(50% - 6px);
  left: -6px;
}

.preview-tier-block-resize-ne,
.preview-tier-block-resize-sw {
  cursor: nesw-resize;
}

.preview-tier-block-resize-se,
.preview-tier-block-resize-nw {
  cursor: nwse-resize;
}

.preview-tier-block-resize-ne {
  top: -6px;
  right: -6px;
}

.preview-tier-block-resize-se {
  right: -6px;
  bottom: -6px;
}

.preview-tier-block-resize-sw {
  bottom: -6px;
  left: -6px;
}

.preview-tier-block-resize-nw {
  top: -6px;
  left: -6px;
}

.preview-tier-block:hover .preview-tier-block-resize-handle,
.preview-tier-block:focus-visible .preview-tier-block-resize-handle,
.preview-tier-block.is-active .preview-tier-block-resize-handle {
  opacity: 1;
  pointer-events: auto;
}

.preview-subtitle-caption {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 58%;
  min-height: 3%;
  overflow-wrap: anywhere;
  border: 1px solid transparent;
  border-radius: calc(4px * var(--preview-subtitle-scale, 1));
  padding:
    calc(8px * var(--preview-subtitle-scale, 1))
    calc(16px * var(--preview-subtitle-scale, 1));
  cursor: grab;
  font-size: calc(var(--preview-subtitle-size, 24px) * var(--preview-subtitle-scale, 1));
  font-weight: 700;
  line-height: 1.25;
  pointer-events: auto;
  text-align: center;
  touch-action: none;
  transition: border-color 0.2s ease;
  user-select: none;
  white-space: pre-wrap;
}

.preview-subtitle-caption.is-dragging {
  cursor: grabbing;
}

.preview-subtitle-text {
  width: 100%;
  pointer-events: none;
}

.preview-subtitle-resize-handle {
  position: absolute;
  z-index: 2;
  width: 12px;
  height: 12px;
  border: 1px solid #006c49;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.preview-subtitle-resize-n,
.preview-subtitle-resize-s {
  cursor: ns-resize;
}

.preview-subtitle-resize-e,
.preview-subtitle-resize-w {
  cursor: ew-resize;
}

.preview-subtitle-resize-n {
  top: -6px;
  left: calc(50% - 6px);
}

.preview-subtitle-resize-e {
  top: calc(50% - 6px);
  right: -6px;
}

.preview-subtitle-resize-s {
  bottom: -6px;
  left: calc(50% - 6px);
}

.preview-subtitle-resize-w {
  top: calc(50% - 6px);
  left: -6px;
}

.preview-subtitle-resize-ne,
.preview-subtitle-resize-sw {
  cursor: nesw-resize;
}

.preview-subtitle-resize-se,
.preview-subtitle-resize-nw {
  cursor: nwse-resize;
}

.preview-subtitle-resize-ne {
  top: -6px;
  right: -6px;
}

.preview-subtitle-resize-se {
  right: -6px;
  bottom: -6px;
}

.preview-subtitle-resize-sw {
  bottom: -6px;
  left: -6px;
}

.preview-subtitle-resize-nw {
  top: -6px;
  left: -6px;
}

.preview-subtitle-caption:hover,
.preview-subtitle-caption:focus-visible,
.preview-subtitle-caption.is-selected,
.preview-subtitle-caption.is-active {
  border-color: #006c49;
  outline: none;
}

.preview-subtitle-caption:hover .preview-subtitle-resize-handle,
.preview-subtitle-caption:focus-visible .preview-subtitle-resize-handle,
.preview-subtitle-caption.is-selected .preview-subtitle-resize-handle,
.preview-subtitle-caption.is-active .preview-subtitle-resize-handle {
  opacity: 1;
  pointer-events: auto;
}

.transport-bar {
  display: grid;
  grid-template-areas: "time controls progress secondary";
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 0 24px;
  border-top: 1px solid var(--video-outline-variant);
  background: var(--video-surface);
}

.transport-timecode {
  grid-area: time;
  min-width: 72px;
  color: var(--video-on-surface-variant);
  font-family: Geist, monospace;
  font-size: 13px;
}

.transport-controls,
.transport-secondary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.transport-controls {
  grid-area: controls;
  justify-content: center;
}

.transport-secondary {
  grid-area: secondary;
  justify-content: flex-end;
}

.transport-progress {
  grid-area: progress;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.transport-progress-input {
  width: 100%;
  min-width: 0;
  accent-color: var(--video-primary);
}

.transport-progress-input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.transport-progress-duration {
  min-width: 72px;
  color: var(--video-on-surface-variant);
  font-family: Geist, monospace;
  font-size: 13px;
  text-align: right;
}

.transport-volume {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.transport-volume input[type="range"] {
  display: block;
  width: 288px;
}

.transport-button {
  display: inline-grid;
  width: 28px;
  min-height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--video-on-surface-variant);
}

.transport-button:hover {
  background: var(--video-surface-high);
  color: var(--video-on-surface);
}

.transport-play {
  width: 40px;
  min-height: 40px;
  background: var(--video-primary);
  color: #001a42;
}

.transport-play:hover {
  background: var(--video-primary-container);
}

.inspector-adjustments {
  display: grid;
  gap: 14px;
}

.inspector-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inspector-section-title h2 {
  color: var(--video-on-surface-variant);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
}

.inspector-section-title .material-symbols-outlined {
  color: var(--video-on-surface-variant);
  font-size: 16px;
}

.inspector-title-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}

.inspector-title-action {
  display: inline-grid;
  width: 28px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--video-on-surface-variant);
  cursor: pointer;
}

.inspector-title-action:hover,
.inspector-title-action:focus-visible {
  border-color: var(--video-outline-variant);
  background: var(--video-surface-low);
  color: var(--video-on-surface);
  outline: 0;
}

.inspector-title-action.danger {
  color: var(--video-error);
}

.inspector-title-action.danger:hover,
.inspector-title-action.danger:focus-visible {
  border-color: rgb(186 26 26 / 0.34);
  background: rgb(252 124 120 / 0.14);
  color: var(--video-error);
}

.inspector-section-title .inspector-title-action .material-symbols-outlined {
  color: currentColor;
  font-size: 18px;
}

.video-editor-shell label {
  display: grid;
  gap: 5px;
  color: var(--video-on-surface);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
}

.video-editor-shell select,
.video-editor-shell input[type="number"],
.video-editor-shell input[type="text"],
.video-editor-shell input[type="range"] {
  width: 100%;
}

.video-editor-shell select,
.video-editor-shell input[type="number"],
.video-editor-shell input[type="text"] {
  min-height: 32px;
  border: 1px solid var(--video-outline-variant);
  border-radius: 4px;
  background: var(--video-surface-highest);
  color: var(--video-on-surface);
  font-size: 12px;
}

.video-editor-shell input[type="range"] {
  accent-color: var(--video-primary-container);
}

.video-editor-shell .button.primary {
  min-height: 36px;
  border-color: var(--video-primary-container);
  background: var(--video-primary-container);
  color: #001a42;
  box-shadow: none;
}

.video-editor-shell .button.primary:hover {
  background: var(--video-primary);
}

.inspector-empty {
  border: 1px dashed var(--video-outline-variant);
  border-radius: 6px;
  padding: 10px;
  color: var(--video-on-surface-variant);
  font-size: 12px;
  line-height: 18px;
}

.inspector-editor-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--video-outline-variant);
  border-radius: 6px;
  padding: 10px;
  background: var(--video-surface-low);
}

.inspector-editor-card header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--video-on-surface);
  font-size: 12px;
}

.inspector-editor-card header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-editor-card header span {
  color: var(--video-on-surface-variant);
  font-family: Geist, monospace;
  font-size: 11px;
}

.video-editor-shell .editor.inspector-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.video-editor-shell .preview-wrap.inspector-preview-wrap {
  max-height: none;
  aspect-ratio: 16 / 9;
  border-color: var(--video-outline-variant);
  border-radius: 5px;
  background: #000000;
}

.video-editor-shell .inspector-preview-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-editor-shell .crop-box {
  border-color: var(--video-primary);
  background: rgb(173 198 255 / 0.08);
}

.video-editor-shell .control-grid,
.video-editor-shell .control-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.video-editor-shell .edit-form {
  display: grid;
  gap: 10px;
}

.video-editor-shell .button.secondary {
  border-color: var(--video-outline-variant);
  background: transparent;
  color: var(--video-on-surface);
}

.video-editor-shell .button.secondary:hover {
  border-color: var(--video-primary);
  color: var(--video-primary);
}


/* Stitch video editor light theme */
body.video-route {
  --video-bg: #f7f9fb;
  --video-surface-lowest: #ffffff;
  --video-surface-low: #f2f4f6;
  --video-surface: #f7f9fb;
  --video-surface-high: #eceef0;
  --video-surface-highest: #e0e3e5;
  --video-outline: #6c7a71;
  --video-outline-variant: #bbcabf;
  --video-hairline: #e0e3e5;
  --video-on-surface: #191c1e;
  --video-on-surface-variant: #3c4a42;
  --video-muted: #6c7a71;
  --video-primary: #006c49;
  --video-primary-container: #10b981;
  --video-primary-soft: #dff8ec;
  --video-secondary: #4648d4;
  --video-secondary-container: #c0c1ff;
  --video-secondary-soft: #e1e0ff;
  --video-tertiary: #a43a3a;
  --video-tertiary-container: #fc7c78;
  --video-tertiary-soft: #ffdad7;
  --video-error: #ba1a1a;
  overflow: hidden;
  background: var(--video-bg);
  color: var(--video-on-surface);
  font-family: Inter, Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.video-route .site-footer {
  display: none;
}

body.video-route .page {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - var(--topbar-height, 65px));
  margin: 0;
  padding: 0;
}

.video-editor-shell {
  --video-timeline-footer-height: 320px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--video-timeline-footer-height, 320px);
  height: calc(100vh - var(--topbar-height, 65px));
  min-height: calc(100vh - var(--topbar-height, 65px));
  overflow: hidden;
  border: 0;
  background: var(--video-bg);
  color: var(--video-on-surface);
  font-family: Inter, Geist, ui-sans-serif, system-ui, sans-serif;
}

.video-editor-shell h2,
.video-editor-shell p {
  margin: 0;
}

.video-editor-main {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--video-outline-variant);
  background: var(--video-surface-lowest);
}

.media-library-panel,
.inspector-panel,
.preview-panel {
  min-width: 0;
  min-height: 0;
}

.media-library-panel,
.inspector-panel {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  background: var(--video-surface-lowest);
}

.preview-panel {
  grid-column: 2;
  grid-row: 1;
}

.media-library-panel {
  border-right: 1px solid var(--video-outline-variant);
}

.inspector-panel {
  border-right: 1px solid var(--video-outline-variant);
  border-left: 0;
  gap: 16px;
  overflow-y: auto;
  padding: 16px;
  scrollbar-color: var(--video-outline-variant) var(--video-surface-low);
}

.library-tabs {
  display: flex;
  min-height: 40px;
  border-bottom: 1px solid var(--video-outline-variant);
  background: var(--video-surface-low);
}

.library-tabs {
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
}

.library-tab {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--video-on-surface-variant);
  font-family: Geist, Inter, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  box-shadow: none;
}

.library-tab {
  padding: 0 12px;
}

.library-tab:hover,
.library-tab.active,
.library-tab[aria-selected="true"] {
  background: var(--video-surface-highest);
  color: var(--video-on-surface);
}

.library-content {
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  scrollbar-color: var(--video-outline-variant) var(--video-surface-low);
}

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

.media-empty-state,
.library-empty-state {
  display: grid;
  min-height: 140px;
  place-items: center;
  border: 1px dashed var(--video-outline-variant);
  border-radius: 6px;
  padding: 16px;
  color: var(--video-muted);
  text-align: center;
}

.library-empty-state {
  align-content: center;
  gap: 8px;
  font-size: 12px;
  line-height: 18px;
}

.library-empty-state .material-symbols-outlined {
  color: var(--video-outline);
  font-size: 24px;
}

.library-empty-state strong {
  color: var(--video-on-surface);
  font-size: 12px;
  font-weight: 650;
}

.media-empty-import {
  min-width: 116px;
}

.media-library-controls {
  display: grid;
  margin-bottom: 12px;
  gap: 8px;
}

.media-import-form {
  display: block;
  margin: 0;
}

.media-import-picker {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 42px;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--video-outline-variant);
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--video-surface-low);
  color: var(--video-on-surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
  box-shadow: inset 0 -1px 0 rgb(0 0 0 / 0.04);
}

.media-import-picker::after {
  content: "add";
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--video-primary);
  font-family: "Material Symbols Outlined";
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.media-import-picker:hover,
.media-import-picker:focus-within {
  border-color: var(--video-primary);
  background: var(--video-primary-soft);
  color: var(--video-on-surface);
}

.media-import-picker:focus-within {
  outline: 2px solid var(--video-primary);
  outline-offset: 2px;
}

.media-import-picker .material-symbols-outlined {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 4px;
  background: rgb(0 108 73 / 0.12);
  color: var(--video-primary);
  font-size: 18px;
}

.media-import-picker span:not(.material-symbols-outlined) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-editor-shell .upload-form.media-upload-form {
  display: grid;
  min-height: 0;
  margin: 0;
  padding: 0;
  gap: 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.media-card {
  min-width: 0;
}

.media-file-label {
  position: relative;
  display: grid;
  gap: 6px;
  color: var(--video-on-surface);
  cursor: pointer;
}

.media-file-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  cursor: pointer;
}

.media-thumb,
.media-placeholder-tile {
  position: relative;
  isolation: isolate;
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--video-surface-highest);
}

.media-file-label:hover .media-thumb,
.media-file-label:focus-within .media-thumb,
.media-placeholder-tile:hover {
  border-color: var(--video-outline-variant);
}

.media-thumb video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.media-audio-thumb {
  gap: 8px;
  padding: 10px;
}

.media-audio-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 4px;
  background: rgb(255 255 255 / 0.08);
  color: var(--video-on-surface);
  font-size: 18px;
}

.media-audio-waveform {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(86%, 120px);
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  gap: 3px;
}

.media-audio-waveform span {
  display: block;
  height: 18px;
  border-radius: 999px;
  background: var(--video-primary);
  opacity: 0.72;
}

.media-audio-waveform span:nth-child(2n) {
  height: 28px;
}

.media-audio-waveform span:nth-child(3n) {
  height: 12px;
}

.media-tile-icon,
.media-placeholder-tile .material-symbols-outlined {
  color: var(--video-outline);
  font-size: 20px;
}

.media-tile-icon-overlay {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  color: rgb(255 255 255 / 0.86);
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.34));
}

.media-duration {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 3;
  border-radius: 3px;
  padding: 1px 4px;
  background: rgb(0 0 0 / 0.68);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
}

.media-title {
  min-width: 0;
  overflow: hidden;
  color: var(--video-on-surface);
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-editor-shell .badge {
  width: fit-content;
  border: 1px solid var(--video-outline-variant);
  border-radius: 999px;
  padding: 2px 6px;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
}

.video-editor-shell .badge.required {
  border-color: rgb(186 26 26 / 0.28);
  background: rgb(252 124 120 / 0.13);
  color: var(--video-error);
}

.video-editor-shell .badge.optional {
  border-color: rgb(0 108 73 / 0.32);
  background: var(--video-primary-soft);
  color: var(--video-primary);
}

.media-admin-link,
.video-editor-shell .button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
  text-decoration: none;
  box-shadow: none;
}

.media-admin-link:hover {
  border-color: var(--video-primary);
  background: var(--video-primary-soft);
  color: var(--video-primary);
}

.media-admin-link .material-symbols-outlined {
  font-size: 16px;
}

.media-empty-copy {
  margin-top: 12px;
  color: var(--video-muted);
  font-size: 12px;
  line-height: 18px;
}

.media-admin-link {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--video-outline-variant);
  background: transparent;
  color: var(--video-on-surface-variant);
}

.preview-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  background: var(--video-surface-lowest);
}

.preview-window {
  position: relative;
  isolation: isolate;
  display: grid;
  align-self: stretch;
  justify-self: stretch;
  min-height: 0;
  margin: 16px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--video-outline-variant);
  border-radius: 8px;
  background: #000000;
}

.preview-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  place-items: center;
  color: rgb(255 255 255 / 0.56);
  font-family: Geist, Inter, sans-serif;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.preview-placeholder .material-symbols-outlined {
  font-size: 40px;
}

.preview-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.preview-clip-label {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  max-width: calc(100% - 24px);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: 4px;
  padding: 4px 8px;
  background: rgb(0 0 0 / 0.52);
  color: #ffffff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transport-bar {
  display: grid;
  grid-template-areas: "time controls progress secondary";
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 0 24px;
  border-top: 1px solid var(--video-outline-variant);
  background: var(--video-surface);
}

.transport-timecode {
  grid-area: time;
  min-width: 72px;
  color: var(--video-on-surface-variant);
  font-family: Geist, ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.transport-controls,
.transport-secondary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.transport-controls {
  grid-area: controls;
  justify-content: center;
}

.transport-secondary {
  grid-area: secondary;
  justify-content: flex-end;
}

.transport-progress {
  grid-area: progress;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.transport-progress-input {
  width: 100%;
  min-width: 0;
  accent-color: var(--video-primary);
}

.transport-progress-input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.transport-progress-duration {
  min-width: 72px;
  color: var(--video-on-surface-variant);
  font-family: Geist, ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  text-align: right;
}

.transport-button {
  display: inline-grid;
  width: 28px;
  min-height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--video-on-surface-variant);
  box-shadow: none;
}

.video-editor-shell .timeline-tool.timeline-tool-labeled {
  display: inline-flex;
  width: auto;
  min-width: 58px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
}

.video-editor-shell .timeline-tool.timeline-tool-labeled span:not(.material-symbols-outlined) {
  font-size: 12px;
  line-height: 1;
}

.timeline-split-dropdown {
  position: relative;
  display: inline-flex;
}

.video-editor-shell .timeline-tool .timeline-tool-caret {
  margin-right: -4px;
  font-size: 16px;
}

.timeline-split-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: grid;
  min-width: 178px;
  overflow: hidden;
  border: 1px solid var(--video-outline-variant);
  border-radius: 6px;
  padding: 4px;
  background: var(--video-surface);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.18);
}

.timeline-split-menu[hidden] {
  display: none;
}

.timeline-split-menu button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 4px;
  padding: 7px 9px;
  background: transparent;
  color: var(--video-on-surface);
  font: inherit;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

.timeline-split-menu button:hover:not(:disabled),
.timeline-split-menu button:focus-visible {
  background: var(--video-surface-highest);
  outline: 0;
}

.timeline-split-menu button:disabled {
  color: rgb(60 74 66 / 0.38);
  cursor: not-allowed;
}

.transport-button:hover {
  background: var(--video-surface-highest);
  color: var(--video-on-surface);
}

.transport-button .material-symbols-outlined {
  font-size: 20px;
}

.transport-play {
  width: 40px;
  min-height: 40px;
  background: var(--video-primary);
  color: #ffffff;
}

.transport-play:hover {
  background: var(--video-primary-container);
  color: var(--video-on-surface);
}

.inspector-adjustments {
  display: grid;
  gap: 14px;
}

.inspector-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inspector-section-title h2 {
  color: var(--video-on-surface-variant);
  font-family: Geist, Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
}

.inspector-section-title .material-symbols-outlined {
  color: var(--video-on-surface-variant);
  font-size: 16px;
}

.video-editor-shell label {
  display: grid;
  gap: 5px;
  color: var(--video-on-surface);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
}

.video-editor-shell select,
.video-editor-shell input[type="number"],
.video-editor-shell input[type="text"],
.video-editor-shell input[type="range"] {
  width: 100%;
}

.video-editor-shell select,
.video-editor-shell input[type="number"],
.video-editor-shell input[type="text"] {
  min-height: 32px;
  border: 1px solid var(--video-outline-variant);
  border-radius: 4px;
  background: var(--video-surface-highest);
  color: var(--video-on-surface);
  font-size: 12px;
}

.video-editor-shell select:focus,
.video-editor-shell input[type="number"]:focus,
.video-editor-shell input[type="text"]:focus {
  border-color: var(--video-primary);
  outline: 2px solid rgb(0 108 73 / 0.16);
  outline-offset: 0;
}

.video-editor-shell input[type="range"] {
  accent-color: var(--video-primary);
}

.video-editor-shell .timeline-zoom-controls input[type="range"] {
  flex: 0 0 132px;
  width: 132px;
}

.video-editor-shell .button.primary {
  min-height: 36px;
  border-color: var(--video-primary);
  background: var(--video-primary);
  color: #ffffff;
}

.video-editor-shell .button.primary:hover {
  border-color: var(--video-primary-container);
  background: var(--video-primary-container);
  color: var(--video-on-surface);
}

.inspector-empty {
  border: 1px dashed var(--video-outline-variant);
  border-radius: 6px;
  padding: 10px;
  color: var(--video-muted);
  font-size: 12px;
  line-height: 18px;
}

.inspector-editor-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--video-outline-variant);
  border-radius: 6px;
  padding: 10px;
  background: var(--video-surface-low);
}

.inspector-editor-card header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--video-on-surface);
  font-size: 12px;
}

.inspector-editor-card header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-editor-card header span {
  color: var(--video-muted);
  font-family: Geist, ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.inspector-editor-card.subtitle-inspector-card {
  gap: 12px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.subtitle-inspector-card .inspector-remove-button {
  min-height: 34px;
  border-color: rgb(186 26 26 / 0.28);
  border-radius: 6px;
  background: rgb(186 26 26 / 0.06);
  color: var(--video-error);
  box-shadow: none;
}

.subtitle-inspector-card .inspector-remove-button:hover,
.subtitle-inspector-card .inspector-remove-button:focus-visible {
  border-color: rgb(186 26 26 / 0.42);
  background: rgb(186 26 26 / 0.1);
  color: var(--video-error);
  outline: 0;
}

.video-editor-shell .editor.inspector-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.video-editor-shell .preview-wrap.inspector-preview-wrap {
  max-height: none;
  aspect-ratio: 16 / 9;
  border-color: var(--video-outline-variant);
  border-radius: 5px;
  background: #000000;
  box-shadow: none;
}

.video-editor-shell .inspector-preview-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-editor-shell .crop-box {
  border-color: var(--video-primary);
  background: rgb(16 185 129 / 0.08);
}

.video-editor-shell .control-grid,
.video-editor-shell .control-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.video-editor-shell .edit-form {
  display: grid;
  gap: 10px;
}

.video-editor-shell .button.secondary {
  border-color: var(--video-outline-variant);
  background: transparent;
  color: var(--video-on-surface);
}

.video-editor-shell .button.secondary:hover {
  border-color: var(--video-primary);
  background: var(--video-primary-soft);
  color: var(--video-primary);
}


.media-trash-button {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 4px;
  background: rgb(8 10 14 / 0.72);
  color: #ffffff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 140ms ease, transform 140ms ease, border-color 140ms ease, color 140ms ease;
}

.media-source-card:hover .media-trash-button,
.media-source-card:focus-within .media-trash-button,
.media-trash-button:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.media-trash-button:hover,
.media-trash-button:focus-visible {
  border-color: var(--video-error);
  color: var(--video-error);
  outline: 0;
}

.media-trash-button .material-symbols-outlined {
  font-size: 16px;
}

.mobile-editor-sheet-header,
.mobile-editor-nav,
.mobile-editor-backdrop {
  display: none;
}

@media (max-width: 760px) {
  body.video-route {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.video-route .page {
    min-width: 0;
    min-height: calc(100dvh - var(--topbar-height, 65px));
    overflow: hidden;
  }

  .video-editor-shell {
    --video-timeline-footer-height: clamp(292px, 38dvh, 340px);
    position: relative;
    isolation: isolate;
    grid-template-rows: minmax(0, 1fr) var(--video-timeline-footer-height);
    width: 100%;
    min-width: 0;
    height: calc(100dvh - var(--topbar-height, 65px));
    min-height: calc(100dvh - var(--topbar-height, 65px));
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .video-editor-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--video-outline-variant);
  }

  .preview-panel {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .preview-window {
    margin: 10px;
    border-radius: 6px;
  }

  .preview-placeholder .material-symbols-outlined {
    font-size: 34px;
  }

  .transport-bar {
    grid-template-areas:
      "progress progress progress"
      "time controls secondary";
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 52px;
    gap: 8px;
    padding: 8px 10px;
  }

  .transport-timecode {
    min-width: 72px;
    font-size: 12px;
    line-height: 16px;
  }

  .transport-controls,
  .transport-secondary {
    min-width: 0;
    gap: 8px;
  }

  .transport-progress {
    gap: 8px;
  }

  .transport-progress-duration {
    min-width: 62px;
    font-size: 12px;
    line-height: 16px;
  }

  .transport-volume input {
    width: min(160px, 24vw);
  }

  .mobile-editor-nav {
    display: grid;
    grid-row: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    padding: 8px 10px 10px;
    border-top: 1px solid var(--video-outline-variant);
    background: var(--video-surface-lowest);
  }

  .mobile-editor-nav-button {
    display: grid;
    min-width: 0;
    min-height: 44px;
    place-items: center;
    gap: 2px;
    border: 1px solid var(--video-outline-variant);
    border-radius: 6px;
    padding: 5px 4px;
    background: var(--video-surface-low);
    color: var(--video-on-surface-variant);
    cursor: pointer;
    font-family: Geist, Inter, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 14px;
  }

  .mobile-editor-nav-button:hover,
  .mobile-editor-nav-button:focus-visible,
  .mobile-editor-nav-button[aria-expanded="true"] {
    border-color: rgb(0 108 73 / 0.38);
    background: var(--video-primary-soft);
    color: var(--video-primary);
    outline: 0;
  }

  .mobile-editor-nav-button .material-symbols-outlined {
    font-size: 20px;
  }

  .mobile-editor-nav-button span:not(.material-symbols-outlined) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-editor-backdrop {
    position: fixed;
    inset: 0;
    z-index: 42;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    background: rgb(15 23 42 / 0.42);
  }

  .mobile-editor-backdrop[hidden] {
    display: none;
  }

  .mobile-editor-backdrop:not([hidden]) {
    display: block;
  }

  .media-library-panel,
  .inspector-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: flex;
    max-height: min(78dvh, calc(100dvh - var(--topbar-height, 65px) - 18px));
    min-height: min(320px, calc(100dvh - var(--topbar-height, 65px) - 18px));
    overflow: hidden;
    border: 1px solid var(--video-outline-variant);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: var(--video-surface-lowest);
    box-shadow: 0 -18px 44px rgb(15 23 42 / 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + env(safe-area-inset-bottom)));
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .media-library-panel.is-mobile-open,
  .inspector-panel.is-mobile-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .inspector-panel {
    gap: 14px;
    overflow-y: auto;
    padding: 0 14px calc(14px + env(safe-area-inset-bottom));
  }

  .mobile-editor-sheet-header {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--video-outline-variant);
    padding: 0 12px 0 16px;
    background: var(--video-surface-lowest);
  }

  .inspector-panel .mobile-editor-sheet-header {
    position: sticky;
    top: 0;
    z-index: 1;
    flex: 0 0 auto;
    margin: 0 -14px;
  }

  .mobile-editor-sheet-header h2 {
    color: var(--video-on-surface);
    font-family: Geist, Inter, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
  }

  .mobile-editor-close {
    display: inline-grid;
    width: 36px;
    height: 36px;
    min-height: 36px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--video-on-surface-variant);
    cursor: pointer;
  }

  .mobile-editor-close:hover,
  .mobile-editor-close:focus-visible {
    border-color: var(--video-outline-variant);
    background: var(--video-surface-low);
    color: var(--video-on-surface);
    outline: 0;
  }

  .mobile-editor-close .material-symbols-outlined {
    font-size: 20px;
  }

  .library-tabs {
    flex: 0 0 auto;
  }

  .library-content {
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

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

  .video-editor-shell .control-grid,
  .video-editor-shell .control-grid.two {
    grid-template-columns: 1fr;
  }

  .inspector-button-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .transport-volume input {
    width: 72px;
  }

  .transport-secondary {
    gap: 4px;
  }

  .media-grid {
    gap: 7px;
  }
}

.media-library-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--video-outline-variant);
  padding: 8px;
  background: var(--video-surface-low);
}

.media-library-header .library-tabs {
  flex: 1 1 auto;
  min-width: 0;
  border-bottom: 0;
  padding: 0;
  background: transparent;
}

.clear-project-button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0 8px;
  background: transparent;
  color: var(--video-error);
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
  white-space: nowrap;
  box-shadow: none;
}

.media-library-header .clear-project-button {
  flex: 0 0 auto;
}

.clear-project-button:hover,
.clear-project-button:focus-visible {
  border-color: rgb(186 26 26 / 0.28);
  background: rgb(186 26 26 / 0.08);
  color: var(--video-error);
  outline: 0;
}

.clear-project-button .material-symbols-outlined {
  font-size: 17px;
}

.clear-project-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(15 23 42 / 0.5);
}

.clear-project-modal-backdrop[hidden] {
  display: none;
}

.clear-project-modal-panel {
  display: grid;
  width: min(430px, 100%);
  gap: 16px;
  border: 1px solid var(--video-outline-variant);
  border-radius: 8px;
  padding: 18px;
  background: var(--video-surface);
  color: var(--video-on-surface);
  box-shadow: 0 24px 80px rgb(15 23 42 / 0.28);
}

.clear-project-modal-panel:focus {
  outline: 0;
}

.clear-project-modal-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.clear-project-modal-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: rgb(186 26 26 / 0.1);
  color: var(--video-error);
  font-size: 20px;
}

.clear-project-modal-header h2 {
  color: var(--video-on-surface);
  font-family: Geist, Inter, sans-serif;
  font-size: 20px;
  line-height: 26px;
}

.clear-project-modal-header p,
.clear-project-modal-warning,
.clear-project-modal-status {
  color: var(--video-on-surface-variant);
  font-size: 13px;
  line-height: 19px;
}

.clear-project-modal-header p {
  margin-top: 4px;
}

.clear-project-modal-warning {
  border: 1px solid rgb(186 26 26 / 0.24);
  border-radius: 6px;
  padding: 10px;
  background: rgb(186 26 26 / 0.08);
  color: var(--video-error);
  font-weight: 650;
}

.clear-project-modal-status {
  border: 1px solid var(--video-outline-variant);
  border-radius: 6px;
  padding: 10px;
}

.clear-project-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.clear-project-modal-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.clear-project-modal-button.secondary {
  border: 1px solid var(--video-outline-variant);
  background: var(--video-surface-low);
  color: var(--video-on-surface);
}

.clear-project-modal-button.secondary:hover,
.clear-project-modal-button.secondary:focus-visible {
  border-color: var(--video-outline);
  background: var(--video-surface-high);
  outline: 0;
}

.clear-project-modal-button.danger {
  border: 1px solid var(--video-error);
  background: var(--video-error);
  color: #ffffff;
}

.clear-project-modal-button.danger:hover,
.clear-project-modal-button.danger:focus-visible {
  border-color: #8c1d18;
  background: #8c1d18;
  outline: 0;
}

.clear-project-modal-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.clear-project-modal-button .material-symbols-outlined {
  font-size: 18px;
}

@media (max-width: 760px) {
  .media-library-header {
    min-height: 52px;
  }

  .clear-project-modal-actions {
    display: grid;
  }
}
