/* AIOGearBox — design system. Brand tokens from aioptics.ai, applied locally. */
:root {
  --accent: #4946F3;
  --accent-light: #605EF3;
  --accent-glow: rgba(73, 70, 243, .45);
  --coral: #F0523D;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
}

/* Dark palette: the default. Image tiles and the full-screen viewer keep it in light mode too,
   because retinal images are read against black. */
:root, :root[data-theme="light"] .shot, :root[data-theme="light"] .lightbox, :root[data-theme="light"] .review-shot {
  --cyan: #00B2FF;
  --bg: #0E0E0E;
  --bg-2: #121216;
  --surface: #1D1D1D;
  --surface-2: #24242A;
  --surface-3: #2E2E36;
  --line: #3E3E3E;
  --ink: 255, 255, 255;          /* overlay tint: rgba(var(--ink), a) */
  --shadow: 0, 0, 0;
  --hair: rgba(var(--ink), .08);
  --hair-2: rgba(var(--ink), .14);
  --text: #F6F6F6;
  --strong: #fff;
  --muted: #C4C4C4;
  --dim: #8E8E99;
  --recess: rgba(0, 0, 0, .3);
  --thumb: #fff;
  --g0: #2BD47D; --g1: #A6DA4C; --g2: #F5C542; --g3: #F59342; --g4: #F0523D; --g9: #8E8E99;
  --sky-glow: #191a3a;
  --stage-glow: #15151c;
  --card-bg: linear-gradient(180deg, rgba(36, 36, 44, .78), rgba(20, 20, 26, .82));
  --bar-bg: rgba(14, 14, 14, .85);
  --rail-bg: linear-gradient(180deg, #151519, #111114);
  --rail-foot: #101013;
  --pop-bg: rgba(22, 22, 28, .94);
  --toast-bg: rgba(30, 30, 38, .95);
  --recess-kbd: rgba(0, 0, 0, .25);
  --recess-deep: rgba(0, 0, 0, .35);
  --btn-kbd: #fff;
  --th-bg: #17171c;
  --scrim: rgba(5, 5, 8, .72);
  --t-green: #b6f5d3; --t-violet: #c9c8ff; --t-cyan: #a8e6ff; --t-cyan-2: #cfefff; --t-red: #ffb3a8; --t-red-2: #ffd1ca; --t-red-3: #ff8c7c; --t-amber: #ffe1a0; --t-amber-2: #ffe7b0; --t-purple: #b79bff; --placeholder: #6c6c76; --scroll: #3a3a44; --scroll-2: #4a4a56;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --accent-glow: rgba(73, 70, 243, .38);
  --cyan: #0A8FD8;
  --bg: #F6F7FD;
  --bg-2: #EEF0F9;
  --surface: #FFFFFF;
  --surface-2: #F3F4FA;
  --surface-3: #E6E8F3;
  --line: #C6C9D8;
  --ink: 22, 24, 52;
  --shadow: 70, 74, 150;
  --hair: rgba(var(--ink), .1);
  --hair-2: rgba(var(--ink), .16);
  --text: #1A1C36;
  --strong: #0B0D2A;
  --muted: #474B68;
  --dim: #6C7090;
  --recess: rgba(22, 24, 52, .06);
  --thumb: var(--accent);
  --g0: #0E8F52; --g1: #5E8D12; --g2: #A67800; --g3: #C4620F; --g4: #D23622; --g9: #686C86;
  --sky-glow: #CFD0FF;
  --stage-glow: #F2F3FB;
  --card-bg: rgba(255, 255, 255, .92);
  --bar-bg: rgba(255, 255, 255, .86);
  --rail-bg: linear-gradient(180deg, #FFFFFF, #FBFBFE);
  --rail-foot: #FFFFFF;
  --pop-bg: rgba(255, 255, 255, .97);
  --toast-bg: rgba(255, 255, 255, .97);
  --recess-kbd: rgba(22, 24, 52, .06);
  --recess-deep: rgba(22, 24, 52, .06);
  --btn-kbd: var(--muted);
  --th-bg: #F3F4FB;
  --scrim: rgba(30, 33, 70, .4);
  --t-green: #0A6E3F; --t-violet: #3532C4; --t-cyan: #00618F; --t-cyan-2: #00557E; --t-red: #B02916; --t-red-2: #9C2414; --t-red-3: #C0301C; --t-amber: #855C00; --t-amber-2: #7A5400; --t-purple: #6A28D0; --placeholder: #8A8EA6; --scroll: #B9BDCF; --scroll-2: #A9AEC4;
  /* light only: card elevation, and the brighter grade colours used for fills */
  --elev-1: 0 1px 2px rgba(22, 24, 52, .06), 0 12px 30px -18px rgba(58, 56, 170, .32);
  --elev-2: 0 2px 4px rgba(22, 24, 52, .06), 0 26px 56px -24px rgba(73, 70, 243, .45);
  --v0: #14B866; --v1: #7DBD1E; --v2: #EDAE1C; --v3: #F28427; --v4: #E8452E; --v9: #8187A2;
  color-scheme: light;
}
:root[data-theme="light"] .shot, :root[data-theme="light"] .lightbox, :root[data-theme="light"] .review-shot { color: var(--text); }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
kbd {
  font: 600 12px/1 var(--mono);
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 6px;
  background: rgba(var(--ink), .08);
  border: 1px solid var(--hair-2);
  border-bottom-width: 2px;
  color: var(--muted);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.hidden { display: none !important; }
svg.defs { position: absolute; width: 0; height: 0; }

/* ---------- brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: .02em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: #2954EE url("../img/logo-mark.png") center / 70% no-repeat;
  box-shadow: 0 0 18px var(--accent-glow);
}
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hair-2);
  background: var(--surface-2);
  font-weight: 600; font-size: 16px;
  text-decoration: none;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { background: var(--surface-3); border-color: rgba(var(--ink), .22); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-color: transparent;
  box-shadow: 0 8px 28px -8px var(--accent-glow), inset 0 1px 0 rgba(var(--ink), .18);
}
.btn-primary:hover { background: linear-gradient(135deg, #5552ff, #7471ff); }
.btn-ghost { background: transparent; }
.btn kbd { background: var(--recess-kbd); color: var(--btn-kbd); border-color: rgba(var(--ink), .2); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- inputs ---------- */
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(var(--ink), .04);
  border: 1px solid var(--hair-2);
  font-size: 17px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus { outline: none; border-color: var(--accent-light); box-shadow: 0 0 0 4px rgba(96, 94, 243, .25); background: rgba(var(--ink), .06); }
.input::placeholder { color: var(--placeholder); }
textarea.input { resize: none; line-height: 1.5; }

/* ---------- animated background ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 800px at 70% -10%, var(--sky-glow) 0%, transparent 60%), var(--bg); }
.stars, .stars::after {
  position: absolute; inset: -50%;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(var(--ink), .7), transparent),
    radial-gradient(1px 1px at 120px 80px, rgba(var(--ink), .5), transparent),
    radial-gradient(1.5px 1.5px at 200px 160px, rgba(var(--ink), .8), transparent),
    radial-gradient(1px 1px at 300px 40px, rgba(var(--ink), .4), transparent),
    radial-gradient(1px 1px at 360px 220px, rgba(180, 200, 255, .6), transparent),
    radial-gradient(1.5px 1.5px at 80px 260px, rgba(var(--ink), .5), transparent);
  background-size: 400px 300px;
  animation: drift 120s linear infinite;
  opacity: .55;
}
.stars::after { content: ""; inset: 0; background-size: 260px 220px; animation-duration: 200s; opacity: .6; }
.aurora { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .35; mix-blend-mode: screen; }
.aurora.a1 { background: var(--accent); top: -25vmax; right: -15vmax; animation: float1 22s ease-in-out infinite alternate; }
.aurora.a2 { background: var(--cyan); bottom: -35vmax; left: -20vmax; opacity: .18; animation: float2 28s ease-in-out infinite alternate; }
.aurora.a3 { background: #7c3aed; top: 30%; left: 35%; width: 30vmax; height: 30vmax; opacity: .14; animation: float1 34s ease-in-out infinite alternate-reverse; }

@keyframes drift { to { transform: translate3d(-400px, -300px, 0); } }
@keyframes float1 { to { transform: translate3d(-8vmax, 6vmax, 0) scale(1.1); } }
@keyframes float2 { to { transform: translate3d(10vmax, -6vmax, 0) scale(1.15); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sweep { to { transform: rotate(360deg); } }

/* ================= LANDING ================= */
.landing { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 22px clamp(16px, 4vw, 56px); animation: fadeIn .8s var(--ease) both; }
.landing-nav .pill { font-size: 13px; color: var(--muted); border: 1px solid var(--hair-2); border-radius: 999px; padding: 6px 12px; background: rgba(var(--ink), .03); }
.landing-main {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: clamp(24px, 5vw, 80px); align-items: center;
  padding: 12px clamp(16px, 4vw, 56px) 40px;
  max-width: 1400px; width: 100%; margin: 0 auto;
}
.hero { display: grid; gap: 26px; }
.hero > * { animation: rise .9s var(--ease) both; }
.hero > *:nth-child(2) { animation-delay: .08s; }
.hero > *:nth-child(3) { animation-delay: .16s; }
.hero > *:nth-child(4) { animation-delay: .24s; }
.hero > *:nth-child(5) { animation-delay: .32s; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); font-weight: 700; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); position: relative; }
.eyebrow .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--cyan); animation: pulse 1.8s ease-out infinite; }
.hero h1 { margin: 0; font-size: clamp(38px, 5.2vw, 74px); line-height: 1.02; letter-spacing: -.025em; font-weight: 700; }
.hero h1 .grad { background: linear-gradient(100deg, var(--strong) 10%, var(--accent-light) 45%, var(--cyan) 85%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { margin: 0; max-width: 620px; font-size: clamp(17px, 1.4vw, 20px); color: var(--muted); }
.hero-visual { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }

.scanner { position: relative; width: 168px; height: 168px; flex: none; }
.scanner .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(var(--ink), .14); }
.scanner .ring.r2 { inset: 22px; border-color: rgba(0, 178, 255, .25); }
.scanner .ring.r3 { inset: 46px; border-color: rgba(96, 94, 243, .35); }
.scanner .fundus {
  position: absolute; inset: 30px; border-radius: 50%;
  background: radial-gradient(circle at 62% 46%, #ffd9a0 0 6%, #e7843a 7% 14%, transparent 15%),
              radial-gradient(circle at 40% 52%, #7a1d10 0 4%, transparent 5%),
              radial-gradient(circle at 50% 50%, #c4471d 0%, #8a2410 55%, #3a0d06 100%);
  box-shadow: inset 0 0 30px rgba(var(--shadow), .7), 0 0 40px rgba(240, 82, 61, .25);
}
.scanner .sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 300deg, rgba(0, 178, 255, .55) 360deg); animation: sweep 3.2s linear infinite; mask: radial-gradient(circle, transparent 0 29%, #000 30%); -webkit-mask: radial-gradient(circle, transparent 0 29%, #000 30%); }
.scanner .ping { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--g2); box-shadow: 0 0 12px var(--g2); }
.scanner .ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: pulse 2s ease-out infinite; }
.scanner .ping.p1 { top: 64px; left: 58px; }
.scanner .ping.p2 { top: 98px; left: 100px; background: var(--g4); box-shadow: 0 0 12px var(--g4); }
.scanner .ping.p2::after { animation-delay: .7s; }
.scanner .ping.p3 { top: 82px; left: 112px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.scanner .ping.p3::after { animation-delay: 1.3s; }

.stats { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 28px; }
.stat b { display: block; font-size: 30px; letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature {
  padding: 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(var(--ink), .05), rgba(var(--ink), .02));
  border: 1px solid var(--hair);
  transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.feature:hover { transform: translateY(-4px); border-color: rgba(96, 94, 243, .5); background: linear-gradient(180deg, rgba(96, 94, 243, .12), rgba(var(--ink), .02)); }
.feature .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(96, 94, 243, .18); color: var(--accent-light); margin-bottom: 12px; }
.feature .ico svg { width: 20px; height: 20px; }
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; font-size: 15px; color: var(--muted); }

.login-card {
  position: relative; padding: 32px; border-radius: 22px;
  background: var(--card-bg);
  border: 1px solid var(--hair-2);
  box-shadow: 0 30px 80px -20px rgba(var(--shadow), .7), 0 0 0 1px rgba(96, 94, 243, .08), inset 0 1px 0 rgba(var(--ink), .06);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: slideInRight .9s .2s var(--ease) both;
}
.login-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, rgba(96, 94, 243, .7), transparent 40%, transparent 60%, rgba(0, 178, 255, .5)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.login-card h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.01em; }
.login-card .sub { margin: 0 0 24px; color: var(--dim); font-size: 15px; }
.login-card form { display: grid; gap: 18px; }
.login-card .btn-primary { min-height: 52px; font-size: 17px; margin-top: 4px; }
.login-card .fine { margin: 18px 0 0; font-size: 13px; color: var(--dim); display: flex; gap: 8px; align-items: center; }
.login-card .fine svg { width: 14px; height: 14px; flex: none; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(240, 82, 61, .12); border: 1px solid rgba(240, 82, 61, .45); color: var(--t-red-2); font-size: 15px; }
.shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97) both; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--dim); display: grid; place-items: center; }
.pw-toggle:hover { color: var(--text); background: rgba(var(--ink), .06); }
.pw-toggle svg { width: 20px; height: 20px; }
.signed-in { display: grid; gap: 14px; }

