:root {
  color-scheme: dark;
  --bg: #09111c;
  --panel: #111c2a;
  --panel-soft: #152333;
  --ink: #f3f7fb;
  --muted: #8fa1b4;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #a78bfa;
  --accent-deep: #7c5ce1;
  --danger: #ff707d;
  --radius: 22px;
  --page-gutter: clamp(15px, 2.4vw, 28px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% -10%, #173a48 0, transparent 34rem), var(--bg); color: var(--ink); }
button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.topbar { min-height: 60px; padding-block: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(1124px, calc(100% - 2 * var(--page-gutter))); margin: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.brand-mark { display: block; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
.brand h1 { margin: 0; font-size: 17px; line-height: 1.25; font-weight: 700; white-space: nowrap; }
.brand-copy { display: grid; gap: 2px; }
.brand .video-count { font-size: 11px; line-height: 1.2; }
.topbar .quiet-button { min-height: 36px; padding: 8px 14px; font-size: 13px; flex: none; }

main { width: min(1124px, calc(100% - 2 * var(--page-gutter))); margin: 0 auto 80px; }
.eyebrow { margin: 0 0 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 800; }
h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; }

button { border: 0; cursor: pointer; }
.quiet-button, .icon-button, .control-button, .mirror-button { background: rgba(255,255,255,.07); border: 1px solid var(--line); }
.quiet-button { padding: 10px 17px; border-radius: 999px; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 999px; background: var(--accent); color: #100b1f; font-weight: 800; box-shadow: 0 12px 34px rgba(124,92,225,.18); }
.primary-button:disabled { cursor: wait; opacity: .55; }
.compact-button { min-height: 42px; padding-inline: 17px; font-size: 13px; }
.full-width { width: 100%; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.section-heading .eyebrow { margin-bottom: 7px; }
.library-section { padding-top: 8px; }
.library-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 12px; }
.library-actions { display: flex; align-items: center; gap: 16px; }
.video-count { color: var(--muted); font-size: 13px; }
.library-message { padding: 60px 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 18px; overflow-anchor: none; }
.video-card { min-width: 0; position: relative; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); text-align: left; transition: opacity .2s ease; -webkit-tap-highlight-color: transparent; }
.video-card-open { display: block; width: 100%; padding: 0; background: transparent; color: inherit; text-align: left; touch-action: pan-y pinch-zoom; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; outline: none; }
.video-card-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.favorite-button { position: absolute; z-index: 2; top: 8px; left: 8px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: white; }
.favorite-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linejoin: round; stroke-width: 1.8; }
.favorite-button.active svg { fill: currentColor; filter: drop-shadow(0 2px 4px rgba(0,0,0,.65)); }
.favorite-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drag-handle { position: absolute; z-index: 2; top: 8px; right: 8px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: rgba(4,9,14,.82); color: white; cursor: grab; touch-action: none; box-shadow: 0 4px 14px rgba(0,0,0,.28); font-size: 20px; }
.drag-handle:active { cursor: grabbing; }
.video-card.dragging { z-index: 3; opacity: .55; transform: scale(.97); border-color: var(--accent); }
.video-grid.saving-order { pointer-events: none; opacity: .7; }
.card-image { position: relative; display: grid; place-items: center; overflow: hidden; background: #02060a; pointer-events: none; }
.card-image img, .card-image video { display: block; width: 100%; height: auto; object-fit: contain; }
.card-copy { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px 13px; font-size: 13px; }
.card-copy strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-copy small { flex: none; color: var(--muted); }

.upload-panel { max-width: 620px; margin: 36px auto 0; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17,28,42,.92); box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font-size: 22px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: 13px; font-weight: 700; }
.field input { width: 100%; height: 50px; padding: 0 15px; border: 1px solid var(--line); border-radius: 13px; outline: none; background: #0b1521; color: var(--ink); }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(167,139,250,.1); }
.drop-zone { display: grid; place-items: center; min-height: 175px; margin-bottom: 18px; padding: 24px; border: 1px dashed rgba(167,139,250,.42); border-radius: 17px; background: rgba(167,139,250,.035); text-align: center; cursor: pointer; }
.drop-zone.dragging { border-color: var(--accent); background: rgba(167,139,250,.09); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { margin: 9px 0 4px; }
.drop-zone small, .toggle-row small { color: var(--muted); }
.drop-icon { font-size: 28px; color: var(--accent); }
.toggle-row { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; cursor: pointer; }
.toggle-row > span:first-child { flex: 1; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { margin-top: 4px; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle { position: relative; width: 48px; height: 28px; border-radius: 999px; background: #2b3948; transition: .2s; }
.toggle::after { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; border-radius: 50%; background: white; transition: .2s; }
.toggle-row input:checked + .toggle { background: var(--accent-deep); }
.toggle-row input:checked + .toggle::after { transform: translateX(20px); }
.upload-progress { margin-bottom: 18px; }
.upload-progress div { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
progress { appearance: none; width: 100%; height: 7px; border: 0; border-radius: 99px; overflow: hidden; background: #263442; }
progress::-webkit-progress-bar { background: #263442; }
progress::-webkit-progress-value { background: var(--accent); }
.form-error { padding: 11px 13px; border-radius: 11px; background: rgba(255,112,125,.1); color: #ff9aa4; font-size: 13px; }

.player-overlay {
  --video-navigation-gutter: 0px;
  --video-navigation-row: 0px;
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  grid-template-columns: var(--video-navigation-gutter) auto var(--video-navigation-gutter);
  place-content: center;
  background: rgba(2, 6, 10, .48);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.player-overlay button:focus { outline: none; }
.player-overlay:has(.video-navigation:not([hidden])) { --video-navigation-gutter: 72px; }
.player-screen { grid-area: 1 / 2; display: grid; grid-template-rows: auto auto auto; width: min(var(--player-width, 960px), calc(100vw - 32px - 2 * var(--video-navigation-gutter))); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #03070b; box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.video-navigation {
  grid-row: 1;
  align-self: center;
  display: grid;
  place-items: center;
  height: 104px;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, .7);
}
.video-navigation[hidden] { display: none; }
#previous-video { grid-column: 1; }
#next-video { grid-column: 3; }
.video-navigation svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.video-navigation:hover { color: white; }
@media (min-width: 761px) {
  .video-navigation { translate: 0 -23px; }
}
@media (hover: hover) {
  .player-overlay:has(#trick-video:hover) .video-navigation { visibility: hidden; }
}
.player-header { display: grid; grid-template-columns: 36px minmax(0,1fr) repeat(2, 36px); align-items: center; gap: 10px; min-height: 54px; padding: 7px 14px; background: #09111c; }
.player-header .icon-button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; }
.header-action-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
#player-favorite-button.active svg { fill: currentColor; }
#share-button .header-action-icon { transform: translateX(-2px); }
.player-header h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.stage { position: relative; display: grid; place-items: center; width: 100%; height: var(--display-video-height, auto); max-height: calc(100dvh - 230px); aspect-ratio: var(--native-video-aspect, 16 / 9); overflow: hidden; background: black; touch-action: pan-y pinch-zoom; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.stage.is-scrubbing { cursor: grabbing; }
.stage-scrub-feedback { display: none; position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 7px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 99px; background: rgba(3,7,11,.85); color: white; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.stage.is-scrubbing .stage-scrub-feedback { display: block; }
.stage video { display: block; width: var(--display-video-width, 100%); height: var(--display-video-height, 100%); max-width: 100%; max-height: 100%; object-fit: contain; background: black; transition: opacity .12s ease; }
.stage video.mirrored { transform: scaleX(-1); }
.video-transition-frame { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: black; pointer-events: none; }
.player-screen.is-switching-video { transition: width .24s ease-in-out; }
.is-switching-video .stage { transition: height .24s ease-in-out; }
.is-switching-video .stage video { transition: width .24s ease-in-out, height .24s ease-in-out; }
@media (prefers-reduced-motion: reduce) {
  .player-screen.is-switching-video, .is-switching-video .stage, .is-switching-video .stage video { transition: none; }
}
.transport { display: grid; grid-template-columns: minmax(0,1fr); align-items: center; gap: 4px; padding: 8px max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)); background: #09111c; border-top: 1px solid var(--line); }
.timeline-row { display: grid; grid-template-columns: max-content minmax(0,1fr) max-content; align-items: center; gap: 10px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.timeline-row { grid-column: 1 / -1; }
.timeline-row span:last-child { text-align: right; }
.timeline { --value: 0%; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: ew-resize; touch-action: none; transform: translateY(4px); }
.timeline:focus { outline: none; }
.timeline::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--value), #30404f var(--value)); }
.timeline::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: white; box-shadow: 0 0 0 4px rgba(167,139,250,.14); }
.control-row { position: relative; grid-column: 1; grid-row: 2; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 10px; margin: 0; }
.control-button, .play-button { display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: white; filter: drop-shadow(0 2px 3px rgba(0,0,0,.65)); transition: opacity .16s ease, transform .16s ease, background-color .16s ease; }
.control-button { width: 44px; height: 44px; border-radius: 11px; }
.play-button { width: 56px; height: 56px; border-radius: 14px; }
.control-button:hover, .play-button:hover { background: rgba(255,255,255,.08); transform: scale(1.04); }
.control-button:active, .play-button:active { transform: scale(.96); }
.control-button svg { width: 20px; height: 20px; }
.seek-controls { grid-column: 2; display: flex; align-items: center; justify-content: center; gap: 10px; }
.frame-step-button { width: 44px; }
.frame-step-button svg { flex: none; width: 24px; height: 24px; }
.seek-icon { fill: currentColor; }
.frame-step-button.is-holding { background: rgba(167,139,250,.14); color: var(--accent); transform: scale(.98); }
.play-button svg { width: 30px; height: 30px; }
.transport-shape { fill: currentColor; stroke: currentColor; stroke-linejoin: round; stroke-width: 4; }
.transport-bar { fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 7; }
.pause-icon { display: none; }
.play-button.is-playing .play-icon { display: none; }
.play-button.is-playing .pause-icon { display: block; }
.speed-button { grid-column: 1; justify-self: start; display: grid; place-items: center; width: 54px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: white; cursor: pointer; transition: background-color .16s ease, transform .16s ease; }
.speed-button:hover { background: rgba(255,255,255,.08); transform: scale(1.04); }
.speed-button:active { transform: scale(.96); }
.speedometer-icon { width: 44px; height: 40px; overflow: visible; }
.speedometer-arc, .speedometer-ticks { fill: none; stroke: currentColor; stroke-linecap: butt; stroke-linejoin: miter; stroke-width: 2; }
.speedometer-needle, .speedometer-hub { fill: currentColor; }
.mirror-button { grid-column: 3; justify-self: end; margin-inline-start: auto; display: grid; place-items: center; width: 54px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: white; transition: color .16s ease, background-color .16s ease, transform .16s ease; }
.mirror-button:hover { background: rgba(255,255,255,.08); transform: scale(1.04); }
.mirror-button:active { transform: scale(.96); }
.mirror-button svg { width: 32px; height: 32px; overflow: visible; }
.mirror-shape, .mirror-axis { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.mirror-axis { stroke-dasharray: 2 3; }
.mirror-button.active { border-color: rgba(167,139,250,.4); color: var(--accent); background: rgba(167,139,250,.12); }
.admin-player-actions { grid-column: 1 / -1; display: flex; align-items: end; justify-content: center; gap: 12px; margin-top: 4px; }
.edit-title-form { display: grid; grid-template-columns: minmax(140px, 260px) auto; align-items: end; gap: 5px 8px; }
.edit-title-form label { grid-column: 1 / -1; color: var(--muted); font-size: 11px; font-weight: 700; }
.edit-title-form input { min-width: 0; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #0b1521; color: var(--ink); }
.edit-title-form input:focus { border-color: var(--accent); }
.edit-title-form .quiet-button { height: 36px; padding-inline: 12px; white-space: nowrap; font-size: 11px; }
.danger-button { padding: 4px 10px; background: transparent; color: var(--danger); font-size: 11px; }

dialog { width: min(430px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); box-shadow: 0 30px 100px rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(1,5,9,.78); backdrop-filter: blur(5px); }
dialog form { position: relative; padding: 30px; }
dialog h2 { margin-bottom: 10px; }
dialog p:not(.eyebrow):not(.form-error) { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.dialog-close { position: absolute; top: 15px; right: 16px; background: transparent; color: var(--muted); font-size: 24px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 25px; transform: translateX(-50%); padding: 12px 18px; border: 1px solid var(--line); border-radius: 999px; background: #172535; box-shadow: 0 12px 45px rgba(0,0,0,.35); font-size: 13px; }

@media (max-width: 760px) {
  .topbar { min-height: 56px; padding-block: 6px; }
  main { margin-bottom: 50px; }
  .library-section { padding-top: 4px; }
  .library-actions { gap: 10px; }
  .compact-button { min-height: 40px; padding-inline: 13px; }
  .video-grid { gap: 12px; }
  .upload-panel { padding: 21px; }
  .player-overlay { grid-template-columns: 1fr 1fr; }
  .player-overlay:has(.video-navigation:not([hidden])) { --video-navigation-row: 48px; }
  .player-screen { grid-area: 1 / 1 / 2 / -1; width: 100vw; max-height: calc(100dvh - var(--video-navigation-row)); border-inline: 0; border-radius: 0; }
  .video-navigation { grid-row: 2; height: 48px; }
  #next-video { grid-column: 2; }
  .video-navigation svg { width: 24px; height: 24px; }
  .player-header { min-height: 50px; padding: 6px 10px; }
  .stage { max-height: none; }
  .transport { padding: 8px 10px max(9px, env(safe-area-inset-bottom)); }
  .timeline-row { grid-template-columns: minmax(0,1fr); gap: 0; margin-inline: -10px; }
  .timeline-row span { display: none; }
  .transport { gap-inline: 5px; }
  .control-row { gap: 4px; }
  .control-button { width: 44px; height: 44px; }
  .frame-step-button { width: 44px; }
  .frame-step-button .seek-icon { width: 22px; height: 22px; }
  .play-button { width: 52px; height: 52px; }
  .control-button svg { width: 16px; height: 16px; }
  .play-button svg { width: 27px; height: 27px; }
  .speed-button, .mirror-button { width: 50px; height: 42px; border-radius: 11px; }
  .mirror-button svg { width: 30px; height: 30px; }
  .speedometer-icon { width: 42px; height: 38px; }
  .admin-player-actions { align-items: center; flex-direction: column; }
  .edit-title-form { width: min(100%, 360px); grid-template-columns: minmax(0,1fr) auto; }
}

@media (max-width: 480px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-actions { margin-left: auto; }
  .control-row { gap: 3px; }
  .control-button, .mirror-button { width: 42px; height: 42px; }
  .frame-step-button { width: 42px; }
  .frame-step-button .seek-icon { width: 22px; height: 22px; }
  .speed-button, .mirror-button { width: 50px; height: 42px; }
  .play-button { width: 48px; height: 48px; }
}

@media (orientation: landscape) and (max-height: 600px) {
  .player-screen { max-height: calc(100dvh - 16px - var(--video-navigation-row)); }
  .stage { max-height: calc(100dvh - 250px); }
  .player-header { min-height: 54px; }
  .transport { padding-block: 9px; }
  .control-row { margin: 0; }
}

/* Flexovik editing tools, with an optional crop and source aspect ratio. */
.clip-editor { min-width: 0; margin: 0 0 24px; padding: 0; border: 0; }
.clip-editor[hidden], .clip-editor [hidden] { display: none !important; }
.clip-editor legend { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.editor-meta, .editor-hint { color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.editor-viewport { position: relative; width: min(100%, 440px); max-width: 100%; max-height: 520px; margin: 0 auto 16px; overflow: hidden; background: #000; border-radius: 12px; }
.editor-viewport video { position: absolute; max-width: none; max-height: none; object-fit: fill; pointer-events: none; }
.editor-viewport.has-crop { touch-action: none; cursor: grab; }
.editor-viewport.has-crop:active { cursor: grabbing; }
.editor-grid { display: none; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to right, transparent 33.2%, #ffffff55 33.3%, transparent 33.6%, transparent 66.5%, #ffffff55 66.6%, transparent 66.9%), linear-gradient(to bottom, transparent 33.2%, #ffffff55 33.3%, transparent 33.6%, transparent 66.5%, #ffffff55 66.6%, transparent 66.9%); border: 1px solid #ffffff66; }
.is-cropping .editor-grid { display: block; }
.editor-tabs { display: flex; width: fit-content; max-width: 100%; gap: 2px; padding: 2px; margin: 0 auto 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; }
.editor-tab { min-height: 30px; padding: 6px 14px; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; line-height: 18px; font-weight: 600; }
.editor-tab:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.editor-tab[aria-selected="true"] { background: rgba(255,255,255,.08); color: var(--ink); }
.editor-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.editor-tool-panel { margin-bottom: 10px; }
.editor-tool-panel > :first-child { margin-top: 0; }
.editor-tool-panel > :last-child { margin-bottom: 0; }
.editor-playback { display: grid; justify-items: center; gap: 8px; margin-bottom: 12px; }
.editor-transport { position: relative; display: flex; align-items: center; gap: 4px; }
.editor-transport .quiet-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 7px; background: transparent; border-color: transparent; }
.editor-transport .quiet-button:hover { background: rgba(255,255,255,.06); border-color: var(--line); }
.editor-transport [data-play] { background: rgba(255,255,255,.06); border-color: var(--line); }
.editor-transport svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.editor-transport .editor-icon-fill { fill: currentColor; stroke: none; }
.editor-transport .is-playing .preview-play-icon, .editor-transport :not(.is-playing) > .preview-pause-icon { display: none; }
.editor-transport output { position: absolute; left: calc(100% + 9px); min-width: 48px; white-space: nowrap; }
.editor-transport button:focus-visible, .editor-reset:focus-visible, .editor-aspect select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.editor-transport output { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.editor-seek { flex: 1; width: 100%; min-width: 0; height: 20px; margin: 0; }
.editor-tool-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; }
.editor-tool-heading output, .editor-tool-heading small { color: var(--muted); font-size: 12px; }
.editor-range { display: grid; grid-template-columns: 115px minmax(0,1fr); gap: 10px; align-items: center; margin: 12px 0; font-size: 12px; }
.editor-range span { display: flex; justify-content: space-between; gap: 8px; }
.editor-range output { color: var(--muted); font-variant-numeric: tabular-nums; }
.clip-editor input[type=range] { accent-color: var(--accent); min-width: 0; }
.editor-trim-summary { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; }
.editor-trim-control { position: relative; height: 32px; touch-action: none; }
.editor-trim-track { position: absolute; inset: 0 7px; cursor: pointer; border-radius: 6px; background: linear-gradient(var(--line), var(--line)) center / 100% 6px no-repeat; }
.editor-trim-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.editor-trim-control input[type=range] { position: absolute; inset: 0; width: 100%; height: 32px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; pointer-events: none; }
.editor-trim-control input[type=range]::-webkit-slider-runnable-track { height: 6px; background: transparent; }
.editor-trim-control input[type=range]::-moz-range-track { height: 6px; background: transparent; }
.editor-trim-control input[type=range]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 14px; height: 26px; margin-top: -10px; border: 1px solid rgba(255,255,255,.22); border-radius: 4px; background: var(--accent); pointer-events: auto; cursor: ew-resize; }
.editor-trim-control input[type=range]::-moz-range-thumb { width: 12px; height: 24px; border: 1px solid rgba(255,255,255,.22); border-radius: 4px; background: var(--accent); pointer-events: auto; cursor: ew-resize; }
.editor-trim-control input[type=range]:focus { z-index: 1; outline: none; }
.editor-trim-control input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--ink); outline-offset: 2px; }
.editor-trim-control input[type=range]:focus-visible::-moz-range-thumb { outline: 2px solid var(--ink); outline-offset: 2px; }
.clip-editor:has([data-editor-tab="trim"][aria-selected="true"]) .editor-seek { display: none; }
.editor-trim-playhead { position: absolute; left: var(--playhead, 0%); top: 5px; width: 2px; height: 22px; transform: translateX(-50%); border-radius: 1px; background: var(--ink); box-shadow: 0 0 0 1px rgba(9,17,28,.45); pointer-events: none; }
.editor-trim-playhead::before { content: ""; position: absolute; top: -2px; left: -3px; width: 8px; height: 6px; background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.editor-trim-selection { position: absolute; left: var(--trim-start); right: calc(100% - var(--trim-end)); top: 13px; height: 6px; border-radius: 6px; background: var(--accent); }
.editor-crop-tools { display: grid; gap: 6px; }
.editor-crop-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-aspect { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--muted); font-size: 12px; }
.editor-aspect select { width: 130px; max-width: 100%; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: #111c2a; color: var(--ink); font: inherit; }
.editor-reset { display: inline-flex; align-items: center; gap: 5px; flex: none; min-height: 32px; padding: 0 6px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; }
.editor-reset:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.editor-reset svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.editor-crop-zoom { display: grid; grid-template-columns: 40px minmax(0,1fr) 42px; align-items: center; gap: 10px; min-height: 28px; color: var(--muted); font-size: 12px; }
.editor-crop-zoom input { width: 100%; margin: 0; }
.editor-crop-zoom output { text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
.editor-reframe-hint { display: none; position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); padding: 4px 8px; border-radius: 5px; background: rgba(9,17,28,.7); color: #fff; font-size: 10px; white-space: nowrap; pointer-events: none; }
.has-crop .editor-reframe-hint { display: block; }
.editor-cover { display: block; width: 24px; height: 24px; }
.editor-cover img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 3px; }
.editor-transport .editor-cover-button.has-cover { border-color: rgba(167,139,250,.5); background: rgba(167,139,250,.06); }
.editor-cover-button.has-cover > svg { display: none; }
.editor-cover-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.clip-editor:disabled { opacity: .65; }

/* Compact source selection and local preview header. */
.drop-zone[hidden], [data-upload-intro][hidden] { display: none !important; }
.editor-preview-panel { position: relative; margin-top: 12px; padding: 16px; }
.editor-preview-header { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
.editor-preview-header h1 { margin: 0; font-size: 18px; line-height: 24px; letter-spacing: -.025em; }
.editor-preview-badge { flex: none; padding: 3px 7px; border-radius: 6px; background: rgba(167,139,250,.1); color: var(--accent); font-size: 10px; line-height: 14px; font-weight: 700; white-space: nowrap; }
.editor-preview-panel > .editor-hint { margin: 0 0 16px; }
.editor-source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; margin: 0 0 12px; }
.editor-heading { display: flex; grid-column: 1; grid-row: 1; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.editor-heading h3 { margin: 0; font-size: 18px; line-height: 24px; letter-spacing: -.025em; }
.editor-source-row .editor-meta { grid-column: 1; grid-row: 2; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 18px; }
.editor-replace { grid-column: 2; grid-row: 1 / 3; min-height: 36px; padding: 8px 12px; border-radius: 9px; font-size: 12px; line-height: 18px; white-space: nowrap; }
.editor-preview-panel:has(.clip-editor:not([hidden])) > .editor-preview-header { display: none; }

@media (max-width: 599px) {
  .editor-heading { grid-column: 1 / -1; }
  .editor-replace { grid-row: 2; }
}

.editor-crop-zoom input, .editor-seek { appearance: none; -webkit-appearance: none; height: 24px; background: transparent; }
.editor-crop-zoom input::-webkit-slider-runnable-track, .editor-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,.16); }
.editor-crop-zoom input::-moz-range-track, .editor-seek::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,.16); }
.editor-crop-zoom input::-webkit-slider-thumb, .editor-seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border: 0; border-radius: 50%; background: var(--accent); cursor: ew-resize; }
.editor-crop-zoom input::-moz-range-thumb, .editor-seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--accent); cursor: ew-resize; }

/* Instagram source credits below the video library. */
.video-credits {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.video-credits-row { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.video-credits h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0; line-height: 1.5; }
.video-credits p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.video-credits-links { display: flex; flex-direction: column; align-items: flex-start; }
.video-credits-links a { display: inline-flex; align-items: center; min-height: 24px; color: var(--accent); text-decoration: none; font-size: 13px; }
.video-credits-links a:hover { text-decoration: underline; text-underline-offset: 4px; color: var(--ink); }
.video-credits-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }

@media (pointer: coarse) {
  .topbar .quiet-button { min-height: 44px; }
}

/* Public video suggestions. */
.topbar .suggest-button {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid #41515e;
  border-radius: 9px;
  background: #13212d;
  color: #e0e8ef;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.suggest-button-icon { flex: none; width: 16px; height: 16px; fill: none; stroke: #a8bbc9; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) {
  .topbar .suggest-button:hover { border-color: #718695; background: #1c2e3d; color: #fff; }
}
.topbar .suggest-button:active { border-color: #8ea1af; background: #0c1822; }
.topbar .suggest-button:focus-visible { outline: 2px solid #c7d5df; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .topbar .suggest-button { transition: none; }
}
.suggest-dialog { width: min(470px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.suggest-dialog .eyebrow { margin-bottom: 12px; }
.suggest-dialog h2 { padding-right: 12px; font-size: 27px; }
.suggest-dialog .field { margin-bottom: 16px; }
.field-required { color: var(--accent); }
.field-optional { color: var(--muted); font-weight: 400; float: right; font-size: 12px; }
.suggest-dialog p.field-hint { margin: -7px 0 20px; font-size: 11px; line-height: 1.5; }
.suggest-dialog p.suggest-note { margin: 13px 0 0; text-align: center; font-size: 11px; }
.submission-trap { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.suggest-success { padding: 10px 0 4px; text-align: center; }
.suggest-check { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%; background: rgba(167,139,250,.12); color: var(--accent); font-size: 26px; }
.suggest-success h3 { margin: 0 0 10px; font-size: 21px; }
.suggest-dialog button:focus-visible, .suggest-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 480px) {
  .brand { gap: 7px; }
  .brand h1 { font-size: 15px; }
  .topbar .suggest-button { gap: 6px; padding: 9px 10px; font-size: 12px; }
  .topbar:has(#admin-button:not(.hidden)) { display: grid; grid-template-columns: 1fr auto; row-gap: 8px; }
  .topbar:has(#admin-button:not(.hidden)) .brand { grid-column: 1; grid-row: 1; }
  .topbar:has(#admin-button:not(.hidden)) #admin-button { grid-column: 2; grid-row: 1; }
  .topbar:has(#admin-button:not(.hidden)) .suggest-button { grid-column: 1 / -1; grid-row: 2; justify-self: end; margin-left: 0; }
  .suggest-dialog form { padding: 26px 22px; }
}
