:root {
  --bg: #14171c;
  --panel: #1b1f26;
  --panel-2: #232830;
  --panel-3: #2b313a;
  --letterbox: #090b0e;
  --line: #2f353e;
  --line-soft: #242a32;
  --text: #e8ecf1;
  --muted: #828d9b;
  --muted-2: #5c6672;
  --accent: #ff2e2e;
  --accent-hi: #ff6b62;
  --accent-dim: rgb(255 46 46 / 14%);
  --accent-glow: rgb(255 46 46 / 45%);
  --mark: #46c9b8;
  --mark-dim: rgb(70 201 184 / 16%);
  --mark-line: rgb(70 201 184 / 85%);
  --clip: #a98bf5;
  --clip-dim: rgb(169 139 245 / 16%);
  --clip-line: rgb(169 139 245 / 85%);
  --danger: #e06a5a;
  --success: #7ed5a8;
  --radius: 10px;
  --radius-sm: 7px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-press: cubic-bezier(.2, 0, 0, 1);

  /* button surfaces — shared tactile recipe for every button on the page */
  --key-face: linear-gradient(180deg, #2d333d 0%, #242a34 52%, #1e232c 100%);
  --key-face-hover: linear-gradient(180deg, #363e4a 0%, #2b323d 52%, #242a34 100%);
  --key-face-press: linear-gradient(180deg, #1c212a 0%, #20262f 100%);
  --key-shadow:
    inset 0 1px 0 rgb(255 255 255 / 7%),
    inset 0 -1px 0 rgb(0 0 0 / 32%),
    0 1px 2px rgb(0 0 0 / 30%),
    0 5px 12px -8px rgb(0 0 0 / 65%);
  --key-shadow-hover:
    inset 0 1px 0 rgb(255 255 255 / 10%),
    inset 0 -1px 0 rgb(0 0 0 / 32%),
    0 2px 5px rgb(0 0 0 / 35%),
    0 12px 22px -10px rgb(0 0 0 / 72%);
  --key-shadow-press:
    inset 0 2px 5px rgb(0 0 0 / 52%),
    inset 0 1px 0 rgb(255 255 255 / 3%),
    0 1px 1px rgb(0 0 0 / 25%);
  --key-shadow-press-amber:
    inset 0 2px 6px rgb(120 16 16 / 55%),
    0 1px 2px rgb(0 0 0 / 30%);
  --amber-face: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 50%, #d82424 100%);
  --amber-face-hover: linear-gradient(180deg, #ff9990 0%, var(--accent-hi) 50%, var(--accent) 100%);
  --amber-face-press: linear-gradient(180deg, var(--accent) 0%, #c41d1d 100%);
  --amber-shadow:
    inset 0 1px 0 rgb(255 255 255 / 48%),
    0 2px 5px rgb(0 0 0 / 30%),
    0 8px 18px -7px var(--accent-glow);
  --amber-shadow-hover:
    inset 0 1px 0 rgb(255 255 255 / 55%),
    0 3px 7px rgb(0 0 0 / 30%),
    0 14px 26px -8px var(--accent-glow);
  --teal-face: linear-gradient(180deg, rgb(70 201 184 / 26%) 0%, rgb(70 201 184 / 13%) 100%);
  --teal-shadow:
    inset 0 1px 0 rgb(180 255 244 / 22%),
    0 0 0 1px rgb(70 201 184 / 22%),
    0 2px 6px rgb(0 0 0 / 25%),
    0 7px 16px -8px var(--mark);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  padding: 22px;
  background:
    radial-gradient(1200px 600px at 50% -10%, #20242d 0%, var(--bg) 62%),
    var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: min(1060px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.glyph {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(150deg, var(--accent-hi) 0%, #d42020 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 35%), 0 6px 18px -8px var(--accent-glow);
}

.glyph svg {
  display: block;
}

.name {
  font-weight: 700;
  letter-spacing: .16em;
  font-size: 15px;
  text-transform: uppercase;
}

.sub {
  margin-top: 1px;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .06em;
}

.loader {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 480px;
  min-width: 260px;
  margin-left: auto;
}

.loader input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--panel);
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12.5px;
}

.loader input::placeholder {
  color: var(--muted-2);
}

.loader input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn-load {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 1px solid rgb(255 46 46 / 70%);
  border-radius: var(--radius-sm);
  background: var(--amber-face);
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .02em;
  box-shadow: var(--amber-shadow);
  transition:
    background .16s var(--ease-out),
    border-color .16s var(--ease-out),
    box-shadow .16s var(--ease-out),
    transform .12s var(--ease-press);
}

.btn-load:hover {
  border-color: var(--accent-hi);
  background: var(--amber-face-hover);
  transform: translateY(-1px);
  box-shadow: var(--amber-shadow-hover);
}

.btn-load:active {
  transform: translateY(1px);
  background: var(--amber-face-press);
  box-shadow: var(--key-shadow-press-amber);
}

.viewer {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--letterbox);
  box-shadow: 0 24px 60px -30px rgb(0 0 0 / 80%), inset 0 0 0 1px rgb(255 255 255 / 2%);
}

.viewer iframe,
#player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
  letter-spacing: .03em;
  background: var(--letterbox);
}

.placeholder.err {
  color: var(--danger);
}

.corner {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border-radius: 5px;
  background: rgb(9 11 14 / 55%);
  backdrop-filter: blur(3px);
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.viewer.ready .corner {
  opacity: 1;
}

.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.rec-dot.live {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .35;
  }
}

.console {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel) 0%, #191d24 100%);
}

.tc-block {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.tc {
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: clamp(26px, 5.4vw, 40px);
  line-height: 1;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tc .ff {
  color: var(--accent);
}

.tc .sep {
  color: var(--muted-2);
}

.tc-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 40px;
}

.tc-total {
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tc-label,
.tag,
.lbl {
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: .16em;
  line-height: 1;
  text-transform: uppercase;
}

.shuttle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  text-align: center;
  white-space: nowrap;
}

.shuttle-pill.fwd {
  border-color: rgb(255 46 46 / 40%);
  background: var(--accent-dim);
  color: var(--accent);
}

.shuttle-pill.rev {
  border-color: rgb(70 201 184 / 40%);
  background: var(--mark-dim);
  color: var(--mark);
}

.opts {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.optgroup {
  display: flex;
  align-items: center;
  gap: 7px;
}

.seg {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--key-face);
  box-shadow: var(--key-shadow);
}

.seg button {
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 500;
  transition: background .14s var(--ease-out), color .14s var(--ease-out);
}

.seg button + button {
  border-left: 1px solid rgb(0 0 0 / 32%);
  box-shadow: inset 1px 0 0 rgb(255 255 255 / 4%);
}

.seg button:hover {
  background: rgb(255 255 255 / 5%);
  color: var(--text);
}

.seg button.sel {
  background: var(--amber-face);
  color: #ffffff;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 45%),
    inset 0 -2px 4px rgb(120 16 16 / 32%);
}

.transport {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.tgroup {
  display: flex;
  align-items: center;
  gap: 6px;
}

.divider {
  width: 1px;
  align-self: stretch;
  margin: 2px 4px;
  background: var(--line-soft);
}

.spacer {
  flex: 1 1 auto;
}

.tbtn {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--key-face);
  color: var(--text);
  cursor: pointer;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  box-shadow: var(--key-shadow);
  transition:
    background .16s var(--ease-out),
    border-color .16s var(--ease-out),
    box-shadow .16s var(--ease-out),
    color .16s var(--ease-out),
    transform .12s var(--ease-press);
}

.tbtn:hover {
  border-color: #4a5360;
  background: var(--key-face-hover);
  transform: translateY(-1px);
  box-shadow: var(--key-shadow-hover);
}

.tbtn:active {
  transform: translateY(1px);
  background: var(--key-face-press);
  box-shadow: var(--key-shadow-press);
}

.tbtn svg {
  display: block;
  fill: currentColor;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 38%));
}

.tbtn.play {
  border-color: rgb(255 46 46 / 70%);
  background: var(--amber-face);
  color: #ffffff;
  box-shadow: var(--amber-shadow);
}

.tbtn.play svg {
  filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / 30%));
}

.tbtn.play:hover {
  border-color: var(--accent-hi);
  background: var(--amber-face-hover);
  transform: translateY(-1px);
  box-shadow: var(--amber-shadow-hover);
}

.tbtn.play:active {
  transform: translateY(1px);
  background: var(--amber-face-press);
  box-shadow: var(--key-shadow-press-amber);
}

.tbtn.select-snippet {
  color: var(--mark);
}

.tbtn.select-snippet.set,
.tbtn.on {
  border-color: var(--mark-line);
  background: var(--teal-face);
  color: var(--mark);
  box-shadow: var(--teal-shadow);
}

.tbtn:disabled {
  cursor: not-allowed;
  opacity: .4;
  box-shadow: none;
  transform: none;
}

/* play/pause glyph crossfade — toggled by .is-playing on #playIcon */
#playIcon .ic-play,
#playIcon .ic-pause {
  transition: opacity .18s var(--ease-out);
}

