/* Demo Video Export: this tool's own styles (the Visualizer's are in visualizer.css) */
.drawer { width: min(1320px, calc(100vw - 80px)); }
.card .tag.marked { background: #e0ecfd; color: #1f4f9a; }

/* Two columns: source + settings on the left, phone preview + export on the right */
.dve { display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 32px; align-items: start; }
.dve-right { position: sticky; top: 0; }
@media (max-width: 1180px) {
  .dve { grid-template-columns: 1fr; }
  .dve-right { position: static; }
}

/* Source player: one timeline that scrubs and holds the markers */
.marks-bar { position: relative; height: 30px; margin: 18px 18px 6px; border-radius: 6px; background: var(--grey-100); box-shadow: inset 0 0 0 1px var(--grey-200); cursor: pointer; touch-action: none; user-select: none; contain: layout style; }
.marks-bar.two { margin-bottom: 16px; }
.marks-bar .rng { position: absolute; left: 0; top: 4px; bottom: 4px; border-radius: 4px; pointer-events: none; }
.marks-bar .rng.rep { background: rgba(74, 137, 232, 0.35); }
.marks-bar .rng.hold { background: rgba(190, 149, 229, 0.55); }
.marks-bar .rng.rep2 { background: rgba(46, 160, 110, 0.4); }
.marks-bar .rng.hold2 { background: rgba(232, 160, 80, 0.55); }
.marks-bar .head { position: absolute; left: 0; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--grey-900); border-radius: 1px; pointer-events: none; z-index: 3; }
/* Playhead grab handle: hidden until the bar is hovered, grows while scrubbing */
.marks-bar .head .grip { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--grey-900), 0 1px 4px rgba(13, 13, 13, 0.25); cursor: grab; pointer-events: auto; opacity: 0; transform: scale(0.5); transition: opacity 0.12s, transform 0.12s; }
.marks-bar:hover .head .grip, .marks-bar.scrubbing .head .grip { opacity: 1; transform: scale(1); }
.marks-bar.scrubbing .head .grip { transform: scale(1.15); cursor: grabbing; }
.marks-bar.scrubbing { cursor: grabbing; }

