/* Cutlist — review-room dark UI.
   Dark is functional here: video must read true against neutral surroundings.
   Reds/oranges are reserved for action presets (semantic), so UI accent is
   an instrument teal; the internal-tier badge is violet. Timecodes are mono. */

:root {
  --bg: #10141c;
  --surface: #171c26;
  --surface-2: #1f2531;
  --surface-3: #28303f;
  --line: #2b3444;
  --line-strong: #3d4960;
  --text: #eef2f8;
  --muted: #97a2b6;
  --faint: #67738c;
  --accent: #6ea8ff;
  --accent-dim: #35517e;
  --internal: #9d8cff;
  --danger: #e5484d;
  --ok: #57c76f;
  --warn: #f0883e;
  --mono: "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, "Helvetica Neue", BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------ shell */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; height: 52px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand {
  font: 700 13px/1 var(--mono); letter-spacing: 0.18em;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.brand .tick {
  width: 3px; height: 16px; background: var(--accent);
  transform: skewX(-18deg); border-radius: 1px;
}
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 13px; }

.page { max-width: 1060px; margin: 0 auto; padding: 32px 20px 80px; }

/* ------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background 120ms, border-color 120ms;
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b1424; font-weight: 600; }
.btn.primary:hover { background: #8cbaff; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.accent {
  border-color: var(--accent); color: var(--accent);
  background: rgba(110,168,255,0.08);
}
.btn.accent:hover { background: rgba(110,168,255,0.18); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* project / client link rows in settings */
.link-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.link-row:last-child { border-bottom: none; }
.link-row .link-role {
  font: 600 10.5px/1 var(--sans); letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted); width: 74px; flex: none;
}
.link-row .link-url {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--faint); font-size: 11px;
}

/* ------------------------------------------------ client watch page */
/* Client-facing pages use a neutral, modern face — Helvetica — rather than
   the technical mono of the review tool. */
.watch-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg);
  font-family: "Helvetica Neue", Helvetica, Arial, var(--sans);
  letter-spacing: 0.01em;
}
.watch-head { padding: 26px 32px 6px; display: flex; justify-content: center; }
.watch-brand { display: inline-flex; align-items: baseline; gap: 12px; }
.watch-logo { height: 52px; width: auto; display: block; }
.watch-main {
  flex: 1; width: 100%; max-width: 1120px; margin: 0 auto;
  padding: 14px 24px 40px; display: flex; flex-direction: column;
}
.watch-titles { text-align: center; margin-bottom: 14px; }
.watch-sub { color: var(--muted); font-size: 16px; margin-top: 2px; font-weight: 400; }
.watch-sub b { color: var(--text); font-weight: 600; }

/* Player: ALWAYS shows the complete frame — never cropped. The <video> keeps its
   own aspect ratio and scales to fit; letterbox/pillarbox fills any gap with black. */
.watch-frame {
  background: #000; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  width: 100%;
}
.watch-frame.landscape { aspect-ratio: 16 / 9; }
.watch-frame.portrait  { aspect-ratio: 16 / 9; }          /* keep frame tidy… */
.watch-frame.portrait video { height: 100%; width: auto; max-width: 100%; }  /* …video sits upright, pillarboxed */
.watch-frame.landscape video { width: 100%; height: 100%; }
.watch-frame video { object-fit: contain; background: #000; display: block; }

/* title + now-playing BELOW the video, left-aligned (Vimeo/YouTube style) */
.np-block { text-align: left; margin: 16px 2px 0; }
.np-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 5px;
}
.np-title { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }

.gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px; margin-top: 22px;
}
.gcard {
  display: flex; flex-direction: column; gap: 0; text-align: left; padding: 0;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 16px; overflow: hidden;
  font-family: inherit; transition: border-color 140ms, transform 120ms;
}
.gcard:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.gcard.sel { border-color: var(--accent); }
.gcard .gthumb {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #05070c;
  display: grid; place-items: center; overflow: hidden;
}
.gcard .gthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gcard .gthumb.portrait img { width: auto; height: 100%; object-fit: contain; } /* vertical poster: full frame */
.gcard .gthumb .gscrub {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none;
}
.gcard .gthumb.portrait .gscrub { object-fit: contain; }
/* play overlay + darkening so cards read as playable */
.gcard .gthumb::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%);
  transition: background 140ms;
}
.gcard:hover .gthumb::before { background: rgba(0,0,0,0.28); }
.gcard .gplay {
  position: relative; z-index: 2; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(0,0,0,0.5); border: 1.5px solid rgba(255,255,255,0.85);
  display: grid; place-items: center; transition: transform 140ms, background 140ms;
}
.gcard .gplay::after {
  content: ""; margin-left: 3px;
  border-style: solid; border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #fff;
}
.gcard:hover .gplay { transform: scale(1.08); background: var(--accent); }
.gcard:hover .gplay::after { border-left-color: #0b1424; }
.gcard.sel .gplay { background: var(--accent); border-color: var(--accent); }
.gcard.sel .gplay::after { border-left-color: #0b1424; }
.gcard .gtitle { font-size: 16px; font-weight: 600; padding: 12px 14px 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard.sel .gtitle { color: var(--accent); }
.gcard .gmeta { color: var(--faint); font-size: 13.5px; padding: 0 14px 12px; }

/* desktop: fit within viewport but NEVER crop — the frame caps its height and
   the aspect-ratio keeps the whole video visible; page may scroll if truly tall. */
@media (min-width: 900px) {
  .watch-frame { max-height: 58vh; margin: 0 auto; }
  .watch-frame.landscape { width: auto; height: 58vh; aspect-ratio: 16/9; max-width: 100%; }
  .watch-frame.portrait  { width: auto; height: 58vh; aspect-ratio: 9/16; max-width: 100%; }
  .watch-frame.portrait video { width: 100%; height: 100%; }
  .np-block { max-width: 1120px; width: 100%; margin-left: auto; margin-right: auto; }
}
/* phone: contained; gallery is a horizontal snap strip; active card snaps into view */
@media (max-width: 899px) {
  .watch-head { padding: 20px 20px 0; }
  .watch-logo { height: 44px; }
  .np-title { font-size: 21px; }
  .watch-frame.landscape { aspect-ratio: 16/9; }
  .watch-frame.portrait  { aspect-ratio: 9/16; max-height: 60vh; margin: 0 auto; width: auto; }
  .watch-frame.portrait video { height: 100%; width: 100%; }
  .gallery {
    display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory; gap: 12px;
    margin: 18px -22px 0; padding: 2px 22px 12px;
    scrollbar-width: none;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .gcard { flex: 0 0 76%; max-width: 300px; scroll-snap-align: center; }
}
.watch-card {
  margin: auto; text-align: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 40px 44px;
  font-family: "Helvetica Neue", Helvetica, Arial, var(--sans);
}
.watch-card .watch-logo { margin: 0 auto; }

/* ------------------------------------------------ brand in the app chrome */
.brand-logo { height: 18px; width: auto; display: block; }
.auth-card .brand-logo { height: 24px; margin: 0 auto; }

/* ------------------------------------------------ new-project kind picker */
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.kind-opt {
  text-align: left; padding: 13px 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  display: flex; flex-direction: column; gap: 5px;
}
.kind-opt strong { font-size: 13.5px; }
.kind-opt span { font-size: 12px; color: var(--muted); line-height: 1.45; }
.kind-opt.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: rgba(110,168,255,0.06); }

/* ------------------------------------------------ screening admin rows */
.screen-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 10px;
}
.screen-row .grow { flex: 1; min-width: 0; }
.screen-thumb {
  width: 40px; height: 40px; flex: none; border-radius: 9px;
  display: grid; place-items: center; background: #000;
  color: rgba(255,255,255,0.85); font-size: 12px;
  border: 1px solid var(--line-strong);
}
.screen-thumb:hover { color: var(--accent); border-color: var(--accent); }
.screen-title { font-weight: 600; font-size: 14px; }
.screen-meta { color: var(--faint); font-size: 12px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.input, textarea.input {
  width: 100%; padding: 8px 11px;
  background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.input:focus { border-color: var(--accent); outline: none; }
textarea.input { resize: vertical; min-height: 60px; }
select.input { appearance: none; }
label.field { display: block; margin-bottom: 14px; }
label.field .lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }

.tc { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }

.badge {
  font: 600 10.5px/1 var(--sans); letter-spacing: 0.07em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px;
}
.badge.internal { color: var(--internal); background: rgba(157,140,255,0.12); border: 1px solid rgba(157,140,255,0.35); }
.badge.role { color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.badge.status-in_review { color: var(--accent); background: rgba(110,168,255,0.1); border: 1px solid rgba(110,168,255,0.3); }
.badge.status-changes_requested { color: var(--warn); background: rgba(240,136,62,0.1); border: 1px solid rgba(240,136,62,0.3); }
.badge.status-approved { color: var(--ok); background: rgba(87,199,111,0.1); border: 1px solid rgba(87,199,111,0.3); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface-3); border: 1px solid var(--line-strong);
  padding: 10px 18px; border-radius: 10px; font-size: 13px; z-index: 100;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.toast.error { border-color: var(--danger); }

/* ------------------------------------------------ auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card {
  width: 380px; max-width: 100%;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 34px 32px;
}
.auth-card .brand { justify-content: center; margin-bottom: 6px; font-size: 15px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.form-error { color: var(--danger); font-size: 13px; margin: 10px 0 0; min-height: 18px; }

/* ------------------------------------------------ dashboard */
.dash-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.dash-head h1 { font: 600 20px/1.2 var(--sans); flex: 1; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.proj-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px; text-align: left;
  display: block; width: 100%; transition: border-color 120ms;
}
.proj-card:hover { border-color: var(--accent-dim); }
.proj-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.proj-card .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.empty {
  border: 1px dashed var(--line-strong); border-radius: 12px;
  padding: 46px 20px; text-align: center; color: var(--muted);
}

/* ------------------------------------------------ modal / panel */
.overlay {
  position: fixed; inset: 0; background: rgba(6,8,11,0.7);
  z-index: 50; display: grid; place-items: center; padding: 20px;
}
.modal {
  width: 460px; max-width: 100%; max-height: 88vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 26px;
}
.modal h2 { font-size: 16px; margin-bottom: 18px; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.member-row, .preset-row, .version-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.member-row:last-child, .preset-row:last-child, .version-row:last-child { border-bottom: none; }
.member-row .grow, .preset-row .grow, .version-row .grow { flex: 1; min-width: 0; }
.member-row .name { font-weight: 500; }
.member-row .email { color: var(--muted); font-size: 12px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.invite-out {
  margin-top: 12px; padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-family: var(--mono); font-size: 11.5px; word-break: break-all;
}
.section-label {
  font: 600 11px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint); margin: 22px 0 10px;
}
.section-label:first-child { margin-top: 0; }

/* ------------------------------------------------ review layout */
.review {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px;
  gap: 0; height: calc(100vh - 52px);
}
.player-col { display: flex; flex-direction: column; min-width: 0; padding: 20px 24px; overflow-y: auto; }
.notes-col {
  border-left: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; min-height: 0;
}
@media (max-width: 980px) {
  .review { grid-template-columns: 1fr; height: auto; }
  .notes-col { border-left: none; border-top: 1px solid var(--line); max-height: none; }
}

.video-frame {
  background: #000; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  display: grid; place-items: center; position: relative;
}
.video-frame video { width: 100%; max-height: 56vh; display: block; background: #000; }

/* control bar */
.controls {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 2px 6px;
}
.controls .timedisp { font-family: var(--mono); font-size: 13px; color: var(--text); }
.controls .timedisp .dur { color: var(--faint); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-strong);
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(110,168,255,0.1); }
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }
.kbd-hint { color: var(--faint); font-size: 11.5px; font-family: var(--mono); }

/* --------- the timeline: scrubber + note rail (signature element) */
.timeline-wrap { user-select: none; margin-top: 4px; }
.scrubber {
  position: relative; height: 30px; cursor: pointer;
  border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.scrubber .buffered { position: absolute; top: 0; bottom: 0; left: 0; background: var(--surface-3); }
.scrubber .played { position: absolute; top: 0; bottom: 0; left: 0; background: rgba(110,168,255,0.18); }
.scrubber.range-mode { cursor: crosshair; box-shadow: 0 0 0 1px var(--accent); }
.playhead {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: var(--accent); z-index: 5; pointer-events: none;
}
.playhead::after {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--accent);
}
.range-select {
  position: absolute; top: 0; bottom: 0;
  background: rgba(110,168,255,0.25);
  border-left: 2px solid var(--accent); border-right: 2px solid var(--accent);
  z-index: 4; pointer-events: none;
}
.note-rail { position: relative; height: 46px; margin-top: 6px; }
.rail-track {
  position: absolute; inset: 0;
  border-radius: 6px; background: var(--surface);
  border: 1px dashed var(--line);
}
.rail-range {
  position: absolute; top: 6px; height: 16px; border-radius: 4px;
  opacity: 0.85; min-width: 4px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.25);
}
.rail-range:hover, .rail-range.hot { opacity: 1; box-shadow: 0 0 0 2px rgba(255,255,255,0.35); z-index: 3; }
.rail-range.resolved { opacity: 0.3; }
.rail-point {
  position: absolute; top: 27px; width: 12px; height: 12px;
  transform: translateX(-50%) rotate(45deg); border-radius: 2px;
  cursor: pointer; border: 1px solid rgba(255,255,255,0.3);
}
.rail-point:hover, .rail-point.hot { box-shadow: 0 0 0 2px rgba(255,255,255,0.35); z-index: 3; }
.rail-point.resolved { opacity: 0.3; }

/* range composer popover */
.composer {
  margin-top: 14px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 16px;
}
.composer .times { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.composer .times input {
  width: 88px; text-align: center; font-family: var(--mono); font-size: 12.5px;
  padding: 6px 4px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 6px;
}
.composer .times .arrow { color: var(--faint); }
.preset-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.quickpick-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* dashboard: pending invitations queue */
.invite-queue { display: flex; flex-direction: column; gap: 10px; }
.invite-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--accent-dim);
  border-radius: 12px; padding: 14px 16px;
}
.invite-title { font-weight: 600; font-size: 15px; }
.invite-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--line-strong);
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip.selected { border-color: var(--chip-color, var(--accent)); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--chip-color, var(--accent)); }
.composer .foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.composer .foot .spacer { flex: 1; }
.vis-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.vis-toggle input { accent-color: var(--internal); }

