/*
  Black and white, so the colour on screen is the footage being reviewed. The one
  exception is the notes themselves: tungsten (--note) marks where they sit on the
  timeline and numbers the open ones, so they're found at a glance. It never goes on
  the frame: marks on the picture are white with a black edge so they read on any image.
  Dark is the default: a neutral surround keeps the eye from shifting the frame's colours.
*/
:root {
  --surround: #050505;
  --panel: #111111;
  --raised: #1c1c1c;
  --hover: #242424;
  --line: #1f1f1f;
  --line-strong: #3d3d3d;
  --text: #ffffff;
  --text-2: #b4b4b4;
  --text-3: #949494;
  --accent: #ffffff;
  --on-accent: #000000;
  --accent-text: #ffffff;
  --note: #f2b33d;
  --note-soft: #2b2414;
  --on-note: #000000;
  --danger: #fafafa;
  --focus: #ffffff;
  --letterbox: #000000;
  --shadow: 0 12px 32px rgb(0 0 0 / .6);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --display: "Archivo", var(--font);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;
  --side: 352px;
  --bar: 56px;
  --control: 32px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --surround: #ebebeb;
  --panel: #f7f7f7;
  --raised: #e9e9e9;
  --hover: #e2e2e2;
  --line: #dedede;
  --line-strong: #b5b5b5;
  --text: #0a0a0a;
  --text-2: #555555;
  --text-3: #6b6b6b;
  --accent: #0a0a0a;
  --on-accent: #fafafa;
  --accent-text: #0a0a0a;
  --note: #9a5b00;
  --note-soft: #fbedd3;
  --on-note: #ffffff;
  --danger: #0a0a0a;
  --focus: #000000;
  --shadow: 0 10px 30px rgb(0 0 0 / .14);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--surround);
  color: var(--text);
  font: 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

[hidden] { display: none !important; }

kbd {
  font: 11px/1 var(--mono);
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--text-2);
  background: var(--panel);
}

/* App shell */
.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.app > .bar { flex: none; height: var(--bar); }
.app > .stage { flex: 1; }

.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 12px 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  flex: none;
}
.logo svg { width: 19px; height: 19px; }
.logo span { font: 900 19px/1 var(--display); font-stretch: 125%; letter-spacing: -0.035em; padding-bottom: 2px; }

.back {
  display: inline-flex;
  align-items: center;
  min-height: var(--control);
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  text-decoration: none;
  font-weight: 520;
  white-space: nowrap;
}
.back:hover { color: var(--text); background: var(--hover); }

.user-slot { min-width: 28px; min-height: 28px; display: grid; place-items: center; }
.avatar {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 11px; font-weight: 650;
}
.preview-banner {
  padding: 6px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  font-size: 12px;
}

.clip {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.clip-name {
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-spec {
  color: var(--text-2);
  font: 12px var(--mono);
  white-space: nowrap;
}

.bar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.field-inline-label { color: var(--text-2); font-size: 12px; }

select, input, textarea {
  background: var(--raised);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  min-height: var(--control);
  padding: 4px 10px;
  transition: border-color .15s ease;
}
select:hover, input:hover, textarea:hover { border-color: var(--line-strong); }
select:focus, input:focus, textarea:focus { border-color: var(--text-3); }
::placeholder { color: var(--text-3); }

select { padding-right: 24px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}

.tc-input {
  width: 104px;
  font: 12px var(--mono);
  font-variant-numeric: tabular-nums;
}

.tc-input[aria-invalid="true"] { border-color: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control);
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--raised);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .12s ease, transform .12s ease;
}

.btn:hover:not(:disabled) { background: var(--hover); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
/* "In the cloud": a status, not an action, but still focusable so its tooltip can be read. */
#cloudBtn[aria-disabled="true"] { cursor: default; background: transparent; color: var(--text-2); }
#cloudBtn { font-variant-numeric: tabular-nums; }

.btn-ghost { background: transparent; border-color: transparent; }

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn-accent:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 84%, var(--surround)); border-color: transparent; }
.btn-accent kbd { background: transparent; border-color: currentColor; color: var(--on-accent); opacity: .7; }
.btn-accent[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--on-accent); }

