/* The studio. Design tokens and global primitives live in tokens.css, which every
   page loads first - see the note at the top of that file. */

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.mono { font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; }
.spacer { flex: 1; }
.hint-inline { color: var(--faint); }

/* ------------------------------------------------------------------ top */
.topbar {
  display: flex; align-items: center; gap: 6px;
  height: 48px; padding: 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: -0.01em; margin-right: 6px; }
.brand .mark { flex: none; display: block; }
.scene-name {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  padding: 5px 8px; min-width: 200px; color: var(--muted);
}
.scene-name:hover { background: var(--raised); }
.scene-name:focus { outline: none; background: var(--raised); color: var(--text); }

/* ---------------------------------------------------------------- layout */
.layout {
  display: grid;
  grid-template-columns: 264px minmax(360px, 1fr) 296px;
  height: calc(100% - 48px);
}
.panel { background: var(--panel); overflow-y: auto; display: flex; flex-direction: column; }
.panel.left { border-right: 1px solid var(--line); }
.panel.right { border-left: 1px solid var(--line); }

.block { padding: 14px; border-bottom: 1px solid var(--line-soft); }
.block:last-child { border-bottom: none; }
.block.grow { flex: 1; min-height: 100px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.block h2 {
  margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); font-weight: 600;
}
.count { color: var(--muted); font-weight: 400; letter-spacing: 0; }

/* --------------------------------------------------------------- inputs */
textarea, input[type="text"], input[type="number"], input:not([type]), select {
  width: 100%; background: var(--raised); border: 1px solid transparent;
  border-radius: var(--r); padding: 8px 10px;
}
textarea { resize: vertical; line-height: 1.55; min-height: 84px; }
textarea::placeholder { color: var(--faint); }
textarea:hover, input:hover, select:hover { border-color: var(--line); }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); }
input[type="color"] { padding: 0; height: 30px; background: none; border: 1px solid var(--line); border-radius: 6px; }

.row { display: flex; gap: 8px; margin: 10px 0; align-items: flex-end; }
.field { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 11px; color: var(--faint); }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; padding: 2px 0; }
.check input { width: auto; accent-color: var(--accent); }

/* -------------------------------------------------------------- buttons */
button {
  background: var(--raised); border: 1px solid transparent; border-radius: var(--r);
  padding: 8px 12px; cursor: pointer; color: var(--text);
  transition: background .12s, border-color .12s, color .12s;
}
button:hover { background: var(--raised); border-color: var(--line); }
button:disabled { opacity: .45; cursor: not-allowed; }

button.primary {
  width: 100%; background: var(--accent); color: var(--accent-ink); font-weight: 600;
  margin-top: 10px;
}
button.primary:hover { background: var(--accent-hover); }
button.secondary { width: 100%; margin-top: 8px; }
button.quiet { background: transparent; color: var(--muted); }
button.quiet:hover { background: var(--raised); color: var(--text); }
button.small { padding: 5px 9px; font-size: 12.5px; }
button.icon {
  background: transparent; color: var(--muted); padding: 6px 9px; line-height: 1; min-width: 32px;
}
button.icon:hover { background: var(--raised); color: var(--text); }
button.icon.play { color: var(--accent); font-size: 12px; }

/* segmented control */
.seg { display: inline-flex; background: var(--raised); border-radius: var(--r); padding: 2px; gap: 2px; }
.seg button { background: transparent; border: none; padding: 6px 11px; border-radius: 6px; color: var(--muted); }
.seg button:hover { color: var(--text); background: transparent; }
.seg button.on { background: var(--accent-weak); color: var(--text); }

/* Icon-only controls: square, comfortably above the 24px minimum pointer target, and
   dimmed until they are the active tool so the row reads as one object rather than six. */
.icon-btn {
  width: 30px; height: 28px; padding: 0;
  display: grid; place-items: center;
  color: var(--muted);
  transition: color var(--t) var(--ease), background var(--t) var(--ease);
}
.icon-btn:hover { color: var(--text); }
.seg .icon-btn.on { color: var(--accent); }
.seg.small { width: 100%; margin-top: 8px; }
.seg.small button { flex: 1; font-size: 12.5px; padding: 6px 8px; }

