/* ================================================================ EDITOR
   A light pro tool. The stage is the soft fill with the template playing in a dark 16:9 frame at its centre;
   the inspector on the right is white with hairline sections and export docked at its foot; the timeline under
   the stage is white: ink play button, tabular counters, a quiet frame ruler, pink keyframes, an ink playhead. */

/* the editor's one call to action is Export */
body[data-route="edit"] .top-cta { display: none; }

.editor {
  --insp-w: 336px;
  --names-w: 132px;
  --ruler-h: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--insp-w);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "canvas panel" "timeline panel";
  height: calc(100vh - var(--bar-h)); height: calc(100dvh - var(--bar-h));
  min-height: 600px;
}

/* ---------------------------------------------------------------- stage */
.ed-canvas { grid-area: canvas; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--soft); }
.ed-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 10px 20px 0 14px;
}
.editor .crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font: 500 14px/1 var(--font); }
.editor .back {
  display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 12px 0 6px; flex: none;
  color: var(--ink-2); text-decoration: none; border-radius: 999px; transition: color var(--dur-fast), background-color var(--dur-fast);
}
.editor .back:hover { color: var(--ink); background: #fff; }
.editor .back .ico svg { width: 18px; height: 18px; }
.editor .crumb-sep { color: var(--tick); }
.editor .crumb { color: var(--ink); white-space: nowrap; }
.editor .crumb.dim { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.editor .bar-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.editor .tool-label { color: var(--ink-3); font: 500 13px/1 var(--font); }
.ed-bar .seg { background: #ededf0; border-color: transparent; }
.editor .zoom-read {
  display: inline-grid; place-items: center; min-width: 48px; height: 32px; padding: 0 6px;
  color: var(--ink-3); font: 500 13px/1 var(--font); font-variant-numeric: tabular-nums;
}

/* the ground: the frame is as large as the room allows (container units, no script) */
.ed-ground { position: relative; flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; }
.art { position: relative; width: min(100cqw - 96px, (100cqh - 96px) * 16 / 9); }
.art-label { display: flex; align-items: baseline; gap: 10px; min-width: 0; margin: 0 0 12px; }
.art-name { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font: 600 15px/1.2 var(--font); letter-spacing: -.01em; }
.art-by { flex: none; color: var(--ink-3); font: 500 13px/1.2 var(--font); }
.art-meta { display: inline-flex; align-items: center; gap: 14px; margin-left: auto; flex: none; color: var(--ink-3); font: 500 13px/1.2 var(--font); font-variant-numeric: tabular-nums; }
.art-kind { display: inline-flex; align-items: center; gap: 6px; }
.art-kind .ico svg { width: 13px; height: 13px; }
.art-frame { position: relative; }
.editor .stage { border-radius: var(--frame-r); box-shadow: var(--frame-shadow); }
/* opening: the frame settles in */
.art.intro .art-frame { animation: edIn .6s var(--ease) both; }
.art.intro .art-label { animation: edLabel .5s .08s var(--ease) both; }
@keyframes edIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes edLabel { from { opacity: 0; } }

/* ---------------------------------------------------------------- timeline */
.timeline { grid-area: timeline; min-width: 0; background: #fff; border-top: 1px solid var(--line); user-select: none; -webkit-user-select: none; }
.editor .transport { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 20px 10px 14px; border-bottom: 1px solid var(--line); }
.editor .t-left { display: flex; align-items: center; gap: 8px; }
.editor .transport .icon-btn { width: 36px; height: 36px; }
.editor .transport .icon-btn svg { width: 18px; height: 18px; }
.icon-btn.play { background: var(--ink); border-color: var(--ink); color: #fff; }
.icon-btn.play:hover { background: #26262b; border-color: #26262b; }
.editor .transport .chip-btn { height: 36px; font-size: 13.5px; }
.editor .transport .chip-btn .ico svg { width: 18px; height: 18px; }
.editor .sound-note { display: inline-grid; place-items: center; width: 30px; height: 36px; color: var(--ink-3); opacity: .55; transition: color var(--dur-fast), opacity var(--dur-fast); }
.editor .sound-note.on { color: var(--ink); opacity: 1; }
.editor .sound-note svg { width: 18px; height: 18px; }
.editor .counters { display: flex; align-items: stretch; height: 36px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.editor .counters .mono { display: grid; place-items: center; padding: 0 14px; font: 600 14px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.editor .counters .fc { color: var(--ink); min-width: 74px; }
.editor .counters .tc { color: var(--ink-2); font-weight: 500; border-left: 1px solid var(--line); min-width: 110px; }
.editor .t-right { margin-left: auto; display: flex; align-items: center; gap: 20px; min-width: 0; color: var(--ink-3); font: 500 13px/1 var(--font); }
.editor .dur-read { white-space: nowrap; font-variant-numeric: tabular-nums; }
.editor .keys { display: flex; gap: 14px; margin: 0; white-space: nowrap; }
.editor .keys kbd { margin-right: 4px; }
.editor .keys kbd + kbd { margin-left: -1px; }

.tl-body { display: grid; grid-template-columns: var(--names-w) minmax(0, 1fr); }
.tl-names { display: grid; grid-template-rows: var(--ruler-h) 38px 26px; padding: 4px 0 12px; border-right: 1px solid var(--line); }
.editor .lane-name { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0 12px 0 20px; white-space: nowrap; color: var(--ink-2); font: 500 12.5px/1 var(--font); }
.editor .lane-name .ico svg { width: 12px; height: 12px; }
.editor .ruler-lane { color: var(--ink-3); }
.editor .key-lane .ico { color: var(--pink); }
.editor .lane-n { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.editor .cue-lane .ico { color: var(--ink-2); }
.editor .cue-lane.off { color: var(--ink-3); }
.editor .cue-lane.off .ico { color: var(--ink-3); opacity: .5; }
.tl-lanes { position: relative; min-width: 0; padding: 4px 28px 12px 22px; }

.tl-ruler { position: relative; height: var(--ruler-h); border-bottom: 1px solid var(--line); }
.editor .tick { position: absolute; bottom: 0; width: 0; height: 4px; border-left: 1px solid var(--tick); }
.editor .tick.mid { height: 8px; }
.editor .tick.major {
  height: 20px; padding-left: 4px; border-left-color: var(--ink-3); white-space: nowrap; color: var(--ink-3);
  font: 500 11px/11px var(--font); font-variant-numeric: tabular-nums;
}

/* the track and, laid over its top band, the keyframe handles (siblings: each handle is its own slider) */
.tl-stack { position: relative; }
.tl-track { position: relative; height: 64px; cursor: ew-resize; touch-action: none; outline: none; border-radius: 6px; }
.tl-track:focus-visible { box-shadow: 0 0 0 2px var(--pink-ring); }
/* the clip: one bar the length of the template; what has played tints pink. While a keyframe is dragged the
   timeline holds its scale, so a shortened clip ends short of the track. */
.tl-clip { position: absolute; left: 0; width: 100%; top: 9px; height: 20px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; pointer-events: none; }
.tl-fill { position: absolute; left: 0; top: 9px; height: 20px; background: var(--pink-fill); border-radius: 6px 0 0 6px; pointer-events: none; }
.tl-keys, .tl-cues, .tl-segs { position: absolute; left: 0; right: 0; pointer-events: none; }
.tl-keys { top: 0; height: 38px; }
.tl-cues { top: 40px; height: 20px; }
.tl-cues::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
/* retimed segments on the clip: hatched, with their playback speed (a stretched one is slower, < 1x) */
.tl-segs { top: 9px; height: 20px; }
.editor .tl-seg {
  position: absolute; top: 1px; bottom: 1px; display: grid; place-items: center; overflow: hidden; border-radius: 4px;
  color: var(--ink-2); font: 600 10.5px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap;
  background: repeating-linear-gradient(135deg, rgba(11, 11, 12, .07) 0 1.5px, transparent 1.5px 6px);
  transition: color var(--dur-fast), box-shadow var(--dur-fast);
}
.editor .tl-seg.fast { background: repeating-linear-gradient(135deg, rgba(11, 11, 12, .09) 0 1.5px, transparent 1.5px 3.5px); }
.editor .tl-seg.hold { background: repeating-linear-gradient(90deg, rgba(11, 11, 12, .06) 0 1px, transparent 1px 4px); color: var(--ink-3); font-weight: 500; }
.editor .tl-seg.active { background-color: rgba(255, 61, 139, .1); color: var(--pink); box-shadow: inset 0 0 0 1px rgba(255, 61, 139, .45); }
/* keyframes: pink diamonds, solid once the playhead has passed them, hollow ahead of it. The handle is a 22 px
   hit box over the clip bar only (it ends above the track's middle, where a scrub starts). */
.editor .kf {
  position: absolute; top: 19px; width: 22px; height: 22px; display: grid; place-items: center;
  transform: translate(-50%, -50%); border-radius: 6px; pointer-events: auto; cursor: grab; touch-action: none; outline: none;
}
.editor .kf-d {
  width: 11px; height: 11px; border-radius: 2px; pointer-events: none;
  background: #fff; border: 1.5px solid var(--pink); box-shadow: 0 0 0 2px #fff;
  transform: rotate(45deg); transition: background-color var(--dur-fast), transform .16s var(--ease);
}
.editor .kf.past .kf-d { background: var(--pink); }
.editor .kf:hover .kf-d { transform: rotate(45deg) scale(1.2); }
.editor .kf:focus-visible { z-index: 4; }
.editor .kf:focus-visible .kf-d { box-shadow: 0 0 0 2px #fff, 0 0 0 4.5px var(--pink-ring); transform: rotate(45deg) scale(1.2); }
.editor .kf.drag { z-index: 4; cursor: grabbing; }
.editor .kf.drag .kf-d { background: var(--pink); transform: rotate(45deg) scale(1.3); box-shadow: 0 0 0 2px #fff, 0 2px 8px 2px rgba(255, 61, 139, .35); }
html.kf-grabbing, html.kf-grabbing * { cursor: grabbing !important; }
/* where the dragged key started (its place in the template's own timing) */
.editor .kf-ghost {
  position: absolute; top: 19px; width: 9px; height: 9px; border: 1.5px dashed var(--pink); border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg); opacity: 0; transition: opacity var(--dur-fast);
}
.editor .kf-ghost.on { opacity: .5; }
/* the drag / nudge readout: frame, timecode, and where the key was */
.editor .kf-tip {
  position: absolute; z-index: 6; top: -29px; display: flex; align-items: center; gap: 7px; height: 22px; padding: 0 8px;
  transform: translateX(-50%); border-radius: 6px; background: var(--ink); color: rgba(255, 255, 255, .72);
  font: 500 11px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity .12s, visibility 0s .12s;
}
.editor .kf-tip b { color: #fff; font-weight: 600; }
.editor .kf-tip .was { color: rgba(255, 255, 255, .5); }
.editor .kf-tip::after { content: ''; position: absolute; left: 50%; top: 100%; width: 8px; height: 5px; transform: translateX(-50%); background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.editor .kf-tip[data-edge="l"] { transform: translateX(-12px); }
.editor .kf-tip[data-edge="l"]::after { left: 12px; }
.editor .kf-tip[data-edge="r"] { transform: translateX(calc(-100% + 12px)); }
.editor .kf-tip[data-edge="r"]::after { left: calc(100% - 12px); }
.editor .kf-tip.on { opacity: 1; visibility: visible; transition: opacity .12s; }
.editor .retime-reset { color: var(--pink); border-color: rgba(255, 61, 139, .45); background: var(--pink-soft); }
.editor .retime-reset:hover { color: var(--ink); }
.editor .transport .chip-btn, .editor .counters .mono { white-space: nowrap; }
.editor .counters { flex: none; }
.editor .transport.retimed .keys { display: none; }
.editor .cue { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--ink-3); border-radius: 1px; }
/* the playhead: ink, from the top of the ruler to the bottom of the lanes; its cap carries the frame */
.editor .playhead { position: absolute; z-index: 3; top: calc(-1 * var(--ruler-h) - 1px); bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; }
.editor .ph-cap {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%); display: grid; place-items: center;
  min-width: 28px; height: 18px; padding: 0 6px; border-radius: 5px; background: var(--ink); color: #fff;
  font: 600 11px/1 var(--font); font-variant-numeric: tabular-nums;
}
.editor .ph-cap::after { content: ''; position: absolute; left: 50%; top: 100%; width: 8px; height: 5px; transform: translateX(-50%); background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.tl-track.scrubbing .playhead { box-shadow: 0 0 0 3px rgba(11, 11, 12, .08); }

/* ---------------------------------------------------------------- inspector */
.panel { grid-area: panel; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; border-left: 1px solid var(--line); }
.insp-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line); }
.insp-title { display: flex; align-items: center; gap: 8px; }
.insp-title .ico { color: var(--ink-3); }
.insp-title h2 { margin: 0; font: 600 15px/1 var(--font); letter-spacing: -.01em; }
.insp-free { flex: none; display: flex; align-items: center; gap: 9px; margin: 0; padding: 11px 20px; color: var(--ink-2); font: 450 13px/1.35 var(--font); border-bottom: 1px solid var(--line); }
.insp-free .dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--pink); }
.insp-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 28px;
  scrollbar-width: thin; scrollbar-color: var(--line-3) transparent;
  /* the controls scroll under the export dock: fade them out instead of slicing a label in half */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
}

/* schema groups: one section each, a hairline between */
.panel .controls .group { padding: 18px 0 6px; border-top: 1px solid var(--line); }
.panel .controls .group:first-child { border-top: 0; }
.panel .controls legend { float: left; width: 100%; padding: 0; margin: 0 0 14px; font: 600 13.5px/1 var(--font); color: var(--ink); }
.panel .controls .group > .field:first-of-type { margin-top: 0; }
.panel .field { clear: both; margin: 0 0 14px; }
.panel .f-head { margin-bottom: 7px; min-height: 14px; }
.panel .f-label { font: 500 13px/1.25 var(--font); color: var(--ink-2); }
.panel .f-count, .panel .f-value { font-size: 12px; }
.panel .f-help { font-size: 12px; margin-top: 6px; }
.panel input[type="text"], .panel input[type="number"], .panel select { height: 36px; padding: 0 11px; font-size: 14px; }
.panel textarea { padding: 8px 11px; min-height: 68px; font-size: 14px; line-height: 1.4; }
.panel select { padding-right: 30px; background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; }
.panel input[type="number"] { -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
.panel input[type="number"]::-webkit-inner-spin-button, .panel input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* one-line rows: label | control | value */
.panel .field.row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.panel .field.row > .f-head { display: contents; }
.panel .field.row .f-label { grid-column: 1; grid-row: 1; }
.panel .field.row > input, .panel .field.row > .color-row { grid-column: 2; grid-row: 1; min-width: 0; }
.panel .field.row .f-value, .panel .field.row .switch { grid-column: 3; grid-row: 1; justify-self: end; }
.panel .field.row .f-value { min-width: 3.2ch; text-align: right; color: var(--ink); }
.panel .field.t-color > .color-row, .panel .field.t-number > input { grid-column: 2 / -1; }
.panel .field.row .f-help { grid-column: 1 / -1; }
.panel .field.t-toggle .f-label { grid-column: 1 / 3; }   /* a switch has no middle control: the label takes the room */

/* color: a round swatch inside one hairline field, the hex typed next to it */
.panel .color-row {
  display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 0 0 7px;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-control); transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.panel .color-row:hover { border-color: var(--line-3); }
.panel .color-row:focus-within { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-ring); }
.panel .color-row input[type="color"] { width: 22px; height: 22px; border-radius: 50%; }
.panel .color-row .hex { flex: 1; min-width: 0; height: 34px; padding: 0 6px; border: 0; background: transparent; box-shadow: none; }
.panel .color-row .hex:focus-visible { box-shadow: none; }
.panel .color-row .hex[aria-invalid="true"] { color: var(--err); }

/* range: a thin track that fills pink to a white thumb */
.panel input[type="range"] { -webkit-appearance: none; appearance: none; height: 20px; margin: 0; background: transparent; cursor: pointer; }
.panel input[type="range"]:focus-visible { outline: none; box-shadow: none; }
.panel input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--pink) var(--p, 50%), #e4e4e7 var(--p, 50%)); }
.panel input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: #e4e4e7; }
.panel input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--pink); }
.panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line-3); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s var(--ease), box-shadow .15s;
}
.panel input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1px solid var(--line-3); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.panel input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.1); }
.panel input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); }
.panel input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--pink-ring), 0 1px 3px rgba(0, 0, 0, .2); border-color: var(--pink); }
.panel input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--pink-ring); border-color: var(--pink); }