#playIcon .ic-pause {
  opacity: 0;
}

#playIcon.is-playing .ic-play {
  opacity: 0;
}

#playIcon.is-playing .ic-pause {
  opacity: 1;
}

.timeline-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.tl-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.zoomctl {
  display: flex;
  align-items: center;
  gap: 9px;
}

.zval {
  min-width: 34px;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  text-align: right;
}

.zoomctl input[type="range"] {
  appearance: none;
  width: 130px;
  height: 4px;
  border-radius: 3px;
  background: var(--panel-3);
  cursor: pointer;
  outline: none;
}

.zoomctl input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid #3a0a0a;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.zoomctl input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #3a0a0a;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.zoombtn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--key-face);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--key-shadow);
  transition:
    background .16s var(--ease-out),
    border-color .16s var(--ease-out),
    box-shadow .16s var(--ease-out),
    color .16s var(--ease-out),
    transform .12s var(--ease-press);
}

.zoombtn svg {
  display: block;
  fill: none;
  stroke: currentColor;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 35%));
}

.zoombtn:hover {
  border-color: #4a5360;
  background: var(--key-face-hover);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--key-shadow-hover);
}

.zoombtn:active {
  transform: translateY(1px);
  background: var(--key-face-press);
  box-shadow: var(--key-shadow-press);
}