.landing-foot { padding: 18px clamp(16px, 4vw, 56px) 26px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--dim); font-size: 13px; border-top: 1px solid var(--hair); }

@media (max-width: 980px) {
  .landing-main { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .login-card { order: -1; }
}

/* ================= APP SHELL (tasks + grading) ================= */
.appbar {
  display: flex; align-items: center; gap: 18px;
  height: 64px; padding: 0 20px;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--hair);
  backdrop-filter: blur(12px);
  position: relative; z-index: 5;
}
.appbar .spacer { flex: 1; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--cyan)); }
.inline-form { display: inline; margin: 0; }

/* ---------- tasks page ---------- */
.tasks-page { min-height: 100vh; }
.tasks-wrap { max-width: 1180px; margin: 0 auto; padding: 40px 24px 60px; }
.tasks-wrap h1 { margin: 0 0 6px; font-size: 38px; letter-spacing: -.02em; animation: rise .7s var(--ease) both; }
.tasks-wrap .lede { margin: 0 0 32px; color: var(--muted); font-size: 18px; animation: rise .7s .06s var(--ease) both; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.task-card {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center;
  padding: 26px; border-radius: 20px; text-decoration: none;
  background: linear-gradient(180deg, rgba(var(--ink), .055), rgba(var(--ink), .02));
  border: 1px solid var(--hair);
  overflow: hidden;
  animation: rise .7s var(--ease) both;
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
}
.task-card:nth-child(2) { animation-delay: .08s; }
.task-card:nth-child(3) { animation-delay: .16s; }
.task-card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 200px at var(--mx, 50%) var(--my, 0%), rgba(96, 94, 243, .18), transparent 60%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.task-card:hover { transform: translateY(-5px); border-color: rgba(96, 94, 243, .55); box-shadow: 0 24px 60px -24px var(--accent-glow); }
.task-card:hover::after { opacity: 1; }
.task-card .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--cyan); font-weight: 700; }
.task-card h2 { margin: 6px 0 8px; font-size: 24px; letter-spacing: -.01em; }
.task-card .meta { color: var(--dim); font-size: 15px; display: flex; gap: 14px; flex-wrap: wrap; }
.task-card .cta { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent-light); }
.task-card .cta svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.task-card:hover .cta svg { transform: translateX(5px); }
.ring { --size: 112px; position: relative; width: var(--size); height: var(--size); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: rgba(var(--ink), .08); }
.ring .val { stroke: url(#ringGrad); stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 289; transition: stroke-dashoffset 1.4s var(--ease); }
.ring .label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .label b { font-size: 26px; letter-spacing: -.02em; line-height: 1; }
.ring .label span { display: block; font-size: 12px; color: var(--dim); margin-top: 4px; }
.empty { padding: 40px; border-radius: 20px; border: 1px dashed var(--hair-2); color: var(--muted); text-align: center; }

/* ================= GRADING ================= */
body.grade { overflow: hidden; }
.grade-shell { height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }

.topbar { display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 16px 0 18px; border-bottom: 1px solid var(--hair); background: var(--bg); position: relative; }
.topbar .unit-head { display: flex; flex-direction: column; min-width: 0; }
.topbar .unit-head .t { font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .unit-head .u { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eye-badge { font-size: 13px; font-weight: 800; letter-spacing: .06em; padding: 3px 9px; border-radius: 6px; background: rgba(0, 178, 255, .16); color: var(--cyan); border: 1px solid rgba(0, 178, 255, .35); }
.eye-badge.os { background: rgba(124, 58, 237, .18); color: var(--t-purple); border-color: rgba(124, 58, 237, .45); }
.state-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--hair-2); color: var(--dim); }
.state-badge.saved { color: var(--g0); border-color: rgba(43, 212, 125, .4); background: rgba(43, 212, 125, .1); }
.state-badge.draft { color: var(--g2); border-color: rgba(245, 197, 66, .4); background: rgba(245, 197, 66, .1); }
.counters { display: flex; gap: 6px; margin-left: auto; }
.counter { min-width: 104px; padding: 6px 14px; border-radius: 12px; background: rgba(var(--ink), .03); border: 1px solid var(--hair); }
.counter b { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.counter span { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
.counter.accent b { color: var(--accent-light); }
.counter.cyan b { color: var(--cyan); }
.counter.bump b { animation: pop .45s var(--spring); }
.topbar .tools { display: flex; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--hair); background: rgba(var(--ink), .03); color: var(--muted); transition: background .2s, color .2s, transform .15s; text-decoration: none; }
.icon-btn:hover { background: rgba(var(--ink), .08); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.on { color: var(--strong); background: rgba(0, 178, 255, .2); border-color: rgba(0, 178, 255, .5); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--cyan)); box-shadow: 0 0 12px var(--cyan); transition: width .6s var(--ease); border-radius: 0 3px 3px 0; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) clamp(430px, 34vw, 600px); min-height: 0; }

/* stage */
.stage { position: relative; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; background: radial-gradient(900px 600px at 50% 40%, var(--stage-glow), var(--bg)); }
.stage-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--hair); min-height: 60px; flex-wrap: wrap; }
.stage-bar .gradable-count { font-size: 15px; color: var(--muted); margin-right: auto; display: flex; align-items: center; gap: 8px; }
.stage-bar .gradable-count b { color: var(--text); font-size: 17px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(var(--ink), .04); border: 1px solid var(--hair); }
.toggle { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; transition: background .2s, color .2s; }
.toggle:hover { color: var(--text); background: rgba(var(--ink), .06); }
.toggle.on { background: rgba(0, 178, 255, .2); color: var(--strong); }
.toggle kbd { height: 20px; min-width: 20px; font-size: 11px; }
/* the image tools (red-free, enhancement, reset) stand out from the plain toggles */
.toggle.tool { border: 1px solid rgba(0, 178, 255, .55); background: rgba(0, 178, 255, .13); color: var(--t-cyan-2); font-weight: 700; box-shadow: 0 0 0 1px rgba(0, 178, 255, .08), 0 8px 22px -14px rgba(0, 178, 255, .9); transition: background .2s, color .2s, border-color .2s, box-shadow .2s, transform .12s; }
.toggle.tool:hover { background: rgba(0, 178, 255, .24); border-color: var(--cyan); color: var(--strong); }
.toggle.tool:active { transform: scale(.97); }
.toggle.tool kbd { background: rgba(0, 178, 255, .22); border-color: rgba(0, 178, 255, .45); color: inherit; }
.toggle.tool.on { background: linear-gradient(180deg, #25BEFF, #0096DD); border-color: transparent; color: #021a27; box-shadow: 0 10px 26px -12px rgba(0, 178, 255, .95); }
.toggle.tool.on kbd { background: rgba(2, 26, 39, .18); border-color: rgba(2, 26, 39, .25); }
.toggle.tool.reset { border-color: rgba(245, 197, 66, .55); background: rgba(245, 197, 66, .12); color: var(--t-amber-2); box-shadow: 0 0 0 1px rgba(245, 197, 66, .07), 0 8px 22px -14px rgba(245, 197, 66, .8); }
.toggle.tool.reset:hover { background: rgba(245, 197, 66, .22); border-color: var(--g2); color: var(--strong); }
.slider { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; padding: 0 8px; }
.slider input { width: 96px; accent-color: var(--accent-light); }

.viewer { position: relative; display: grid; gap: 12px; padding: 14px; min-height: 0; min-width: 0; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); }
.shot {
  position: relative; min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--hair);
  transition: border-color .25s, box-shadow .25s, opacity .3s;
}
.shot:hover { border-color: rgba(96, 94, 243, .6); box-shadow: 0 0 0 1px rgba(96, 94, 243, .25), 0 20px 50px -20px var(--accent-glow); }
.shot .frame { position: relative; min-height: 0; min-width: 0; cursor: zoom-in; overflow: hidden; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .4s var(--ease), opacity .35s; opacity: 0; }
.shot img.loaded { opacity: 1; }
.shot .frame:hover img { transform: scale(1.015); }
.shot .zoom-hint { position: absolute; right: 12px; top: 12px; display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-size: 13px; color: #fff; opacity: 0; transform: translateY(-6px); transition: .25s var(--ease); pointer-events: none; backdrop-filter: blur(6px); }
.shot .zoom-hint svg { width: 14px; height: 14px; }
.shot .frame:hover .zoom-hint { opacity: 1; transform: none; }
.shot .num { position: absolute; left: 12px; top: 12px; font: 700 13px/1 var(--mono); padding: 6px 9px; border-radius: 8px; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(6px); }
.shot .loader { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.shot .loader::before { content: ""; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(var(--ink), .12); border-top-color: var(--cyan); animation: spin .8s linear infinite; }
.shot.ready .loader { display: none; }
.shot .foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--hair); }
.shot .fname { flex: 1; min-width: 0; font: 13px/1.3 var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-toggle { display: inline-flex; align-items: flex-end; gap: 6px; margin-left: auto; flex: none; max-width: 100%; }
/* a box captioned GRADABLE (caption sits on its top edge) holding the three levels; Ungradable beside it */
.q-grad, .q-ungr { border: 1px solid var(--hair-2); border-radius: 10px; background: rgba(var(--ink), .04); transition: border-color .2s, background .2s, color .2s; }
.q-grad { position: relative; display: inline-flex; gap: 2px; padding: 3px; margin-top: 8px; }
.q-cap { position: absolute; top: -8px; left: 8px; padding: 0 5px; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; line-height: 14px; color: var(--dim); background: var(--surface); border-radius: 4px; pointer-events: none; }
.q-grad.on { border-color: rgba(43, 212, 125, .5); }
.q-grad.on .q-cap { color: var(--g0); }
.q-grad button { height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--dim); font-weight: 700; font-size: 13.5px; white-space: nowrap; transition: .2s; }
.q-grad button:hover, .q-ungr:hover { color: var(--text); background: rgba(var(--ink), .06); }
.q-grad button.on[data-q="Adequate"] { background: rgba(43, 212, 125, .2); color: var(--g0); }
.q-grad button.on[data-q="Fair"] { background: rgba(166, 218, 76, .2); color: var(--g1); }
.q-grad button.on[data-q="Poor_but_gradable"] { background: rgba(245, 197, 66, .2); color: var(--g2); }
.q-ungr { height: 38px; padding: 0 12px; color: var(--dim); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.q-ungr.on { background: rgba(240, 82, 61, .2); border-color: rgba(240, 82, 61, .55); color: var(--t-red-3); }
.shot.ungradable .frame::after { content: "UNGRADABLE"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; letter-spacing: .3em; font-size: 15px; color: rgba(var(--ink), .85); background: repeating-linear-gradient(135deg, rgba(240, 82, 61, .16) 0 12px, rgba(0, 0, 0, .3) 12px 24px); pointer-events: none; animation: fadeIn .25s; }
.shot.ungradable img { opacity: .55; }

.viewer.leave-next { animation: leaveNext .16s var(--ease) both; }
.viewer.leave-prev { animation: leavePrev .16s var(--ease) both; }
.viewer.enter-next { animation: enterNext .3s var(--ease) both; }
.viewer.enter-prev { animation: enterPrev .3s var(--ease) both; }
@keyframes leaveNext { to { opacity: 0; transform: translateX(-36px); } }
@keyframes leavePrev { to { opacity: 0; transform: translateX(36px); } }
@keyframes enterNext { from { opacity: 0; transform: translateX(36px); } }
@keyframes enterPrev { from { opacity: 0; transform: translateX(-36px); } }

/* rail */
.rail { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; border-left: 1px solid var(--hair); background: var(--rail-bg); }
.group { padding: 14px 18px 4px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.group-head h3 { margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.group-head .req { font-size: 12px; color: var(--dim); }
.group.invalid .group-head h3 { color: var(--coral); }
.group.invalid .tiles { animation: shake .45s cubic-bezier(.36, .07, .19, .97) both; }
.group.invalid .tile { border-color: rgba(240, 82, 61, .7); }

.tiles { display: grid; gap: 8px; }
.tiles.icdr { grid-template-columns: repeat(3, 1fr); }
.tiles.csdme { grid-template-columns: repeat(3, 1fr); }
.tile {
  --c: var(--accent-light);
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 8px 10px;
  border-radius: 12px; border: 1px solid var(--hair-2);
  background: rgba(var(--ink), .035);
  text-align: left; font-weight: 700; font-size: 17px; line-height: 1.15; hyphens: auto; -webkit-hyphens: auto;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .25s, color .2s;
  overflow: hidden;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); opacity: .75; transition: width .25s var(--ease), opacity .2s; }
.tile kbd { flex: none; }
.tile:hover { background: rgba(var(--ink), .07); border-color: rgba(var(--ink), .25); }
.tile:active { transform: scale(.97); }
.tile[aria-checked="true"] {
  background: color-mix(in srgb, var(--c) 22%, transparent);
  border-color: var(--c);
  box-shadow: 0 0 0 1px var(--c), 0 10px 30px -12px var(--c);
  color: var(--strong);
}
.tile[aria-checked="true"]::before { width: 100%; opacity: .12; }
.tile[aria-checked="true"] kbd { background: var(--c); color: #0b0b0b; border-color: transparent; }
.tile.flash { animation: tap .3s var(--spring); }
@keyframes tap { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: none; } }
.tile[data-value="0"] { --c: var(--g0); } .tile[data-value="1"] { --c: var(--g1); } .tile[data-value="2"] { --c: var(--g2); }
.tile[data-value="3"] { --c: var(--g3); } .tile[data-value="4"] { --c: var(--g4); } .tile[data-value="9"] { --c: var(--g9); }
.tile[data-value="a"] { --c: var(--g0); } .tile[data-value="s"] { --c: var(--g4); } .tile[data-value="d"] { --c: var(--g9); }

/* optional tabs */
.optional { flex: 1 1 auto; display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); min-height: 0; min-width: 0; margin-top: 10px; border-top: 1px solid var(--hair); }
.tabs { display: flex; gap: 2px; padding: 10px 12px 0; min-width: 0; }
.tab { position: relative; flex: 1 1 auto; min-width: 0; height: 44px; white-space: nowrap; padding: 0 5px; border: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--dim); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: color .2s, background .2s; }
.tab:hover { color: var(--text); background: rgba(var(--ink), .03); }
.tab[aria-selected="true"] { color: var(--strong); background: rgba(var(--ink), .05); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--cyan)); animation: fadeIn .25s; }
.tab .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; display: inline-grid; place-items: center; transform: scale(0); transition: transform .3s var(--spring); }
.tab .count.show { transform: scale(1); }
.tab.invalid { color: var(--coral); }
/* the tab row reads as its own strip, so it is easy to find again from inside a panel */
.tabs { gap: 4px; padding: 8px 10px 0; background: rgba(var(--ink), .045); border-bottom: 2px solid rgba(91, 88, 255, .55); }
.tab { color: var(--text); font-weight: 800; border: 1px solid var(--hair-2); border-bottom: 0; background: rgba(var(--ink), .03); }
.tab:hover { color: var(--strong); background: rgba(var(--ink), .07); }
.tab[aria-selected="true"] { color: var(--strong); background: rgba(91, 88, 255, .28); border-color: rgba(91, 88, 255, .7); }
.tab[aria-selected="true"]::after { display: none; }
.tab.invalid { color: var(--coral); }
.panels { min-height: 0; overflow: auto; padding: 12px 18px 14px; background: rgba(var(--ink), .02); scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
.panel { animation: fadeIn .25s; }
.panel h4 { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 700; }
.panel .sub-group + .sub-group { margin-top: 16px; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.chip {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px;
  border-radius: 10px; border: 1px solid var(--hair-2); background: rgba(var(--ink), .03);
  font-size: 15px; font-weight: 600; color: var(--muted); text-align: left; line-height: 1.2;
  transition: background .2s, border-color .2s, color .2s, transform .12s;
}
.chip::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 5px; border: 2px solid #5a5a66; transition: .2s var(--ease); }
.chip:hover { background: rgba(var(--ink), .07); color: var(--text); }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { color: var(--strong); border-color: var(--accent-light); background: rgba(96, 94, 243, .2); }
.chip[aria-pressed="true"]::before { border-color: var(--accent-light); background: var(--accent-light) url("../img/check.svg") center / 12px no-repeat; }
.chips.row { grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 4px; padding: 3px; border-radius: 11px; background: rgba(var(--ink), .03); border: 1px solid var(--hair); }
.chips.row .chip { justify-content: center; text-align: center; border-color: transparent; background: transparent; padding: 6px 6px; }
.chips.row .chip::before { display: none; }
.chips.row .chip:hover { background: rgba(var(--ink), .06); }
.chips.row .chip[aria-pressed="true"] { background: rgba(96, 94, 243, .28); border-color: var(--accent-light); }
.chips.single .chip::before { border-radius: 50%; }
.panel .sub-group + .sub-group { margin-top: 12px; }
.chips.single .chip[aria-pressed="true"]::before { background: radial-gradient(circle, #fff 0 3px, var(--accent-light) 4px); }
.other-input { margin-top: 8px; animation: rise .3s var(--ease) both; }
.other-input.invalid .input, .sub-group.invalid .chips { border-color: var(--coral); }
.sub-group.invalid h4 { color: var(--coral); }
.sub-group.invalid .chips { animation: shake .45s both; }
.reveal { animation: rise .35s var(--ease) both; }
.hint { font-size: 13px; color: var(--dim); margin: 0 0 10px; }

.rail-actions { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--hair); background: var(--rail-foot); }
.rail-actions .btn-primary { min-height: 56px; font-size: 18px; }
.rail-actions .btn-ghost { min-height: 56px; width: 56px; padding: 0; }
.rail-actions .btn-ghost svg { width: 22px; height: 22px; }
.btn-primary.saving { pointer-events: none; filter: brightness(.68) saturate(1.1); box-shadow: none; transition: none; }

/* queue map */
.queue { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--hair); background: var(--bg); }
.queue .lbl { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; }
.cells { flex: 1; display: grid; gap: 2px; height: 18px; }
.cell { border: 0; padding: 0; border-radius: 3px; background: rgba(var(--ink), .09); transition: background .3s, transform .2s; }
.cell:hover { transform: scaleY(1.5); background: rgba(var(--ink), .3); }
.cell.done { background: linear-gradient(180deg, var(--accent-light), var(--accent)); }
.cell.current { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); transform: scaleY(1.5); }
/* where the current case is in the queue, and the magnifying strip used for long queues */
.qtrack { flex: 1; display: grid; min-width: 0; }
.qpos { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.qpos b { color: var(--strong); font-size: 14px; }
.qlens { display: block; width: 100%; height: 24px; cursor: pointer; touch-action: none; }
.qtip { position: fixed; z-index: 65; padding: 4px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--hair-2); color: var(--text); font-size: 12.5px; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: 0 10px 30px -12px rgba(var(--shadow), .8); }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; pointer-events: none; justify-items: center; }
.toast { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; background: var(--toast-bg); border: 1px solid var(--hair-2); box-shadow: 0 20px 50px -10px rgba(var(--shadow), .7); font-weight: 600; font-size: 15px; animation: toastIn .35s var(--spring) both; backdrop-filter: blur(10px); }
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--g0); color: #062; }
.toast.warn .ic { background: var(--coral); color: #300; }
.toast.info .ic { background: var(--cyan); color: #013; }
.toast .ic svg { width: 14px; height: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }


/* overlays */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--scrim); backdrop-filter: blur(8px); animation: fadeIn .2s; }
.sheet { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--hair-2); box-shadow: 0 40px 100px -20px rgba(var(--shadow), .8); animation: pop .35s var(--spring); }
.sheet h2 { margin: 0 0 16px; font-size: 24px; }
.keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 28px; }
.keys div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 15px; color: var(--muted); }
.keys div span:last-child { display: flex; gap: 4px; }
.finish { text-align: center; }
.finish .big { font-size: 64px; line-height: 1; margin-bottom: 8px; }
.finish p { color: var(--muted); font-size: 17px; }
.finish .row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.fin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 18px 0 4px; }
.fin-stat { padding: 12px 10px; border-radius: 14px; border: 1px solid var(--hair); background: rgba(var(--ink), .04); }
.fin-stat b { display: block; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fin-stat span { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 700; }
.fin-mix { display: grid; gap: 8px; margin-top: 14px; text-align: left; }
.fin-mix .dist-legend b { color: var(--text); }
.fin-feedback { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 0 8px; text-align: left; font-weight: 700; font-size: 16px; }
.fin-feedback span { font-size: 13px; font-weight: 400; color: var(--dim); }
.finish textarea.input { text-align: left; font-size: 16px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(0, 0, 0, .96); animation: fadeIn .2s; }
.lb-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
.lb-bar .title { margin-right: auto; font: 14px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.lb-bar .zoom-val { font: 700 14px var(--mono); min-width: 56px; text-align: center; color: var(--text); }
.lb-stage { position: relative; overflow: hidden; cursor: grab; touch-action: none; }
.lb-stage.dragging { cursor: grabbing; }
.lb-stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; will-change: transform; }
.lb-stage img.animate { transition: transform .28s var(--ease); }
.lb-stage .loader { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.lb-stage .loader::before { content: ""; width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(var(--ink), .12); border-top-color: var(--cyan); animation: spin .8s linear infinite; }
.lb-strip { display: flex; gap: 8px; justify-content: center; padding: 10px; border-top: 1px solid var(--hair); }
.lb-strip button { width: 92px; height: 64px; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: #111; opacity: .55; transition: .2s; }
.lb-strip button.on { border-color: var(--cyan); opacity: 1; }
.lb-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-help { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, .6); font-size: 13px; color: var(--muted); pointer-events: none; animation: fadeIn .4s .3s both; }

canvas.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }

/* error page */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.error-page .code { font-size: 96px; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(120deg, var(--accent-light), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.error-page h1 { margin: 10px 0 6px; }
.error-page p { color: var(--muted); margin: 0 0 22px; }

/* laptop heights: tighten the rail so the optional panels don't scroll */
@media (max-height: 960px) {
  .group { padding: 10px 18px 2px; }
  .group-head { margin-bottom: 6px; }
  .tile { min-height: 50px; }
  .optional { margin-top: 6px; }
  .tabs { padding-top: 6px; }
  .tab { height: 40px; }
  .panels { padding-top: 10px; }
  .rail-actions { padding: 10px 14px; }
}
@media (max-height: 820px) {
  .tile { min-height: 50px; font-size: 16px; }
  .group { padding-top: 12px; }
  .group-head { margin-bottom: 8px; }
  .rail-actions .btn-primary, .rail-actions .btn-ghost { min-height: 50px; }
  .chip { min-height: 38px; }
}
@media (max-width: 1100px) {
  .counter { min-width: 0; padding: 6px 10px; }
  .counter b { font-size: 18px; }
  .slider { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .stars, .aurora, .scanner .sweep { animation: none !important; }
}

.btn-primary.ok { background: linear-gradient(135deg, #1fb86a, var(--g0)); box-shadow: 0 8px 28px -8px rgba(43, 212, 125, .6); }

/* compact rail: ICDR/csDME fold into a one-line summary while a long optional tab is open */
.summary { display: flex; align-items: center; gap: 18px; margin: 10px 14px 0; padding: 0 14px; min-height: 48px; border-radius: 12px; border: 1px solid var(--hair-2); background: rgba(var(--ink), .04); font-size: 15px; color: var(--dim); text-align: left; animation: fadeIn .2s; }
.summary b { color: var(--text); font-size: 16px; margin-left: 4px; }
.summary svg { width: 18px; height: 18px; margin-left: auto; }
.summary:hover { background: rgba(var(--ink), .08); color: var(--muted); }
.rail.compact #g-icdr, .rail.compact #g-csdme { display: none; }

/* ================= ADMIN ================= */
body.admin { min-height: 100vh; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-warn { border-color: rgba(245, 197, 66, .5); color: var(--t-amber); }
.btn-warn:hover { background: rgba(245, 197, 66, .12); }
.btn-danger { border-color: rgba(240, 82, 61, .55); color: var(--t-red); }
.btn-danger:hover { background: rgba(240, 82, 61, .16); }
.btn.disabled { opacity: .4; pointer-events: none; }
.admin-nav { display: flex; gap: 4px; margin-left: 18px; }
.admin-nav a { position: relative; padding: 10px 14px; border-radius: 10px; text-decoration: none; color: var(--dim); font-weight: 700; font-size: 15px; transition: color .2s, background .2s; }
.admin-nav a:hover { color: var(--text); background: rgba(var(--ink), .04); }
.admin-nav a.on { color: var(--strong); }
.admin-nav a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -12px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.admin-wrap { max-width: 1320px; margin: 0 auto; padding: 28px 24px 64px; display: grid; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; animation: rise .5s var(--ease) both; }
.page-head h1 { margin: 4px 0 4px; font-size: 32px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head h1 code { font-size: 15px; color: var(--dim); font-weight: 400; }
.page-head .lede { margin: 0; color: var(--muted); }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.crumb { color: var(--dim); text-decoration: none; font-size: 14px; font-weight: 600; }
.crumb:hover { color: var(--text); }
.muted { color: var(--dim); }
.small { font-size: 13px; }
.hint { color: var(--dim); font-size: 13px; margin: 8px 0 0; }
.mt, .card h2.mt { margin-top: 26px; }
code { font-family: var(--mono); font-size: .9em; }
.card { padding: 22px; border-radius: 18px; background: linear-gradient(180deg, rgba(var(--ink), .045), rgba(var(--ink), .02)); border: 1px solid var(--hair); animation: rise .55s var(--ease) both; min-width: 0; }
.card h2 { margin: 0 0 14px; font-size: 19px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card h2 a { text-decoration: none; }
.card h2 a:hover { color: var(--accent-light); }
.card.narrow { max-width: 560px; width: 100%; margin: 20px auto 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 2px 0 0; }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--cyan); font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .grid-2, .split { grid-template-columns: 1fr; } .admin-nav { display: none; } }

.banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; font-size: 15px; animation: rise .5s var(--ease) both; }
.banner svg { width: 22px; height: 22px; flex: none; }
.banner span { flex: 1; }
.banner.warn { background: rgba(245, 197, 66, .1); border: 1px solid rgba(245, 197, 66, .45); color: var(--t-amber-2); }
.flash { padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 15px; }
.flash.ok { background: rgba(43, 212, 125, .12); border: 1px solid rgba(43, 212, 125, .4); color: var(--t-green); animation: rise .4s var(--ease) both; }
.flash.err { background: rgba(240, 82, 61, .12); border: 1px solid rgba(240, 82, 61, .45); color: var(--t-red-2); }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-tile { position: relative; padding: 18px 20px; border-radius: 18px; border: 1px solid var(--hair); background: linear-gradient(160deg, rgba(96, 94, 243, .1), rgba(var(--ink), .02) 60%); overflow: hidden; animation: rise .55s var(--ease) both; }
.stat-tile:nth-child(2) { animation-delay: .05s; } .stat-tile:nth-child(3) { animation-delay: .1s; } .stat-tile:nth-child(4) { animation-delay: .15s; }
.stat-tile span { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); font-weight: 700; }
.stat-tile b { display: block; font-size: 40px; letter-spacing: -.03em; line-height: 1.1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.stat-tile small { color: var(--dim); font-size: 13px; }
.stat-tile.accent b { color: var(--accent-light); }
.stat-tile.cyan b { color: var(--cyan); }
.stat-tile.green b { color: var(--g0); }

table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--hair-2); white-space: nowrap; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: rgba(var(--ink), .03); }
table.data.clickable tbody tr[data-href] { cursor: pointer; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data a { text-decoration: none; }
table.data a:hover { color: var(--accent-light); }
table.data tr.disagree { background: rgba(245, 147, 66, .07); }
table.data tr.disagree td:first-child { box-shadow: inset 3px 0 0 var(--g3); }
table.data.sticky thead th { position: sticky; top: 0; background: var(--th-bg); z-index: 1; }
table.data td.ua, table.data td.detail { color: var(--dim); font-size: 13px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data td.pre { white-space: pre-wrap; }
.review-table th[scope], .review-table tbody th { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--muted); width: 170px; vertical-align: top; padding-top: 12px; }
.review-table td { vertical-align: top; }
.table-scroll { overflow: auto; max-height: 70vh; border-radius: 10px; }
.table-scroll.tall { max-height: 76vh; }
/* A table must never spill out of its card: the browser column gives way first, a long (IPv6)
   address is shortened, and anything still too wide scrolls inside the card. */
.card { overflow-x: auto; }
table.data td.ua { max-width: 0; width: 100%; }
table.data td.ip { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-bar { width: 220px; }
td.w-bar { display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 10px; border-radius: 999px; background: rgba(var(--ink), .07); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--cyan)); box-shadow: 0 0 12px rgba(0, 178, 255, .45); transition: width 1.1s var(--ease); }
.bar-label { font-size: 13px; color: var(--muted); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

.who { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.who code { color: var(--dim); font-weight: 400; font-size: 13px; }
.who-head .avatar { width: 46px; height: 46px; font-size: 19px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 46px; height: 46px; font-size: 19px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--hair-2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.pill.dim { color: var(--dim); }
.pill.accent { color: var(--t-violet); background: rgba(96, 94, 243, .2); border-color: rgba(96, 94, 243, .5); }
.pill.danger { color: var(--t-red); background: rgba(240, 82, 61, .14); border-color: rgba(240, 82, 61, .5); }
.pill.warn { color: var(--t-amber); background: rgba(245, 197, 66, .12); border-color: rgba(245, 197, 66, .45); }
.pill.live { color: var(--t-green); background: rgba(43, 212, 125, .12); border-color: rgba(43, 212, 125, .45); }
.pill.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--g0); position: relative; }
.pill.live i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--g0); animation: pulse 1.8s ease-out infinite; }
.task-cells { display: flex; gap: 6px; flex-wrap: wrap; }
.task-chip { font-size: 13px; padding: 4px 9px; border-radius: 8px; background: rgba(var(--ink), .05); border: 1px solid var(--hair); color: var(--muted); white-space: nowrap; }
.task-chip b { color: var(--text); margin-left: 4px; font-variant-numeric: tabular-nums; }
.grade-pill { --c: var(--g9); display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 13px; font-weight: 700; white-space: nowrap; background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 70%, var(--strong)); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); }
.grade-pill.g0 { --c: var(--g0); } .grade-pill.g1 { --c: var(--g1); } .grade-pill.g2 { --c: var(--g2); }
.grade-pill.g3 { --c: var(--g3); } .grade-pill.g4 { --c: var(--g4); } .grade-pill.g9 { --c: var(--g9); }

.dist-wrap { margin-top: 18px; display: grid; gap: 8px; }
.dist-title { font-size: 13px; color: var(--dim); }
.dist { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: rgba(var(--ink), .06); gap: 2px; }
.dist.mini { height: 10px; width: 140px; }
.dist > i { display: block; height: 100%; width: 0; transition: width 1.1s var(--ease); }
.dist > i.g0, .dist-legend i.g0 { background: var(--g0); } .dist > i.g1, .dist-legend i.g1 { background: var(--g1); }
.dist > i.g2, .dist-legend i.g2 { background: var(--g2); } .dist > i.g3, .dist-legend i.g3 { background: var(--g3); }
.dist > i.g4, .dist-legend i.g4 { background: var(--g4); } .dist > i.g9, .dist-legend i.g9 { background: var(--g9); }
.dist-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.dist-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dist-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.form-grid { display: grid; gap: 16px; }
.form-grid > label, .form-grid fieldset > legend { display: grid; gap: 7px; font-size: 14px; font-weight: 700; color: var(--muted); }
.form-grid fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.form-grid fieldset > legend { margin-bottom: 8px; }
.seg-radio { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(var(--ink), .04); border: 1px solid var(--hair); width: max-content; }
.seg-radio label { position: relative; }
.seg-radio input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-radio span { display: inline-block; padding: 9px 18px; border-radius: 9px; font-weight: 700; color: var(--dim); transition: .2s; }
.seg-radio input:checked + span { background: rgba(96, 94, 243, .3); color: var(--strong); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--cyan); }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.assign-list { display: grid; gap: 6px; }
.assign-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.lock-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; border: 1px dashed var(--hair-2); color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lock-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--t-amber, #F5C542); }
.lock-toggle:has(input:checked) { border-style: solid; border-color: rgba(245, 197, 66, .7); background: rgba(245, 197, 66, .12); color: var(--strong); }
.view-add { margin-top: 14px; }
.assign-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.due-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.due-field .input { width: 190px; min-height: 36px; padding: 4px 8px; font-size: 13px; }
.check, .radio { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--hair-2); background: rgba(var(--ink), .03); font-weight: 600; cursor: pointer; transition: .2s; }
.check:hover, .radio:hover { background: rgba(var(--ink), .06); }
.check:has(input:checked) { border-color: var(--accent-light); background: rgba(96, 94, 243, .16); color: var(--strong); }
.check input, .radio input { width: 18px; height: 18px; accent-color: var(--accent-light); margin: 0; }
.pw-choice { display: grid; gap: 8px; }
.pw-set { display: grid; gap: 8px; animation: rise .3s var(--ease) both; }
.input.search { width: 260px; min-height: 42px; }
.input.sm, .input.search.sm { min-height: 38px; padding: 6px 12px; font-size: 15px; width: auto; }
select.input { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
select.input option { background: var(--surface); }
.filters { display: flex; gap: 8px; align-items: center; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.action-row form { margin: 0; }
.action-row.center { justify-content: center; margin-top: 18px; }
.seg-links { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(var(--ink), .04); border: 1px solid var(--hair); }
.seg-links a { padding: 7px 12px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--dim); }
.seg-links a.on { background: rgba(96, 94, 243, .3); color: var(--strong); }
.seg-links b { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--g3); color: #1a0f00; font-size: 12px; }

.timeline { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 2px; }
.timeline li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 14px; }
.timeline time { color: var(--dim); font-size: 13px; white-space: nowrap; }
.timeline .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: rgba(var(--ink), .06); color: var(--muted); white-space: nowrap; }
.ev-login { background: rgba(43, 212, 125, .14); color: var(--t-green); }
.ev-grade { background: rgba(96, 94, 243, .2); color: var(--t-violet); }
.ev-admin { background: rgba(0, 178, 255, .16); color: var(--t-cyan); }
.ev-lockout, .ev-csrf { background: rgba(240, 82, 61, .16); color: var(--t-red); }
.ev-export { background: rgba(245, 197, 66, .14); color: var(--t-amber); }