/* ----------------------------------------------------------------- menus */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 190px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; gap: 2px;
}
.menu.right { left: auto; right: 0; }
.menu.wide { width: 232px; }
.menu button, .menu .menu-file {
  background: transparent; text-align: left; padding: 7px 9px; border-radius: 6px;
  color: var(--muted); font-size: 13px; cursor: pointer; display: block; width: 100%;
}
.menu button:hover, .menu .menu-file:hover { background: var(--raised); color: var(--text); }
.menu .check { padding: 7px 9px; font-size: 13px; }
.menu-field { display: flex; flex-direction: column; gap: 5px; padding: 7px 9px; color: var(--faint); font-size: 11px; }

/* ------------------------------------------------------------ status/hint */
.status { margin-top: 10px; font-size: 12.5px; min-height: 15px; color: var(--muted); white-space: pre-wrap; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }
.hint { color: var(--faint); font-size: 12px; margin: 10px 0 0; line-height: 1.5; }
.movehint { color: var(--faint); font-size: 12px; margin: 8px 0 0; line-height: 1.45; }

.quiet-details { margin-top: 12px; }
.quiet-details summary { cursor: pointer; color: var(--faint); font-size: 12.5px; list-style: none; }
.quiet-details summary::-webkit-details-marker { display: none; }
.quiet-details summary::before { content: '+ '; }
.quiet-details[open] summary::before { content: '- '; }
.quiet-details summary:hover { color: var(--muted); }
.quiet-details .example {
  display: block; width: 100%; text-align: left; margin-top: 7px; font-size: 12.5px;
  color: var(--muted); line-height: 1.45; background: var(--raised); padding: 8px 10px;
}
.quiet-details .example:hover { color: var(--text); }
.menu-item { display: block; width: 100%; text-align: left; margin-top: 6px; font-size: 13px; color: var(--muted); }

/* -------------------------------------------------------------- palette */
.palette { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.palette button {
  padding: 8px 4px; font-size: 12px; text-transform: capitalize; color: var(--muted);
  background: var(--raised);
}
.palette button:hover { color: var(--text); }

/* ---------------------------------------------------------------- lists */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.list li {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: 7px; cursor: pointer; color: var(--muted);
}
.list li:hover { background: var(--raised); color: var(--text); }
.list li.selected { background: var(--accent-weak); color: var(--text); }
.list li .swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.list li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li .type { color: var(--faint); font-size: 11px; }
.list li .kill { background: none; border: none; color: var(--faint); padding: 0 3px; opacity: 0; }
.list li:hover .kill { opacity: 1; }
.list li .kill:hover { color: var(--danger); background: none; }

.list.shots .num {
  width: 19px; height: 19px; flex: none; border-radius: 5px; background: var(--raised);
  color: var(--faint); font-size: 10.5px; display: flex; align-items: center; justify-content: center;
}
.list.shots li.selected .num { background: var(--accent); color: var(--accent-ink); }
.list.shots .meta { color: var(--faint); font-size: 10.5px; }
.list.shots .arrows { display: flex; flex-direction: column; gap: 1px; opacity: 0; }
.list.shots li:hover .arrows { opacity: 1; }
.list.shots .arrows button { background: none; border: none; padding: 0 3px; line-height: 1; font-size: 8px; color: var(--faint); }
.list.shots .arrows button:hover { color: var(--text); background: none; }
.pill {
  display: inline-block; padding: 1px 6px; border-radius: 20px; font-size: 10px;
  background: var(--raised); color: var(--faint);
}
.pill.on { background: rgba(125, 217, 143, .16); color: var(--ok); }

/* ----------------------------------------------------------------- tabs */
.tabs { display: flex; padding: 8px 10px 0; gap: 2px; border-bottom: 1px solid var(--line-soft); }
.tab {
  background: transparent; border: none; border-radius: 7px 7px 0 0; padding: 8px 13px;
  color: var(--faint); font-size: 12.5px; border-bottom: 2px solid transparent;
}
.tab:hover { background: transparent; color: var(--muted); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* ---------------------------------------------------------------- stage */
.stage { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.canvas-wrap {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
#viewport { display: block; width: 100%; height: 100%; }
.shot-frame { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 183, 77, .4); }
.shot-badge {
  position: absolute; left: 14px; top: 12px; padding: 4px 10px; border-radius: 20px;
  background: rgba(8, 11, 15, .75); color: var(--text); font-size: 12px;
  pointer-events: none; border: 1px solid var(--line);
}

/* -------------------------------------------------------------- timeline */
.timeline {
  display: flex; flex-direction: column; gap: 8px; padding: 10px;
  border-top: 1px solid var(--line); background: var(--panel);
}
.strip {
  position: relative; height: 28px; display: flex; gap: 2px;
  background: var(--raised); border-radius: var(--r); padding: 2px;
  overflow: hidden; cursor: pointer; user-select: none;
}
.strip .seg-shot {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-width: 0; border-radius: var(--r-sm); background: var(--raised); color: var(--faint);
  font-size: 11px; white-space: nowrap; overflow: hidden; padding: 0 8px;
}
.strip .seg-shot.active { background: var(--accent); color: var(--accent-ink); }
.strip .segname { overflow: hidden; text-overflow: ellipsis; }
.playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--amber);
  pointer-events: none; z-index: 2;
}

/* ----------------------------------------------------------- camera panel */
.cam-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cam-row label { color: var(--muted); font-size: var(--fs-sm); }
.cam-row select { flex: 1; }

.cam-grid { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px; align-items: center; }
.cam-axis { color: var(--muted); font-size: var(--fs-sm); padding-right: 4px; }
.cam-grid button { padding: 7px 10px; }

.cam-readout { color: var(--faint); font-size: var(--fs-xs); margin-top: 10px; }

.cam-zoom { display: flex; align-items: center; gap: 10px; }
.cam-zoom span { color: var(--muted); font-size: var(--fs-sm); }
.cam-zoom input { flex: 1; }
.cam-zoom-scale {
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--faint); font-size: var(--fs-xs); margin-top: 4px;
}
.cam-zoom-scale .mono { color: var(--amber); }