.timeline-scroll {
  overflow: auto hidden;
}

.timeline-scroll::-webkit-scrollbar,
.seq-cards::-webkit-scrollbar {
  height: 9px;
}

.timeline-scroll::-webkit-scrollbar-track {
  background: #12151a;
}

.timeline-scroll::-webkit-scrollbar-thumb,
.seq-cards::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: #333a44;
}

.timeline-scroll::-webkit-scrollbar-thumb:hover,
.seq-cards::-webkit-scrollbar-thumb:hover {
  background: #3f4753;
}

.tl-inner {
  position: relative;
  min-width: 100%;
  user-select: none;
  touch-action: pan-y;
}

.ruler {
  position: relative;
  height: 26px;
  border-bottom: 1px solid var(--line-soft);
  background: #171b21;
}

.tick {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid #333b45;
}

.tick span {
  position: absolute;
  top: 5px;
  left: 5px;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .02em;
  white-space: nowrap;
}

.track {
  position: relative;
  height: 70px;
  background:
    repeating-linear-gradient(90deg, transparent 0 3px, rgb(0 0 0 / 14%) 3px 4px),
    linear-gradient(180deg, #20252d 0%, #1a1e25 100%);
  cursor: pointer;
}

.track::before,
.track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 9px;
  pointer-events: none;
  background-image: radial-gradient(circle, rgb(0 0 0 / 50%) 1.6px, transparent 2.2px);
  background-position: center;
  background-size: 14px 9px;
  opacity: .5;
}

.track::before {
  top: 0;
}

.track::after {
  bottom: 0;
}

.loaded-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: rgb(255 255 255 / 3.5%);
  pointer-events: none;
}

.progress-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: var(--accent-dim);
  pointer-events: none;
}

.mark-region {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  display: none;
  border-left: 2px solid var(--mark-line);
  border-right: 2px solid var(--mark-line);
  background:
    repeating-linear-gradient(135deg, rgb(70 201 184 / 12%) 0 8px, transparent 8px 16px),
    var(--mark-dim);
  cursor: grab;
  pointer-events: auto;
  transition:
    background .28s var(--ease-out),
    border-color .28s var(--ease-out),
    box-shadow .28s var(--ease-out),
    transform .18s var(--ease-out);
}

