/* Dailies — review UI
   Dark by default: the video is the hero, the chrome stays out of the way.
   No frameworks, no external resources (strict CSP). */

:root {
  --bg: #0a0b0d;
  --bg-1: #111316;
  --bg-2: #181b1f;
  --bg-3: #21252a;
  --bg-4: #2a2f35;
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #eef0f2;
  --muted: #a1a8b1;
  --faint: #6c737d;
  --accent: #f2b33d;
  --accent-hover: #ffc455;
  --accent-ink: #1c1404;
  --accent-soft: rgba(242, 179, 61, .14);
  --green: #3fcf8e;
  --green-ink: #06170e;
  --green-soft: rgba(63, 207, 142, .14);
  --red: #f4675c;
  --red-soft: rgba(244, 103, 92, .14);
  --blue: #74acff;
  --blue-soft: rgba(116, 172, 255, .14);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px -8px rgba(0, 0, 0, .6);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 24px 60px -20px rgba(0, 0, 0, .8);
  --topbar-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { cursor: pointer; }
svg { display: block; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: rgba(242, 179, 61, .35); }

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

/* Icons rendered from ui.js (inline SVG wrapped in a span) */
.ico { display: inline-grid; place-items: center; flex: none; width: 1.15em; height: 1.15em; }
.ico svg { width: 100%; height: 100%; }

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--bg-3); color: var(--text);
  font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease), box-shadow .15s;
  user-select: none;
}
.btn:hover { background: var(--bg-4); border-color: rgba(255, 255, 255, .2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn .ico { width: 16px; height: 16px; margin-left: -2px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-green { background: var(--green); border-color: var(--green); color: var(--green-ink); font-weight: 600; }
.btn-green:hover { background: #58dba0; border-color: #58dba0; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, .07); border-color: transparent; color: var(--text); }
.btn-outline { background: transparent; }
.btn-outline:hover { background: rgba(255, 255, 255, .05); }
.btn-danger { color: var(--red); }
.btn-danger:not(.btn-ghost) { border-color: rgba(244, 103, 92, .35); background: var(--red-soft); }
.btn-danger:not(.btn-ghost):hover { background: rgba(244, 103, 92, .22); border-color: rgba(244, 103, 92, .5); }
.btn-danger.btn-ghost:hover { background: var(--red-soft); color: var(--red); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn-sm .ico { width: 14px; height: 14px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 15px; border-radius: 10px; }

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--text);
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .09); }
.icon-btn:active { background: rgba(255, 255, 255, .14); }
.icon-btn .ico { width: 20px; height: 20px; }
.icon-btn:disabled { opacity: .4; }

/* ---------------------------------------------------------------------------
   Form controls
   --------------------------------------------------------------------------- */
input[type=text], input[type=email], input:not([type]), textarea, select {
  width: 100%; min-width: 0;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 11px; outline: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=text]:hover, input:not([type]):hover, textarea:hover, select:hover { border-color: rgba(255, 255, 255, .22); }
input[type=text]:focus, input:not([type]):focus, textarea:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none;
}
input[readonly] { color: var(--muted); }
textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a1a8b1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px;
}
select option { background: var(--bg-2); color: var(--text); }
label.field { display: grid; gap: 6px; margin-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 500; }
label.field > input, label.field > select { color: var(--text); font-weight: 400; }

/* Checkbox */
.check {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 17px; height: 17px; margin: 0; border-radius: 5px;
  border: 1px solid var(--line-strong); background: var(--bg-2);
  display: inline-grid; place-items: center; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.check:hover { border-color: rgba(255, 255, 255, .3); }
.check:checked { background: var(--accent); border-color: var(--accent); }
.check:checked::after {
  content: ""; width: 9px; height: 5px; margin-top: -2px;
  border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg);
}

/* Switch */
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative;
  width: 38px; height: 22px; margin: 0; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--bg-4); cursor: pointer;
  transition: background-color .18s, border-color .18s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  transition: transform .18s var(--ease), background-color .18s;
}
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(16px); background: var(--accent-ink); }