/* ------------------------------------------------ notes sidebar */
.notes-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.notes-head .toprow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.notes-head h2 { font-size: 13px; font-weight: 600; flex: 1; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.seg {
  display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden;
}
.seg button { padding: 5px 10px; font-size: 12px; color: var(--muted); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.notes-list { flex: 1; overflow-y: auto; padding: 10px 12px 30px; }
.group-head {
  display: flex; align-items: center; gap: 8px;
  font: 600 11px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 16px 4px 8px;
}
.group-head:first-child { margin-top: 4px; }
.group-head .count { color: var(--faint); }

.note-card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--note-color, var(--line-strong));
  border-radius: 12px; padding: 11px 12px; margin-bottom: 9px;
  transition: border-color 120ms, box-shadow 120ms;
}
.note-card.hot { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-dim); }
.note-card.resolved { opacity: 0.55; }
.note-card .head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.note-card .tcbtn {
  font-family: var(--mono); font-size: 11.5px; color: var(--accent);
  background: rgba(110,168,255,0.08); border: 1px solid rgba(110,168,255,0.25);
  padding: 2px 7px; border-radius: 5px;
}
.note-card .tcbtn:hover { background: rgba(110,168,255,0.16); }
.note-card .action-tag {
  font: 600 10.5px/1 var(--sans); letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px; color: #0e1116;
  background: var(--note-color, var(--muted));
}
.note-card .body { white-space: pre-wrap; word-wrap: break-word; margin-bottom: 7px; }
.note-card .meta { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 11.5px; flex-wrap: wrap; }
.note-card .meta .spacer { flex: 1; }
.note-card .meta button { color: var(--faint); font-size: 11.5px; }
.note-card .meta button:hover { color: var(--text); }
.note-card .meta .resolve { color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.note-card .meta .resolve:hover { color: var(--ok); }
.note-card.resolved .meta .resolve { color: var(--ok); }

.replies { margin-top: 9px; border-top: 1px solid var(--line); padding-top: 8px; }
.reply { display: flex; gap: 8px; margin-bottom: 7px; font-size: 12.5px; }
.reply .who { color: var(--muted); font-weight: 600; white-space: nowrap; }
.reply .del { color: var(--faint); visibility: hidden; }
.reply:hover .del { visibility: visible; }
.reply-input { display: flex; gap: 7px; margin-top: 4px; }
.reply-input input { flex: 1; padding: 6px 10px; font-size: 12.5px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 7px; }

.share-banner {
  margin: 10px 12px 0; padding: 10px 12px; border-radius: 10px;
  background: rgba(157,140,255,0.08); border: 1px solid rgba(157,140,255,0.3);
  font-size: 12.5px; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.share-banner .n { font-family: var(--mono); color: var(--internal); font-weight: 700; }

/* review topbar extras */
.review-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.review-top h1 { font-size: 16px; font-weight: 600; margin-right: 4px; }
.ver-select {
  font-family: var(--sans); font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  padding: 6px 10px; border-radius: 8px;
}
.upload-progress { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.upload-progress .bar { height: 100%; background: var(--accent); width: 0%; transition: width 200ms; }
.drop-hint { color: var(--muted); font-size: 12.5px; }

/* ======================================================================
   Project Board (studio-admin only). Namespaced under .board-* so nothing
   collides with the review UI. Design tokens are shared with the rest of
   Cutlist, so the board reads as the same product — no visual seam.
   ====================================================================== */
.board-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.board-head h1 { flex: 1; margin: 0; }

.board-filters { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.board-chip { border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 5px 13px; font-size: 13px; color: var(--muted); cursor: pointer; }
.board-chip:hover { border-color: var(--line-strong); color: var(--text); }
.board-chip[aria-pressed="true"] { background: var(--accent-dim); border-color: var(--accent-dim); color: var(--text); }
.board-count { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: 5px; }

/* project · editor · sent · delivered · budget · net · status */
.board-ledger-head { display: grid; grid-template-columns: 1fr 96px 82px 82px 92px 92px 124px; gap: 12px;
  padding: 0 16px 8px; margin-top: 16px; font-family: var(--mono); font-size: 11px;
  letter-spacing: .04em; color: var(--faint); border-bottom: 1px solid var(--line); }
.board-ledger-head .board-h-num { text-align: right; }
.board-ledger-head .board-h-st { text-align: center; }
@media (max-width: 720px) { .board-ledger-head { display: none; } }

.board-proj { background: var(--surface); margin-top: 9px; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.board-proj:hover { border-color: var(--line-strong); }
.board-proj.open { border-color: var(--accent-dim); }

.board-row { display: grid; grid-template-columns: 1fr 96px 82px 82px 92px 92px 124px; gap: 12px; align-items: center;
  width: 100%; text-align: left; background: none; border: 0; padding: 14px 16px; color: var(--text); cursor: pointer; }
.board-row:hover { background: var(--surface-2); }
.board-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.board-title { font-size: 16px; font-weight: 600; line-height: 1.25; display: flex; align-items: baseline; gap: 9px; }
.board-caret { color: var(--faint); font-size: 11px; transition: transform .18s ease; display: inline-block; }
.board-proj.open .board-caret { transform: rotate(90deg); }
.board-editor { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.board-editor.unassigned { color: var(--faint); }
.board-date { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.board-notsent { color: var(--faint); }

/* net — job profitability legible without opening the row. Budget shares the
   base style but stays normal weight so net is the figure that draws the eye. */
.board-net { font-family: var(--mono); font-size: 12.5px; font-weight: 600; text-align: right; }
.board-net.pos  { color: var(--ok); }
.board-net.neg  { color: var(--danger); }
.board-net.none { color: var(--faint); font-weight: 500; }
.board-net.bud  { color: var(--text); font-weight: 500; }

/* Status pills: solid fills with dark ink. The old translucent tints separated
   the states by hue alone, so in-progress green and in-review amber read as the
   same pill while scanning; lightness does the work now. Not-started stays a
   hollow outline on purpose — "nothing happened yet" shouldn't compete. */
.board-status { font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 6px 11px;
  border-radius: 999px; border: 1px solid transparent; text-align: center;
  white-space: nowrap; letter-spacing: .04em; text-transform: uppercase; }
.board-st-notstarted { color: var(--muted); background: transparent; border-color: var(--line-strong); }
.board-st-inprogress { color: #08240f; background: #5fd47c; }  /* green */
.board-st-inreview   { color: #3a2a00; background: #f5c542; }  /* amber */
.board-st-feedback   { color: #fff;    background: #e0553f; }  /* red   */
.board-st-done       { color: #05203f; background: #6ea8ff; }  /* blue  */

/* month groups — the header row that makes a long list navigable */
.board-mgroup { display: flex; align-items: center; gap: 11px; margin: 22px 0 2px; padding: 0 4px; }
.board-mgroup:first-child { margin-top: 14px; }
.board-mlabel { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text); }
.board-mcount { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.board-mline { flex: 1; height: 1px; background: var(--line); }
.board-mnet { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.board-mnet.pos { color: var(--ok); }
.board-mnet.neg { color: var(--danger); }

.board-detail { display: none; border-top: 1px solid var(--line); padding: 18px 16px 20px; background: var(--bg); }
.board-proj.open .board-detail { display: block; }
.board-cols { display: grid; grid-template-columns: 1fr 372px; gap: 22px; }
@media (max-width: 860px) { .board-cols { grid-template-columns: 1fr; } }

.board-lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; color: var(--faint);
  margin-bottom: 5px; display: block; }
.board-field { margin-bottom: 15px; }
.board-brief { white-space: pre-wrap; font-size: 14.5px; line-height: 1.62; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--accent-dim);
  padding: 13px 15px; border-radius: 8px; max-height: 290px; overflow: auto; }
.board-meta-strip { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 15px; }
.board-runtime { font-family: var(--mono); font-size: 19px; font-weight: 500; color: var(--text); }
.board-runtime.board-sm { font-size: 16px; padding-top: 5px; }
.board-link { color: var(--accent); word-break: break-all; font-size: 13.5px; text-decoration: none; }
.board-link:hover { text-decoration: underline; }
.board-sm2 { font-size: 14px; }
.board-missing { color: var(--faint); font-style: italic; font-size: 13.5px; }

.board-ctrls { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px; margin-top: 14px; }
.board-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.board-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .board-grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .board-grid2, .board-grid3 { grid-template-columns: 1fr; } }
.board-f { display: block; margin-bottom: 12px; }
.board-f input[type=text], .board-f input[type=date], .board-f input[type=number],
.board-f select, .board-f textarea, .board-extra input {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface-2); color: var(--text); }
.board-f input:focus, .board-f select:focus, .board-f textarea:focus, .board-extra input:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.board-f textarea { resize: vertical; min-height: 76px; line-height: 1.55; }
.board-notes { margin-top: 14px; }

/* additional costs — repeatable label + amount rows, empty by default */
.board-extras { margin-top: 4px; }
.board-extra { display: grid; grid-template-columns: 1fr 110px 34px; gap: 8px;
  align-items: center; margin-bottom: 8px; }
.board-extra .board-ex-a { font-family: var(--mono); text-align: right; }
.board-ex-x { width: 34px; height: 34px; flex: 0 0 auto; padding: 0; line-height: 1;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2);
  color: var(--faint); font-size: 17px; cursor: pointer; }
.board-ex-x:hover { color: var(--danger); border-color: var(--danger); }
.board-ex-add { margin-top: 2px; }

/* the ledger — project total, every cost against it, then the net */
.board-ledger { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); padding: 12px 14px; }
.board-lg-line { display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; padding: 4px 0; font-size: 13.5px; color: var(--text); }
.board-lg-amt { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.board-lg-cost { color: var(--muted); }
.board-lg-cost .board-lg-amt { font-weight: 500; }
.board-lg-rule { border-top: 1px solid var(--line-strong); margin: 8px 0; }
.board-lg-total .board-lg-amt { font-size: 14.5px; }
.board-lg-net { font-weight: 600; padding-top: 2px; }
.board-lg-net .board-lg-amt { font-size: 19px; }
.board-lg-net.pos, .board-lg-net.pos .board-lg-amt { color: var(--ok); }
.board-lg-net.neg, .board-lg-net.neg .board-lg-amt { color: var(--danger); }
.board-lg-unset { color: var(--muted); }
.board-lg-unset .board-lg-amt { font-size: 13px; font-weight: 500; color: var(--faint); font-family: var(--sans); }

.board-note-stamp { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 5px; }
.board-rowbtns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* handoff — the reason the board exists: one-tap forward to an editor */
.board-handoff { background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 16px; position: relative; overflow: hidden; }
.board-handoff::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(115deg, var(--surface-3) 0 13px, var(--surface) 13px 26px); }
.board-handoff h3 { font-size: 16px; font-weight: 600; margin: 12px 0 4px; color: var(--text); }
.board-hint { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.board-preview { font-family: var(--mono); font-size: 11.5px; line-height: 1.65; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 11px; max-height: 190px; overflow: auto;
  white-space: pre-wrap; color: var(--muted); margin-bottom: 11px; user-select: text; }
.board-copy { width: 100%; justify-content: center; }
.board-ready { font-family: var(--mono); font-size: 11.5px; margin-top: 10px; text-align: center; }
.board-ready.ok { color: var(--ok); }
.board-ready.warn { color: var(--warn); }

/* ======================================================================
   Phone layout. The desktop grid is fine; the phone layout was the real
   work of revision 1 — the header overflowed, the chips built a tall wrap
   that pushed the list off-screen, the intake sheet was cut off, and every
   focused field force-zoomed Mobile Safari.
   ====================================================================== */
@media (max-width: 720px) {
  /* header — actions must fit on one line, no horizontal overflow */
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar .who { max-width: 22vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .btn { flex: 0 0 auto; }
  .brand-logo { height: 16px; }

  .page { padding: 20px 16px 72px; }
  .board-head h1 { font-size: 21px; }

  /* filter chips: one horizontally-scrollable row bled to the screen edges.
     7+ chips used to wrap into a tall block. Scrollbar hidden — the partially
     visible next chip is the affordance. */
  .board-filters {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
    margin: 0 -16px 6px; padding: 2px 16px 4px;
  }
  .board-filters::-webkit-scrollbar { display: none; }
  .board-chip { flex: 0 0 auto; }

  /* three-line row: title across the top, editor + net stacked on the left,
     status spanning the right. Both dates and Budget live in the detail view —
     seven columns do not fit a phone, and net is the one figure worth a glance. */
  .board-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "t t" "e s" "n s";
    row-gap: 6px; padding: 15px;
  }
  .board-title { grid-area: t; font-size: 16.5px; }
  .board-editor { grid-area: e; }
  .board-net { grid-area: n; text-align: left; font-size: 13px; }
  .board-date, .board-net.bud { display: none; }
  .board-status { grid-area: s; justify-self: end; align-self: center; font-size: 10px; padding: 5px 10px; }

  /* month headers stay — they are how you navigate a long list on a phone */
  .board-mgroup { margin: 20px 0 2px; gap: 9px; }
  .board-mlabel { font-size: 11px; }

  /* detail — single column, roomier meta, brief capped so controls stay reachable */
  .board-detail { padding: 16px 15px 18px; }
  .board-cols { grid-template-columns: 1fr; gap: 16px; }
  .board-meta-strip { gap: 14px 26px; margin-bottom: 16px; }
  .board-brief { max-height: 220px; }

  /* the primary action on mobile — thumb-sized */
  .board-copy { padding: 14px 18px; font-size: 15px; }

  /* a label and an amount side by side are too cramped to type into */
  .board-extra { grid-template-columns: 1fr 34px; grid-template-areas: "l l" "a x"; row-gap: 6px; }
  .board-extra .board-ex-l { grid-area: l; }
  .board-extra .board-ex-a { grid-area: a; }
  .board-ex-x { grid-area: x; }

  /* intake sheet — full-width padding, buttons stretch to fill the row */
  .overlay { padding: 0; place-items: stretch; }
  .modal { width: 100%; max-width: 100%; max-height: 100vh; border: 0; border-radius: 0; padding: 20px 16px 32px; }
  .modal .board-btnrow { display: flex; gap: 8px; }
  .modal .board-btnrow .btn { flex: 1; justify-content: center; }
  .modal .board-btnrow .spacer { display: none; }
}

/* iOS zoom fix — Mobile Safari force-zooms the whole page when a focused field
   is under 16px. Do not lower this. */
@media (max-width: 860px) {
  input, select, textarea { font-size: 16px; }
  .board-f input, .board-f select, .board-f textarea, .board-extra input { padding: 11px 12px; }
  .board-f { margin-bottom: 14px; }
}

/* the net figure steps down so it never wraps on a small phone */
@media (max-width: 420px) {
  .board-lg-net .board-lg-amt { font-size: 17px; }
  .board-lg-line { font-size: 13px; }
  .board-grid2, .board-grid3 { gap: 10px; }
}

/* ============================================================ deliveries
   Admin side of the client-delivery feature. Uses the app's existing tokens
   so this section looks like the rest of the tool — the Smitty branding
   applies to the public /d/ page, not to the studio's own interface. */
.dlv-admin-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 900px) { .dlv-admin-grid { grid-template-columns: 380px 1fr; align-items: start; } }

.dlv-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.dlv-panel h2 { font: 600 15px/1.2 var(--sans); margin-bottom: 14px; }

.dlv-drop {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 22px 16px; text-align: center; cursor: pointer;
  color: var(--muted); font-size: 13px; transition: border-color .15s, background .15s;
}
.dlv-drop:hover, .dlv-drop.over { border-color: var(--accent); background: var(--surface-2); }
.dlv-drop strong { color: var(--text); display: block; margin-bottom: 4px; font-weight: 600; }
.dlv-drop .picked { color: var(--accent); }

.dlv-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.dlv-bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
.dlv-progress { margin-top: 14px; font-size: 12px; color: var(--muted); }

.dlv-result { margin-top: 14px; }
.dlv-result .invite-out { word-break: break-all; }

.dlv-list { display: flex; flex-direction: column; gap: 10px; }
.dlv-row {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.dlv-row .grow { flex: 1; min-width: 220px; }
.dlv-row .t { font: 600 14px/1.3 var(--sans); }
.dlv-row .m { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.dlv-row .m .tc { font-family: var(--mono); font-size: 12px; }
.badge.dlv-ready { color: var(--ok); background: rgba(87,199,111,0.1); border: 1px solid rgba(87,199,111,0.3); }
.badge.dlv-expired { color: var(--faint); background: var(--surface-2); border: 1px solid var(--line); }
.badge.dlv-revoked { color: var(--danger); background: rgba(229,72,77,0.1); border: 1px solid rgba(229,72,77,0.3); }
.badge.dlv-processing { color: var(--warn); background: rgba(240,136,62,0.1); border: 1px solid rgba(240,136,62,0.3); }

/* delivery analytics detail */
.dlv-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 26px;
}
.dlv-stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.dlv-stat .k { display: block; color: var(--faint); font-size: 11px; margin-bottom: 6px; }
.dlv-stat .v { font: 600 18px/1.2 var(--sans); }

.dlv-events { display: flex; flex-direction: column; gap: 6px; }
.dlv-event {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px;
}
.dlv-event .when { color: var(--muted); min-width: 130px; font-family: var(--mono); font-size: 12px; }
.dlv-event .who { color: var(--text); }
.dlv-event .rep { color: var(--faint); margin-left: auto; font-family: var(--mono); font-size: 11.5px; }

/* Per-host accent. The studio UI is one app wearing whichever identity the
   hostname implies; only the accent and its contrast colour change. */
:root[data-brand="smitty"] {
  --accent: #EE1C25;
  --accent-dim: #7a1418;
}
:root[data-brand="smitty"] .btn.primary { color: #fff; }
:root[data-brand="smitty"] .btn.primary:hover { background: #ff2d36; }