.pw-once-card { text-align: center; }
.big-check { width: 72px; height: 72px; border-radius: 50%; margin: 6px auto 14px; display: grid; place-items: center; background: radial-gradient(circle, rgba(43, 212, 125, .95), rgba(43, 212, 125, .7)); box-shadow: 0 0 50px rgba(43, 212, 125, .45); animation: pop .5s var(--spring) both; color: #052; }
.big-check svg { width: 36px; height: 36px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .4s .25s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.pw-once { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0 4px; padding: 16px; border-radius: 14px; background: var(--recess-deep); border: 1px dashed rgba(96, 94, 243, .6); }
.pw-once code { font-size: 22px; letter-spacing: .04em; color: var(--strong); user-select: all; }

.review-images { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.review-images.n1 { grid-template-columns: minmax(0, 900px); justify-content: center; }
.review-shot { position: relative; display: grid; padding: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--hair); background: #000; cursor: zoom-in; transition: border-color .25s, box-shadow .25s, transform .25s var(--ease); animation: rise .5s var(--ease) both; }
.review-shot:hover { border-color: rgba(96, 94, 243, .6); box-shadow: 0 20px 50px -20px var(--accent-glow); transform: translateY(-2px); }
.review-shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; }
.review-shot .fname { padding: 8px 12px; font: 13px var(--mono); color: var(--dim); background: var(--surface); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* next-ungraded button */
.rail-actions .btn-ghost.skip { width: auto; padding: 0 12px; gap: 6px; font-size: 14px; color: var(--muted); }
.rail-actions .btn-ghost.skip svg { width: 18px; height: 18px; }
.rail-actions .btn-ghost.skip kbd { background: rgba(var(--ink), .08); color: var(--muted); }
.rail-actions .btn-ghost.skip:hover { color: var(--text); }

/* image grid: 2 columns, 2 rows visible, scroll for more */
.viewer { align-content: start; overflow: hidden; }
.viewer.scrolls { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-2) transparent; scroll-snap-type: y proximity; }
.viewer.scrolls .shot { scroll-snap-align: start; }

/* preview / full-resolution tag */
.shot .res { position: absolute; left: 12px; bottom: 12px; font: 600 12px/1 var(--mono); padding: 5px 8px; border-radius: 7px; background: rgba(0, 0, 0, .55); color: var(--dim); backdrop-filter: blur(6px); transition: color .3s, background .3s; pointer-events: none; }
.shot.hd .res { color: var(--t-green); background: rgba(6, 40, 24, .7); }

/* download progress: a bar while an image is on its way, a thin line while the original replaces the preview */
.loader.has-bar::before { content: none; }
.dl { width: min(280px, 76%); display: grid; gap: 9px; justify-items: center; text-align: center; }
.dl-text { font: 600 13px/1.3 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.dl-track { width: 100%; height: 6px; border-radius: 999px; background: rgba(var(--ink), .14); overflow: hidden; }
.dl-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent-light), var(--cyan)); box-shadow: 0 0 10px rgba(0, 178, 255, .6); transition: width .2s linear; }
.dl.unknown .dl-track i { width: 34%; animation: dlSlide 1.15s ease-in-out infinite; }
@keyframes dlSlide { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.shot .hd-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(var(--ink), .1); pointer-events: none; }
.shot .hd-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-light), var(--cyan)); transition: width .2s linear; }
.lb-stage .loader .dl { padding: 12px 16px; border-radius: 12px; background: rgba(0, 0, 0, .55); position: absolute; left: 50%; top: 18px; transform: translateX(-50%); }
@media (max-width: 1500px) { .rail-actions .btn-ghost.skip span { display: none; } }