/* ---------------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 13, .85);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  font-weight: 650; letter-spacing: -.01em; text-decoration: none; white-space: nowrap;
  border-radius: 8px;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: var(--bg-3); display: grid; place-items: center;
  border: 1px solid var(--line-strong);
}
.brand-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(242, 179, 61, .55); }
a.brand:hover .brand-mark { border-color: rgba(255, 255, 255, .25); }
.topbar .who { color: var(--faint); font-size: 13px; }
.topbar .sep { color: var(--faint); opacity: .7; user-select: none; }
.crumb { color: var(--muted); text-decoration: none; white-space: nowrap; border-radius: 6px; }
.crumb:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
/* Back arrow that replaces the project name on phones. */
.crumb-back .crumb-arrow {
  display: none; place-items: center; width: 32px; height: 32px; margin-left: -6px;
  font-size: 26px; line-height: 1; color: var(--text); border-radius: 8px;
}
.crumb-back:hover .crumb-arrow { background: var(--bg-3); }
.title-line { min-width: 0; display: flex; align-items: center; gap: 10px; }
.title-line h1 { font-size: 15px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: none; }

/* ---------------------------------------------------------------------------
   Status pills
   --------------------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; letter-spacing: .005em;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-in_review { background: var(--blue-soft); color: var(--blue); }
.pill-approved { background: var(--green-soft); color: var(--green); }
.pill-changes_requested { background: var(--red-soft); color: var(--red); }

/* ---------------------------------------------------------------------------
   Admin: projects & cards
   --------------------------------------------------------------------------- */
.page { max-width: 1280px; margin: 0 auto; padding: 28px 24px 96px; }
.page-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 28px; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head .muted { font-size: 13px; }

.empty {
  max-width: 420px; margin: 10vh auto 0; text-align: center; color: var(--muted);
  display: grid; justify-items: center; gap: 8px;
}
.empty-art {
  width: 72px; height: 72px; border-radius: 20px; margin-bottom: 10px;
  background: var(--bg-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--faint);
}
.empty-art .ico { width: 30px; height: 30px; }
.empty h2 { color: var(--text); margin: 0; font-size: 19px; }
.empty p { margin: 0 0 14px; }

.project { margin-bottom: 44px; }
.project-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; min-width: 0; }
.project-head h2 { font-size: 17px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-head .count { color: var(--faint); font-size: 13px; white-space: nowrap; }
.project-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.project-empty {
  padding: 22px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--muted); display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.project-empty > .ico { width: 20px; height: 20px; color: var(--faint); }
.project-empty > span { flex: 1 1 240px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card {
  display: block; position: relative; text-decoration: none; color: inherit;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; min-width: 0;
  transition: border-color .18s, transform .18s var(--ease), box-shadow .18s;
}
a.card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-1); }
a.card:focus-visible { outline-offset: 0; }
.thumb {
  aspect-ratio: 16 / 9; position: relative; overflow: hidden;
  background: var(--bg-2); color: var(--faint);
  display: grid; place-items: center; font-size: 13px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ico { width: 28px; height: 28px; opacity: .6; }
.thumb .thumb-label { display: grid; justify-items: center; gap: 6px; }
.thumb .dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 0, 0, .7); padding: 2px 6px; border-radius: 5px;
  font: 11.5px/1.4 var(--mono); font-variant-numeric: tabular-nums; color: #fff;
}
a.card:hover .thumb img { filter: brightness(1.06); }
.card-body { padding: 11px 13px 13px; display: grid; gap: 7px; }
.card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.card-meta { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; min-width: 0; }
.card-meta > * { white-space: nowrap; }
.card-meta .open { color: var(--accent); font-weight: 600; }
.card-meta .dot { color: var(--faint); }
.card-meta .size { white-space: nowrap; }

.progress { height: 4px; background: var(--bg-4); border-radius: 2px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width .25s; }