.mark-region:hover,
.mark-region.dragging {
  box-shadow: inset 0 0 0 1px rgb(70 201 184 / 45%), 0 10px 24px -18px var(--mark);
}

.mark-region.dragging {
  cursor: grabbing;
  transform: translateY(-1px);
}

.trim-grip {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  place-content: center;
  gap: 4px;
  opacity: .65;
  pointer-events: none;
  transition: opacity .18s var(--ease-out), transform .18s var(--ease-out);
}

.trim-grip span {
  width: 3px;
  height: 22px;
  border-radius: 2px;
  background: rgb(232 236 241 / 30%);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 20%);
}

.mark-region:hover .trim-grip,
.mark-region.dragging .trim-grip {
  opacity: .95;
  transform: scaleY(1.08);
}

.trim-handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 22px;
  cursor: ew-resize;
  touch-action: none;
}

.trim-handle::before {
  content: "";
  width: 8px;
  height: 100%;
  border-radius: 4px;
  background: var(--mark);
  box-shadow: 0 0 0 2px rgb(12 21 19 / 65%), 0 0 12px rgb(70 201 184 / 40%);
  transition: width .16s var(--ease-press), box-shadow .16s var(--ease-press), transform .16s var(--ease-press);
}

.trim-handle::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 24px;
  border-radius: 999px;
  background: rgb(12 21 19 / 55%);
  opacity: .55;
  pointer-events: none;
}

.trim-handle:hover::before,
.mark-region.dragging .trim-handle::before {
  width: 10px;
  box-shadow: 0 0 0 2px rgb(12 21 19 / 72%), 0 0 18px rgb(70 201 184 / 62%);
}

.trim-start {
  left: -12px;
}

.trim-end {
  right: -12px;
}

.mark-region.compact .trim-grip {
  opacity: 0;
}

.mark-flag {
  position: absolute;
  top: 0;
  z-index: 6;
  display: none;
  width: 0;
  height: 0;
  pointer-events: none;
}

.mark-flag .lab {
  position: absolute;
  top: 2px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--mark);
  color: #0c1513;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .05em;
}

.mark-flag.in .lab {
  left: 2px;
}

.mark-flag.out .lab {
  right: 2px;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  pointer-events: none;
}

.head-handle {
  position: absolute;
  top: -1px;
  left: 50%;
  width: 13px;
  height: 13px;
  background: var(--accent);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 50%));
  transform: translateX(-50%);
}

.scrub-tip {
  position: absolute;
  top: -30px;
  z-index: 6;
  display: none;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0c0f13;
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}

.sequence {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 1.5%), transparent 92px),
    var(--panel);
}

.seq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}

.seq-title {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  flex: 1 1 320px;
  min-width: 0;
  flex-wrap: wrap;
}

.seq-title .lbl {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding-top: 0;
  line-height: 1;
}

.seq-name-row {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 32px;
}

.seq-count {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgb(12 15 19 / 30%);
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.seq-name {
  width: 260px;
  max-width: 100%;
  height: 32px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: rgb(12 15 19 / 35%);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 32px;
  animation: titleIn .22s var(--ease-out);
}

.seq-name::placeholder {
  color: var(--muted-2);
}

.seq-name:focus-visible {
  border-color: var(--mark-line);
  box-shadow: 0 0 0 3px var(--mark-dim);
}

.seq-name-display {
  display: flex;
  align-items: center;
  gap: 7px;
  width: auto;
  max-width: 320px;
  overflow: hidden;
  height: 32px;
  min-width: 0;
  padding: 1px 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out);
}

.seq-name-display:hover {
  border-color: var(--line-soft);
  background: rgb(12 15 19 / 18%);
}

.seq-name-text {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 30px;
}

.seq-name-text.is-placeholder {
  color: var(--muted-2);
  font-weight: 500;
}

.seq-edit {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--key-face);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--key-shadow);
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out), color .18s var(--ease-out), box-shadow .18s var(--ease-out), transform .12s var(--ease-press);
}

.seq-edit svg {
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 35%));
}

.seq-edit:hover {
  border-color: #4a5360;
  background: var(--key-face-hover);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--key-shadow-hover);
}

.seq-edit:active {
  transform: translateY(1px);
  background: var(--key-face-press);
  box-shadow: var(--key-shadow-press);
}

