/* Keypoint review: one stylesheet for every page. No framework, no build step.
   Colours are tokens on :root, redefined for dark mode. Skeleton colours (--left, --right,
   --mid) are read by the canvas viewer in common.js. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --sunken: #eef0f3;
  --ink: #15171c;
  --ink-2: #3a3f4b;
  --muted: #6b7180;
  --line: #e3e6eb;
  --line-strong: #cfd4dc;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --good: #15803d;
  --good-soft: #e8f6ed;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --gold: #a16207;
  --gold-soft: #fbf5df;
  --left: #2f7bff;
  --right: #ff8a1f;
  --mid: #34b35a;
  --stage: #1b1d22;
  --shadow-sm: 0 1px 2px rgb(16 18 27 / 6%);
  --shadow: 0 1px 2px rgb(16 18 27 / 6%), 0 4px 14px rgb(16 18 27 / 6%);
  --shadow-lg: 0 10px 40px rgb(16 18 27 / 18%);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --top-h: 56px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1c2027;
    --sunken: #12151a;
    --ink: #eceef2;
    --ink-2: #c4c8d1;
    --muted: #8b919e;
    --line: #262a33;
    --line-strong: #353a45;
    --accent: #8b85ff;
    --accent-ink: #0f1115;
    --accent-soft: #23234a;
    --good: #4ade80;
    --good-soft: #13291c;
    --bad: #f87171;
    --bad-soft: #351719;
    --warn: #fbbf24;
    --warn-soft: #33270f;
    --gold: #facc15;
    --gold-soft: #2f2a10;
    --stage: #08090c;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 18px rgb(0 0 0 / 25%);
    --shadow-lg: 0 14px 48px rgb(0 0 0 / 55%);
    color-scheme: dark;
  }
}

/* ---- base ------------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 0.9em var(--mono); padding: 0.1em 0.35em; border-radius: 4px; background: var(--sunken); }
:focus-visible { outline: none; box-shadow: var(--ring); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.icon { width: 1.1em; height: 1.1em; flex: none; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

kbd {
  display: inline-grid; place-items: center;
  min-width: 1.7em; height: 1.7em; padding: 0 0.4em;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
  background: var(--surface); color: var(--ink-2);
  font: 600 11.5px/1 var(--mono);
}

/* ---- buttons and fields ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  font-weight: 550; white-space: nowrap; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon-only { width: 34px; padding: 0; }
.btn.small.icon-only { width: 30px; }
.btn kbd { height: 1.6em; min-width: 1.6em; font-size: 11px; }
.btn.primary kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 45%, transparent); }

input[type=email], input[type=password], input[type=text], input[type=number], select {
  height: 38px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder { color: var(--muted); }
select { padding-right: 8px; cursor: pointer; }
input[type=number] { width: 64px; padding: 0 8px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }

/* ---- brand ------------------------------------------------------------------------------ */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.crumb:has(#job-title:not(:empty)) .brand-name { display: none; }
.brand:hover { text-decoration: none; }
.mark {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 8px; background: var(--accent); color: var(--accent-ink);
}
.mark .icon { width: 18px; height: 18px; stroke-width: 2.2; }

/* ---- sign-in and join ------------------------------------------------------------------- */
.card-page {
  display: grid; place-items: center; min-height: 100%; padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(700px 500px at 110% 110%, color-mix(in srgb, var(--right) 10%, transparent), transparent 70%),
    var(--bg);
}
.card {
  width: min(400px, 100%);
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card .mark { width: 40px; height: 40px; border-radius: 11px; margin-bottom: 20px; }
.card .mark .icon { width: 22px; height: 22px; }
.card h1 { font-size: 22px; margin: 0 0 6px; }
.card > p, .card form > p { margin: 0 0 22px; }
.card form { display: grid; gap: 16px; }
.card .field input { width: 100%; }
.card .btn.primary { width: 100%; height: 42px; margin-top: 4px; }
.card .foot { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.error { color: var(--bad); font-size: 14px; }
.error:empty { display: none; }
.meter { height: 4px; border-radius: 2px; background: var(--sunken); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; background: var(--warn); transition: width 0.15s, background 0.15s; }
.meter.ok > i { background: var(--good); }

/* ---- app shell -------------------------------------------------------------------------- */
.shell { display: grid; grid-template-rows: var(--top-h) 1fr; height: 100dvh; }
.top {
  display: flex; align-items: center; gap: 14px;
  height: var(--top-h); padding: 0 16px; min-width: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.top .spacer { flex: 1; }
.top .crumb { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--muted); }
.top .crumb b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .sep { width: 1px; height: 22px; background: var(--line); }
.who { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.progress b { color: var(--ink); font-weight: 600; }
.progress .bar { width: 140px; }

.bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; background: var(--good); transition: width 0.3s; }
.bar > i.bad { background: var(--bad); }
.bar > i.warn { background: var(--warn); }
.bar > i.accent { background: var(--accent); }

/* ---- job picker ------------------------------------------------------------------------- */
.scroll { overflow: auto; min-height: 0; }
.jobs { max-width: 720px; margin: 0 auto; padding: 48px 16px; }
.jobs h1 { font-size: 26px; margin: 0 0 6px; }
.jobs > p { margin: 0 0 24px; }
.job-list { display: grid; gap: 10px; }
.job {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  width: 100%; padding: 16px 18px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.job:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.job.sel { border-color: var(--accent); box-shadow: var(--ring); }
.job .name { font-weight: 600; font-size: 16px; }
.job .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.job .meta .bar { flex: 1; min-width: 80px; max-width: 220px; }
.job .go { color: var(--muted); }
.job.sel .go { color: var(--accent); }

.empty { display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; padding: 64px 16px; }
.empty .big {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 10px;
  border-radius: 16px; background: var(--good-soft); color: var(--good);
}
.empty .big.neutral { background: var(--sunken); color: var(--muted); }
.empty .big .icon { width: 26px; height: 26px; }
.empty h2 { margin: 0; font-size: 20px; }
.empty p { margin: 0 0 12px; max-width: 420px; }

/* ---- review screen ---------------------------------------------------------------------- */
.review { display: grid; grid-template-columns: 1fr 320px; min-height: 0; }
.stage { position: relative; background: var(--stage); min-height: 0; overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.stage .loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.stage.busy .loading { opacity: 1; transition-delay: 0.15s; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgb(255 255 255 / 15%); border-top-color: rgb(255 255 255 / 75%);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hud {
  position: absolute; display: flex; align-items: center; gap: 6px;
  padding: 5px; border-radius: 10px;
  background: rgb(15 17 21 / 72%); color: #e6e8ec;
  backdrop-filter: blur(6px); font-size: 12.5px;
}
.hud.tl { top: 12px; left: 12px; padding: 6px 10px; gap: 12px; }
.hud.br { right: 12px; bottom: 12px; }
.hud.bl { left: 12px; bottom: 12px; padding: 6px 10px; }
.hud kbd { background: rgb(255 255 255 / 8%); border-color: rgb(255 255 255 / 22%); color: #e6e8ec; }
.hud .btn { height: 28px; width: 28px; padding: 0; border: 0; box-shadow: none; background: transparent; color: #e6e8ec; }
.hud .btn:hover { background: rgb(255 255 255 / 12%); }
.hud .dot { box-shadow: 0 0 0 2px rgb(255 255 255 / 85%); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.l { background: var(--left); } .dot.r { background: var(--right); }

.stamp {
  position: absolute; left: 50%; top: 50%; display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px;
  font-size: 18px; font-weight: 700; color: #fff;
  transform: translate(-50%, -50%) scale(0.9); opacity: 0; pointer-events: none;
}
.stamp .icon { width: 22px; height: 22px; stroke-width: 2.6; }
.stamp.good { background: #15803d; }
.stamp.bad { background: #dc2626; }
.stamp.show { animation: stamp 0.55s ease-out; }
@keyframes stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.02); }
}

.side {
  display: flex; flex-direction: column; gap: 20px;
  padding: 20px; overflow: auto; min-height: 0;
  border-left: 1px solid var(--line); background: var(--surface);
}
.side section { display: grid; gap: 10px; }
.side h2 { margin: 0; font-size: 16px; }
.side h3 { margin: 0; font-size: 11.5px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.side p { margin: 0; font-size: 13.5px; color: var(--muted); }

.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.verdict .btn { height: 52px; border-radius: var(--r); font-size: 15px; font-weight: 650; box-shadow: none; }
.verdict .btn .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.verdict .accept { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 45%, transparent); color: var(--good); }
.verdict .accept:hover { background: color-mix(in srgb, var(--good) 18%, var(--surface)); }
.verdict .reject { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }
.verdict .reject:hover { background: color-mix(in srgb, var(--bad) 18%, var(--surface)); }
.verdict .btn.ready { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; }
.verdict .btn.dim { opacity: 0.45; }
.verdict kbd { background: transparent; border-color: color-mix(in srgb, currentColor 40%, transparent); color: inherit; }

.parts { display: grid; gap: 6px; }
.part {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); cursor: pointer; text-align: left;
  transition: background 0.1s, border-color 0.1s;
}
.part:hover { border-color: var(--line-strong); background: var(--surface-2); }
.part .n { flex: 1; font-weight: 500; }
.part .c { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--bad); color: #fff; }
.part.on { border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: var(--bad-soft); }
.part.on .n { color: var(--bad); }
.flag-tools { display: flex; gap: 6px; }
.flag-tools .btn { flex: 1; }
.missing { display: flex; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.missing .icon { margin-top: 2px; }

.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; font-size: 13px; color: var(--ink-2); }
.keys kbd { justify-self: start; }
.side .keys { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }

/* ---- dialog ----------------------------------------------------------------------------- */
.overlay {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: rgb(8 9 12 / 55%); backdrop-filter: blur(3px); z-index: 30;
}
.overlay .card { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: var(--shadow-lg); }
.overlay .card h1 { display: flex; align-items: center; justify-content: space-between; }
.overlay .keys { font-size: 14px; gap: 10px 16px; }
.note { font-size: 13px; color: var(--muted); }
.card .note { margin: 18px 0 0; }

#toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  max-width: calc(100% - 32px); padding: 10px 16px;
  border-radius: 10px; background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow-lg); font-size: 14px;
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); color: #fff; }

/* ---- admin ------------------------------------------------------------------------------ */
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--sunken); }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font-weight: 550; cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; }
.badge:empty { display: none; }

.page { max-width: 1240px; margin: 0 auto; padding: 28px 16px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head p { margin: 4px 0 0; }
.section { margin-bottom: 32px; }
.section > h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 12px; }
.section > h2 .count { font-weight: 500; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-sm); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat-card { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.stat-card .k { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.stat-card .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.stat-card .v.hot { color: var(--bad); }
.stat-card .s { font-size: 12.5px; color: var(--muted); }

.invite { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; }
.linkbox { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 10px; border-radius: 8px; background: var(--accent-soft); }
.linkbox input { flex: 1; min-width: 0; font: 13px var(--mono); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
th { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); }
tbody tr:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td .sub { display: block; font-size: 12.5px; color: var(--muted); }
.person { display: flex; align-items: center; gap: 10px; }
.person.off { opacity: 0.55; }
.hot { color: var(--bad); font-weight: 650; }
.blank { padding: 28px; text-align: center; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--sunken); color: var(--ink-2);
}
.pill.accepted, .pill.accept { background: var(--good-soft); color: var(--good); }
.pill.rejected, .pill.reject { background: var(--bad-soft); color: var(--bad); }
.pill.disputed, .pill.paused { background: var(--warn-soft); color: var(--warn); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.admin, .pill.open { background: var(--accent-soft); color: var(--accent); }

/* a small menu built on <details>: keyboard-friendly, no script */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 10;
  display: grid; min-width: 180px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.menu-list button {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px;
  border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; font-size: 14px;
}
.menu-list button:hover, .menu-list button:focus-visible { background: var(--sunken); box-shadow: none; }
.menu-list button.danger { color: var(--bad); }

.drop {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px; border: 1.5px dashed var(--line-strong); border-radius: var(--r);
  background: var(--surface); transition: border-color 0.12s, background 0.12s;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .icon-box { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.drop .what { flex: 1; min-width: 200px; }
.drop .what b { display: block; }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }

.job-cards { display: grid; gap: 14px; }
.job-card { padding: 18px 20px; display: grid; gap: 16px; }
.job-card header { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.job-card header h3 { margin: 0; font-size: 17px; }
.job-card header .sub { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.job-card header .spacer { flex: 1; }
.job-card .bar { height: 10px; border-radius: 5px; }
.job-card .legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.job-card .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.legend .g { background: var(--good); } .legend .b { background: var(--bad); } .legend .w { background: var(--warn); } .legend .a { background: var(--accent); } .legend .n { background: var(--sunken); border: 1px solid var(--line-strong); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.metrics > div { padding: 10px 12px; background: var(--surface); }
.metrics .k { font-size: 12px; color: var(--muted); }
.metrics .v { font-size: 18px; font-weight: 650; }
.settings { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.settings .field > span { font-size: 12px; }
.settings .push { flex: 1; }

.frames { display: grid; grid-template-columns: 240px 1fr 340px; gap: 14px; height: calc(100dvh - var(--top-h) - 150px); min-height: 460px; }
.frame-list { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px; }
.frame-list button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 40px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; cursor: pointer; text-align: left;
}
.frame-list button:hover { background: var(--surface-2); }
.frame-list button.sel { background: var(--accent-soft); }
.frame-list .id { font-weight: 600; flex: 1; }
.frame-list .n { font-size: 12px; color: var(--muted); }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.sdot.accepted { background: var(--good); } .sdot.rejected { background: var(--bad); }
.sdot.disputed { background: var(--warn); } .sdot.gold { background: var(--gold); } .sdot.open { background: var(--accent); }
.frames .stage { border-radius: var(--r); }
.frame-side { overflow: auto; display: grid; align-content: start; gap: 18px; }
.frame-side h3 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.frame-side .title { display: flex; align-items: center; gap: 10px; }
.frame-side .title h2 { margin: 0; font-size: 18px; }
.vote { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.vote:last-child { border-bottom: 0; }
.vote .who-v { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { height: 22px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: 6px; background: var(--bad-soft); color: var(--bad); font-size: 12px; font-weight: 550; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--sunken); }
.seg button { height: 30px; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 550; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.filters .hint { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---- small screens ---------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .frames { grid-template-columns: 1fr; height: auto; }
  .frames .stage { height: 60dvh; }
  .frame-list { max-height: 220px; }
  .filters .hint { display: none; }
}
@media (max-width: 860px) {
  .review { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .side {
    border-left: 0; border-top: 1px solid var(--line);
    max-height: 46dvh; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); gap: 14px;
  }
  .side .intro, .side .keys { display: none; }
  .verdict { order: 3; }
  .parts { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .part { flex-direction: column; justify-content: center; gap: 2px; height: 56px; padding: 0 4px; text-align: center; font-size: 12px; }
  .part kbd, .flag-tools kbd { display: none; }
  .part .n { flex: none; }
  .part .c { position: absolute; top: -7px; right: -4px; padding: 0 6px; }
  .part { position: relative; }
  .hud.tl .hide-sm, .hud.bl { display: none; }
  .progress .bar { width: 70px; }
  .hide-sm { display: none !important; }
  .invite { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .top { gap: 8px; padding: 0 10px; }
  .top .crumb .brand-name, .progress .txt { display: none; }
  .tab .label { display: none; }
  .page { padding: 20px 12px 48px; }
  .card { padding: 24px; }
  .job { grid-template-columns: 1fr auto; }
  .job > kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