/* Upload-in-progress card */
.card-upload .thumb { background: var(--bg-2); }
.card-upload .thumb::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .045) 50%, transparent 70%);
  background-size: 200% 100%; animation: shimmer 1.6s linear infinite;
}
.card-upload .thumb .pct { font: 600 22px var(--mono); font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: -.02em; }
.card-upload .thumb .step { color: var(--muted); font-size: 12px; }
.card-upload.is-error .thumb::before { animation: none; background: none; }
.card-upload.is-error .thumb { color: var(--red); }
.card-upload.is-error .thumb .ico { opacity: 1; }
.card-upload.is-error .progress > div { background: var(--red); }
.card-upload .card-meta.error { color: var(--red); white-space: normal; }
.card-incomplete .thumb { color: var(--muted); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Client folder page: the card holds a link plus a separate download button. */
.folder-card { display: flex; flex-direction: column; }
.folder-card:hover { border-color: var(--line-strong); }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover .thumb img { filter: brightness(1.06); }
.card-link:focus-visible { outline-offset: -2px; }
.card-download { margin: -4px 13px 12px; justify-self: start; align-self: flex-start; gap: 6px; }
.card-download .muted { font-weight: 400; }

/* Admin: project share dialog */
.share-dialog { display: grid; gap: 14px; }
.share-item { display: grid; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.share-item:last-child { border-bottom: 0; }
.share-item .setting { border-bottom: 0; padding: 6px 0 0; min-height: 0; cursor: pointer; }

/* Version badges (H / L / M) */
.badges { display: inline-flex; gap: 3px; flex: none; }
.badge {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px;
  font: 600 10px var(--mono); color: var(--faint); border: 1px solid var(--line);
}
.badge.on { color: var(--text); background: var(--bg-3); border-color: var(--line-strong); }

/* ---------------------------------------------------------------------------
   Review layout
   --------------------------------------------------------------------------- */
.review {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px;
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
}
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #000; }
.player { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; background: #000; overflow: hidden; }
.player video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.player:fullscreen { background: #000; }
.player .big-play {
  position: absolute; width: 80px; height: 80px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(14, 15, 18, .62); color: #fff; display: grid; place-items: center;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  transition: transform .18s var(--ease), background-color .18s;
}
.player .big-play:hover { transform: scale(1.06); background: rgba(20, 22, 26, .78); }
.player .big-play .ico { width: 34px; height: 34px; margin-left: 5px; }
.player .big-play:focus-visible { outline-offset: 4px; }

.player-notice {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  padding: 20px; background: rgba(0, 0, 0, .78);
}
.player-notice .notice-card {
  display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 360px;
  padding: 22px 24px; border-radius: var(--radius-lg);
  background: var(--bg-1); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2);
}
.player-notice strong { font-size: 15px; }
.player-notice span { color: var(--muted); }
.player-notice .btn { margin-top: 6px; }

/* Controls */
.controls {
  background: var(--bg-1); border-top: 1px solid var(--line);
  padding: 6px 12px 8px; user-select: none; -webkit-user-select: none;
}
.scrub { position: relative; height: 30px; cursor: pointer; touch-action: none; outline-offset: -2px; border-radius: 4px; }
.scrub-track {
  position: absolute; left: 0; right: 0; top: 13px; height: 4px;
  background: var(--bg-4); border-radius: 2px;
  transition: transform .15s var(--ease);
}
.scrub:hover .scrub-track, .scrub.dragging .scrub-track { transform: scaleY(1.5); }
.scrub-buffer { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .16); border-radius: 2px; }
.scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; }
.scrub-head {
  position: absolute; top: 8px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, .45), 0 1px 4px rgba(0, 0, 0, .6);
  opacity: 0; transform: scale(.7); transition: opacity .15s, transform .15s var(--ease);
  pointer-events: none;
}
.scrub:hover .scrub-head, .scrub.dragging .scrub-head, .scrub:focus-visible .scrub-head { opacity: 1; transform: scale(1); }
@media (hover: none) { .scrub-head { opacity: 1; transform: scale(1); } }
.scrub-markers { position: absolute; inset: 0; pointer-events: none; }
.scrub-marker {
  position: absolute; top: 1px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-1); box-sizing: content-box;
  cursor: pointer; transition: transform .12s var(--ease);
}
.scrub-marker:hover { transform: scale(1.35); }
.scrub-marker.resolved { background: var(--faint); }
.scrub-marker.studio { background: var(--blue); }
.scrub-hover {
  position: absolute; bottom: 32px; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--line-strong); padding: 3px 7px; border-radius: 5px;
  font: 12px var(--mono); font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap;
  box-shadow: var(--shadow-1);
}
.ctrl-row { display: flex; align-items: center; gap: 2px; }
.ctrl-row .tc {
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; padding: 0 10px; white-space: nowrap;
}
.ctrl-row .tc .dim { color: var(--faint); }
.ctrl-row select {
  width: auto; height: 30px; padding: 0 26px 0 9px; font-size: 12.5px; font-weight: 500;
  background-color: transparent; border-color: transparent; color: var(--muted); border-radius: 7px;
  background-position: right 7px center; background-size: 12px;
}
.ctrl-row select:hover { background-color: rgba(255, 255, 255, .07); color: var(--text); }
.ctrl-row select:focus { box-shadow: none; border-color: var(--line-strong); }