.seq-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seq-sep {
  align-self: stretch;
  width: 1px;
  min-height: 22px;
  margin: 3px 2px;
  background: var(--line-soft);
}

@keyframes titleIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-seq,
.btn-ghost {
  padding: 8px 13px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  transition:
    background .18s var(--ease-out),
    border-color .18s var(--ease-out),
    color .18s var(--ease-out),
    box-shadow .18s var(--ease-out),
    transform .12s var(--ease-press);
}

.btn-seq {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid rgb(255 46 46 / 70%);
  background: var(--amber-face);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: var(--amber-shadow);
}

.btn-seq .seq-ico {
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 25%));
}

.btn-seq .ic-stop {
  display: none;
}

.btn-seq.playing .ic-play {
  display: none;
}

.btn-seq.playing .ic-stop {
  display: inline;
}

.btn-seq:hover:not(:disabled) {
  border-color: var(--accent-hi);
  background: var(--amber-face-hover);
  transform: translateY(-1px);
  box-shadow: var(--amber-shadow-hover);
}

.btn-seq:active:not(:disabled) {
  transform: translateY(1px);
  background: var(--amber-face-press);
  box-shadow: var(--key-shadow-press-amber);
}

.btn-seq.playing {
  border-color: rgb(224 106 90 / 70%);
  background: linear-gradient(180deg, rgb(224 106 90 / 22%) 0%, rgb(224 106 90 / 10%) 100%);
  color: var(--danger);
  box-shadow:
    inset 0 1px 0 rgb(255 210 204 / 18%),
    0 2px 6px rgb(0 0 0 / 25%),
    0 7px 16px -8px var(--danger);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--key-face);
  color: var(--text);
  box-shadow: var(--key-shadow);
}

.btn-ghost:hover:not(:disabled) {
  border-color: #4a5360;
  background: var(--key-face-hover);
  transform: translateY(-1px);
  box-shadow: var(--key-shadow-hover);
}

.btn-ghost:active:not(:disabled) {
  transform: translateY(1px);
  background: var(--key-face-press);
  box-shadow: var(--key-shadow-press);
}

.btn-ghost.copied {
  border-color: rgb(126 213 168 / 45%);
  background: rgb(126 213 168 / 12%);
  color: var(--success);
}

.btn-ghost.danger {
  color: var(--muted);
}

.btn-ghost.danger:hover:not(:disabled) {
  border-color: rgb(224 106 90 / 40%);
  color: var(--danger);
}

.btn-seq:disabled,
.btn-ghost:disabled {
  cursor: not-allowed;
  opacity: .4;
  box-shadow: none;
  transform: none;
}

.copy-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.copy-status {
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  padding: 4px 7px;
  border: 1px solid rgb(126 213 168 / 35%);
  border-radius: 6px;
  background: #101610;
  color: var(--success);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10.5px;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px) scale(.98);
  pointer-events: none;
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
}

.copy-status.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.copy-status.error {
  border-color: rgb(224 106 90 / 38%);
  background: #19100f;
  color: var(--danger);
}

.seq-body {
  padding: 14px;
  min-height: 104px;
}

.seq-empty {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 70px;
  padding: 12px;
  overflow: hidden;
  border: 1px dashed rgb(70 201 184 / 25%);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgb(70 201 184 / 9%), transparent 54%),
    rgb(12 15 19 / 18%);
  color: var(--muted);
  animation: emptyIn .32s var(--ease-out);
}

.empty-mark {
  position: relative;
  flex: 0 0 auto;
  width: 58px;
  height: 34px;
  border: 1px solid rgb(70 201 184 / 32%);
  border-radius: 7px;
  background: rgb(70 201 184 / 10%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 3%);
}

.empty-mark::before {
  content: "";
  position: absolute;
  inset: 9px 13px;
  border-radius: 4px;
  background: rgb(70 201 184 / 18%);
}

.empty-mark span {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 999px;
  background: var(--mark);
  box-shadow: 0 0 12px rgb(70 201 184 / 45%);
  animation: handleFloat 1.9s ease-in-out infinite;
}

.empty-mark span:first-child {
  left: 9px;
}

.empty-mark span:last-child {
  right: 9px;
  animation-delay: .18s;
}

