/* Mint Review: design tokens + primitives shared by every page. Dark pro-tool theme. */
:root {
  color-scheme: dark;
  --bg: #101211;
  --bg-viewer: #08080a; /* stays NEUTRAL: a tinted surround skews colour judgement on the video */
  --surface: #171a19;
  --surface-2: #1f2221;
  --surface-3: #282b2a;
  --border: #2a2e2c;
  --border-strong: #373c39;
  --text: #f0f2f1;
  --text-2: #b7bdb9;
  --muted: #8a918d;
  --faint: #5d6461;

  --mint: #62e08c;
  --mint-hover: #7ae89e;
  --mint-ink: #08200f;
  --mint-soft: rgba(98, 224, 140, 0.14);
  --mint-edge: rgba(98, 224, 140, 0.3);
  --mint-glow: rgba(98, 224, 140, 0.42);

  --red: #ff5d5d;
  --red-soft: rgba(255, 93, 93, 0.14);
  --amber: #ffb84d;
  --amber-soft: rgba(255, 184, 77, 0.14);
  --blue: #6aa8ff;
  --blue-soft: rgba(106, 168, 255, 0.14);
  --grey-soft: rgba(255, 255, 255, 0.07);

  --status-none: var(--muted);
  --status-needs_review: var(--amber);
  --status-in_progress: var(--blue);
  --status-changes: var(--red);
  --status-approved: var(--mint);

  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--mint);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --topbar-h: 56px;
  --speed: 160ms;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--mint-soft); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-s); }

.mono, .tc { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600; font-size: 13px; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background var(--speed), border-color var(--speed), color var(--speed), opacity var(--speed);
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--mint); border-color: var(--mint); color: var(--mint-ink); }
.btn-primary:hover { background: var(--mint-hover); border-color: var(--mint-hover); }
.btn-danger { background: transparent; border-color: rgba(255, 93, 93, 0.45); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--grey-soft); color: var(--text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 15px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---- Inputs ----------------------------------------------------------- */
.input, .select, .textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  color: var(--text);
  transition: border-color var(--speed), box-shadow var(--speed);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-soft); }
.textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: background var(--speed); margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform var(--speed), background var(--speed); }
.switch input:checked { background: var(--mint); }
.switch input:checked::after { transform: translateX(14px); background: var(--mint-ink); }

/* ---- Pills, badges, avatars ------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap;
  background: var(--grey-soft); color: var(--text-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.no-dot::before { display: none; }
.status-none { color: var(--status-none); }
.status-needs_review { color: var(--amber); background: var(--amber-soft); }
.status-in_progress { color: var(--blue); background: var(--blue-soft); }
.status-changes { color: var(--red); background: var(--red-soft); }
.status-approved { color: var(--mint); background: var(--mint-soft); }

.badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 5px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.62); color: #fff;
}
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 11px; font-weight: 800; color: #0b0b0d; letter-spacing: 0.02em;
}
.avatar-sm { width: 22px; height: 22px; font-size: 9px; }

/* ---- Surfaces --------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.divider { height: 1px; background: var(--border); border: 0; margin: 12px 0; }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 10px; padding: 64px 24px; color: var(--muted);
}
.empty h3 { margin: 0; color: var(--text); font-size: 17px; }
.empty p { margin: 0; max-width: 420px; }

/* ---- Top bar ---------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: rgba(16, 18, 17, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { height: 22px; width: auto; }
.brand .brand-tag { color: var(--mint); font-weight: 700; }

/* ---- Menus, modals, toasts -------------------------------------------- */
.menu {
  position: fixed; z-index: 400; min-width: 190px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.menu button, .menu a {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--radius-s);
  background: transparent; color: var(--text); text-align: left; font-size: 13px; cursor: pointer;
}
.menu button:hover, .menu a:hover { background: var(--grey-soft); text-decoration: none; }
.menu .danger { color: var(--red); }
.menu hr { border: 0; height: 1px; background: var(--border); margin: 6px 0; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, 0.6);
}
.modal {
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-l);
  box-shadow: var(--shadow);
}
.modal-head { padding: 18px 20px 6px; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 10px 20px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }

.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 600; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; padding: 10px 16px; border-radius: var(--radius);
  background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  font-weight: 600; font-size: 13px; text-align: center;
}
.toast.ok { border-color: rgba(98, 224, 140, 0.5); }
.toast.error { border-color: rgba(255, 93, 93, 0.6); color: #ffd0d0; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18); border-top-color: var(--mint);
  animation: mr-spin 0.8s linear infinite;
}
@keyframes mr-spin { to { transform: rotate(360deg); } }

.scroll-y { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }

/* ---- Auth card (login, password gate) --------------------------------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; padding: 32px 28px; text-align: center; }
.auth-card .brand { justify-content: center; margin-bottom: 22px; }
.auth-card h1 { margin: 0 0 6px; font-size: 20px; }
.auth-card p { margin: 0 0 20px; color: var(--muted); }
.auth-card form { text-align: left; }
.auth-card .btn { width: 100%; }
.alert { padding: 10px 12px; border-radius: var(--radius-s); margin-bottom: 14px; font-size: 13px; text-align: center; }
.alert-error { background: var(--red-soft); color: #ffd0d0; }
.alert-ok { background: var(--mint-soft); color: var(--mint); }

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