/* ---------------------------------------------------------------------------
   Side panel: decisions, notes, settings
   --------------------------------------------------------------------------- */
.side { border-left: 1px solid var(--line); background: var(--bg-1); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.side-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.side-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.side-head:empty { display: none; }
.side-head .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.decision { display: flex; gap: 8px; }
.decision .btn { flex: 1; justify-content: center; height: 40px; border-radius: 9px; }

.status-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 9px; border: 1px solid transparent;
}
.status-banner .status-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.status-banner .status-text strong { font-size: 13.5px; }
.status-banner .status-text span { font-size: 12.5px; color: var(--muted); }
.status-banner .ico { width: 20px; height: 20px; }
.status-banner.approved { background: var(--green-soft); border-color: rgba(63, 207, 142, .25); color: var(--green); }
.status-banner.changes_requested { background: var(--red-soft); border-color: rgba(244, 103, 92, .25); color: var(--red); }
.status-banner.in_review { background: var(--blue-soft); border-color: rgba(116, 172, 255, .25); color: var(--blue); }
.status-banner .status-text strong { color: var(--text); }
.status-banner .btn { margin-left: auto; }

.side-tabs {
  display: flex; gap: 2px; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
}
.side-tabs button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  padding: 7px 10px; border-radius: 6px; font-weight: 500; font-size: 13px;
  transition: background-color .15s, color .15s;
}
.side-tabs button:hover { color: var(--text); }
.side-tabs button[aria-selected=true] { background: var(--bg-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.side-tabs .tab-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700;
}

/* Notes list */
.comments { flex: 1; overflow-y: auto; padding: 10px 10px 18px; overscroll-behavior: contain; }
.comments-empty { padding: 40px 20px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 6px; }
.comments-empty .ico { width: 26px; height: 26px; color: var(--faint); margin-bottom: 4px; }
.comments-empty strong { color: var(--text); font-weight: 600; }
.comments-empty p { margin: 0; max-width: 260px; font-size: 13px; }

.comment {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px;
  padding: 10px 10px 8px; border-radius: 9px; margin-bottom: 2px;
  transition: background-color .15s, box-shadow .15s;
}
.comment:hover { background: var(--bg-2); }
.comment.active { background: var(--bg-2); box-shadow: inset 2px 0 0 var(--accent); }
.comment.resolved > .comment-main { opacity: .6; }
.comment.resolved > .avatar { opacity: .6; }
.comment-main { min-width: 0; display: grid; gap: 3px; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  background: var(--accent-soft); color: var(--accent); margin-top: 1px;
}
.avatar.studio { background: var(--blue-soft); color: var(--blue); }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 22px; flex-wrap: wrap; row-gap: 2px; }
.comment-head .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-head .who.studio { color: var(--blue); }
.comment-head .when { color: var(--faint); font-size: 12px; white-space: nowrap; }
.comment-head .resolved-tag {
  display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 11.5px; font-weight: 600;
}
.comment-head .resolved-tag .ico { width: 13px; height: 13px; }
.ts {
  font: 12px var(--mono); font-variant-numeric: tabular-nums;
  background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 5px; padding: 2px 7px;
  transition: background-color .15s;
}
.ts:hover { background: rgba(242, 179, 61, .28); }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; font-size: 14px; }
.comment-actions { display: flex; gap: 2px; margin-top: 2px; margin-left: -6px; }
.comment-actions button {
  border: 0; background: transparent; color: var(--faint); font-size: 12px; font-weight: 500;
  padding: 3px 6px; border-radius: 5px; transition: color .15s, background-color .15s;
}
.comment-actions button:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.comment-actions button.danger:hover { color: var(--red); background: var(--red-soft); }
@media (hover: hover) {
  .comment-actions { opacity: 0; transition: opacity .15s; }
  .comment:hover .comment-actions, .comment:focus-within .comment-actions, .comment.active .comment-actions { opacity: 1; }
}
.replies { margin: 8px 0 0; padding-left: 10px; border-left: 2px solid var(--line); display: grid; gap: 2px; }
.replies .comment { padding: 6px 6px 4px; grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; }
.replies .avatar { width: 20px; height: 20px; font-size: 10px; }
.replies .comment:hover { background: rgba(255, 255, 255, .03); }
.reply-box { margin-top: 8px; display: grid; gap: 8px; }
.reply-box .row { display: flex; gap: 6px; justify-content: flex-end; }