.empty-copy {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.empty-copy strong {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.empty-copy span {
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.55;
}

.empty-action {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgb(70 201 184 / 48%);
  border-radius: 8px;
  background: var(--teal-face);
  color: var(--mark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--teal-shadow);
  transition: background .16s var(--ease-out), border-color .16s var(--ease-out), box-shadow .16s var(--ease-out), transform .12s var(--ease-press);
}

.empty-action:hover:not(:disabled) {
  border-color: var(--mark-line);
  background: linear-gradient(180deg, rgb(70 201 184 / 34%) 0%, rgb(70 201 184 / 18%) 100%);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgb(180 255 244 / 26%),
    0 0 0 1px rgb(70 201 184 / 30%),
    0 3px 8px rgb(0 0 0 / 25%),
    0 12px 22px -8px var(--mark);
}

.empty-action:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 5px rgb(0 0 0 / 30%);
}

.empty-action:disabled {
  cursor: not-allowed;
  opacity: .42;
  box-shadow: none;
}

@keyframes emptyIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes handleFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

.seq-cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 4px;
}

.seq-cards:empty {
  display: none;
}

.clip-card {
  position: relative;
  flex: 0 0 auto;
  min-width: 176px;
  max-width: 224px;
  padding: 9px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 2.5%), transparent 38%),
    var(--panel-2);
  cursor: grab;
  animation: clip-enter .28s var(--ease-out) both;
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out), box-shadow .18s var(--ease-out), transform .18s var(--ease-out);
}

.clip-card:hover {
  background: var(--panel-3);
  transform: translateY(-1px);
}

.clip-card.active {
  border-color: var(--clip-line);
  background: var(--clip-dim);
  box-shadow: 0 0 0 1px var(--clip-line), 0 0 16px -4px var(--clip);
}

.clip-card.editing {
  border-color: var(--mark-line);
  box-shadow: 0 0 0 1px var(--mark-line), 0 0 18px -6px var(--mark);
}

.clip-card.dragging {
  cursor: grabbing;
  opacity: .45;
}

.clip-card.drop-before {
  box-shadow: inset 3px 0 0 var(--accent);
}

.clip-card.drop-after {
  box-shadow: inset -3px 0 0 var(--accent);
}

@keyframes clip-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.cc-num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: var(--clip);
  color: #160f2a;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
}

.cc-dur {
  flex: 1;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
}

.cc-x {
  padding: 2px 5px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.cc-x:hover {
  background: rgb(224 106 90 / 10%);
  color: var(--danger);
}

.cc-times {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  margin-bottom: 9px;
  padding: 5px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgb(12 15 19 / 28%);
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cc-arrow {
  color: var(--clip);
}

.cc-out {
  color: var(--muted);
}

.cc-play {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--key-face);
  color: var(--text);
  cursor: pointer;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  box-shadow: var(--key-shadow);
  transition: background .18s var(--ease-out), color .18s var(--ease-out), border-color .18s var(--ease-out), box-shadow .18s var(--ease-out), transform .12s var(--ease-press);
}

.cc-play:hover {
  border-color: var(--clip-line);
  background: linear-gradient(180deg, rgb(169 139 245 / 26%) 0%, rgb(169 139 245 / 13%) 100%);
  color: var(--clip);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgb(214 197 255 / 20%),
    0 0 0 1px rgb(169 139 245 / 22%),
    0 3px 8px rgb(0 0 0 / 25%),
    0 10px 20px -9px var(--clip);
}

.cc-play:active {
  transform: translateY(1px);
  background: var(--key-face-press);
  box-shadow: var(--key-shadow-press);
}

.clip-band {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  border-left: 2px solid var(--clip-line);
  border-right: 2px solid var(--clip-line);
  background: var(--clip-dim);
  cursor: pointer;
  pointer-events: auto;
}

.clip-band.active {
  background: rgb(169 139 245 / 28%);
  box-shadow: inset 0 0 0 1px var(--clip-line);
}

.clip-band.editing {
  border-left-color: var(--mark-line);
  border-right-color: var(--mark-line);
  background: linear-gradient(180deg, rgb(70 201 184 / 24%), rgb(70 201 184 / 12%));
  box-shadow: inset 0 0 0 1px var(--mark-line);
}

.clip-band-num {
  position: absolute;
  top: 2px;
  left: 3px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--clip);
  color: #160f2a;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.5;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  padding: 2px 4px;
  color: var(--muted);
}

