@font-face {
  font-family: Aircut Sans;
  src: url('./fonts/inter.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Aircut Sans, system-ui, sans-serif;
  color: var(--ink);
  background: #f5f5f7;
  color-scheme: light;
  font-synthesis: none;
  --muted: #6e6e73;
  --line: #e8e8ed;
  --accent: #0071e3;
  --accent-hover: #0062cc;
  --accent-soft: #edf5ff;
  --accent-line: #a6ceff;
  --control: #f5f5f7;
  --control-hover: #ededf0;
  --ink: #1d1d1f;
  --card-shadow: 0 3px 18px #1d1d1f03;
  --surface: #fff;
  --focus: #007aff;
  --canvas-accent: #007aff;
}

* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button, a, select { transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
button:disabled, input:disabled, select:disabled { opacity: .45; cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

header {
  height: 80px;
  max-width: none;
  background: #ffffffed;
  border-bottom: 1px solid var(--line);
  margin: auto;
  padding: 0 max(48px, calc((100% - 1480px) / 2 + 48px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 27px; font-weight: 700; letter-spacing: -.8px; text-decoration: none; color: inherit; }
.brand-mark { display: block; width: 36px; height: 36px; flex: none; object-fit: contain; border-radius: 8px; }
.brand small { border-left: 1px solid var(--line); margin-left: 12px; padding-left: 22px; color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: 0; }
.history-actions { display: flex; align-items: center; gap: 6px; }
.history-button { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.history-button svg { width: 22px; height: 22px; }
.history-button:disabled { opacity: .3; }
.history-button:hover:not(:disabled) { background: var(--control); color: var(--ink); }
#export-panel { scroll-margin-block: 24px; }
main { max-width: 1480px; margin: auto; padding: 36px 48px 0; }
.workspace-intro { margin: 0 0 30px; }
h1 { font-size: clamp(28px, 2.4vw, 34px); font-weight: 600; letter-spacing: -1.3px; line-height: 1.2; margin: 0 0 9px; }
.workspace-intro p { margin: 0; color: var(--muted); font-size: 16px; }
h2 { font-size: 24px; font-weight: 600; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 450px; align-items: start; gap: 28px; }
.preview-panel, .workspace aside { min-width: 0; }
.preview-panel { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--card-shadow); }
.canvas-wrap { display: flex; align-items: center; justify-content: center; min-height: 280px; padding: 0; border: 0; border-radius: 12px; background: var(--control); overflow: visible; }
.canvas-wrap:has(#empty[hidden]) { min-height: 0; }
#stage { position: relative; width: 100%; max-width: 100%; line-height: 0; touch-action: none; }
#stage.vertical { width: min(100%, 320px); }
canvas { display: block; width: 100%; height: auto; }
#stage:has(#empty:not([hidden])) { min-height: 380px; }
#stage:has(#empty:not([hidden])) > #preview { visibility: hidden; }
.empty-canvas { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; line-height: 1.4; color: var(--ink); border: 1px dashed #d2d2d7; border-radius: 10px; background: linear-gradient(155deg, #fafbff, #f0f2f6); }
.empty-canvas p { margin: 0 0 6px; font-size: clamp(19px, 2.3vw, 28px); font-weight: 600; letter-spacing: -.7px; }
.empty-description { font-size: 16px; color: var(--muted); }
.empty-canvas .primary { display: flex; align-items: center; gap: 8px; width: auto; padding: 12px 22px; margin-top: 23px; }
.empty-canvas .primary span { font-size: 18px; font-weight: 400; line-height: 16px; }
.empty-art { position: relative; width: 180px; height: 125px; margin-bottom: 18px; }
.art-card { position: absolute; border: 3px solid #fff; border-radius: 12px; box-shadow: 0 8px 14px #1d1d1f18; }
.art-landscape { width: 93px; height: 86px; left: 15px; top: 25px; background: #e1eaf5; transform: rotate(-15deg); overflow: hidden; }
.art-landscape svg { width: 100%; height: 100%; stroke: none; }
.art-landscape circle { fill: #fff; }
.art-landscape path { fill: #a5bddc; }
.art-film { width: 92px; height: 106px; top: 6px; left: 77px; padding: 10px; transform: rotate(11deg); background: #fff; color: #576779; }
.art-film svg { display: block; width: 100%; height: 58px; margin-top: 7px; border-radius: 6px; background: #e6f0ff; fill: #007aff; stroke: none; }
.film-dots { display: block; width: 5px; height: 5px; border-radius: 50%; background: #b7bbc2; box-shadow: 9px 0 #d3d7de, 18px 0 #d3d7de; }
.film-line { display: block; width: 30px; height: 4px; margin-top: 7px; background: #d3d7de; border-radius: 4px; }
.art-spark svg { width: 30px; height: 30px; stroke-width: 1.8; }
.art-spark { position: absolute; top: 0; left: 25px; color: #9aa8bc; font-size: 32px; line-height: 1; transform: rotate(-12deg); }

#editor-sidebar { position: relative; }
#editor-sidebar[data-switching] { overflow: clip; }
.sidebar-mode-leaving { position: absolute; inset: 0 0 auto; width: 100%; }
#editor-sidebar[data-switching] .selection-actions { visibility: hidden !important; }
#sidebar-view { position: relative; overflow: clip; min-width: 0; transition: height 220ms ease; margin-top: 0; }
#sidebar-view[data-view=layers]:has(#add-menu[open]) { overflow: clip visible; }
.sidebar-pane { width: 100%; min-width: 0; display: flow-root; transition: transform 220ms ease, visibility 0s linear 220ms; }
#layers-pane { margin: 0; transform: translateX(0); visibility: visible; }
#details-pane { position: absolute; top: 0; left: 0; transform: translateX(100%); visibility: hidden; padding: 3px; }
#sidebar-view[data-view=details] #layers-pane { transform: translateX(-100%); visibility: hidden; }
#sidebar-view[data-view=details] #details-pane { transform: translateX(0); visibility: visible; transition-delay: 0s; }
#sidebar-view[data-view=layers] #layers-pane { transition-delay: 0s; }
.layers-panel { border: 1px solid var(--line); border-radius: 24px; padding: 24px; background: var(--surface); box-shadow: var(--card-shadow); }
.layers-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.layers-heading h2 { font-size: 20px; font-weight: 600; letter-spacing: -.3px; margin: 0; }
#add-menu { position: relative; }
#add-menu-toggle { display: flex; align-items: center; gap: 7px; min-height: 40px; list-style: none; padding: 8px 12px; border: 1px solid transparent; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background 160ms ease, border-color 160ms ease, transform 120ms ease; }
#add-menu-toggle:active:not([aria-disabled=true]) { transform: scale(.97); }
#add-menu-toggle svg { width: 18px; height: 18px; stroke-width: 1.8; }
#add-menu-toggle::-webkit-details-marker { display: none; }
#add-menu-toggle:hover:not([aria-disabled=true]), #add-menu[open] > summary { background: #e0eeff; border-color: var(--accent-line); }
#add-menu-toggle[aria-disabled=true] { opacity: .45; cursor: default; }
.add-tools { position: absolute; z-index: 3000; right: 0; top: calc(100% + 8px); display: grid; width: 200px; padding: 7px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px #1d1d1f14; transform-origin: top right; }
#add-menu[data-closing] .add-tools { pointer-events: none; }
.add-tools button { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 14px; min-height: 50px; padding: 14px; border: 0; border-radius: 10px; background: transparent; font-size: 15px; text-align: left; transition: background 120ms ease, color 120ms ease; }
.add-tools button:hover:not(:disabled), .add-tools button:focus-visible { background: var(--control); }
.add-tools svg { width: 22px; height: 22px; color: var(--muted); }
.layers { display: grid; gap: 7px; }
.layer { display: flex; min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 11px; background: #fff; overflow: hidden; }
.layer { position: relative; }
.layer .layer-reorder { flex: none; align-self: center; display: grid; place-items: center; width: 26px; min-height: 34px; margin: 0 7px; padding: 6px; border-radius: 7px; background: transparent; color: #8e8e93; cursor: grab; touch-action: none; transition: color 140ms ease; }
.layer-reorder svg { width: 12px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.7; stroke-linecap: round; }
.layer:hover .layer-reorder, .layer:focus-within .layer-reorder { color: var(--muted); }
.layer .layer-reorder:hover:not(:disabled), .layer .layer-reorder:focus-visible { background: transparent; color: var(--ink); }
.layers.reordering .layer { transition: transform 180ms cubic-bezier(.2,.8,.2,1); }
.layer.dragging { opacity: 0; }
.layer-drag-preview { position: fixed; z-index: 5000; pointer-events: none; margin: 0; opacity: .98; background: var(--surface); border-color: var(--accent-line); box-shadow: 0 12px 30px #1d1d1f28, 0 2px 6px #1d1d1f12; will-change: transform; }
@media (prefers-reduced-motion: reduce) { .layers.reordering .layer { transition: none; } }
.layer:has(.layer-reorder) .layer-select { padding-left: 0; }
.layer[data-kind=canvas] .layer-select { padding-left: 40px; }
.layer-reorder:active { cursor: grabbing; }
.layer.selected { border-color: var(--accent-line); background: var(--accent-soft); }
.layer button { border: 0; background: transparent; font-size: 16px; min-height: 52px; }
.layer-select { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; text-align: left; padding: 10px 11px; }
.layer-thumbnail { flex: 0 0 48px; width: 48px; height: 36px; border-radius: 6px; border: 1px solid #1d1d1f0d; }
.layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-arrow { flex: none; width: 18px; height: 18px; margin-left: 6px; color: var(--muted); }
#layer-removal { clear: both; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
#remove-layer { color: #b42318; }
#remove-layer:hover:not(:disabled) { background: #fff1f0; border-color: #f3c6c2; }
.layer button:hover:not(:disabled) { background: #00000005; }
.layer button:focus-visible { outline-offset: -3px; }
#back-to-layers { display: block; padding: 8px 5px; margin: 0 0 12px; font-size: 16px; }
#back-to-layers:focus-visible, #back-from-transcript:focus-visible { outline: none; border-radius: 6px; background: var(--control); text-decoration: underline; text-underline-offset: 4px; }
fieldset { min-width: 0; margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--card-shadow); }
legend { float: left; width: 100%; margin: 0 0 24px; padding: 0; font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
#settings > section { clear: both; }
#settings { padding: 22px; margin-bottom: 2px; }
.setting { margin: 8px 0 23px; }
.setting:last-child { margin-bottom: 0; }
.setting > label, .label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; margin-bottom: 11px; }
.setting output, .caption-style output { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
select { width: 100%; padding: 13px 40px 13px 14px; border: 1px solid var(--line); border-radius: 12px; appearance: none; background: var(--control) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 16px center / 16px 16px; color: inherit; font-size: 16px; }
select:hover:not(:disabled) { border-color: #c7c7cc; }
input[type=range] { width: 100%; accent-color: var(--accent); margin: 10px 0; cursor: pointer; appearance: none; -webkit-appearance: none; background: transparent; height: 24px; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: #8e8e93; border-radius: 4px; }
input[type=range]::-moz-range-track { height: 4px; background: #8e8e93; border-radius: 4px; }
input[type=range]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border: 1px solid #85858b; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #1d1d1f1a; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 1px solid #85858b; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #1d1d1f1a; }
.setting input[type=range] { margin: 5px 0; }
.preset-slider { position: relative; cursor: pointer; touch-action: none; height: 36px; margin: 8px 0; border-radius: 24px; background: var(--control); }
.preset-dots { position: absolute; inset: 0 20px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.preset-dot { position: absolute; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: #c7c7cc; transform: translate(-50%, -50%); }
.preset-thumb { position: absolute; top: 50%; left: calc(20px + (100% - 40px) * var(--preset-position)); width: 22px; height: 22px; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 5px #0071e326; transform: translate(-50%, -50%); pointer-events: none; }
.preset-slider input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.preset-slider:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.preset-slider:has(input:disabled) { opacity: .45; cursor: default; }

input[type=checkbox] { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
input[type=color] { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; padding: 0; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type=color]::-webkit-color-swatch { border: 1px solid #0002; border-radius: 50%; }
input[type=color]::-moz-color-swatch { border: 1px solid #0002; border-radius: 50%; }
.colors { display: flex; align-items: center; gap: 9px; }
.swatch { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; border: 1px solid #0001; background: var(--swatch); }
.swatch[aria-pressed=true] { outline: 2px solid var(--accent); outline-offset: 3px; }
.quiet { background: transparent; border: 0; padding: 8px 0; }
.quiet:hover:not(:disabled) { color: var(--accent); }
.secondary { width: 100%; padding: 13px 16px; background: var(--control); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; white-space: nowrap; }
.secondary:hover:not(:disabled) { background: var(--control-hover); border-color: #d2d2d7; }
.primary { display: block; width: 100%; padding: 16px 20px; border: 1px solid var(--accent); border-radius: 30px; background: var(--accent); color: #fff; text-align: center; font-size: 16px; font-weight: 600; text-decoration: none; box-shadow: 0 2px 5px #007aff14; }
.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 3px 9px #007aff1a; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.65; }
.hint a { color: inherit; text-underline-offset: 2px; }
#edit-layer-name { display: block; width: 100%; min-width: 0; margin: -4px; padding: 4px; border: 0; border-radius: 6px; font: inherit; letter-spacing: inherit; color: var(--ink); text-align: left; background: transparent; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#edit-layer-name:hover:not(:disabled) { background: var(--control); }
#layer-name-editor { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 9px 8px 15px; border-radius: 18px; background: var(--control); }
#layer-name-editor:focus-within { box-shadow: 0 0 0 2px var(--accent-soft); }
#layer-name { flex: 1; width: 0; min-width: 0; margin: 0; padding: 6px 0; border: 0; outline: none; box-shadow: none; background: transparent; color: var(--ink); font-family: inherit; font-size: 18px; font-weight: 400; line-height: 1.4; letter-spacing: normal; }
#save-layer-name { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 7px; border: 0; border-radius: 50%; background: var(--ink); color: var(--surface); }
#save-layer-name:hover:not(:disabled) { opacity: .8; }
#save-layer-name svg { width: 20px; height: 20px; }

.asset-actions { display: flex; align-items: center; gap: 12px; }
.asset-actions .secondary { flex: 1; }
.asset-actions .quiet { font-size: 14px; }
#background-image-name, #logo-name { overflow-wrap: anywhere; }
.background-image-row .secondary { font-size: 13px; }
.shape-picker { padding: 0; margin: 0 0 30px; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.shape-picker > legend { float: none; width: auto; padding: 0; margin: 0 0 16px; font-size: 16px; font-weight: 500; letter-spacing: 0; }
.shape-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.shape-choice { position: relative; min-width: 0; cursor: pointer; }
.shape-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.shape-choice > span { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; min-height: 84px; padding: 13px 4px; border: 1px solid transparent; border-radius: 14px; background: var(--control); color: var(--muted); font-size: 15px; transition: background 160ms ease, border-color 160ms ease; }
.shape-choice svg { width: 28px; height: 28px; stroke-width: 1.7; }
.shape-choice:hover > span { background: var(--control-hover); }
.shape-choice input:checked + span { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.shape-choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }
.canvas-background { margin-bottom: 30px; }
.canvas-background > label { font-weight: 500; margin-bottom: 16px; }
.canvas-background .colors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); justify-items: center; gap: clamp(6px, 1vw, 12px); }
.canvas-background .swatch, .custom-color { width: 100%; max-width: 36px; height: auto; aspect-ratio: 1; }
.canvas-background .swatch[aria-pressed=true]::after { content: '✓'; color: var(--swatch-check, #525258); font-size: 15px; }
.custom-color { position: relative; display: grid; place-items: center; border: 1px solid #d2d2d7; border-radius: 50%; background: var(--control); color: var(--muted); font-size: 21px; cursor: pointer; }
.custom-color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.custom-color:focus-within, .custom-color.selected { outline: 2px solid var(--focus); outline-offset: 3px; }
.canvas-background .background-image-row { margin-top: 20px; }
#choose-background { display: flex; align-items: center; justify-content: center; gap: 9px; white-space: normal; font-size: 14px; line-height: 1.4; }
#choose-background svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.canvas-spacing { margin-bottom: 27px; }
.canvas-spacing .label-row { flex-wrap: wrap; }
.canvas-arrangement { border-top: 1px solid var(--line); padding-top: 20px; }
.dimension-field { display: inline-flex; align-items: center; gap: 3px; flex: none; margin-left: auto; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--control); color: var(--muted); font-size: 13px; }
.dimension-field input { width: 3ch; font-variant-numeric: tabular-nums; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--muted); text-align: right; font-size: 14px; appearance: textfield; -moz-appearance: textfield; }
.dimension-field input::-webkit-inner-spin-button, .dimension-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dimension-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
#frame-padding::-webkit-slider-runnable-track { background: linear-gradient(to right, #8e8e93 var(--range-progress, 26.666%), #e5e5ea var(--range-progress, 26.666%)); }
#frame-padding::-moz-range-track { background: linear-gradient(to right, #8e8e93 var(--range-progress, 26.666%), #e5e5ea var(--range-progress, 26.666%)); }
.range-endpoints { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: 13px; }
.layout-label { display: block; font-size: 16px; margin-bottom: 12px; }
textarea { display: block; width: 100%; min-height: 66px; margin: 5px 0 16px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--control); color: inherit; resize: vertical; line-height: 1.5; }
.text-link { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.caption-style { display: grid; gap: 16px; margin: 0 0 18px; }
.inspector-group { display: grid; gap: 17px; min-width: 0; }
.inspector-group h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.inspector-group .hint { margin: -8px 0 0; }
.caption-style label { min-width: 0; font-size: 14px; }
.caption-style select { margin-top: 7px; font-size: 14px; padding: 9px 40px 9px 14px; }
select.font-picker { padding: 14px 44px 14px 16px; }
.caption-size output { float: right; }
.caption-style .caption-color { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.caption-size input { display: block; margin-bottom: 0; }
.caption-style .text-link { margin-top: 8px; }
.caption-style .inspector-group { gap: 12px; }
#caption-settings .setting { margin: 0; }
.caption-style .label-row, .caption-style .setting > label { margin-bottom: 6px; }
.caption-style .preset-slider { margin: 6px 0 0; }
.caption-style .caption-color { min-height: 32px; }
.caption-option { display: grid; grid-template-columns: minmax(0, 1fr) 30px 34px; align-items: center; gap: 12px; min-height: 32px; }
.caption-option > span { display: flex; }
input.caption-toggle { appearance: none; margin: 0; width: 34px; height: 22px; padding: 3px; border: 0; border-radius: 20px; background: #d1d1d6; cursor: pointer; }
.caption-toggle::before { content: ''; display: block; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; }
.caption-toggle:checked { background: var(--accent); }
.caption-toggle:checked::before { transform: translateX(12px); }
#caption-background-controls, #caption-position-group { border-top: 1px solid var(--line); padding-top: 16px; }
.caption-background-dimensions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.caption-background-dimensions .label-row { flex-wrap: wrap; gap: 4px; }
.caption-background-dimensions .dimension-field { padding-inline: 6px; }
.caption-placement { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 20px; }
.caption-placement select { margin-top: 0; }
.caption-style #caption-position-group .hint { margin: 0; font-size: 12px; }
#caption-status { font-size: 14px; line-height: 1.6; color: var(--muted); }
#caption-status:empty, #status:empty { display: none; }
#preparation-status { margin-bottom: 0; }
details { font-size: 14px; }
summary { cursor: pointer; }

#selection { position: absolute; border: 2px solid var(--canvas-accent); pointer-events: none; box-shadow: 0 0 0 1px #222; }
#resize, #logo-resize, #text-resize, #shape-resize, #caption-resize { position: absolute; width: 18px; height: 18px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--accent); border-radius: 4px; background: var(--canvas-accent); cursor: nwse-resize; touch-action: none; }
#resize, #logo-resize { pointer-events: auto; right: -9px; bottom: -9px; }
#text-resize, #shape-resize, #caption-resize { z-index: 2100; transform: translate(-50%, -50%); }
#logo-selection { position: absolute; z-index: 1; pointer-events: none; }
#logo-handle { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; pointer-events: auto; cursor: grab; touch-action: none; }
#logo-width { pointer-events: auto; position: absolute; right: -7px; top: 50%; transform: translateY(-50%); width: 14px; height: 28px; padding: 0; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--accent); border-radius: 4px; background: var(--canvas-accent); cursor: ew-resize; touch-action: none; }
#decoration-handles { position: absolute; inset: 0; pointer-events: none; }
.decoration-target { position: absolute; background: transparent; border: 0; padding: 0; pointer-events: auto; cursor: grab; touch-action: none; }
#caption-handle { position: absolute; z-index: 1000; background: transparent; border: 0; border-radius: 2px; padding: 0; min-width: 0; cursor: grab; touch-action: none; }
#caption-handle:hover:not(:disabled), #caption-handle:focus-visible, #logo-handle:hover, .decoration-target:hover { outline: 1px dashed var(--canvas-accent); outline-offset: 2px; }
#caption-handle.selected, #logo-selection.selected, .decoration-target.selected { outline: 2px solid var(--canvas-accent); outline-offset: 2px; }
#logo-selection.selected, #caption-handle.selected { z-index: 2000; }
#logo-handle:active, #caption-handle:active:not(:disabled), .decoration-target:active { cursor: grabbing; }
#caption-handle:disabled { cursor: default; }
#canvas-text-editor { position: absolute; z-index: 2200; margin: 0; padding: 0; border: 0; outline: 2px solid var(--canvas-accent); outline-offset: 2px; border-radius: 2px; background: #1d1d1f; color: white; text-align: center; resize: none; overflow: hidden; min-height: 0; touch-action: auto; }
#stage.editing-text .decoration-target.selected { visibility: hidden; }

.transport { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "time play actions"; align-items: center; gap: 16px; min-width: 0; margin: 14px 0 24px; padding: 4px 0; border: 0; border-radius: 0; background: white; font-size: 14px; }
.transport #time { grid-area: time; white-space: nowrap; }
.playback-controls { grid-area: play; display: flex; align-items: center; justify-self: center; gap: 8px; }
.skip-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 9px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.skip-button:hover:not(:disabled) { color: var(--ink); background: var(--control); }
.skip-button svg { width: 26px; height: 26px; }
.skip-button text { fill: currentColor; stroke: none; font-size: 8px; font-weight: 600; }
@media (max-width: 700px), (min-width: 901px) and (max-width: 1250px) {
  .transport { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "time actions" "play play"; }
}
#play { grid-area: play; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid #00000012; border-radius: 50%; color: #fff; background: #252528; box-shadow: 0 2px 5px #0000001a; transition: background 150ms ease, box-shadow 150ms ease, transform 180ms cubic-bezier(.2, .8, .2, 1); }
#play:hover:not(:disabled) { background: #424247; box-shadow: 0 3px 8px #00000026; }
#play:active:not(:disabled) { background: #111113; box-shadow: none; transform: scale(.94); }
#play svg { grid-area: 1 / 1; width: 20px; height: 20px; fill: currentColor; pointer-events: none; transition: opacity 160ms ease, transform 200ms cubic-bezier(.2, .8, .2, 1); }
#play .play-icon, #play .pause-icon { opacity: 1; transform: scale(1) rotate(0); }
#play[aria-label="Play"] .pause-icon { opacity: 0; transform: scale(.65) rotate(12deg); }
#play[aria-label="Pause"] .play-icon { opacity: 0; transform: scale(.65) rotate(-12deg); }
.transport output { font-variant-numeric: tabular-nums; color: var(--muted); }
.preview-panel:has(#transport[hidden]) { padding-bottom: 24px; }
.export-panel { margin-top: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--card-shadow); }
.export-options { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; }
.export-quality { display: block; font-size: 14px; margin-bottom: 15px; }
.export-quality select { margin-top: 8px; font-size: 14px; }
#export-caption-status { margin: 0 0 12px; }
#export-without-captions { width: 100%; margin-top: 8px; text-align: center; font-size: 14px; }
#export-progress { margin-top: 19px; }
#result { margin-top: 0; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 8px; }
.result-actions button { font-size: 14px; }
#export-estimate { display: block; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.progress-heading { display: flex; justify-content: space-between; font-size: 14px; }
progress { width: 100%; accent-color: var(--accent); height: 7px; margin: 13px 0; border-radius: 5px; overflow: hidden; }
#export-preview { width: 100%; margin-top: 14px; max-height: 240px; border-radius: 9px; background: #f5f5f7; }
#cancel { font-size: 14px; }
#status { margin: 22px 0; font-size: 14px; color: var(--muted); }
#error { border: 1px solid #ffd1ce; background: #fff5f4; color: #b42318; padding: 13px 16px; border-radius: 12px; font-size: 16px; line-height: 1.6; }
.privacy-note { display: inline-flex; align-items: center; gap: 7px; }
.privacy-note svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
footer { display: flex; justify-content: space-between; gap: 16px; padding: 26px 0 28px; font-size: 12px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

#configurations-dialog { color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 30px; width: min(580px, calc(100vw - 32px)); max-height: 85vh; box-shadow: 0 24px 80px #1d1d1f26; }
#configurations-dialog::backdrop { background: #1d1d1f40; backdrop-filter: blur(5px); }
.configuration-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.configuration-heading h2 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.8px; line-height: 1.2; }
.configuration-heading button { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border-radius: 12px; color: var(--muted); }
.configuration-heading svg { width: 22px; height: 22px; }
.configuration-intro { margin: 8px 0 28px; font-size: 16px; line-height: 1.5; color: var(--muted); }
#configuration-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.configuration-row { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 16px; background: #f7f7f9; border: 1px solid var(--line); border-radius: 16px; transition: border-color 160ms ease, background 160ms ease; }
.configuration-row:has(.configuration-use:not(:disabled)) { cursor: pointer; }
.configuration-row:has(.configuration-use:not(:disabled)):is(:hover, :focus-within) { background: #ececf1; border-color: #c7c7d0; }
.configuration-use { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 40px; border: 0; border-radius: 10px; background: transparent; padding: 4px; }
.configuration-preview { flex: 0 0 88px; width: 88px; height: 72px; display: flex; align-items: center; justify-content: center; }
.configuration-preview svg { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; overflow: hidden; border-radius: 3px; stroke: none; box-shadow: 0 0 0 1px #1d1d1f0d; }
.configuration-copy { flex: 1; min-width: 0; }
.configuration-name { display: block; max-width: 100%; padding: 0; border: 0; border-radius: 3px; background: transparent; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 500; line-height: 1.4; }
.configuration-name:hover:not(:disabled) { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 4px; }
.configuration-name-input { display: block; width: 100%; min-width: 0; padding: 3px 5px; border: 1px solid var(--accent); border-radius: 6px; background: #fff; color: var(--ink); font-size: 18px; line-height: 1.4; }
.configuration-name-input[aria-invalid=true] { border-color: #c33; }
.configuration-copy small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 5px; }
.configuration-arrow { display: flex; flex: 0 0 20px; color: var(--muted); }
.configuration-arrow svg { width: 20px; height: 20px; }
.configuration-remove { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 40px; padding: 0; color: var(--muted); border-radius: 10px; }
.configuration-remove svg { width: 18px; height: 18px; }
.configuration-remove:hover:not(:disabled) { background: #e9e9ed; color: var(--ink); }
#configuration-form { margin: 24px 0 0; }
.configuration-save { display: flex; align-items: stretch; gap: 10px; }
.configuration-save input { min-width: 0; flex: 1; background: #f7f7f9; color: inherit; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 16px; }
.configuration-save .primary { width: auto; border-radius: 12px; padding: 14px 18px; font-size: 15px; white-space: nowrap; box-shadow: none; }
#configuration-status { margin: 14px 0 0; font-size: 13px; }
#configuration-status:empty { display: none; }
#configuration-list:empty::after { content: 'Your saved layouts will appear here.'; padding: 22px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 16px; text-align: center; }

@media (max-width: 1100px) {
  header { padding: 0 28px; }
  main { padding: 24px 28px 0; }
  .brand small { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
  .preview-panel { padding: 18px; }
  .empty-art { transform: scale(.8); height: 103px; margin-bottom: 8px; }
  .empty-canvas .primary { margin-top: 16px; }
}
@media (max-width: 900px) {
  header { height: 76px; }
  main { padding-top: 19px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .workspace aside { display: block; }
  .workspace-intro { margin-bottom: 23px; }
  #sidebar-view { margin-top: 0; }
  .canvas-wrap { min-height: 280px; }
  #stage.vertical { width: min(100%, 320px); }
  .layers-panel, .export-panel { padding: 18px; }
  footer { margin-top: 24px; }
}
@media (max-width: 480px) {
  header { padding: 0 20px; gap: 12px; }
  .brand { font-size: 24px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  main { padding: 16px 20px 0; }
  h1 { font-size: 26px; letter-spacing: -.9px; max-width: 300px; }
  .workspace-intro p { font-size: 16px; }
  .preview-panel { padding: 12px; border-radius: 20px; }
  .canvas-wrap { border-radius: 10px; min-height: 300px; }
  #stage:has(#empty:not([hidden])) { min-height: 320px; }
  .empty-canvas { padding: 12px; }
  .empty-art { transform: scale(.7); height: 90px; margin-top: -8px; margin-bottom: 10px; }
  .empty-canvas p { font-size: 22px; }
  .empty-description { font-size: 14px; }
  .empty-canvas .primary { padding: 11px 20px; margin-top: 17px; }
  .transport { gap: 10px; padding: 8px 0; font-size: 13px; }
  #stage.vertical { width: 230px; }
  #configurations-dialog { padding: 22px 18px; border-radius: 24px; }
  .configuration-heading { gap: 8px; }
  .configuration-heading h2 { font-size: 24px; letter-spacing: -.6px; }
  .configuration-intro { font-size: 15px; margin-bottom: 22px; }
  .configuration-row { padding: 10px; gap: 6px; }
  .configuration-preview { width: 48px; height: 54px; flex-basis: 48px; }
  .configuration-name { font-size: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; overflow-wrap: anywhere; }
  .configuration-name-input { font-size: 16px; }
  .configuration-copy small { font-size: 12px; }
  .configuration-remove { width: 28px; flex-basis: 28px; }
  .configuration-save { flex-wrap: wrap; }
  .configuration-save input { flex-basis: 100%; }
  .configuration-save .primary { width: 100%; }
}
@media (max-width: 600px) {
  header { height: auto; padding: 16px 20px; flex-wrap: wrap; gap: 14px; }
  .brand small { display: none; }
  .history-actions { gap: 0; }
  .history-button { width: auto; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.timeline-actions { grid-area: actions; display: flex; gap: 18px; justify-self: end; min-width: 0; }
.timeline-actions button { font-size: 14px; }
#edit-with-transcript { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--control); color: var(--ink); font-weight: 500; white-space: nowrap; transition: background 150ms ease, border-color 150ms ease; }
#edit-with-transcript svg { width: 18px; height: 18px; flex: none; }
#edit-with-transcript:hover:not(:disabled), #edit-with-transcript[aria-expanded=true] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
@media (max-width: 480px) {
  #edit-with-transcript { width: 44px; height: 44px; padding: 0; }
  #edit-with-transcript span { display: none; }
}
.preview-panel:has(#timeline:not([hidden])) .transport { margin-bottom: 14px; }
#timeline { padding: 0 7px; }
#timeline-ruler { position: relative; height: 24px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; user-select: none; }
#timeline-ruler span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
#timeline-ruler span:first-child { transform: none; }
#timeline-ruler span:last-child { transform: translateX(-100%); }
#timeline-track { position: relative; height: 64px; border-radius: 10px; background: var(--control-hover); isolation: isolate; }
#timeline-images { display: block; width: 100%; height: 64px; border-radius: 10px; opacity: .8; }
#timeline-sections { position: absolute; inset: 0; }
#timeline-sections { pointer-events: none; }
.timeline-join { position: absolute; top: 0; bottom: 0; width: 1px; background: #ffffff99; }
#timeline-playhead { position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; box-shadow: 0 0 0 1px #0009, 0 1px 5px #0006; pointer-events: none; z-index: 2; }
#timeline-playhead::before { content: ''; position: absolute; top: -5px; left: -4.5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #0005, 0 2px 4px #0005; }
#timeline #scrubber { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: ew-resize; z-index: 3; }
#timeline-track:has(#scrubber:focus-visible) #timeline-playhead::before { background: var(--focus); }
.timeline-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; font-size: 12px; color: var(--muted); }
.timeline-footer button { font-size: 12px; }
@media (max-width: 480px) {
  .timeline-actions { gap: 12px; }
  .timeline-actions button { font-size: 12px; }
}

.transcript-panel { margin: 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--card-shadow); }
.transcript-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.transcript-heading h2 { flex: none; margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.transcript-heading > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.transcript-heading .quiet { padding: 3px 0; font-size: 13px; }
.transcript-heading .transcript-search-shell { position: relative; flex: 1; min-width: 34px; height: 38px; }
#transcript-search-toggle { position: absolute; z-index: 1; left: calc(100% - 34px); top: 2px; display: grid; place-items: center; width: 34px; height: 34px; padding: 7px; border-radius: 10px; color: var(--muted); transition: left 260ms cubic-bezier(.2,.8,.2,1), color 160ms ease; }
#transcript-search-toggle:hover:not(:disabled) { background: var(--control); color: var(--accent); }
#transcript-search-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.transcript-search-shell.open #transcript-search-toggle { left: 2px; color: var(--accent); }
.transcript-search { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 34px 0 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--control); opacity: 0; }
.transcript-search-shell.open .transcript-search { opacity: 1; }
#transcript-search { width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; outline: none; }
#transcript-search::-webkit-search-cancel-button { appearance: none; }
.transcript-search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--accent-soft); }
#transcript-search-close { position: absolute; right: 3px; top: 3px; width: 30px; height: 30px; padding: 6px; background: transparent; color: var(--muted); border: 0; border-radius: 8px; }
#transcript-search-close:hover { background: var(--surface); color: var(--ink); }
#transcript-search-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
@media (prefers-reduced-motion: reduce) { #transcript-search-toggle { transition: none; } }
#transcript-words { position: relative; padding-block: 2px; max-height: min(560px, 60vh); overflow-y: auto; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; user-select: text; cursor: text; scroll-padding: 16px; }
.transcript-word { border-radius: 4px; padding: 2px 0; }
.transcript-word:hover, .transcript-word.is-current { color: var(--accent); background: var(--accent-soft); }
.transcript-word.is-selected, .transcript-space.is-selected { border-radius: 0; color: var(--ink); background: var(--selection-fill, var(--accent-line)); }
#transcript-words[data-selection-active="false"] { --selection-fill: #dce9f8; }
#transcript-words:focus-visible { outline: none; }
#transcript-help { margin: 12px 0 0; font-size: 12px; }
#transcript-empty { margin: 0; }
@media (max-width: 480px) { .transcript-panel { padding: 14px; } }

#transcript-words:focus-visible .is-focused { outline: 1px solid var(--accent); outline-offset: 2px; }


.transcript-paragraph { padding-left: 44px; margin-bottom: 14px; }
.transcript-paragraph:last-child { margin-bottom: 0; }
.transcript-timestamp { float: left; padding: 0; margin: 0 0 0 -44px; border: 0; background: transparent; color: var(--muted); font-size: 11px; line-height: 22.5px; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; -webkit-user-select: none; user-select: none; }
.transcript-timestamp:hover:not(:disabled) { color: var(--accent); }
.transcript-word.is-match:not(.is-selected) { background: #fff1be; color: var(--ink); }
#transcript-search-status { margin: 0 0 12px; }

.transcript-word-editor { display: inline-block; max-width: 100%; min-width: 3ch; padding: 0 3px; margin: 0; border: 0; border-radius: 4px; background: var(--accent-soft); color: var(--ink); font: inherit; line-height: inherit; outline: 2px solid var(--accent-line); vertical-align: baseline; }

#back-from-transcript { margin: 0 0 12px; padding: 4px 0; color: var(--muted); font-size: 14px; }

#video-layout-shortcut { margin: 2px 0 8px; text-align: left; }
#no-selection { margin: 16px 0 0; }
.dimension-field input { color: var(--ink); }
.caption-size .dimension-field input { display: inline; margin: 0; }
.caption-size .label-row { margin-bottom: 3px; }
@media (max-width: 480px) {
  .history-actions { gap: 0; }
  .history-button { padding: 0 6px; gap: 4px; font-size: 13px; }
  .history-button svg { width: 17px; height: 17px; }
}

.project-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.project-actions #open-configurations { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--control); color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap; }
.project-actions #open-configurations:hover:not(:disabled) { background: var(--control-hover); border-color: #d2d2d7; }
.project-actions #open-configurations svg { color: var(--muted); }
.project-actions svg { width: 19px; height: 19px; flex: none; }
.project-actions .history-button { justify-content: center; width: 36px; height: 36px; padding: 0; }
@media (max-width: 480px) {
  header { gap: 8px; }
  .project-actions { gap: 4px; }
  .project-actions #open-configurations { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .project-actions #open-configurations span { display: none; }
}

#shape-controls { display: grid; gap: 18px; }
#shape-controls .setting { margin: 0; }
#shape-appearance { display: grid; gap: 14px; }
#shape-appearance #decoration-color-control > label { margin: 0; }
.shape-size { padding: 14px; border: 1px solid var(--line); border-radius: 14px; box-shadow: none; margin: 0; background: var(--control); }
.shape-size > legend { float: left; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin: 0 0 12px; }
#shape-dimensions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; clear: both; }
#shape-dimensions .setting { margin: 0; min-width: 0; }
#shape-dimensions .label-row { flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 14px; }
#shape-dimensions .dimension-field { margin-left: 0; background: var(--surface); }
.compact-number .label-row { margin-bottom: 0; }

@media (max-width: 480px) {
  header { flex-wrap: nowrap; }
  .brand small { display: none; }
}

@supports (appearance: base-select) {
  .font-picker, .font-picker::picker(select) { appearance: base-select; }
  select.font-picker { align-items: center; padding-right: 16px; background-image: none; }
  .font-picker::picker(select) { padding: 6px; margin-block: 6px; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 12px 32px #00000014; }
  .font-picker option { padding: 10px 12px; border-radius: 9px; font-size: 18px; line-height: 1.4; }
  .font-picker option:hover, .font-picker option:focus, .font-picker option:checked { background: var(--accent-soft); color: var(--ink); }
  .font-picker option::checkmark { color: var(--accent); }
  .font-picker option[value="__upload-font__"] { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; font: inherit; color: var(--accent); }
}

#color-picker { position: fixed; inset: auto; margin: 0; padding: 18px; width: 288px; max-width: calc(100vw - 24px); overflow: auto; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 12px 40px #0003; }
#color-picker::backdrop { background: transparent; }
.color-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.color-picker-heading h2 { margin: 0; font-size: 16px; font-weight: 600; }
#color-picker-done { padding: 4px; color: var(--accent); font-size: 14px; }
#color-picker-area { position: relative; height: 164px; border-radius: 10px; background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent), var(--picker-hue); cursor: crosshair; touch-action: none; }
#color-picker-area:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
#color-picker-area span { position: absolute; width: 14px; height: 14px; border: 2px solid white; box-shadow: 0 0 0 1px #0007; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
#color-picker-hue { margin: 16px 0; }
#color-picker-hue::-webkit-slider-runnable-track { height: 8px; background: linear-gradient(to right, red, #ff0, #0f0, #0ff, blue, #f0f, red); }
#color-picker-hue::-moz-range-track { height: 8px; background: linear-gradient(to right, red, #ff0, #0f0, #0ff, blue, #f0f, red); }
#color-picker-hue::-webkit-slider-thumb { margin-top: -6px; }
.color-picker-value { display: flex; align-items: center; gap: 10px; }
#color-picker-swatch { width: 30px; height: 30px; flex: none; border: 1px solid var(--line); border-radius: 50%; }
.color-picker-value label { margin: 0; font-size: 13px; color: var(--muted); }
#color-picker-hex { min-width: 0; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--control); color: var(--ink); font-family: inherit; font-size: 15px; font-variant-numeric: tabular-nums; }
#color-picker-hex[aria-invalid=true] { border-color: #c33; }
#color-picker-error { margin: 10px 0 0; font-size: 12px; }

.timeline-footer:has(#timeline-duration:empty):has(#timeline-reset[hidden]) { display: none; }
@media (min-width: 901px) {
  #editor-sidebar:has(#transcript-panel:not([hidden])) { align-self: stretch; contain: size; display: flex; flex-direction: column; }
  #transcript-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  #back-from-transcript { align-self: flex-start; flex: none; }
  #transcript-panel > .transcript-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  #transcript-panel .transcript-heading, #transcript-panel .transcript-search, #transcript-help { flex: none; }
  #transcript-words { flex: 1; min-height: 0; max-height: none; }
}

#timeline-selection { position: absolute; top: -2px; bottom: -2px; background: #007aff35; border: 3px solid var(--accent); border-radius: 8px; pointer-events: none; z-index: 1; }
#scrubber { touch-action: none; }

#transcript-words ::selection { color: var(--ink); background: var(--selection-fill, var(--accent-line)); }
.transcript-space.is-selected { padding: 2px 0; }
#timeline-selection::before, #timeline-selection::after { content: ''; position: absolute; top: -3px; bottom: -3px; width: 12px; border-radius: 5px; background: linear-gradient(#fff, #fff) center / 2px 24px no-repeat, var(--selection-accent, var(--accent)); box-shadow: 0 0 0 1px #fff, 0 2px 4px #0002; }
#timeline-selection::before { left: -6px; }
#timeline-selection::after { right: -6px; }

.selection-actions { position: fixed; z-index: 2500; display: grid; width: 286px; max-width: calc(100vw - 16px); padding: 10px; border: 1px solid #dddde3; border-radius: 18px; background: var(--surface); box-shadow: 0 8px 28px #1d1d1f20, 0 2px 6px #1d1d1f08; user-select: none; animation: selection-actions-in 140ms ease-out; }
.selection-actions::after { content: ''; position: absolute; left: var(--selection-arrow, 50%); bottom: -7px; width: 12px; height: 12px; background: var(--surface); border-right: 1px solid #dddde3; border-bottom: 1px solid #dddde3; transform: translateX(-50%) rotate(45deg); }
.selection-actions[data-placement="below"]::after { top: -7px; bottom: auto; transform: translateX(-50%) rotate(225deg); }
.selection-boundaries { display: grid; gap: 6px; padding: 2px 2px 10px; }
.selection-boundary { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.selection-boundary label { width: 36px; flex: none; margin: 0; padding-left: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
.selection-stepper { display: flex; align-items: center; padding: 2px; border-radius: 10px; background: var(--control); }
.selection-actions button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; font-size: 12px; font-weight: 600; white-space: nowrap; }
.selection-actions button svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.selection-actions .selection-nudge { width: 32px; padding: 7px; color: var(--muted); touch-action: none; }
.selection-actions .selection-nudge:hover:not(:disabled), .selection-actions .selection-nudge:active:not(:disabled) { color: var(--accent); background: var(--surface); }
.selection-time { width: 86px; min-width: 0; padding: 6px 3px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); background: transparent; text-align: center; font: inherit; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; user-select: text; }
.selection-actions .selection-preview { width: 32px; padding: 7px; flex: none; color: var(--muted); border-radius: 50%; }
.selection-actions .selection-preview:hover:not(:disabled), .selection-actions .selection-preview[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.selection-actions .selection-preview svg { fill: currentColor; stroke: none; }
.selection-preview-play, .selection-preview-pause { transform-origin: center; opacity: 1; transform: scale(1); transition: opacity 160ms ease, transform 200ms cubic-bezier(.2, .8, .2, 1); }
.selection-preview-pause, .selection-preview[aria-pressed="true"] .selection-preview-play { opacity: 0; transform: scale(.65); }
.selection-preview[aria-pressed="true"] .selection-preview-pause { opacity: 1; transform: scale(1); }
.selection-time:focus { background: var(--surface); border-color: var(--accent-line); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }
.selection-time[aria-invalid="true"] { border-color: #e53935; }
.selection-action-footer { display: flex; align-items: center; justify-content: space-between; gap: 3px; border-top: 1px solid var(--line); padding-top: 6px; }
.selection-actions output { padding: 0 5px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.selection-actions .selection-full-preview { width: auto; gap: 3px; padding: 7px 5px; border-radius: 8px; }
.selection-full-preview output { padding: 0; color: inherit; font-weight: 500; }
.selection-actions button[id$="-remove"] { color: #e53935; }
.selection-actions button[id$="-remove"]:hover:not(:disabled) { background: #fff1f0; }
.selection-actions button[id$="-keep"] { color: var(--accent); }
.selection-actions button[id$="-keep"]:hover:not(:disabled) { background: var(--accent-soft); }
#timeline-selection[data-edge="start"]::before, #timeline-selection[data-edge="end"]::after { box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--accent-line), 0 2px 8px #007aff40; }
@keyframes selection-actions-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .selection-actions { animation: none; } }
@media (max-width: 600px) { .selection-actions .selection-nudge { min-height: 38px; } }

.video-fit-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.video-fit { display: flex; padding: 3px; border-radius: 10px; background: var(--control); }
.video-fit button { min-width: 68px; padding: 8px 14px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.video-fit button[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px #00000014; }
#video-no-audio { margin: 6px 0 0; }

#video-reposition { width: 100%; margin-top: 12px; padding: 9px 12px; font-size: 14px; }
#video-reposition[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
#stage.repositioning { cursor: grab; }
#stage.repositioning:active { cursor: grabbing; }

@media (prefers-reduced-motion: no-preference) {
  :is(.primary, .secondary, .history-button, .skip-button, .add-tools button, .selection-actions button, .configuration-heading button, .configuration-remove, #edit-with-transcript, #save-layer-name) {
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, scale 180ms cubic-bezier(.2, .8, .2, 1);
  }
  :is(.primary, .secondary, .add-tools button, #edit-with-transcript):active:not(:disabled) { scale: .98; }
  :is(.history-button, .skip-button, .selection-preview, .configuration-heading button, .configuration-remove, #save-layer-name):active:not(:disabled) { scale: .94; }
  :is(.history-button, .selection-nudge) svg, .skip-button svg > path, .layer-arrow, .configuration-arrow { transition: transform 180ms cubic-bezier(.2, .8, .2, 1); transform-origin: center; }
  .selection-nudge[data-direction="-1"]:active:not(:disabled) svg { transform: translateX(-2px); }
  .selection-nudge[data-direction="1"]:active:not(:disabled) svg { transform: translateX(2px); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #undo:hover:not(:disabled) svg, #rewind:hover:not(:disabled) svg > path { transform: rotate(-10deg); }
  #redo:hover:not(:disabled) svg, #forward:hover:not(:disabled) svg > path { transform: rotate(10deg); }
  .layer-select:hover:not(:disabled) .layer-arrow, .configuration-use:hover:not(:disabled) .configuration-arrow { transform: translateX(2px); }
}

#file-drop-overlay { position: fixed; inset: 12px; z-index: 6000; display: grid; place-items: center; padding: 24px; border: 1px solid #a6ceff99; border-radius: 24px; background: linear-gradient(135deg, #e6f3fff0, #f6f5fff0 52%, #eee7fff0); backdrop-filter: blur(5px); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 180ms ease, visibility 0s linear 180ms; }
#file-drop-overlay[aria-hidden="false"] { opacity: 1; visibility: visible; transition-delay: 0s; }
.file-drop-content { display: flex; align-items: flex-start; gap: 20px; width: min(100%, 480px); padding: 30px; border: 1px solid #ffffffe6; border-radius: 24px; background: linear-gradient(135deg, #ffffffb3, #ffffff70); box-shadow: 0 12px 36px #45648a0b, inset 0 1px 0 #ffffffcc; text-align: left; transform: translateY(6px); transition: transform 220ms cubic-bezier(.2, .8, .2, 1); }
#file-drop-overlay[aria-hidden="false"] .file-drop-content { transform: translateY(0); }
.file-drop-icon { flex: 0 0 56px; width: 56px; height: 56px; padding: 13px; border: 1px solid #ffffffcc; border-radius: 17px; background: linear-gradient(145deg, #fff, #e8f2ff); box-shadow: 0 2px 5px #0071e309; color: var(--accent); }
.file-drop-icon svg { width: 100%; height: 100%; stroke-width: 1.6; }
.file-drop-copy { min-width: 0; }
.file-drop-content strong { display: block; font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.6px; }
.file-drop-content p { margin: 7px 0 18px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.file-drop-privacy { display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid #7487a21a; font-size: 12px; line-height: 1.5; color: var(--muted); }
.file-drop-privacy svg { flex: none; width: 15px; height: 15px; stroke-width: 1.4; }
@media (max-width: 480px) {
  .file-drop-content { display: block; padding: 24px 20px; text-align: center; }
  .file-drop-icon { margin: 0 auto 16px; }
  .file-drop-privacy { justify-content: center; }
}

#timeline-selection[data-selection-active="false"] { --selection-accent: #7eade0; border-color: var(--selection-accent); background: #007aff1a; }