/* Composer */
.composer { border-top: 1px solid var(--line); padding: 12px 12px 10px; display: grid; gap: 8px; background: var(--bg-1); }
.composer textarea { background: var(--bg); }
.composer .row { display: flex; align-items: center; gap: 8px; }
.composer label.attach {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px 0 8px;
  border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 12.5px; cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s;
}
.composer label.attach:hover { border-color: var(--line-strong); color: var(--text); }
.composer label.attach .mono { color: var(--text); font-size: 12px; }
.composer .kbd { font: 11.5px var(--mono); color: var(--faint); }
.hint { font-size: 12px; color: var(--faint); }
.hint kbd { font: 11px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--bg-3); border: 1px solid var(--line); color: var(--muted); }
.hint kbd + kbd { margin-left: 2px; }
.composer > .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Share & settings */
.share-panel { padding: 6px 16px 24px; display: grid; gap: 22px; overflow-y: auto; flex: 1; align-content: start; }
.share-section { display: grid; gap: 10px; }
.section-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; margin: 0; }
.share-links { display: grid; gap: 8px; }
.share-link { display: flex; gap: 6px; align-items: center; min-width: 0; }
.share-link input { font: 12px var(--mono); padding: 7px 10px; height: 32px; min-width: 0; }
.share-empty { color: var(--muted); font-size: 13px; line-height: 1.5; }
.settings { display: grid; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 50px; }
.setting:last-child { border-bottom: 0; }
.setting select { width: auto; }
.setting .setting-label { display: grid; gap: 1px; min-width: 0; }
.setting .setting-label span:last-child { color: var(--faint); font-size: 12px; }
.danger-zone { border: 1px solid rgba(244, 103, 92, .25); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.danger-zone .muted { font-size: 13px; flex: 1; }

.versions { display: grid; gap: 8px; }
.version { border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; display: grid; gap: 8px; background: var(--bg); min-width: 0; }
.version.on { border-color: var(--line-strong); }
.version-head { display: flex; align-items: center; gap: 8px; }
.version-head strong { font-size: 13.5px; }
.version-head .hint { flex: 1; }
.version-kind { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font: 700 11px var(--mono); background: var(--bg-3); color: var(--muted); flex: none; }
.version.on .version-kind { background: var(--accent-soft); color: var(--accent); }
.version .file { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version .file .file-name { display: inline; color: var(--text); }
.version-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.version .uploading { display: grid; gap: 6px; }

/* ---------------------------------------------------------------------------
   Upload dialog
   --------------------------------------------------------------------------- */
.file-rows { display: grid; gap: 8px; margin-bottom: 16px; }
.file-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); min-width: 0; }
.file-row .file-ico { width: 34px; height: 34px; border-radius: 8px; background: var(--bg-3); color: var(--muted); display: grid; place-items: center; flex: none; }
.file-row .file-ico .ico { width: 18px; height: 18px; }
.file-info { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 13px; }
.file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.file-meta { color: var(--muted); font-size: 12.5px; }
.file-warn { color: var(--accent); font-size: 12px; display: flex; gap: 6px; align-items: flex-start; line-height: 1.4; margin-top: 3px; }
.file-warn .ico { width: 14px; height: 14px; margin-top: 2px; }
.file-row select { width: auto; flex: none; max-width: 46%; font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
.form-error { color: var(--red); margin: 0 0 10px; font-size: 13px; padding: 9px 11px; background: var(--red-soft); border-radius: 8px; }

/* ---------------------------------------------------------------------------
   Modal & toast
   --------------------------------------------------------------------------- */
.modal {
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--bg-1); color: var(--text);
  padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  box-shadow: var(--shadow-2);
}
.modal[open] { animation: modal-in .18s var(--ease); }
.modal::backdrop { background: rgba(4, 5, 7, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-inner { padding: 22px 22px 18px; margin: 0; }
.modal h2 { margin: 0 0 18px; font-size: 17px; }
.modal p.muted { margin: 0 0 6px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: min(480px, calc(100vw - 32px));
  background: var(--bg-3); border: 1px solid var(--line-strong); padding: 10px 16px; border-radius: 10px;
  box-shadow: var(--shadow-2); font-weight: 500; font-size: 13.5px; text-align: center;
  transition: opacity .2s, transform .2s var(--ease); z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { border-color: rgba(244, 103, 92, .5); background: #2a1a19; }

.notice { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------------------
   Gate (landing / link unavailable)
   --------------------------------------------------------------------------- */
.gate-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate {
  width: min(400px, 100%); padding: 30px 28px; text-align: center;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-2);
  display: grid; justify-items: center; gap: 6px;
}
.gate .brand-mark { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 12px; }
.gate .brand-mark::after { width: 16px; height: 16px; }
.gate h1 { font-size: 19px; margin: 0; }
.gate p { color: var(--muted); margin: 0; line-height: 1.55; }

/* ---------------------------------------------------------------------------
   Phone / narrow layouts
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .review { grid-template-columns: 1fr; height: auto; }
  /* The player stays put while the notes scroll underneath it. */
  .stage { position: sticky; top: 0; z-index: 10; height: auto; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
  body.review-page .topbar { position: static; }
  .player { aspect-ratio: 16 / 9; flex: none; max-height: 56vh; }
  .side { border-left: 0; border-top: 1px solid var(--line); min-height: 50vh; }
  .comments { overflow: visible; flex: none; }
  .share-panel { overflow: visible; flex: none; }
  .hide-sm { display: none !important; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .who { display: none; }
  body.review-page .topbar .brand-name { display: none; }
  .ctrl-row .tc { font-size: 12px; padding: 0 6px; }
  .ctrl-row .tc .dim { display: none; }
  .composer > .hint { display: none; }
  .page { padding: 20px 16px 80px; }
  .page-head { margin-bottom: 20px; }
  .project-head { flex-wrap: wrap; }
  .project-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .file-row { flex-wrap: wrap; }
  .file-row select { max-width: none; width: 100%; }
  .modal-inner { padding: 18px 16px 14px; }
  .status-banner .btn { margin-left: 0; }
  .setting { flex-wrap: wrap; }
  /* Make room for the video title in the top bar. */
  .topbar-right .btn-label { display: none; }
  .crumb-back .crumb-name, .crumb-sep { display: none; }
  .crumb-back .crumb-arrow { display: inline-grid; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
  .side-head { padding: 12px; }
  .decision .btn { padding: 0 8px; font-size: 13px; }
}