/* Marker: label chip + line through the bar. Two sides: side 1 grabs on the top half, side 2 on the bottom half */
.marks-bar .mk { position: absolute; left: 0; top: -8px; bottom: -2px; width: 18px; margin-left: -9px; cursor: ew-resize; z-index: 2; }
.marks-bar .mk.top { bottom: auto; height: 23px; }
.marks-bar .mk.low { top: 15px; bottom: -8px; }
.marks-bar .mk::before { content: ""; position: absolute; left: 8px; top: 8px; height: 30px; width: 2px; background: var(--c, #4a89e8); pointer-events: none; }
.marks-bar .mk.low::before { top: -15px; }
.marks-bar .mk b { position: absolute; left: 50%; top: 0; transform: translateX(-50%); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--c, #4a89e8); color: #fff; font: 600 10px/16px var(--sans); text-align: center; white-space: nowrap; }
.marks-bar .mk.low b { top: auto; bottom: 0; }
.marks-bar .mk.def b { background: #fff; color: var(--c, #4a89e8); box-shadow: inset 0 0 0 1.5px var(--c, #4a89e8); }
.marks-bar .mk.def::before { opacity: 0.55; }
.marks-bar .mk .tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: var(--grey-900); color: #fff; font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; opacity: 0; pointer-events: none; transition: opacity 0.1s; }
.marks-bar .mk.low .tip { bottom: auto; top: calc(100% + 4px); }
.marks-bar .mk:hover .tip, .marks-bar .mk.drag .tip { opacity: 1; }
.marks-bar .mk.drag { z-index: 4; }

.goto { border: 0; background: none; padding: 0; font-size: 12px; color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.player .controls .spacer { flex: 1 1 auto; }
.player .controls button.txt { width: auto; padding: 0 14px; font-size: 13px; font-weight: 500; }
.player .controls button.txt:disabled { opacity: 0.45; cursor: default; }

/* Settings rows */
.set { border: 1px solid var(--grey-200); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.set .r { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 18px; border-bottom: 1px solid var(--grey-200); }
.set .r:last-child { border-bottom: 0; }
.set .r > label:first-child, .set .r > .lab { flex: none; width: 150px; font-size: 13.5px; color: var(--grey-700); }
.set .r .grow { flex: 1 1 auto; min-width: 0; }
.set .r .icon-btn.reset:disabled { opacity: 0.35; cursor: default; border-color: var(--grey-200); color: var(--grey-700); }
.set .r .val { flex: none; min-width: 54px; text-align: right; font-size: 13px; color: var(--grey-800); font-variant-numeric: tabular-nums; }
.set .tabs { margin: 0; }
.set input[type="range"] { width: 100%; }
.set .hint { margin: 0; font-size: 12.5px; color: var(--grey-600); }
.set .switch { margin-left: auto; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 6px 14px; border: 1px solid var(--grey-200); border-radius: 999px; background: #fff; font-size: 13px; transition: border-color 0.15s; }
.pill:hover { border-color: var(--grey-400); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--grey-200); border-radius: 999px; background: #fff; overflow: hidden; }
.stepper button { width: 34px; height: 32px; border: 0; background: none; font-size: 16px; color: var(--grey-800); }
.stepper button:hover { background: var(--grey-100); }
.stepper input { width: 52px; height: 32px; border: 0; border-left: 1px solid var(--grey-200); border-right: 1px solid var(--grey-200); text-align: center; font: 600 14px var(--sans); color: var(--grey-900); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper + .unit { font-size: 13px; color: var(--grey-600); }
input[type="color"] { width: 34px; height: 30px; padding: 0; border: 1px solid var(--grey-200); border-radius: 8px; background: #fff; cursor: pointer; }
.warn { margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; background: #fff3d6; color: #7a4a00; font-size: 13px; }
.warn:empty { display: none; }
.odd-note { padding: 4px 10px; border-radius: 8px; background: #fff3d6; color: #7a4a00; font-size: 12.5px; }
.odd-note:empty { display: none; }

/* Preview */
.stage { position: relative; border: 1px solid var(--grey-200); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-md); overflow: hidden; }
.stage canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; background:
  linear-gradient(45deg, var(--grey-100) 25%, transparent 25%, transparent 75%, var(--grey-100) 75%) 0 0 / 16px 16px,
  linear-gradient(45deg, var(--grey-100) 25%, transparent 25%, transparent 75%, var(--grey-100) 75%) 8px 8px / 16px 16px, var(--grey-50); }
.stage canvas.dragging { cursor: grabbing; }
.stage .controls { border-top: 1px solid var(--grey-200); }
.out-meta { display: flex; justify-content: space-between; gap: 12px; margin: 12px 2px 0; font-size: 12.5px; color: var(--grey-700); }
.export { margin-top: 16px; }
.export .out-meta { align-items: center; margin: 0 2px 12px; }
.export .tabs { margin: 0; }
.export { position: relative; }
.export .q-right { display: flex; align-items: center; gap: 8px; }
.export .gear { display: grid; place-items: center; width: 34px; height: 34px; margin: 0; padding: 0; border: 1px solid var(--grey-200); border-radius: 10px; background: #fff; color: var(--grey-700); transition: background 0.15s, color 0.15s; }
.export .gear:hover, .export .gear[aria-expanded="true"] { background: var(--grey-100); color: var(--grey-900); }
/* Compression popover: opens above the quality row, right-aligned with the cogwheel */
.comp-pop { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20; width: 340px; padding: 16px; border: 1px solid var(--grey-200); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-lg); }
.comp-pop.hidden { display: none; }
.comp-pop h4 { margin: 0 0 10px; font-size: 13.5px; font-weight: 600; color: var(--grey-900); }
.comp-pop .tabs { margin: 0; }
.comp-pop .comp-custom { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.comp-pop .comp-custom.hidden { display: none; }
.comp-pop .comp-custom input { flex: 1; }
.comp-pop .comp-custom .val { flex: none; min-width: 64px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.comp-pop .comp-rate { margin: 12px 0 0; font-size: 12.5px; color: var(--grey-700); font-variant-numeric: tabular-nums; }
.comp-pop .comp-est { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--grey-900); }
.comp-pop .comp-est:empty { display: none; }
.comp-pop .hint { margin: 10px 0 0; font-size: 12px; color: var(--grey-600); }
.primary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border: 0; border-radius: 999px; background: var(--grey-800); color: #fff; font-size: 15px; font-weight: 600; transition: background 0.15s; }
.primary:hover { background: var(--grey-900); }
.primary:disabled { background: var(--grey-300); color: var(--grey-600); cursor: default; }
.progress { height: 4px; margin-top: 10px; border-radius: 4px; background: var(--grey-200); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--gradient); transition: width 0.1s linear; }
.progress.hidden { display: none; }
.done-msg { margin: 10px 2px 0; font-size: 12.5px; color: var(--grey-700); }
.done-msg:empty { display: none; }
.done-msg.err { color: #c52424; }
.side-foot .ghost { margin-top: 10px; }
.backup { display: flex; gap: 8px; }
.backup .ghost { margin-top: 0; }