.legend .item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
}

.kbd {
  min-width: 16px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.legend .note {
  margin-left: auto;
  color: var(--muted-2);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .02em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- taste pass: entrances, exits, delight ---------- */

/* Selection region + flags fade/drop in instead of popping (display:none suppresses
   the animation until they're shown, and it does not replay while dragging). */
.mark-region {
  animation: markRegionIn .2s var(--ease-out);
}

.mark-flag {
  animation: flagDrop .24s var(--ease-out);
}

@keyframes markRegionIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes flagDrop {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Only genuinely new clip cards slide in; existing cards must stay put on re-render. */
.clip-card.no-anim {
  animation: none;
}

/* Removing a clip collapses and fades rather than vanishing. */
.clip-card.leaving {
  pointer-events: none;
  animation: clip-leave .26s var(--ease-press) forwards;
}

@keyframes clip-leave {
  to {
    opacity: 0;
    transform: translateY(6px) scale(.96);
  }
}

/* Easter egg: click the logo for a spin. */
.glyph {
  cursor: pointer;
}

.glyph.spin {
  animation: glyphSpin .7s var(--ease-out);
}

@keyframes glyphSpin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  body {
    padding: 12px;
  }

  .head {
    gap: 10px;
  }

  .brand,
  .loader {
    flex: 1 1 100%;
  }

  .console {
    gap: 12px;
    padding: 11px 12px;
  }

  .tc-block {
    flex-wrap: wrap;
  }

  .transport {
    gap: 8px;
    padding: 10px;
  }

  .divider {
    display: none;
  }

  .spacer {
    flex-basis: auto;
  }

  .tbtn {
    min-width: 40px;
    height: 40px;
  }

  .seq-actions {
    width: 100%;
  }

  .seq-sep {
    display: none;
  }

  .btn-seq,
  .btn-ghost {
    flex: 1 1 132px;
  }

  .zoomctl input[type="range"] {
    width: 90px;
  }

  .legend .note {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- intro / onboarding modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(6 8 11 / 62%);
  backdrop-filter: blur(6px);
  animation: modalBackdropIn .28s var(--ease-out);
}

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

.modal-backdrop.closing {
  animation: modalBackdropOut .2s var(--ease-out) forwards;
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #1f242e 0%, var(--panel) 100%);
  box-shadow:
    0 40px 90px -30px rgb(0 0 0 / 80%),
    inset 0 1px 0 rgb(255 255 255 / 5%);
  animation: modalIn .34s var(--ease-out);
}

.modal-backdrop.closing .modal {
  animation: modalOut .2s var(--ease-press) forwards;
}

@keyframes modalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalBackdropOut {
  to { opacity: 0; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}

@keyframes modalOut {
  to { opacity: 0; transform: translateY(6px) scale(.98); }
}

.modal-head {
  position: relative;
  padding: 22px 22px 8px;
}

.modal-eyebrow {
  color: var(--accent);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.modal-title {
  margin: 6px 44px 0 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.modal-lead {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--key-face);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--key-shadow);
  transition:
    background .16s var(--ease-out),
    border-color .16s var(--ease-out),
    color .16s var(--ease-out),
    box-shadow .16s var(--ease-out),
    transform .12s var(--ease-press);
}

.modal-close svg {
  display: block;
  fill: none;
  stroke: currentColor;
}

.modal-close:hover {
  border-color: #4a5360;
  background: var(--key-face-hover);
  color: var(--text);
}

.modal-close:active {
  transform: translateY(1px);
  background: var(--key-face-press);
  box-shadow: var(--key-shadow-press);
}

.modal-body {
  padding: 10px 22px 4px;
}

.intro-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.intro-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.intro-num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: var(--amber-face);
  color: #ffffff;
  box-shadow: var(--amber-shadow);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
}

.intro-steps strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.intro-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.intro-steps p strong {
  display: inline;
  color: var(--text);
  font-size: inherit;
}

.intro-steps .kbd {
  margin: 0 1px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--line-soft);
}

.modal-dontshow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}

.modal-dontshow input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}