.btn-icon { width: var(--control); padding: 0; }
.btn-icon svg { width: 18px; height: 18px; }

.link {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--accent-text);
  cursor: pointer;
  font-weight: 520;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}
.link:hover { text-decoration-color: currentColor; }

/* Menu */
.menu-wrap { position: relative; }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 260px;
  padding: 5px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}

.menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: none;
  cursor: pointer;
}
.menu button:hover, .menu button:focus-visible { background: var(--hover); outline-offset: -2px; }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }

/* Stage */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  min-height: 0;
}

.viewer {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.frame {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--letterbox);
  overflow: hidden;
}

.frame video, .frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Live sessions: the bar above the frame, and pointers on it. */
.live-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px rgb(255 255 255 / .15); animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
.live-label { font: 700 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.live-who { color: var(--text-2); }
.live-people { display: flex; margin: 0 0 0 auto; padding: 0; list-style: none; }
.live-person {
  width: 26px; height: 26px;
  margin-left: -6px;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--raised);
  box-shadow: 0 0 0 2px var(--panel), inset 0 0 0 1px var(--line-strong);
  font-size: 10px; font-weight: 700;
}
.live-person img { width: 100%; height: 100%; object-fit: cover; }
.live-person.is-away { opacity: .4; }
.live-person.is-driving { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--text); }
.live-driver { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.live-driver select { height: 30px; font-size: 13px; }

.pings { position: absolute; z-index: 4; pointer-events: none; }
.ping {
  position: absolute;
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 2.5px solid #fafafa;
  box-shadow: 0 0 0 2px rgb(0 0 0 / .55);
  animation: ping 2.6s cubic-bezier(.2, .7, .1, 1) forwards;
}
.ping-name {
  position: absolute;
  top: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 4px;
  background: rgb(0 0 0 / .78);
  color: #fafafa;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
@keyframes ping {
  0% { transform: scale(.4); opacity: 0; }
  12% { transform: scale(1); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .live-dot, .ping { animation: none; } }

.live-pick { margin: 14px 0 0; padding: 0; border: 0; }
.live-pick legend { margin-bottom: 8px; font-size: 14px; font-weight: 540; }
.live-pick ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 280px; overflow-y: auto; }
.live-pick label { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--r-sm); cursor: pointer; }
.live-pick label:hover { background: var(--hover); }
.live-pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--text); }
.live-handle { color: var(--text-2); font-size: 13px; }
.live-none { color: var(--text-2); }