/* segmented options: equal columns across the inspector */
.panel .field > .seg { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); width: 100%; padding: 3px; gap: 2px; border-radius: 11px; }
.panel .field > .seg span { padding: 7px 4px; text-align: center; font-size: 13px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; }
.panel .field > .seg span::first-letter { text-transform: uppercase; }

/* lists: a small table in one hairline box */
.panel .list { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-control); overflow: hidden; }
.panel .list-cols, .panel .list-row { display: flex; align-items: center; }
.panel .list-cols { height: 28px; border-bottom: 1px solid var(--line); background: var(--soft); color: var(--ink-3); font: 500 12px/1 var(--font); }
.panel .list .row-n { width: 26px; flex: none; text-align: center; font-size: 12px; color: var(--ink-3); }
.panel .list-cols .col { min-width: 0; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel .list-cols .col.txt, .panel .list-row .cell.txt { flex: 2 1 0; }
.panel .list-cols .col.num, .panel .list-row .cell.num { flex: 1 1 0; }
.panel .list-cols .col.num { text-align: right; }
.panel .list-cols .col-x { width: 30px; flex: none; }
.panel .list-rows { display: block; margin: 0; }
.panel .list-row { gap: 0; height: 34px; border-bottom: 1px solid var(--line); }
.panel .list-row .cell { align-self: stretch; min-width: 0; border-left: 1px solid var(--line); }
.panel .list-row .cell input { height: 100%; padding: 0 8px; border: 0; border-radius: 0; background: transparent; font-size: 13.5px; }
.panel .list-row .cell.num input { text-align: right; }
.panel .list-row .cell input:focus-visible { box-shadow: inset 0 0 0 1.5px var(--pink); }
.panel .list-row:hover { background: #fafafb; }
.panel .list-row .rm { width: 30px; height: 30px; flex: none; border: 0; border-radius: 0; background: transparent; color: var(--ink-3); opacity: 0; transition: opacity var(--dur-fast), color var(--dur-fast); }
.panel .list-row:hover .rm, .panel .list-row:focus-within .rm, .panel .list-row .rm:focus-visible { opacity: 1; }
.panel .list-row .rm:hover { color: var(--err); background: transparent; }
.panel .list-row .rm:disabled { opacity: 0 !important; }
.panel .list .add { width: 100%; min-height: 34px; margin: 0; padding: 0 10px; justify-content: flex-start; gap: 6px; border: 0; border-radius: 0; background: transparent; color: var(--ink-2); font-size: 13px; }
.panel .list .add:hover { background: var(--soft); color: var(--ink); }
.panel .list .add:active { transform: none; }
@media (hover: none) { .panel .list-row .rm { opacity: 1; } }

/* image */
.panel .drop { padding: 6px; font-size: 13px; }
.panel .thumb { width: 36px; height: 36px; }

.panel .publish { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.panel .publish .field { margin-bottom: 0; }

/* ---------------------------------------------------------------- export, docked at the inspector's foot */
.export { flex: none; position: relative; padding: 16px 20px 20px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -14px 28px -24px rgba(15, 15, 30, .25); }
.editor .exp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.export h2 { margin: 0; font: 600 15px/1 var(--font); letter-spacing: -.01em; }
.editor .exp-size { font-size: 12.5px; color: var(--ink-3); }
.editor .formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.editor .fmt {
  position: relative; display: block; min-width: 0; padding: 10px 11px 11px; cursor: pointer;
  background: #fff; border: 1px solid var(--line-2); border-radius: 12px; transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.editor .fmt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.editor .fmt-body { display: block; pointer-events: none; }
.editor .fmt-body strong { display: block; font: 600 14px/1.1 var(--font); color: var(--ink); }
.editor .fmt-body small { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 450 12px/1.2 var(--font); color: var(--ink-3); }
.editor .fmt-alpha { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font: 500 11.5px/1 var(--font); color: var(--ink-2); }
.editor .fmt-alpha .ico svg { width: 12px; height: 12px; }
.editor .fmt-alpha.none { color: var(--ink-3); }
.editor .fmt:hover { border-color: var(--line-3); }
.editor .fmt:has(input:checked) { border-color: var(--pink); background: var(--pink-soft); }
.editor .fmt:has(input:checked) .fmt-alpha { color: var(--ink); }
.editor .fmt:has(input:focus-visible) { outline: 2px solid var(--pink); outline-offset: 2px; }
.editor .fmt-note { margin: 9px 0 0; min-height: 17px; color: var(--ink-2); font: 450 12.5px/1.35 var(--font); }
/* resolution | frame rate, then the one pink button */
.editor .exp-row { display: flex; align-items: stretch; gap: 8px; margin-top: 12px; }
.editor .res-seg, .editor .fps-seg { flex: 2 1 0; display: flex; flex-wrap: nowrap; min-width: 0; padding: 3px; }
.editor .fps-seg { flex-grow: 3; }
.editor .res-seg label, .editor .fps-seg label { flex: 1 1 0; display: flex; min-width: 0; }
.editor .res-seg span, .editor .fps-seg span { flex: 1; display: grid; place-items: center; min-height: 30px; padding: 0 4px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.editor .exp-go { min-height: 42px; margin-top: 10px; padding: 0 14px; font-size: 14.5px; }
.export.busy .btn.primary.wide { opacity: 1; background: var(--soft); border-color: var(--line); color: var(--ink-3); }
.editor .exp-progress { margin-top: 12px; }
.export .bar { position: relative; height: 6px; margin: 0 0 8px; overflow: hidden; border-radius: 3px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.export .bar span { display: block; width: 100%; height: 100%; border-radius: 3px; background: var(--pink); transform: scaleX(0); transform-origin: 0 50%; transition: transform .3s var(--ease), background-color .3s; }
.export.done .bar span { background: var(--ink); }
.editor .exp-status { margin: 0; color: var(--ink-2); font: 450 12.5px/1.35 var(--font); overflow-wrap: anywhere; }
.editor .exp-status .mono { color: var(--ink); }
.editor .exp-status.err { color: var(--err); }
.export .download { min-height: 40px; margin-top: 10px; background: var(--ink); border-color: var(--ink); color: #fff; animation: edLabel .35s var(--ease) both; }
.export .download:hover { background: #26262b; border-color: #26262b; }
/* after an export: one quiet ask to join the early-access list */
.exp-ask { margin-top: 14px; padding: 12px; border-radius: 14px; background: var(--soft); animation: edLabel .35s var(--ease) both; }
.ask-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.ask-head p { flex: 1; margin: 0; font: 500 13.5px/1.4 var(--font); color: var(--ink); text-wrap: pretty; }
.ask-x { flex: none; width: 26px; height: 26px; margin: -3px -3px 0 0; border-color: transparent; background: transparent; color: var(--ink-3); }
.ask-x:hover { color: var(--ink); border-color: var(--line-3); background: #fff; }
.exp-ask .wl-bar { height: 42px; }
.exp-ask .wl-bar .btn { min-height: 32px; }
.exp-ask .wl-done { padding: 0; background: transparent; font-size: 13.5px; }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1280px) {
  .editor .keys { display: none; }
}
@media (max-width: 1100px) {
  .editor { --insp-w: 304px; --names-w: 112px; }
  .editor .tool-label, .crumb.dim { display: none; }
}
@media (max-width: 900px) {
  .editor { display: block; height: auto; min-height: 0; }
  .ed-bar { flex-wrap: wrap; row-gap: 8px; padding: 12px 16px 0 10px; }
  .ed-ground { container-type: inline-size; display: block; padding: 24px 16px 32px; }
  .art { width: 100%; }
  .timeline { border-bottom: 1px solid var(--line); }
  .panel { display: block; border-left: 0; }
  .insp-scroll { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .export { box-shadow: none; }
}
@media (max-width: 640px) {
  .editor .bar-tools { width: 100%; }
  .editor .bar-tools .seg { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); }
  .editor .bar-tools .seg span { text-align: center; padding: 6px 4px; }
  .editor .zoom-read { min-width: 42px; padding: 0 2px; }
  .art-label { flex-wrap: wrap; row-gap: 4px; }
  .art-meta { margin-left: 0; width: 100%; }
  .editor .transport { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .editor .transport .chip-btn { width: 36px; padding: 0; justify-content: center; }
  .editor .transport .chip-btn > span:not(.ico) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .editor .counters { margin-left: auto; }
  .editor .counters .mono { padding: 0 11px; }
  .editor .counters .tc { min-width: 0; }
  .editor .t-right { display: none; }
  .tl-body { grid-template-columns: minmax(0, 1fr); }
  .tl-names { display: none; }
  .tl-lanes { padding: 4px 20px 12px; }
  .insp-head { padding: 0 14px 0 16px; }
  .insp-free { padding: 11px 16px; }
  .insp-scroll { padding: 0 16px 24px; }
  .export { padding: 16px 16px 20px; }
}

/* waitlist stage: keyframes are markers you click to jump to (no retiming), and the export panel is closed */
.editor .tl-keys.kf-view .kf { cursor: pointer; }
.export.locked .exp-lock { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