/* ---------------------------------------------------------------- library */
.library { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.library li {
  display: flex; align-items: center; gap: 10px;
  background: var(--raised); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 8px 10px;
}
.library .clip-name {
  flex: 1; min-width: 0; font-size: var(--fs-sm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.library .clip-meta { font-size: var(--fs-xs); color: var(--faint); white-space: nowrap; }
.library .clip-meta.expiring { color: var(--amber); }
.library a, .library button { flex: none; }
.library .empty { color: var(--faint); font-size: var(--fs-sm); padding: 4px 2px; }

/* --------------------------------------------------------------- coverage
   The edit strip answers "what plays next". This answers "what else did we shoot of
   this moment" - and they are different questions that a single track cannot hold,
   because the whole point of coverage is that two shots occupy the SAME ten seconds. */
.track-switch { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.track-switch .seg.small { width: auto; flex: none; margin-top: 0; }
.track-switch .hint-inline { font-size: var(--fs-xs); }

.coverage {
  position: relative; background: var(--raised); border-radius: var(--r);
  padding: 4px; overflow: hidden; user-select: none; min-height: 28px;
}
.coverage-lane { position: relative; height: 20px; margin-bottom: 3px; }
.coverage-lane:last-child { margin-bottom: 0; }

.coverage-shot {
  position: absolute; top: 0; height: 100%;
  display: flex; align-items: center; padding: 0 7px;
  border-radius: var(--r-sm); background: var(--panel); border: 1px solid var(--line);
  color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden;
  cursor: pointer; transition: border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.coverage-shot:hover { border-color: var(--muted); color: var(--text); }
.coverage-shot.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* A shot sharing its window with another is the thing this view exists to show, so it
   is marked rather than left for the reader to notice from the geometry. */
.coverage-shot.stacked { border-left-width: 3px; border-left-color: var(--amber); }
.coverage-shot.active.stacked { border-left-color: var(--accent-ink); }
.coverage-empty { color: var(--faint); font-size: var(--fs-xs); padding: 4px 6px; }
.transport { display: flex; align-items: center; gap: 10px; }
.transport #scrub { flex: 1; accent-color: var(--accent); background: none; border: none; padding: 0; }
.transport #timeLabel { color: var(--faint); }

/* ------------------------------------------------------------ properties */
.props { padding: 0; }
.props.empty { color: var(--faint); font-size: 12.5px; padding: 14px; text-align: center; }
.props .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.props label.tiny, .keyedit label.tiny {
  font-size: 11px; color: var(--faint); display: block; margin: 12px 0 4px;
}
.props input[type="number"], .keyedit input[type="number"] { padding: 6px 8px; }
.subhead {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint);
}
.keyrow, .motionrow {
  display: flex; align-items: center; gap: 4px; padding: 3px 4px; margin-top: 3px;
  border-radius: 6px; font-size: 12px;
}
.keyrow:hover, .motionrow:hover { background: var(--raised); }
.keyrow.selected { background: var(--accent-weak); }
.keyrow .keylabel {
  flex: 1; text-align: left; background: none; border: none; padding: 3px 4px;
  color: var(--muted); font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: 11.5px;
}
.keyrow .keylabel:hover { color: var(--text); background: none; }
.motionrow .mono { flex: 1; color: var(--muted); }
.keyrow button, .motionrow button { padding: 3px 7px; font-size: 11px; background: transparent; color: var(--faint); }
.keyrow button:hover, .motionrow button:hover { background: var(--raised); color: var(--text); }
.keyedit { margin: 4px 0 10px; padding: 10px; border-radius: var(--r); background: var(--raised); }
.keyedit .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
input[type="range"].slim { width: 100%; accent-color: var(--accent); background: none; border: none; padding: 0; }

.shotprompt {
  width: 100%; font-size: 12.5px; line-height: 1.55; resize: vertical; min-height: 96px;
  background: var(--raised); border: 1px solid transparent; border-radius: var(--r); padding: 9px 10px;
}

/* ------------------------------------------------------ camera key timing */
.keytime {
  position: relative; height: 24px; margin: 8px 0;
  background: var(--raised); border-radius: 6px; cursor: pointer;
}
.keytime-head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--amber); pointer-events: none; }
.keytime-dot {
  position: absolute; top: 50%; width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-size: 9.5px; line-height: 17px; text-align: center; cursor: ew-resize;
  touch-action: none; user-select: none;
}
.keytime-dot.pinned { background: var(--amber); }
.keytime-dot.active { box-shadow: 0 0 0 2px rgba(79, 195, 247, .5); }

/* ---------------------------------------------------------------- sheet */
.sheet {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 9, 12, .6); backdrop-filter: blur(3px);
}
.sheet-inner {
  width: min(420px, 90vw); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.sheet h3 { margin: 0 0 14px; font-size: 15px; }
.sheet dl { display: grid; grid-template-columns: 88px 1fr; gap: 7px 12px; margin: 0 0 4px; }
.sheet dt { color: var(--text); font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: 11.5px; }
.sheet dd { margin: 0; color: var(--muted); font-size: 13px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--r-sm); border: 2px solid var(--panel); }
::-webkit-scrollbar-track { background: var(--panel); }

@media (max-width: 1180px) {
  .toolbar #shotInfo { display: none; }   /* the readout is the first thing to go */
}

@media (max-width: 940px) {
  .block { padding: 11px; }
  .scene-name { min-width: 120px; }
  .toolbar { gap: 5px; flex-wrap: wrap; }
  .list li .type { display: none; }
}

/* ============================================================ v3 UI polish */

/* breathing room: the old panels were shoulder to shoulder */
.topbar { height: 52px; gap: 8px; padding: 0 16px; }
.toolbar { padding: 10px 12px; gap: 10px; }
.block { padding: 16px; }
.list li { padding: 8px 10px; }
button { padding: 9px 13px; }
button.small { padding: 6px 10px; }
.seg button { padding: 7px 12px; }
.row { gap: 10px; margin: 12px 0; }

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

/* undo / redo: their own cluster next to File, not lost among the text buttons */
.history { display: inline-flex; gap: 2px; background: var(--raised); border-radius: var(--r); padding: 2px; }
.history button { padding: 6px 8px; min-width: 30px; display: flex; align-items: center; justify-content: center; }
.history button:disabled { opacity: .3; }

button.icon svg { display: block; }
button.primary.inline { width: auto; margin: 0; padding: 9px 18px; }

/* toolbar extras */
.inline-slider {
  display: flex; align-items: center; gap: 8px; color: var(--faint);
  font-size: 12px; white-space: nowrap;
}
.inline-slider input[type="range"] { width: 108px; }
.draw-hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  padding: 7px 14px; border-radius: 20px; font-size: 12.5px;
  background: rgba(8, 11, 15, .82); border: 1px solid var(--line); color: var(--muted);
  pointer-events: none; max-width: 80%; text-align: center;
}