/* Comparing versions: a divider over the frame, previous version on the left. */
.wipe { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.wipe-tag {
  position: absolute;
  top: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgb(0 0 0 / .72);
  color: #fafafa;
  font: 600 12px var(--mono);
}
.wipe-a { left: 12px; }
.wipe-b { right: 12px; }
.wipe-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 28px;
  margin-left: -14px;
  pointer-events: auto;
  cursor: ew-resize;
  touch-action: none;
}
.wipe-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 13px; width: 2px; background: #fafafa; box-shadow: 0 0 0 1px rgb(0 0 0 / .5); }
.wipe-handle span {
  position: absolute;
  top: 50%; left: 50%;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: #fafafa;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .5), 0 4px 12px rgb(0 0 0 / .4);
}
.wipe-handle span::before, .wipe-handle span::after {
  content: "";
  position: absolute;
  top: 8px;
  border: 5px solid transparent;
}
.wipe-handle span::before { left: 1px; border-right: 6px solid #0a0a0a; border-left-width: 0; }
.wipe-handle span::after { right: 1px; border-left: 6px solid #0a0a0a; border-right-width: 0; }
.wipe-handle:focus-visible span { outline: 2px solid #fafafa; outline-offset: 3px; }

.tools-end { display: flex; gap: 8px; margin-left: auto; }

.overlay {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}

.frame.is-marking .overlay {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}

/* Marks are always white on a black edge, whatever the interface theme. Resolved marks go dashed. */
.overlay .stroke-under { stroke: rgb(0 0 0 / .7); }
.overlay .stroke { stroke: #fff; }
.overlay .is-resolved .stroke { stroke-dasharray: 5 6; }
.overlay .is-selected .stroke-under { stroke: #000; stroke-width: 7px; }
.overlay .pin-dot { fill: #fff; stroke: rgb(0 0 0 / .7); }
.overlay .is-resolved .pin-dot { fill: #000; stroke: #fff; }
.overlay .pin-num { fill: #0a0a0a; font-family: var(--font); font-weight: 650; }
.overlay .is-resolved .pin-num { fill: #fff; }
.overlay .draft .stroke { stroke-dasharray: 6 5; }
.overlay .ghost { opacity: .55; }

.state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: #ececef;
}

.state-title { margin: 0; font-size: 17px; font-weight: 600; }
.state-body { margin: 0 0 6px; max-width: 46ch; color: #a4a4ab; }

.drop {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 40px 32px;
  border: 1.5px dashed #4a4a50;
  border-radius: var(--r-lg);
  max-width: 520px;
}

.frame.is-dragover .drop { border-color: #fff; border-style: solid; background: rgb(255 255 255 / .05); }

/* The shutter loader, as on every Shutter page: the logo's blade turning at 24 frames a second. */
.spinner {
  position: relative;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid #fafafa;
}
.spinner::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: conic-gradient(#fafafa 0 180deg, transparent 0);
  animation: spin 1s steps(24) infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Same page change and selection as the rest of Shutter (this page doesn't load site.css). */
@property --sweep { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) {
  animation: shutter-turn .42s cubic-bezier(.65, 0, .35, 1) both;
  -webkit-mask-image: conic-gradient(from 135deg, #000 var(--sweep), transparent 0);
  mask-image: conic-gradient(from 135deg, #000 var(--sweep), transparent 0);
}
@keyframes shutter-turn { from { --sweep: 0deg; } to { --sweep: 360deg; } }
::selection { background: var(--text); color: var(--surround); }

.mark-hint {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  background: rgb(10 10 11 / .82);
  color: #ececef;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.mark-hint kbd { background: transparent; color: #c9c9cf; border-color: #55555b; }

/* Tools + transport */
.tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: var(--surround);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 550;
}
.segmented button svg { width: 16px; height: 16px; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-checked="true"] { background: var(--raised); color: var(--text); }
.segmented-sm button { min-height: 24px; padding: 0 8px; font-size: 12px; }

.transport {
  padding: 8px 14px 14px;
  background: var(--panel);
}

.transport-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.transport-buttons { display: flex; align-items: center; gap: 4px; }

.btn-play { width: 36px; min-height: 36px; border-radius: 50%; }
.btn-play svg { width: 20px; height: 20px; }

.tc {
  font: 500 22px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.tc-meta {
  color: var(--text-2);
  font: 12px var(--mono);
  font-variant-numeric: tabular-nums;
}
.tc-dur { margin-left: auto; }

.timeline { margin-top: 10px; }

.track {
  position: relative;
  height: 28px;
}

.track::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 12px;
  height: 4px;
  border-radius: 2px;
  background: var(--raised);
}

.track-fill {
  position: absolute;
  left: 0; top: 12px;
  height: 4px;
  border-radius: 2px;
  background: var(--text-2);
  width: 0;
}

.ticks { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

.tick {
  position: absolute;
  top: 2px;
  width: 3px;
  height: 24px;
  margin-left: -1.5px;
  padding: 0;
  border: 0;
  border-radius: 1.5px;
  background: var(--note);
  box-shadow: 0 0 0 1px var(--panel);
  pointer-events: auto;
  cursor: pointer;
  transition: width .12s ease, margin .12s ease;
}
/* A wider target than the line itself, so ticks are easy to hit. */
.tick::before { content: ""; position: absolute; inset: -2px -6px; }
.tick:hover { width: 5px; margin-left: -2.5px; }

.tick-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  z-index: 5;
  display: grid;
  gap: 3px;
  max-width: min(300px, 100%);
  padding: 8px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--raised);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
}
.tip-top { color: var(--text-2); font: 11px var(--mono); }
.tip-text { overflow-wrap: anywhere; }
/* Resolved ticks are shorter so they never read as the playhead. */
.tick.is-resolved { background: var(--text-3); top: 8px; height: 12px; }
.tick.is-selected { top: 0; height: 28px; width: 4px; margin-left: -2px; }

#scrub {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  min-height: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}
#scrub::-webkit-slider-runnable-track { background: transparent; height: 28px; }
#scrub::-moz-range-track { background: transparent; height: 28px; }
#scrub::-webkit-slider-thumb {
  appearance: none;
  width: 2px; height: 28px;
  background: var(--text);
  box-shadow: 0 0 0 1px var(--panel);
  border-radius: 1px;
}
#scrub::-moz-range-thumb { width: 2px; height: 28px; background: var(--text); border: 0; border-radius: 1px; }
#scrub:focus-visible { outline-offset: 0; border-radius: 4px; }

/* Notes column */
.notes {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-left: 1px solid var(--line);
}

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

.notes-title { margin: 0; font-size: 15px; font-weight: 650; }
.count { color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; }

.composer {
  display: grid;
  gap: 10px;
  padding: 16px;
  margin: 12px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--raised);
  box-shadow: inset 3px 0 0 var(--note);
}

.composer-head { display: flex; align-items: baseline; gap: 10px; }
.composer-tc { color: var(--note); font: 600 14px var(--mono); font-variant-numeric: tabular-nums; }
.composer-kind { color: var(--text-2); font-size: 12px; }

.field { display: grid; gap: 4px; }
.field-label { color: var(--text-2); font-size: 12px; font-weight: 520; }
.field textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.composer input, .composer select, .composer textarea { background-color: var(--panel); }
.field-error { margin: 0; color: var(--danger); font-size: 12px; font-weight: 600; }
.field-error::before { content: "! "; }

.composer-actions { display: flex; justify-content: flex-end; gap: 8px; }

.note-list {
  list-style: none;
  margin: 0;
  padding: 6px 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 10px;
  padding: 10px 8px 10px 6px;
  border-radius: var(--r-md);
  cursor: pointer;
}
.note + .note { margin-top: 2px; }
.note:hover { background: var(--raised); }
.note.is-selected { background: var(--raised); box-shadow: inset 3px 0 0 var(--note); }
.note.is-resolved.is-selected { box-shadow: inset 3px 0 0 var(--text-3); }
.note:focus-visible { outline-offset: -2px; }

.note-num {
  width: 22px; height: 22px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--note);
  color: var(--on-note);
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.note.is-resolved .note-num { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1.5px var(--line-strong); }

.note-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.note-tc { color: var(--note); font: 600 12px var(--mono); font-variant-numeric: tabular-nums; }
.note.is-resolved .note-tc { color: var(--text-3); }
.note-cat { color: var(--text-2); font-size: 12px; }
.note-text {
  margin: 3px 0 6px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.note.is-resolved .note-text { color: var(--text-2); }

.note-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 12px;
}

.initial {
  width: 18px; height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--hover);
  color: var(--text);
  font-size: 10px;
  font-weight: 650;
}

.note-actions { margin-left: auto; display: flex; gap: 2px; }

.mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 520;
  cursor: pointer;
}
.mini:hover { background: var(--surround); color: var(--text); }
.mini svg { width: 14px; height: 14px; }
.mini[aria-pressed="true"] { color: var(--text); }
.mini-danger:hover { color: var(--text); text-decoration: underline; }

/* Replies under a note: a short thread, indented under the note text. */
.replies { margin: 8px 0 2px; padding-left: 10px; border-left: 2px solid var(--line); }
.reply-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.reply-top { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.reply-author { font-weight: 650; }
.reply-time { color: var(--text-2); }
.reply-delete { margin-left: auto; padding: 0; border: 0; background: none; color: var(--text-2); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; opacity: 0; }
.reply:hover .reply-delete, .reply-delete:focus-visible { opacity: 1; }
@media (hover: none) { .reply-delete { opacity: 1; } }
.reply-text { margin: 2px 0 0; font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-form { display: grid; gap: 6px; margin-top: 8px; }
.reply-form textarea { width: 100%; resize: vertical; font-size: 13px; }
.reply-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }

.notes-empty {
  padding: 28px 22px;
  color: var(--text-2);
  text-align: center;
}
.notes-empty p { margin: 0; }

.notes-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* Shortcuts sheet */
.sheet {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--raised);
  color: var(--text);
  box-shadow: var(--shadow);
}
/* Fields inside a dialog sit one step darker than it, so they never vanish into it. */
.sheet input:not([type="checkbox"]):not([type="radio"]), .sheet select, .sheet textarea { background-color: var(--panel); }
.sheet::backdrop { background: rgb(0 0 0 / .45); }
.sheet h2 { margin: 0 0 12px; font-size: 15px; }
.sheet form { display: flex; justify-content: flex-end; margin-top: 16px; }

.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  margin: 0;
  align-items: center;
}
.keys dt { white-space: nowrap; color: var(--text-2); }
.keys dd { margin: 0; }


/* Zoom: the picture and its marks scale together, from the top-left corner. */
.zoom { position: absolute; inset: 0; transform-origin: 0 0; }
.frame.is-zoomed { cursor: grab; touch-action: none; }
.frame.is-zoomed:active { cursor: grabbing; }
.frame.is-zoomed.is-marking { cursor: crosshair; }
.zoom-chip {
  position: absolute;
  z-index: 6;
  right: 10px; bottom: 10px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 3px 3px 10px;
  border-radius: 999px;
  background: rgb(10 10 11 / .8);
  color: #fafafa;
  font: 600 12px var(--mono);
  font-variant-numeric: tabular-nums;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.zoom-chip span { margin-right: 6px; }
.zoom-chip button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / .12);
  color: #fafafa;
  font: 600 12px var(--font);
  cursor: pointer;
}
.zoom-chip button:hover { background: rgb(255 255 255 / .22); }
@media (pointer: coarse) { .zoom-chip button { min-height: 36px; padding: 0 14px; } }
/* Phones only: the More button, and the chevron that stands in for "All reviews". */
.more-btn, .back-chev { display: none; }

/* Swiping across the frame: how far, and where you are. */
.jog-hud {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 16px;
  border-radius: var(--r-lg);
  background: rgb(10 10 11 / .78);
  color: #fafafa;
  pointer-events: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
#jogDelta { font: 650 15px var(--font); }
#jogTc { font: 500 13px var(--mono); font-variant-numeric: tabular-nums; color: #c9c9cf; }

/* The phone action sheet: rises from the bottom, pulls down to close. */
.action-sheet {
  width: 100%;
  max-width: 560px;
  max-height: min(86dvh, 760px);
  margin: auto auto 0;
  padding: 6px 12px calc(12px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 16px 16px 0 0;
  background: var(--raised);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: transform .2s cubic-bezier(.2, .7, .1, 1);
}
.action-sheet[open] { animation: rise .26s cubic-bezier(.2, .7, .1, 1); }
@keyframes rise { from { transform: translateY(40%); opacity: .4; } }
.action-sheet::backdrop { background: rgb(0 0 0 / .5); }
.as-grip { width: 38px; height: 5px; margin: 4px auto 10px; border-radius: 3px; background: var(--line); }
.as-head { padding: 0 6px 12px; }
.as-title { margin: 0; font-size: 17px; font-weight: 650; overflow-wrap: anywhere; }
.as-sub { margin: 2px 0 0; color: var(--text-2); font: 13px var(--mono); }
.as-fields { display: grid; gap: 1px; margin-bottom: 12px; border-radius: var(--r-lg); overflow: hidden; background: var(--line); }
.as-fields:not(:has(> :not([hidden]))) { display: none; }
.as-fields .field-inline { justify-content: space-between; min-height: 52px; padding: 6px 8px 6px 14px; background: var(--panel); }
.as-fields #fpsField > .sr-only { position: static; width: auto; height: auto; margin: 0; clip: auto; overflow: visible; white-space: normal; }
.as-fields .field-inline-label, .as-fields #fpsField > .sr-only { color: var(--text); font-size: 15px; font-weight: 520; }
.as-fields select, .as-fields input { min-height: 40px; font-size: 16px; }
.as-group { display: grid; gap: 1px; margin-bottom: 12px; border-radius: var(--r-lg); overflow: hidden; background: var(--line); }
.as-group button, .as-done {
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.as-group button:active, .as-done:active { background: var(--hover); }
.as-group button:disabled { color: var(--text-2); }
.action-sheet form { margin: 0; }
.as-done { width: 100%; border-radius: var(--r-lg); text-align: center; font-weight: 650; }

/* Narrow windows and phones: one-row top bar, the player stays at the top while notes scroll
   beneath it, and the note composer is a sheet at the bottom. */
@media (max-width: 860px) {
  :root { --control: 44px; }

  body { font-size: 15px; }

  .app { height: auto; min-height: 100dvh; }

  .app > .bar {
    height: auto;
    min-height: calc(var(--bar) + env(safe-area-inset-top));
    gap: 4px;
    padding: env(safe-area-inset-top) max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left));
  }
  .bar .logo { display: none; }
  .back { width: 44px; height: 44px; padding: 0; justify-content: center; flex: none; color: var(--text); }
  .back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .back-chev { display: block; width: 24px; height: 24px; }
  .clip { flex: 1; padding-left: 0; border-left: 0; }
  .clip-spec { display: none; }
  .bar-actions { gap: 4px; }
  .bar-actions .menu-wrap, #openBtn, #cloudBtn, .bar #startTcField, .bar #fpsField { display: none !important; }
  .more-btn {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    flex: none;
    border: 0; border-radius: 50%;
    background: none; color: var(--text);
    cursor: pointer;
  }
  .more-btn svg { width: 22px; height: 22px; }
  .more-btn:active { background: var(--hover); }

  .stage { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .as-fields input { width: 150px; }

  .frame { flex: none; height: min(56.25vw, 60vh); min-height: 200px; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
  .frame video, .frame img { -webkit-touch-callout: none; }
  .frame:has(#emptyState:not([hidden])), .frame:has(#errorState:not([hidden])) { height: auto; min-height: 320px; }

  .tools { gap: 8px; padding: 8px 12px; }
  .tools .segmented button span { display: none; }
  .tools .segmented button { min-width: 48px; justify-content: center; }
  .tools .segmented button svg { width: 20px; height: 20px; }
  .tools #markBtn { flex: 1; }
  #markBtn kbd { display: none; }
  .tools-end { display: none; }

  .segmented button { min-height: 40px; }
  .segmented-sm button { min-height: 40px; min-width: 44px; justify-content: center; }
  .notes-foot { display: none; }
  .transport { padding: 6px 12px 10px; }
  .transport-row { gap: 10px; }
  .btn-play { width: 48px; min-height: 48px; }
  .transport-buttons .btn-ghost { min-width: 44px; }
  .tc { font-size: 19px; }
  .tc-meta { font-size: 13px; }
  .tc-dur { display: none; }
  .timeline { margin-top: 4px; }
  .track { height: 44px; }
  .track::before, .track-fill { top: 20px; }
  .tick { top: 10px; }
  .tick::before { inset: -10px -8px; }
  #scrub::-webkit-slider-runnable-track, #scrub::-webkit-slider-thumb { height: 44px; }
  #scrub::-webkit-slider-thumb { width: 3px; }

  .notes { border-left: 0; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .note-list { overflow: visible; }
  .mini { min-height: 40px; padding: 0 10px; font-size: 14px; }
  .field-label, .note-cat, .note-foot { font-size: 13px; }
  .mark-hint { top: 8px; font-size: 13px; }
  .mark-hint kbd, .mark-hint kbd + span { display: none; }
  /* iOS zooms in on any field under 16px when it gets focus. */
  select, input, textarea, .tc-input { font-size: 16px; }

  /* The composer rises from the bottom, above the keyboard when it's open. */
  .composer {
    position: fixed;
    z-index: 30;
    left: 0; right: 0;
    bottom: var(--kb, 0px);
    max-height: min(58dvh, 440px);
    overflow-y: auto;
    margin: 0;
    padding: 14px max(14px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 30px rgb(0 0 0 / .45);
    grid-template-columns: 1fr 1fr;
    animation: rise .24s cubic-bezier(.2, .7, .1, 1);
  }
  .composer > * { grid-column: 1 / -1; }
  .composer > .field:has(#category), .composer > .field:has(#author) { grid-column: auto; }
  .composer > .field:has(#noteText) { order: -1; }
  .composer-head { order: -2; }
  .composer textarea { min-height: 76px; }
  .composer-actions .btn { flex: 1; }
  .app:has(.composer:not([hidden])) .notes { padding-bottom: 340px; }
}

/* Phones held upright: the player stays on screen while the notes scroll under it. */
@media (max-width: 860px) and (orientation: portrait) {
  .viewer { position: sticky; top: env(safe-area-inset-top); z-index: 20; background: var(--panel); box-shadow: 0 1px 0 var(--line); }
  body::before { content: ""; position: fixed; z-index: 25; inset: 0 0 auto; height: env(safe-area-inset-top); background: var(--panel); }
}

/* Phones turned sideways: the frame fills the height, the controls are a scroll away. */
@media (max-height: 500px) and (orientation: landscape) {
  .frame { height: calc(100dvh - 60px); min-height: 0; }
  .app > .bar { padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  .tools, .transport, .notes { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  @view-transition { navigation: none; }
  .spinner::before { animation: spin 4s steps(8) infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .action-sheet[open], .composer { animation: none; }
}

/* Touch screens wide enough for the desktop layout (iPad): bigger targets, same layout. */
@media (pointer: coarse) and (min-width: 861px) {
  :root { --control: 40px; --bar: 60px; }
  .segmented button { min-height: 36px; padding: 0 14px; }
  .segmented-sm button { min-height: 34px; }
  .btn-icon { min-width: 40px; }
  .btn-play { width: 44px; min-height: 44px; }
  .track { height: 40px; }
  .track::before, .track-fill { top: 18px; }
  .tick { top: 8px; }
  .tick::before { inset: -8px -8px; }
  #scrub::-webkit-slider-runnable-track, #scrub::-webkit-slider-thumb { height: 40px; }
  .mini { min-height: 36px; }
  .frame { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
  .mark-hint kbd, .mark-hint kbd + span, #markBtn kbd, .notes-foot { display: none; }
  /* Safari on iPad zooms in on any field under 16px when it gets focus. */
  select, input, textarea, .tc-input { font-size: 16px; }
  .tc-input { width: 136px; }
}

/* Takes logged on set in Slate for this clip. */
.on-set { display: grid; gap: 6px; padding: 10px 12px 0; }
.on-set-take { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--raised); color: var(--text); text-decoration: none; }
.on-set-take:hover { border-color: var(--text-2); }
.on-set-label { color: var(--text-2); font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.on-set-main { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.on-set-good, .on-set-ng { padding: 0 7px; border-radius: 9px; font-size: 11px; font-weight: 700; }
.on-set-good { background: var(--accent); color: var(--on-accent); }
.on-set-ng { box-shadow: inset 0 0 0 1px var(--text-2); color: var(--text-2); }
.on-set-note { color: var(--text-2); }