/* ================= ADJUST PANEL ================= */
.toggle .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--g2); color: #201500; font-size: 11px; font-weight: 800; display: none; place-items: center; }
.toggle .count.show { display: inline-grid; }
.toggle.on .count { background: #fff; color: #013; }
.adjust {
  position: fixed; top: 128px; right: calc(clamp(430px, 34vw, 600px) + 18px); z-index: 75;
  width: 412px; max-width: calc(100vw - 24px); max-height: calc(100vh - 140px); display: flex; flex-direction: column;
  border-radius: 16px; overflow: hidden;
  background: var(--pop-bg); border: 1px solid var(--hair-2);
  box-shadow: 0 30px 80px -10px rgba(var(--shadow), .8), 0 0 0 1px rgba(96, 94, 243, .12);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: pop .25s var(--spring);
}
.adjust.dragging { box-shadow: 0 40px 100px -10px rgba(var(--shadow), .9), 0 0 0 2px var(--accent-light); user-select: none; }
.adj-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 16px; cursor: grab; border-bottom: 1px solid var(--hair); touch-action: none; }
.adjust.dragging .adj-head { cursor: grabbing; }
.adj-head b { font-size: 15px; white-space: nowrap; }
.adj-head span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--dim); white-space: nowrap; }
.adj-close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
.adj-close:hover { background: rgba(var(--ink), .08); color: var(--strong); }
.adj-body { padding: 4px 16px 12px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
.adj-body h5 { margin: 10px 0 2px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.adj-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 10px; padding: 3px 0; cursor: default; }
.adj-row span { font-size: 15px; font-weight: 600; color: var(--muted); }
.adj-row output { font: 600 14px var(--mono); color: var(--dim); min-width: 38px; text-align: right; }
.adj-row.changed span { color: var(--strong); }
.adj-row.changed output { color: var(--g2); }
.adj-row input[type="range"] { grid-column: 1 / -1; width: 100%; height: 20px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: ew-resize; }
.adj-row input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--track, linear-gradient(90deg, var(--scroll), #6a6a78)); }
.adj-row input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--track, linear-gradient(90deg, var(--scroll), #6a6a78)); }
.adj-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--thumb); border: 0; box-shadow: 0 1px 6px rgba(var(--shadow), .6); transition: transform .12s; }
.adj-row input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--thumb); border: 0; box-shadow: 0 1px 6px rgba(var(--shadow), .6); }
.adj-row input[type="range"]:hover::-webkit-slider-thumb, .adj-row input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); }
.adj-row.changed input[type="range"]::-webkit-slider-thumb { background: var(--g2); }
.adj-row.changed input[type="range"]::-moz-range-thumb { background: var(--g2); }
.adj-row.tint-r { --track: linear-gradient(90deg, #0b3a3a, #55555f 50%, #ff4d4d); }
.adj-row.tint-g { --track: linear-gradient(90deg, #3a0b3a, #55555f 50%, #3ddc6a); }
.adj-row.tint-b { --track: linear-gradient(90deg, #3a3a0b, #55555f 50%, #4d8dff); }
.adj-redfree { width: 100%; justify-content: space-between; margin-top: 8px; border: 1px solid var(--hair-2); height: 40px; }
.adj-keep { display: flex; gap: 12px; align-items: center; margin: 0 12px 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--hair-2); background: rgba(var(--ink), .03); cursor: pointer; transition: .2s; }
.adj-keep:hover { background: rgba(var(--ink), .06); }
.adj-keep:has(input:checked) { border-color: var(--accent-light); background: rgba(96, 94, 243, .16); }
.adj-keep input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent-light); flex: none; }
.adj-keep b { display: block; font-size: 15px; }
.adj-keep small { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }
.adj-reset { flex: none; white-space: nowrap; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--hair-2); background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.adj-reset:hover { background: rgba(var(--ink), .08); color: var(--strong); }
.viewer.adjusted .shot .res::after { content: " · adjusted"; color: var(--g2); }
@media (max-width: 900px) { .adjust { right: 12px; } }

/* admin results table */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.filter-bar label { display: grid; gap: 5px; font-size: 12px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.filter-bar .input.sm { min-width: 150px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.result-count { margin: 14px 0 10px; color: var(--muted); font-size: 15px; }
.result-count b { color: var(--text); font-size: 20px; }
table.sortable th[data-sort] { cursor: pointer; user-select: none; }
table.sortable th[data-sort]:hover { color: var(--text); }
table.sortable th.asc::after { content: " ▲"; color: var(--cyan); }
table.sortable th.desc::after { content: " ▼"; color: var(--cyan); }
.results-table td { white-space: nowrap; }
.results-table td.wrap { white-space: normal; min-width: 160px; max-width: 280px; }

/* "Next unlabeled" row, directly above Save & next */
.next-unlabeled { display: flex; align-items: center; gap: 10px; margin: 0 14px; min-height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--hair-2); background: rgba(0, 178, 255, .07); color: var(--text); font-weight: 700; font-size: 16px; transition: background .2s, border-color .2s, transform .15s; flex: none; }
.next-unlabeled:hover { background: rgba(0, 178, 255, .16); border-color: rgba(0, 178, 255, .55); }
.next-unlabeled:active { transform: scale(.985); }
.next-unlabeled svg { width: 18px; height: 18px; color: var(--cyan); flex: none; }
.next-unlabeled .left { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--dim); }
.next-unlabeled[disabled] { opacity: .45; pointer-events: none; }
.rail-actions { border-top: 0; padding-top: 8px; }
.optional { border-bottom: 1px solid var(--hair); margin-bottom: 8px; }

/* planned maintenance: a countdown pill on every page, and a cover over a reader's page while it lasts */
.maint-pill { position: fixed; top: 10px; left: 0; right: 0; margin: 0 auto; width: fit-content; z-index: 90; max-width: min(460px, calc(100vw - 24px)); border-radius: 14px; border: 1px solid rgba(245, 197, 66, .6); background: var(--toast-bg); box-shadow: 0 18px 44px -18px rgba(var(--shadow), .8), 0 0 0 1px rgba(245, 197, 66, .1); color: var(--t-amber-2); animation: rise .4s var(--ease) both; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
body.admin .maint-pill { top: auto; bottom: 16px; }   /* the admin menu sits where the pill would */
.maint-pill-head { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 6px 12px; border: 0; background: transparent; color: inherit; font-weight: 800; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.maint-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--g2); box-shadow: 0 0 0 4px rgba(245, 197, 66, .22); }
.maint-lines { display: grid; gap: 1px; min-width: 0; text-align: left; }
.maint-sub { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.maint-sub:empty { display: none; }
.maint-caret { margin-left: auto; padding-left: 4px; color: var(--dim); font-size: 12px; transition: transform .2s; }
.maint-pill.open .maint-caret { transform: rotate(180deg); }
.maint-long { display: none; padding: 0 14px 12px 30px; font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--text); white-space: normal; overflow-wrap: anywhere; }
.maint-pill.open .maint-long:not(:empty) { display: block; }
.maint-long:empty ~ .maint-caret, .maint-pill.done .maint-caret { display: none; }
.maint-pill.soon, .maint-pill.on { border-color: rgba(240, 82, 61, .65); color: var(--t-red-2); box-shadow: 0 18px 44px -18px rgba(var(--shadow), .8), 0 0 0 1px rgba(240, 82, 61, .12); }
.maint-pill.soon .maint-dot, .maint-pill.on .maint-dot { background: var(--g4); box-shadow: 0 0 0 4px rgba(240, 82, 61, .22); }
.maint-pill.done { border-color: rgba(43, 212, 125, .6); color: var(--t-green); }
.maint-pill.done .maint-dot { background: var(--g0); box-shadow: 0 0 0 4px rgba(43, 212, 125, .22); }
.maint-overlay { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 16px; background: var(--scrim); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); animation: fadeIn .25s; }
.maint-overlay.page { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.maint-card { width: min(520px, 100%); padding: 34px 30px 28px; border-radius: 22px; text-align: center; background: var(--surface); border: 1px solid rgba(245, 197, 66, .5); box-shadow: 0 40px 100px -30px rgba(var(--shadow), .85), 0 0 0 1px rgba(245, 197, 66, .1); animation: rise .45s var(--ease) both; }
.maint-icon { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: rgba(245, 197, 66, .18); border: 1px solid rgba(245, 197, 66, .45); color: var(--t-amber); }
.maint-icon svg { width: 30px; height: 30px; }
.maint-card h1 { margin: 0 0 10px; font-size: 26px; letter-spacing: -.01em; color: var(--strong); }
.maint-eta { margin: 0; font-size: 19px; font-weight: 700; color: var(--t-amber-2); }
.maint-window { display: grid; gap: 4px; margin: 12px 0 0; font-size: 16px; font-weight: 600; color: var(--text); }
.maint-window:empty { display: none; }
.maint-msg { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--recess); border: 1px solid var(--hair-2); font-size: 16px; color: var(--text); overflow-wrap: anywhere; }
.maint-foot { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.maint-admin h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.maint-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.maint-facts div { padding: 12px 14px; border-radius: 12px; background: var(--recess); border: 1px solid var(--hair); }
.maint-facts dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.maint-facts dd { margin: 4px 0 0; font-size: 16px; font-weight: 700; color: var(--strong); overflow-wrap: anywhere; }
.maint-note { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: rgba(240, 82, 61, .1); border: 1px solid rgba(240, 82, 61, .4); color: var(--t-red-2); font-weight: 600; }
.maint-row { display: flex; align-items: center; gap: 14px 22px; flex-wrap: wrap; }
.maint-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.maint-inline .input { width: 84px; }
.maint-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin: 14px 0; }
.maint-form .wide { grid-column: 1 / -1; }
.maint-form .hint { margin: 0; }
@media (max-width: 700px) { .maint-form { grid-template-columns: 1fr; } }
:root[data-theme="light"] .maint-pill { border-color: rgba(190, 140, 0, .7); }
:root[data-theme="light"] .maint-card { background: #fff; border-color: rgba(214, 158, 0, .6); box-shadow: 0 40px 100px -30px rgba(40, 44, 130, .5); }
:root[data-theme="light"] .maint-icon { background: #FFE9A8; border-color: rgba(214, 158, 0, .55); }

/* unsaved-changes popup: the page blurs and the popup rises over the grading form, as tall as its list needs */
.unsaved { position: fixed; inset: 0; z-index: 78; background: var(--scrim); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); animation: fadeIn .18s; }
.unsaved-card { position: fixed; right: 12px; bottom: 12px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); display: flex; flex-direction: column; border-radius: 18px; border: 1px solid rgba(245, 197, 66, .55); background: var(--surface); box-shadow: 0 0 0 1px rgba(245, 197, 66, .12), 0 40px 90px -28px rgba(var(--shadow), .85), 0 -18px 60px -30px rgba(245, 197, 66, .45); outline: none; overflow: hidden; }
.unsaved-card.nudge { animation: pendingIn .32s var(--spring); }
/* a question about the grade: only the grading panel blurs, the images stay in view (but not clickable) */
.unsaved.rail-only { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.unsaved.rail-only::before { content: ''; position: fixed; left: var(--rail-l, 0); top: var(--rail-t, 0); width: var(--rail-w, 100%); height: var(--rail-h, 100%); background: var(--scrim); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
@keyframes pendingIn { 0% { transform: translateY(18px) scale(.97); opacity: 0; } 100% { transform: none; opacity: 1; } }
.unsaved-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 18px 14px; background: linear-gradient(180deg, rgba(245, 197, 66, .17), rgba(245, 197, 66, .05)); border-bottom: 1px solid rgba(245, 197, 66, .28); }
.unsaved-icon { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(245, 197, 66, .2); color: var(--t-amber); border: 1px solid rgba(245, 197, 66, .45); }
.unsaved-icon svg { width: 20px; height: 20px; }
.unsaved-titles { min-width: 0; }
.unsaved-title { font-size: 19px; font-weight: 800; color: var(--t-amber-2); line-height: 1.2; }
.unsaved-sub { margin-top: 2px; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unsaved-sub.wrap { white-space: normal; }
.unsaved-list { flex: 0 1 auto; min-height: 56px; overflow: auto; padding: 4px 18px; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
.chg { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; }
.chg + .chg { border-top: 1px solid var(--hair); }
.chg-label { justify-self: start; max-width: 100%; margin-top: 1px; padding: 4px 9px; border-radius: 8px; background: rgba(96, 94, 243, .2); border: 1px solid rgba(96, 94, 243, .45); color: var(--t-violet); font-size: 13px; font-weight: 800; letter-spacing: .02em; line-height: 1.25; }
.chg-what { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; min-height: 28px; font-size: 15px; font-weight: 600; color: var(--strong); line-height: 1.3; }
.chg-from { color: var(--dim); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.chg-arrow { color: var(--muted); font-size: 17px; font-weight: 800; line-height: 1; }
.chg-to { font-weight: 800; }
.chg-to.tone { display: inline-flex; align-items: center; gap: 7px; }
.chg-to.tone::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.chg-to.g0 { --c: var(--g0); } .chg-to.g1 { --c: var(--g1); } .chg-to.g2 { --c: var(--g2); }
.chg-to.g3 { --c: var(--g3); } .chg-to.g4 { --c: var(--g4); } .chg-to.g9 { --c: var(--g9); }
.chg-none { color: var(--dim); font-style: italic; font-weight: 600; }
.chg-chip { padding: 3px 9px; border-radius: 8px; border: 1px solid var(--hair-2); background: var(--recess); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.chg-chip.add { color: var(--t-green); border-color: rgba(43, 212, 125, .4); background: rgba(43, 212, 125, .1); }
.chg-chip.del { color: var(--t-red); border-color: rgba(240, 82, 61, .4); background: rgba(240, 82, 61, .09); text-decoration: line-through; }
.chg-chip.note { color: var(--muted); border-style: dashed; }
.chg-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-weight: 500; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.unsaved-actions { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px 16px; border-top: 1px solid var(--hair); background: var(--rail-foot); }
.unsaved-actions .btn { flex: 1 1 190px; min-width: 0; gap: 8px; min-height: 48px; font-size: 16px; white-space: nowrap; }
.unsaved-actions .btn-ghost { flex-basis: 100%; min-height: 42px; font-size: 15px; }
.unsaved-actions .btn kbd { height: 20px; font-size: 11px; }
.unsaved-actions .btn-danger { background: rgba(240, 82, 61, .12); }
@media (max-width: 520px) { .chg { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
@media (max-height: 960px) { .next-unlabeled { min-height: 38px; } }

.tab .count { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }
.tab .count:not(.show) { display: none; }
/* laptop heights: make room for the "Next unlabeled" row without folding the ICDR tiles */
@media (max-height: 960px) {
  .chip { min-height: 36px; padding: 4px 10px; }
  .chips { gap: 5px; }
  .tile { min-height: 46px; }
  .tiles { gap: 6px; }
  .group { padding: 8px 18px 2px; }
  .panels { padding: 8px 18px 8px; }
  .optional { margin-bottom: 6px; }
  .next-unlabeled { min-height: 36px; }
  .rail-actions { padding: 6px 14px 10px; }
  .rail-actions .btn-primary, .rail-actions .btn-ghost { min-height: 48px; }
}

/* "Next unlabeled" is a checkbox row */
label.next-unlabeled { cursor: pointer; user-select: none; }
label.next-unlabeled input { width: 20px; height: 20px; margin: 0; accent-color: var(--cyan); flex: none; cursor: pointer; }
label.next-unlabeled.on { background: rgba(0, 178, 255, .18); border-color: rgba(0, 178, 255, .65); }
label.next-unlabeled.on .left { color: var(--t-cyan); }
/* show-password option */
.show-pw { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; width: max-content; }
.show-pw input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-light); }

.banner.info { background: rgba(0, 178, 255, .1); border: 1px solid rgba(0, 178, 255, .45); color: var(--t-cyan-2); margin-bottom: 22px; }
.banner.info code { background: var(--recess-deep); padding: 2px 7px; border-radius: 6px; color: var(--strong); user-select: all; }
.banner.warn { margin-bottom: 22px; }

/* ---------- tablets ---------- */
/* The page is exactly as wide as the screen: a long case name is shortened instead of pushing the
   grading panel off the right edge (the page itself cannot scroll sideways). */
.grade-shell { grid-template-columns: minmax(0, 1fr); height: 100dvh; }
.grade-shell button { touch-action: manipulation; }
/* Below laptop widths the grading panel is at its narrowest, so the grade names need a little less room. */
@media (max-width: 1200px) {
  .group { padding-left: 12px; padding-right: 12px; }
  .tile { font-size: 14px; gap: 6px; padding: 8px 7px; }
}

/* ---------- theme switch ---------- */
.nav-right { display: inline-flex; align-items: center; gap: 10px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: block; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }

/* ================= LIGHT THEME =================
   Everything below applies only with data-theme="light"; the dark theme is untouched.
   Image tiles and the full-screen viewer are left alone on purpose (see the palette note at the top). */

/* background: a soft indigo / cyan wash instead of the night sky */
:root[data-theme="light"] .sky { background: radial-gradient(1100px 760px at 78% -12%, rgba(99, 96, 255, .28), transparent 62%), radial-gradient(900px 700px at -6% 104%, rgba(0, 178, 255, .22), transparent 60%), radial-gradient(720px 520px at 42% 46%, rgba(168, 85, 247, .09), transparent 62%), var(--bg); }
:root[data-theme="light"] .stars { display: none; }
:root[data-theme="light"] .aurora { mix-blend-mode: normal; filter: blur(110px); }
:root[data-theme="light"] .aurora.a1 { background: #8E8BFF; opacity: .3; }
:root[data-theme="light"] .aurora.a2 { background: #6FD3FF; opacity: .36; }
:root[data-theme="light"] .aurora.a3 { background: #C9A6FF; opacity: .26; }

/* bars */
:root[data-theme="light"] .appbar, :root[data-theme="light"] .topbar { background: rgba(255, 255, 255, .88); border-bottom-color: rgba(var(--ink), .08); box-shadow: 0 10px 30px -22px rgba(40, 44, 130, .55); }
:root[data-theme="light"] .brand-mark { box-shadow: 0 6px 16px -4px rgba(41, 84, 238, .55); }
:root[data-theme="light"] .admin-nav a:hover { background: rgba(73, 70, 243, .06); }
:root[data-theme="light"] .admin-nav a.on { color: var(--accent); }

/* buttons */
:root[data-theme="light"] .btn { background: #fff; border-color: rgba(var(--ink), .16); box-shadow: 0 1px 2px rgba(22, 24, 52, .06); }
:root[data-theme="light"] .btn:hover { background: #F5F5FF; border-color: rgba(73, 70, 243, .5); color: var(--accent); }
:root[data-theme="light"] .btn-primary { background: linear-gradient(135deg, #4340F0, #6D5BFF 60%, #4B8DF8 135%); border-color: transparent; color: #fff; box-shadow: 0 12px 26px -10px rgba(73, 70, 243, .75), inset 0 1px 0 rgba(255, 255, 255, .28); }
:root[data-theme="light"] .btn-primary:hover { background: linear-gradient(135deg, #3734DE, #5E4CF2 60%, #3C7FEF 135%); border-color: transparent; color: #fff; }
:root[data-theme="light"] .btn-primary kbd { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .38); color: #fff; }
:root[data-theme="light"] .btn-primary.ok { background: linear-gradient(135deg, #0FA35B, #2BD47D); box-shadow: 0 12px 26px -10px rgba(43, 212, 125, .75); }
:root[data-theme="light"] .btn-ghost { background: transparent; box-shadow: none; }
:root[data-theme="light"] .btn-ghost:hover { background: rgba(73, 70, 243, .08); }
:root[data-theme="light"] .btn-warn { border-color: rgba(190, 135, 0, .55); color: var(--t-amber); }
:root[data-theme="light"] .btn-warn:hover { background: rgba(245, 197, 66, .18); border-color: rgba(190, 135, 0, .7); color: var(--t-amber); }
:root[data-theme="light"] .btn-danger { border-color: rgba(240, 82, 61, .55); color: var(--t-red); }
:root[data-theme="light"] .btn-danger:hover { background: rgba(240, 82, 61, .1); border-color: rgba(240, 82, 61, .75); color: var(--t-red); }
:root[data-theme="light"] .unsaved-actions .btn-danger { background: rgba(240, 82, 61, .08); }
:root[data-theme="light"] .unsaved-card { background: #fff; border-color: rgba(214, 158, 0, .6); box-shadow: 0 0 0 1px rgba(214, 158, 0, .12), 0 40px 90px -30px rgba(40, 44, 130, .55); }
:root[data-theme="light"] .unsaved-head { background: linear-gradient(180deg, #FFF4D2, #FFFBEE); border-bottom-color: rgba(214, 158, 0, .3); }
:root[data-theme="light"] .unsaved-icon { background: #FFE9A8; border-color: rgba(214, 158, 0, .55); }
:root[data-theme="light"] .chg-label { background: rgba(73, 70, 243, .09); border-color: rgba(73, 70, 243, .3); }
:root[data-theme="light"] .chg-chip.add { background: rgba(14, 143, 82, .09); border-color: rgba(14, 143, 82, .35); }
:root[data-theme="light"] .chg-chip.del { background: rgba(210, 54, 34, .07); border-color: rgba(210, 54, 34, .32); }
:root[data-theme="light"] .topbar .icon-btn, :root[data-theme="light"] .appbar .icon-btn, :root[data-theme="light"] .landing-nav .icon-btn { background-color: #fff; border-color: rgba(var(--ink), .14); box-shadow: 0 1px 2px rgba(22, 24, 52, .06); }
:root[data-theme="light"] .topbar .icon-btn:hover, :root[data-theme="light"] .appbar .icon-btn:hover, :root[data-theme="light"] .landing-nav .icon-btn:hover { background-color: #F3F3FF; border-color: rgba(73, 70, 243, .45); color: var(--accent); }
:root[data-theme="light"] .topbar .icon-btn.on { background-color: rgba(73, 70, 243, .12); border-color: rgba(73, 70, 243, .5); color: var(--accent); }

/* inputs */
:root[data-theme="light"] .input, :root[data-theme="light"] textarea.input { background-color: #fff; border-color: rgba(var(--ink), .2); box-shadow: inset 0 1px 2px rgba(22, 24, 52, .04); }
:root[data-theme="light"] .input:focus { background-color: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(73, 70, 243, .18); }

/* landing */
:root[data-theme="light"] .landing-nav .pill { background: rgba(255, 255, 255, .75); border-color: rgba(73, 70, 243, .28); color: var(--accent); }
:root[data-theme="light"] .eyebrow, :root[data-theme="light"] .kicker, :root[data-theme="light"] .task-card .kicker { color: var(--accent); }
:root[data-theme="light"] .eyebrow .dot, :root[data-theme="light"] .eyebrow .dot::after { background: var(--accent); }
:root[data-theme="light"] .hero h1 .grad { background: linear-gradient(100deg, #4946F3 5%, #8B5CF6 50%, #0A9BE8 95%); -webkit-background-clip: text; background-clip: text; }
:root[data-theme="light"] .stat b { background: linear-gradient(100deg, #2B2ACB, #0A8FD8); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] .scanner .ring { border-color: rgba(73, 70, 243, .22); }
:root[data-theme="light"] .scanner .fundus { box-shadow: inset 0 0 30px rgba(0, 0, 0, .55), 0 14px 40px -8px rgba(240, 82, 61, .45); }
:root[data-theme="light"] .feature { background: rgba(255, 255, 255, .82); border-color: rgba(var(--ink), .08); box-shadow: var(--elev-1); }
:root[data-theme="light"] .feature:hover { background: #fff; border-color: rgba(73, 70, 243, .45); box-shadow: var(--elev-2); }
:root[data-theme="light"] .feature .ico { background: linear-gradient(135deg, rgba(73, 70, 243, .18), rgba(0, 178, 255, .18)); color: var(--accent); }
:root[data-theme="light"] .login-card { border-color: rgba(var(--ink), .06); box-shadow: 0 40px 90px -36px rgba(73, 70, 243, .6), 0 2px 6px rgba(22, 24, 52, .05); }

/* task list */
:root[data-theme="light"] .task-card { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, rgba(73, 70, 243, .55), rgba(0, 178, 255, .45)) border-box; border-color: transparent; box-shadow: var(--elev-1); }
:root[data-theme="light"] .task-card:hover { border-color: transparent; box-shadow: var(--elev-2); }
:root[data-theme="light"] .task-card::after { background: radial-gradient(500px 200px at var(--mx, 50%) var(--my, 0%), rgba(73, 70, 243, .1), transparent 60%); }
:root[data-theme="light"] .task-card .cta { color: var(--accent); }
:root[data-theme="light"] .ring .track { stroke: rgba(73, 70, 243, .12); }

/* grading: header, stage, rail */
:root[data-theme="light"] .counter { background-color: #fff; border-color: rgba(var(--ink), .1); box-shadow: 0 1px 2px rgba(22, 24, 52, .05); }
:root[data-theme="light"] .counter.accent b { color: var(--accent); }
:root[data-theme="light"] .eye-badge { color: var(--t-cyan); }
:root[data-theme="light"] .eye-badge.os { color: var(--t-purple); }
:root[data-theme="light"] .stage { background: radial-gradient(900px 600px at 50% 35%, #F2F3FB, #E3E6F4); }
:root[data-theme="light"] .stage-bar { background: rgba(255, 255, 255, .78); }
:root[data-theme="light"] .stage-bar .toggle.on { background: rgba(73, 70, 243, .14); color: var(--accent); }
:root[data-theme="light"] .stage-bar .toggle.on .count { background: var(--accent); color: #fff; }
:root[data-theme="light"] .stage-bar .toggle.tool { background: rgba(0, 150, 221, .1); border-color: rgba(0, 137, 204, .6); box-shadow: 0 6px 16px -12px rgba(0, 137, 204, .8); }
:root[data-theme="light"] .stage-bar .toggle.tool:hover { background: rgba(0, 150, 221, .18); color: var(--t-cyan-2); }
:root[data-theme="light"] .stage-bar .toggle.tool.on { background: linear-gradient(180deg, #14A9EE, #0086C8); border-color: transparent; color: #fff; }
:root[data-theme="light"] .stage-bar .toggle.tool.on kbd { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .4); color: #fff; }
:root[data-theme="light"] .stage-bar .toggle.tool.on .count { background: #fff; color: #00557E; }
:root[data-theme="light"] .stage-bar .toggle.tool.reset { background: rgba(214, 158, 0, .12); border-color: rgba(190, 140, 0, .65); box-shadow: 0 6px 16px -12px rgba(190, 140, 0, .8); }
:root[data-theme="light"] .stage-bar .toggle.tool.reset:hover { background: rgba(214, 158, 0, .22); color: var(--t-amber-2); }
:root[data-theme="light"] .shot { box-shadow: 0 20px 44px -24px rgba(16, 18, 50, .75); }
:root[data-theme="light"] .rail { box-shadow: -14px 0 34px -26px rgba(40, 44, 130, .45); }
:root[data-theme="light"] .group-head h3 { color: var(--strong); }
:root[data-theme="light"] .tile { background: #fff; border-color: rgba(var(--ink), .14); box-shadow: 0 1px 2px rgba(22, 24, 52, .05); }
:root[data-theme="light"] .tile:hover { background: color-mix(in srgb, var(--c) 9%, #fff); border-color: var(--c); }
:root[data-theme="light"] .tile[aria-checked="true"] { background: color-mix(in srgb, var(--c) 22%, #fff); border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 12px 26px -14px var(--c); }
:root[data-theme="light"] .group.invalid .tile { border-color: rgba(240, 82, 61, .8); }
:root[data-theme="light"] .tile[data-value="0"], :root[data-theme="light"] .tile[data-value="a"] { --c: var(--v0); }
:root[data-theme="light"] .tile[data-value="1"] { --c: var(--v1); }
:root[data-theme="light"] .tile[data-value="2"] { --c: var(--v2); }
:root[data-theme="light"] .tile[data-value="3"] { --c: var(--v3); }
:root[data-theme="light"] .tile[data-value="4"], :root[data-theme="light"] .tile[data-value="s"] { --c: var(--v4); }
:root[data-theme="light"] .tile[data-value="9"], :root[data-theme="light"] .tile[data-value="d"] { --c: var(--v9); }
:root[data-theme="light"] .tab:hover { background: rgba(73, 70, 243, .05); }
:root[data-theme="light"] .tab[aria-selected="true"] { color: var(--accent); background: rgba(73, 70, 243, .08); }
:root[data-theme="light"] .tab.invalid { color: var(--coral); }
:root[data-theme="light"] .tabs { background: rgba(73, 70, 243, .06); border-bottom-color: rgba(73, 70, 243, .5); }
:root[data-theme="light"] .tab { background: #fff; border-color: rgba(var(--ink), .14); }
:root[data-theme="light"] .tab[aria-selected="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
:root[data-theme="light"] .tab[aria-selected="true"] .count { background: #fff; color: var(--accent); }
:root[data-theme="light"] .panels { background: #FAFAFE; }
:root[data-theme="light"] .chip { background: #fff; border-color: rgba(var(--ink), .14); color: var(--text); }
:root[data-theme="light"] .chip::before { border-color: #A9AEC6; }
:root[data-theme="light"] .chip:hover { background: #F5F5FF; border-color: rgba(73, 70, 243, .45); color: var(--strong); }
:root[data-theme="light"] .chip[aria-pressed="true"] { background: rgba(73, 70, 243, .12); border-color: var(--accent); color: #2A27B8; }
:root[data-theme="light"] .chip[aria-pressed="true"]::before { border-color: var(--accent); background-color: var(--accent); }
:root[data-theme="light"] .chips.row { background: rgba(var(--ink), .05); }
:root[data-theme="light"] .chips.row .chip { background: transparent; border-color: transparent; }
:root[data-theme="light"] .chips.row .chip:hover { background: rgba(var(--ink), .06); }
:root[data-theme="light"] .chips.row .chip[aria-pressed="true"] { background: #fff; border-color: var(--accent); color: var(--accent); box-shadow: 0 1px 3px rgba(73, 70, 243, .3); }
:root[data-theme="light"] .summary { background-color: #fff; }
:root[data-theme="light"] .queue { background: #fff; }
:root[data-theme="light"] .toast { box-shadow: 0 20px 50px -14px rgba(40, 44, 130, .45); }
:root[data-theme="light"] .sheet { box-shadow: 0 40px 100px -30px rgba(40, 44, 130, .55); }
:root[data-theme="light"] .adjust { box-shadow: 0 30px 80px -22px rgba(40, 44, 130, .55), 0 0 0 1px rgba(73, 70, 243, .14); }

/* admin */
:root[data-theme="light"] .card { background: #fff; border-color: rgba(var(--ink), .08); box-shadow: var(--elev-1); }
:root[data-theme="light"] .stat-tile { background: linear-gradient(160deg, rgba(73, 70, 243, .12), #fff 62%); border-color: rgba(73, 70, 243, .18); box-shadow: var(--elev-1); }
:root[data-theme="light"] .stat-tile.cyan { background: linear-gradient(160deg, rgba(0, 178, 255, .16), #fff 62%); border-color: rgba(0, 178, 255, .28); }
:root[data-theme="light"] .stat-tile.green { background: linear-gradient(160deg, rgba(43, 212, 125, .18), #fff 62%); border-color: rgba(43, 212, 125, .32); }
:root[data-theme="light"] .stat-tile.accent b { color: var(--accent); }
:root[data-theme="light"] table.data tbody tr:hover { background: rgba(73, 70, 243, .045); }
:root[data-theme="light"] .bar { background: rgba(73, 70, 243, .1); }
:root[data-theme="light"] .check, :root[data-theme="light"] .radio { background-color: #fff; }
:root[data-theme="light"] .check:hover, :root[data-theme="light"] .radio:hover { background-color: #F5F5FF; }
:root[data-theme="light"] .check:has(input:checked) { background-color: rgba(73, 70, 243, .1); border-color: var(--accent); }
:root[data-theme="light"] .seg-radio input:checked + span, :root[data-theme="light"] .seg-links a.on { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(73, 70, 243, .3); }
:root[data-theme="light"] .dist > i.g0, :root[data-theme="light"] .dist-legend i.g0 { background: var(--v0); }
:root[data-theme="light"] .dist > i.g1, :root[data-theme="light"] .dist-legend i.g1 { background: var(--v1); }
:root[data-theme="light"] .dist > i.g2, :root[data-theme="light"] .dist-legend i.g2 { background: var(--v2); }
:root[data-theme="light"] .dist > i.g3, :root[data-theme="light"] .dist-legend i.g3 { background: var(--v3); }
:root[data-theme="light"] .dist > i.g4, :root[data-theme="light"] .dist-legend i.g4 { background: var(--v4); }
:root[data-theme="light"] .dist > i.g9, :root[data-theme="light"] .dist-legend i.g9 { background: var(--v9); }
:root[data-theme="light"] .review-shot { box-shadow: 0 20px 44px -24px rgba(16, 18, 50, .75); }

/* ---------- disagreement review: grader 1 (top 40%), the reviewer's choice (middle 20%), grader 2 (bottom 40%) ---------- */
.review-rail .rv-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: minmax(0, 2fr) minmax(min-content, 1fr) minmax(0, 2fr); }
.rv-grader { --gc: var(--accent); display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); gap: 5px; min-height: 0; min-width: 0; padding: 8px 14px 8px; border-left: 4px solid var(--gc); background: color-mix(in srgb, var(--gc) 6%, transparent); }
.rv-grader[data-g="2"] { --gc: var(--cyan); }
.rv-grader.missing { grid-template-rows: auto auto; }
.rv-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rv-name { font-size: 17px; font-weight: 800; color: var(--strong); }
.rv-role { font-size: 12px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.rv-scores { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.1fr) minmax(0, .75fr); gap: 5px; }
.rv-score { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 3px 7px 4px; border-radius: 10px; background: rgba(var(--ink), .04); border: 1px solid var(--hair); }
.rv-score.differs { border-color: rgba(245, 197, 66, .6); box-shadow: 0 0 0 1px rgba(245, 197, 66, .25) inset; }
.rv-slabel { font-size: 10px; line-height: 1.1; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.rv-score .grade-pill { min-width: 0; max-width: 100%; padding: 2px 7px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.rv-tabs { display: flex; gap: 4px; min-width: 0; }
.rv-tab { flex: 1 1 auto; min-width: 0; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--hair-2); background: rgba(var(--ink), .03); color: var(--muted); font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-tab:hover { color: var(--strong); background: rgba(var(--ink), .07); }
.rv-tab.on { color: var(--strong); background: color-mix(in srgb, var(--gc) 28%, transparent); border-color: color-mix(in srgb, var(--gc) 70%, transparent); }
.rv-scroll { position: relative; min-height: 0; overflow: auto; padding: 2px 10px 0; border-radius: 10px; background: rgba(var(--ink), .025); border: 1px solid var(--hair); scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
.rv-sec { padding: 6px 0 8px; border-bottom: 1px dashed var(--hair-2); }
.rv-sec:last-child { border-bottom: 0; min-height: 100%; }      /* every section can reach the top, so both boxes line up */
.rv-sec h5 { margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.rv-item { display: flex; gap: 8px; padding: 1px 0; font-size: 14px; line-height: 1.35; }
.rv-ilabel { flex: none; width: 40%; color: var(--muted); }
.rv-ival { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.rv-ival.none, .rv-none { color: var(--dim); font-style: italic; }
.rv-none { margin: 2px 0; font-size: 13.5px; }

.rv-decide { display: grid; gap: 5px; align-content: center; min-width: 0; margin: 6px 8px; padding: 8px 10px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, var(--accent) 65%, transparent); background: var(--rail-foot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent), 0 10px 28px -16px rgba(var(--shadow), .8); }
.rv-q { display: grid; gap: 4px; border-radius: 10px; }
.rv-q.invalid { box-shadow: 0 0 0 2px var(--coral); }
.rv-qhead { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rv-qhead span { flex: none; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.rv-qhead small { min-width: 0; font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-opts { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1.3fr); gap: 6px; }
.rv-choice { --gc: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 44px; padding: 3px 6px; border-radius: 10px; border: 1px solid var(--hair-2); background: rgba(var(--ink), .04); color: var(--text); text-align: center; line-height: 1.15; transition: background .15s, border-color .15s; }
.rv-choice[data-g="2"] { --gc: var(--cyan); }
.rv-choice.nc { --gc: var(--g9); }
.rv-choice:disabled { opacity: .4; cursor: not-allowed; background: transparent; border-style: dashed; }
.rv-choice small { font-size: 11px; color: var(--dim); }
.rv-choice b { font-size: 14px; }
.rv-cval { font-size: 12px; color: var(--muted); }
.rv-choice:hover { background: rgba(var(--ink), .08); border-color: rgba(var(--ink), .25); }
.rv-choice[aria-pressed="true"] { background: color-mix(in srgb, var(--gc) 30%, transparent); border-color: var(--gc); box-shadow: 0 0 0 1px var(--gc) inset; }
.rv-choice[aria-pressed="true"] small, .rv-choice[aria-pressed="true"] .rv-cval { color: var(--text); }
.rv-comment { min-height: 34px; padding: 6px 10px; font-size: 14px; }

/* queue: filter & sort (review tasks) */
.queue-filter-btn { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 8px; border: 1px solid var(--hair-2); background: rgba(var(--ink), .04); color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.queue-filter-btn svg { width: 15px; height: 15px; }
.queue-filter-btn:hover { color: var(--strong); }
.queue-filter-btn.on { color: var(--strong); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 25%, transparent); }
.qf-panel { position: fixed; left: 16px; bottom: 46px; z-index: 60; width: min(520px, calc(100vw - 32px)); padding: 12px 16px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--hair-2); box-shadow: 0 30px 80px -30px rgba(var(--shadow), .85); animation: fadeIn .15s; }
.qf-panel h4 { margin: 4px 0 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.qf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-bottom: 8px; }
.qf-field { display: grid; gap: 4px; min-width: 0; font-size: 13px; color: var(--muted); }
.qf-field select { min-height: 36px; padding: 4px 8px; }
.qf-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qf-hint { margin-right: auto; font-size: 12.5px; color: var(--dim); }

/* ---------- view only (a locked task, or another reader's grades) ---------- */
.vo-pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: none; white-space: nowrap; color: var(--t-amber, #F5C542); background: rgba(245, 197, 66, .14); border: 1px solid rgba(245, 197, 66, .5); }
.state-badge.viewonly { color: var(--muted); }
.unit-head .u .vo-pill { margin-left: 2px; }

/* ---------- task list: a finished task is outlined in green ---------- */
.task-card .kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.done-pill { padding: 2px 9px; border-radius: 999px; font-size: 12px; letter-spacing: .04em; text-transform: none; color: #0b0b0b; background: var(--g0); }
.task-card.complete { border: 2px solid var(--g0); box-shadow: 0 0 0 1px rgba(43, 212, 125, .25), 0 18px 50px -26px rgba(43, 212, 125, .55); }
.task-card.complete:hover { border-color: var(--g0); }
.task-card.complete .ring .val { stroke: var(--g0); }
:root[data-theme="light"] .task-card.complete { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #0FA35B, #2BD47D) border-box; border: 2px solid transparent; }

/* ---------- tutorial ---------- */
.tour-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(245, 197, 66, .75); background: linear-gradient(135deg, rgba(245, 197, 66, .28), rgba(245, 197, 66, .12)); color: var(--strong); font-weight: 800; font-size: 14px; white-space: nowrap; box-shadow: 0 0 0 3px rgba(245, 197, 66, .14), 0 0 18px -4px rgba(245, 197, 66, .6); animation: tourPulse 2.6s ease-in-out infinite; }
.tour-btn svg { width: 18px; height: 18px; }
.tour-btn:hover { background: rgba(245, 197, 66, .35); }
@keyframes tourPulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(245, 197, 66, .14), 0 0 18px -4px rgba(245, 197, 66, .6); } 50% { box-shadow: 0 0 0 5px rgba(245, 197, 66, .22), 0 0 24px -2px rgba(245, 197, 66, .75); } }
@media (prefers-reduced-motion: reduce) { .tour-btn { animation: none; } }
.tour { position: fixed; inset: 0; z-index: 95; animation: fadeIn .2s; }
.tour-scrim { position: absolute; inset: 0; fill: rgba(4, 5, 14, .74); }
.tour-ring { position: fixed; border-radius: 12px; border: 2px solid #F5C542; box-shadow: 0 0 0 4px rgba(245, 197, 66, .22); pointer-events: none; transition: all .25s var(--ease, ease); }
.tour-card { position: fixed; width: min(360px, calc(100vw - 32px)); padding: 14px 16px 12px; border-radius: 14px; background: #161727; border: 1px solid rgba(255, 255, 255, .14); color: #e9e9f2; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9); animation: fadeIn .18s; }
.tour-card.intro { width: min(460px, calc(100vw - 32px)); padding: 18px 20px 14px; border-color: rgba(124, 122, 255, .7); }
.tour-kicker { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #9d9bff; }
.tour-card h3 { margin: 2px 0 6px; font-size: 17px; color: #fff; }
.tour-card.intro h3 { font-size: 21px; }
.tour-card p { margin: 0; font-size: 14px; line-height: 1.5; color: #d6d6e4; }
.tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-dots { display: flex; gap: 4px; margin-right: auto; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.tour-dots i.on { width: 16px; border-radius: 3px; background: #F5C542; }
.tour-count { font-size: 12.5px; color: #a3a3b8; font-variant-numeric: tabular-nums; margin-right: 4px; }
.tour-card .btn-sm { min-height: 32px; padding: 0 12px; font-size: 13.5px; }
.tour-card .btn-ghost { color: #d6d6e4; }
.tour-card .btn-ghost:disabled { opacity: .35; }
.tour-exit { position: fixed; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border-radius: 12px; border: 1.5px solid #F5C542; background: #F5C542; color: #1a1400; font-weight: 800; font-size: 14px; white-space: nowrap; cursor: pointer; box-shadow: 0 0 0 4px rgba(245, 197, 66, .3); }
.tour-exit svg { width: 16px; height: 16px; }

/* ---------- expected completion: countdown, then the time past it ---------- */
.due-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .01em; text-transform: none; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--cyan); background: rgba(0, 178, 255, .12); border: 1px solid rgba(0, 178, 255, .5); }
.due-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.due-pill.soon { color: var(--t-amber, #F5C542); background: rgba(245, 197, 66, .14); border-color: rgba(245, 197, 66, .55); }
.due-pill.overdue { color: var(--coral); background: rgba(240, 82, 61, .14); border-color: rgba(240, 82, 61, .55); }
.due-pill.top { flex: none; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 6px; align-items: center; padding: 4px 10px 4px 8px; border-radius: 12px; line-height: 1.1; }
.due-pill.top::before { grid-row: 1 / 3; }
.due-pill.top small { font-size: 11px; font-weight: 600; letter-spacing: 0; opacity: .9; white-space: nowrap; }
.due-pill.top b { font-size: 15px; font-weight: 800; }

/* admin: time a reader took (assigned -> last case saved), and against the turnaround deadline */
.tat-done b { color: var(--strong); font-variant-numeric: tabular-nums; }
.tat-done sup { color: var(--dim); }
.tat-vs { margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tat-vs.early { color: var(--g0); background: rgba(43, 212, 125, .12); border: 1px solid rgba(43, 212, 125, .45); }
.tat-vs.late { color: var(--coral); background: rgba(240, 82, 61, .12); border: 1px solid rgba(240, 82, 61, .45); }

/* ---------- images can't be saved (deterrent; the scripts block right-click, drag and Ctrl+S) ---------- */
.shot img, .review-shot img, .lb-stage img, .lb-strip img { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
@media print { .shot, .review-shot, #lightbox { visibility: hidden !important; } }

/* ---------- admin: task board ---------- */
.board-search { position: relative; display: flex; align-items: center; min-width: min(340px, 100%); }
.board-search svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--dim); pointer-events: none; }
.board-search input.input { width: 100%; padding-left: 34px; }
.board-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.board-jump a { text-decoration: none; }
.board-jump a b { color: var(--strong); }
.board-group { margin: 0 0 30px; scroll-margin-top: 80px; }
.board-title { --gc: var(--cyan); font-size: 20px; font-weight: 800; margin: 0 0 14px; padding: 10px 14px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; border-radius: 12px; color: var(--strong); background: linear-gradient(90deg, color-mix(in srgb, var(--gc) 22%, transparent), transparent 75%); border-left: 4px solid var(--gc); }
.board-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gc); box-shadow: 0 0 10px var(--gc); flex: none; }
.board-count { font-size: 13px; font-weight: 800; padding: 2px 9px; border-radius: 999px; color: var(--gc); border: 1px solid color-mix(in srgb, var(--gc) 55%, transparent); background: color-mix(in srgb, var(--gc) 12%, transparent); }
.g-image, .board-jump-image { --gc: var(--cyan); }
.g-eye, .board-jump-eye { --gc: var(--accent-light); }
.g-review, .board-jump-review { --gc: var(--t-amber, #F5C542); }
.g-disagreement, .board-jump-disagreement { --gc: var(--coral); }
.board-jump a[class*="board-jump-"] { color: var(--gc); border-color: color-mix(in srgb, var(--gc) 55%, transparent); background: color-mix(in srgb, var(--gc) 10%, transparent); }
.board-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.board-created { font-size: 12px; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.board-tile { display: flex; flex-direction: column; gap: 8px; padding: 18px; overflow: visible; }
.board-tile.unassigned { border-style: dashed; }
.board-tile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.board-tile h3 { margin: 0; font-size: 17px; line-height: 1.3; letter-spacing: -.01em; }
.board-tile h3 a { text-decoration: none; }
.board-tile h3 a:hover { color: var(--accent-light); }
.board-id { color: var(--dim); font-size: 12px; overflow-wrap: anywhere; }
.board-desc { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.board-graders { margin: 0; font-size: 13px; font-weight: 600; }
.board-people { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--hair); flex: 1; }
.board-people ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board-people li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; }
.board-people li.off { opacity: .55; }
.board-people .who { margin-right: auto; }
.board-prog { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.board-prog b { color: var(--strong); }
.board-prog .bar { flex: none; width: 64px; height: 8px; }
.board-none { margin: 0; font-size: 14px; }
.board-viewers { margin: 10px 0 0; font-size: 13px; line-height: 1.5; }
.board-actions { display: flex; gap: 8px; margin-top: 6px; }
@media (max-width: 520px) { .board-grid { grid-template-columns: 1fr; } }