/* sliders in panels */
.slider-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--faint); margin: 12px 0 5px;
}
.slider-label .mono { color: var(--muted); }

/* menus */
.menu-label {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); padding: 8px 9px 4px;
}
.menu button.menu-strong { color: var(--text); font-weight: 500; }
.menu .palette { padding: 2px; }

/* modals */
.sheet-inner.wide { width: min(520px, 92vw); }
.sheet-inner .tiny { font-size: 11px; color: var(--faint); display: block; margin: 14px 0 5px; }
.sheet-inner .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 4px; }
.type-grid button {
  padding: 10px 4px; font-size: 11.5px; text-transform: capitalize;
  color: var(--muted); background: var(--raised); border: 1px solid transparent;
}
.type-grid button.on { border-color: var(--accent); color: var(--text); background: var(--accent-weak); }

/* the "ask the camera" box */
.ask-row { display: flex; gap: 8px; margin-top: 8px; }
.ask-row input { flex: 1; }
.ask-row button { flex: none; }

@media (max-width: 1180px) {
  .toolbar .divider { display: none; }
  .inline-slider input[type="range"] { width: 74px; }
}
@media (max-width: 1000px) {
  .type-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --------------------------------------------------- aim bar (shot view) */
/* The arrival control lives with "This key" because that is the moment the question comes
   up: you have just aimed one key, and the next thing you want to know is whether the
   camera swings there or cuts there. */
.aim-arrive { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.aim-arrive select { font-size: var(--fs-xs); padding: 3px 6px; border-radius: var(--r-sm); }

/* A floating overlay on the viewport, so it has to fit INSIDE the viewport rather than
   assume the width it wants. It grew a second control and started running off the right
   edge on a narrow pane, taking the aim readout with it. Capping the width and letting it
   wrap keeps every control reachable at any size - which matters more here than staying
   on one line, because these are the controls you use while dragging in the picture. */
.aim-bar {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  gap: 8px 10px; flex-wrap: wrap;
  max-width: calc(100% - 24px);
  padding: 6px 10px 6px 14px; border-radius: 18px;
  background: rgba(8, 11, 15, .86); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.aim-bar > * { flex: none; }
.aim-bar .aim-label { color: var(--faint); }
/* The readout changes every frame while dragging; a min-width stops the row reflowing
   under the cursor, and truncation stops it forcing a wrap on a narrow pane. */
.aim-bar .mono {
  color: var(--amber); min-width: 96px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seg.tiny-seg { padding: 2px; }
.seg.tiny-seg button { padding: 4px 10px; font-size: 12px; }

.transport-label { color: var(--faint); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.transport .seg.small { width: auto; margin-top: 0; flex: none; }

/* transport buttons should never wrap onto two lines */
.transport .seg button, .toolbar .seg button { white-space: nowrap; }
.transport { flex-wrap: nowrap; }

/* ------------------------------------------------------- resizable panels */
.layout {
  --left-w: 264px;
  --right-w: 300px;
  grid-template-columns: var(--left-w) 5px minmax(320px, 1fr) 5px var(--right-w);
}
.splitter {
  background: var(--line-soft);
  cursor: col-resize;
  transition: background .12s;
  position: relative;
}
.splitter::after {
  content: ''; position: absolute; inset: 0 -3px;   /* a forgiving grab area */
}
.splitter:hover, .splitter.dragging { background: var(--accent); }
body.resizing { cursor: col-resize; user-select: none; }

/* shot rows: the name gets the space, the timing shrinks */
.list.shots .name { min-width: 0; }
.list.shots .meta { flex: none; opacity: .75; }

/* Narrow screens get narrower panels. These sit after the base .layout rule so they
   actually win; a width the user has dragged is inline and wins over both. */
@media (max-width: 1180px) {
  .layout { --left-w: 232px; --right-w: 268px; }
}
@media (max-width: 940px) {
  .layout { --left-w: 196px; --right-w: 232px; }
}

/* ------------------------------------------------------------- credits chip */
.credits-chip {
  display: flex; align-items: baseline; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--raised); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.credits-chip:hover { border-color: var(--accent); }
.credits-chip .unit { color: var(--muted); font-size: 11.5px; }
.credits-chip .plan {
  color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  padding-left: 6px; margin-left: 2px; border-left: 1px solid var(--line);
}
.credits-chip.low { border-color: var(--amber); }
.credits-chip.spent { border-color: var(--danger); }

/* The price rides on the button so the cost is read at the moment of spending it. */
button .price {
  margin-left: 7px; padding: 1px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); font-size: 11px;
  font-variant-numeric: tabular-nums; opacity: .9;
}

/* ------------------------------------------------------- collapsible blocks */
.block-head { gap: 8px; }
.collapse-toggle {
  background: transparent; border: none; padding: 2px; margin: 0 -2px 0 0;
  color: var(--faint); display: flex; align-items: center; justify-content: center;
  flex: none; width: 18px; height: 18px; border-radius: 4px;
}
.collapse-toggle:hover { background: var(--raised); color: var(--text); }
.collapse-toggle svg { transition: transform .15s ease; }
.block.collapsible .block-head h2 { margin-right: auto; }
.block.collapsible.collapsed .collapse-toggle svg { transform: rotate(-90deg); }
.block.collapsible .block-body { overflow: hidden; }
.block.collapsible.collapsed .block-body { display: none; }
.block.collapsible.collapsed { padding-bottom: 14px; }
.block.grow.collapsible.collapsed { flex: none; }

/* ------------------------------------------------------------- empty hero */
.empty-hero {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 24px; pointer-events: none; /* lets orbit/drag on the empty grid still work */
}
.empty-hero-inner {
  pointer-events: auto;
  width: min(560px, 100%);
  background: rgba(20, 26, 32, .82);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 30px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.empty-hero h1 {
  margin: 0 0 8px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--text);
}
.empty-hero > .empty-hero-inner > p {
  margin: 0 0 16px; color: var(--muted); font-size: 13.5px; line-height: 1.5;
}
.empty-hero textarea {
  width: 100%; font-size: 14px; line-height: 1.5; min-height: 76px;
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 12px 14px; resize: vertical;
}
.empty-hero textarea:focus { outline: none; border-color: var(--accent); }
.empty-hero button.primary { margin-top: 12px; padding: 11px 16px; font-size: 14.5px; }
.empty-hero .status { text-align: center; }
.empty-hero-examples {
  display: flex; flex-direction: column; gap: 6px; margin-top: 16px;
}
.empty-hero-examples .example {
  text-align: left; font-size: 12px; line-height: 1.4; color: var(--muted);
  background: var(--raised); border: 1px solid transparent; border-radius: 8px; padding: 8px 10px;
}
.empty-hero-examples .example:hover { color: var(--text); border-color: var(--line); }
#heroSkipBtn { display: block; margin: 16px auto 0; color: var(--faint); }

/* --------------------------------------------------- record with a phone */

/* The QR sits on white whatever the theme is doing. Phone cameras read a dark-on-light
   code reliably and an inverted one only sometimes, and a code that scans on the fourth
   try is a feature people stop using. */
.qr {
  display: flex; align-items: center; justify-content: center;
  margin: 4px auto 12px; padding: 12px;
  width: min(268px, 70vw); aspect-ratio: 1;
  background: #fff; border-radius: 12px;
  color: var(--ink, #12141A); font-size: 13px; text-align: center;
}
.qr svg { width: 100%; height: 100%; display: block; }

/* A button that is the only thing in its block reads as a link when it is only as wide as
   its label. */
button.wide { width: 100%; }
