/* Instructor grading page. Values come from the Kaushal Drishti tokens
   (03-KE/drishti/app/client/src/styles/tokens.css, Gen-2 saffron-indigo) and the
   rules in 03-KE/drishti/app/DESIGN.md. Nothing here is a new colour.
   Light-first; the photo panel is the only dark surface; one orange pill per screen;
   orange marks the action point on the photograph; red never touches the photograph. */
@font-face { font-family: "Cabinet"; src: url("fonts/cabinet-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cabinet"; src: url("fonts/cabinet-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "InterT"; src: url("fonts/intertight-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "PlexSans"; src: url("fonts/plexsans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PxMono"; src: url("fonts/mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PxMono"; src: url("fonts/mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PxDev"; src: url("fonts/dev-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PxDev"; src: url("fonts/dev-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "PxDev"; src: url("fonts/dev-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ground: #f8f9f9; --card: #ffffff; --lite: #f2f3f4; --line: #d4d8da; --mist: #e4e7e8;
  --ink: #131a2e; --indigo-950: #090d19; --indigo-900: #0e1424; --indigo-300: #8991aa; --indigo-100: #e2e5ec; --indigo-50: #eef0f4;
  --body: #2b2f33; --muted: #687076; --neutral-600: #4a5055;
  --action: #ff671f; --action-press: #d94a00; --acc: #b83d00; --arc: #ff824a; --orange-100: #ffe7da;
  --teal: #0d5b63; --teal-100: #e7f0f1; --teal-200: #9ac2c4;
  --sage: #4a6b57; --sage-800: #314735; --sage-100: #eaf0ec; --verdict-border: #cfe0d5;
  --err: #b3261e; --err-tint: rgb(179 38 30 / 0.08);
  --font-display: "Cabinet", "Cabinet Grotesk", "InterT", "PxDev", system-ui, sans-serif;
  --font-sans: "InterT", "Inter Tight", "PxDev", "IBM Plex Sans Devanagari", system-ui, sans-serif;
  --font-mono: "PxMono", "IBM Plex Mono", "PxDev", ui-monospace, monospace;
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-card: 20px; --r-pill: 99px; --r-trust: 2px;
  --shadow-card: 0 8px 26px rgb(19 26 46 / 0.06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--body); font-family: var(--font-sans); font-size: 15px; line-height: 1.5; touch-action: manipulation; font-variant-numeric: tabular-nums; }
body { -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
h1 { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.1; letter-spacing: -0.015em; color: var(--ink); margin: 0; }
:lang(hi) h1 { font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; line-height: 1.25; }
p { margin: 0 0 12px; }
button { font: inherit; color: var(--ink); cursor: pointer; appearance: none; background: none; border: 0; padding: 0; }
button:disabled { opacity: 0.4; cursor: default; }
.rule { width: 56px; height: 3px; background: var(--action); margin: 12px 0 18px; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; color: var(--ink); opacity: 0.62; margin-bottom: 10px; }
:lang(hi) .kicker { letter-spacing: 0.02em; font-size: 12.5px; }
.quiet { color: var(--muted); font-size: 13.5px; }
.err { color: var(--err); font-size: 13.5px; margin: 8px 2px 0; }
.link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 8px 2px; min-height: 40px; font-weight: 500; }

.pill-primary { display: flex; min-height: 56px; width: 100%; align-items: center; justify-content: center; border-radius: 999px; background: var(--action); color: var(--indigo-950); font-family: var(--font-display); font-weight: 700; font-size: 16.5px; padding: 0 20px; }
:lang(hi) .pill-primary { font-family: var(--font-sans); font-weight: 600; font-size: 15.5px; }
.pill-primary:active { background: var(--action-press); border-radius: 20px; }
.pill-quiet { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--indigo-300); border-radius: 999px; background: var(--card); color: var(--ink); font-weight: 600; font-size: 14.5px; padding: 0 18px; }
.pill-quiet.sm { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
.pill-quiet.strong { border-color: var(--ink); }
.pill-quiet.wide { width: 100%; margin-top: 10px; }
.pill-quiet.danger { color: var(--err); border-color: var(--err); }
.iconbtn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink); border-radius: 50%; }

.center { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 28px 22px; max-width: 520px; margin: 0 auto; }
.page { padding: 24px 22px 36px; max-width: 560px; margin: 0 auto; }
.lockup { display: flex; align-items: center; gap: 9px; margin-bottom: 28px; }
.lockup img { height: 28px; width: auto; }
.lockup span, .wordmark { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.015em; color: var(--ink); }
.steps { padding-left: 20px; margin: 0 0 16px; }
.steps li { margin-bottom: 8px; padding-left: 4px; }
.steps li::marker { font-family: var(--font-mono); font-weight: 600; color: var(--acc); }
.langrow { display: flex; gap: 8px; margin: 18px 0 0; }
.watch { margin: 10px 0 14px; }
.vid { align-items: center; padding: 14px; }
.vid-card { background: var(--card); width: 100%; max-width: 400px; border-radius: var(--r-card); padding: 12px 14px 14px; }
.vid-card video { display: block; width: 100%; max-height: 74vh; background: var(--indigo-900); border-radius: var(--r-sm); }
.langrow .lang { flex: 1; }
.langrow .lang.on { border-color: var(--ink); background: var(--indigo-100); }
sup { font-size: 0.5em; vertical-align: super; font-weight: 700; margin-left: 1px; }
.agree { margin: 12px 2px 0; font-size: 13px; color: var(--muted); }
.link.inline { padding: 0; min-height: 0; font-size: inherit; }
.conf { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
/* The legal footer: the Kaushal Edge lockup as on kaushaledge.com (mark in Kaushal Orange,
   stacked Plex Sans 600 wordmark), then the rights line. */
.legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.legal:empty { display: none; }
.ke-lockup { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.ke-lockup img { height: 40px; width: auto; }
.ke-word { font-family: "PlexSans", "IBM Plex Sans", var(--font-sans); font-weight: 600; font-size: 18px; line-height: 0.95; letter-spacing: 0.02em; color: var(--ink); display: flex; flex-direction: column; align-items: flex-start; }
.legal p { margin: 0 0 6px; }
.legal .rights { color: var(--ink); font-weight: 600; font-size: 13px; }
.legal .cin { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; }
.legal .link { padding: 6px 0; min-height: 36px; font-size: 13px; }
.terms { font-size: 14.5px; }
.terms h2 { font-family: var(--font-sans); font-size: 15px; font-weight: 700; color: var(--ink); margin: 18px 0 4px; }
.terms p { margin: 0 0 8px; }
.terms .num { font-family: var(--font-mono); font-weight: 600; color: var(--acc); margin-right: 8px; }

#s-grade { display: flex; flex-direction: column; min-height: 100%; }
.top { background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; padding-top: max(6px, env(safe-area-inset-top)); }
.top .mark { height: 24px; width: auto; }
.top .wordmark { flex: 1; font-size: 16.5px; }
.sub { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--card); flex-wrap: wrap; }
.count { font-family: var(--font-mono); font-weight: 600; font-size: 13px; color: var(--ink); margin-right: 4px; letter-spacing: 0.02em; }
.chip-iso { font-family: var(--font-mono); font-size: 11.5px; background: var(--indigo-100); color: var(--ink); padding: 3px 7px; border-radius: var(--r-trust); letter-spacing: 0.01em; }
.chip-iso:empty { display: none; }
.bar { height: 3px; background: var(--mist); }
.bar i { display: block; height: 3px; background: var(--action); width: 0; transition: width .3s cubic-bezier(0.77, 0, 0.175, 1); }
.coach { background: var(--teal-100); color: var(--teal); border: 1px solid var(--teal-200); }
.tipcard { margin: 10px 12px 0; padding: 10px 14px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 500; }

.work { flex: 1; display: flex; flex-direction: column; }
.stagecol { padding-top: 10px; }
.stage { position: relative; height: 46vh; min-height: 260px; background: var(--indigo-900); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; --inv: 1; will-change: transform; }
.canvas img { display: block; width: 100%; height: 100%; pointer-events: none; -webkit-touch-callout: none; }
#lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#lines line { vector-effect: non-scaling-stroke; stroke-linecap: round; }
#pins { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; width: 0; height: 0; transform: scale(var(--inv)); }
.pin::after { content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--arc); border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(9 13 25 / 0.6); }
.pin b { position: absolute; left: -12px; top: -37px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 6px; background: var(--action); color: var(--indigo-950); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 13px; font-weight: 600; box-shadow: 0 0 0 1.5px #fff, 0 2px 6px rgb(9 13 25 / 0.45); }
.pin b::after { content: ""; position: absolute; left: 11px; top: 24px; width: 2px; height: 8px; background: #fff; }
.pin.pending::after { background: #fff; }
.pin.pending b { background: #fff; }
.zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 40px; height: 40px; border-radius: 999px; background: #fff; color: var(--ink); font-family: var(--font-mono); font-weight: 600; font-size: 17px; box-shadow: 0 2px 8px rgb(9 13 25 / 0.35); }
.zoom #z-fit { font-size: 11.5px; }
.hint { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 64px); color: var(--ink); font-size: 12.5px; font-weight: 600; background: #fff; padding: 6px 12px; border-radius: 999px; pointer-events: none; box-shadow: 0 2px 8px rgb(9 13 25 / 0.35); }
.hint:empty { display: none; }

.tools { display: flex; gap: 6px; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.tool { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 6px 8px; font-size: 13.5px; font-weight: 600; line-height: 1.15; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); }
.tool svg { flex: none; }
.tool.on { border-color: var(--ink); background: var(--indigo-100); }
.armed { display: flex; align-items: center; gap: 8px; margin: 10px 12px 0; padding: 8px 8px 8px 14px; border-radius: var(--r-md); }
.armed-text { flex: 1; min-width: 0; line-height: 1.25; }
.armed-text b { display: block; font-size: 14px; font-weight: 700; }
.armed-text span { font-size: 12.5px; }

.panel { padding: 10px 12px 104px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-card); }
#marks { list-style: none; margin: 0 0 6px; padding: 0; }
#marks li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--mist); }
#marks li .dot { flex: none; min-width: 26px; height: 26px; border-radius: 6px; background: var(--action); color: var(--indigo-950); font-family: var(--font-mono); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
#marks li .txt { flex: 1; min-width: 0; color: var(--ink); font-weight: 600; text-align: left; }
#marks li .txt small { color: var(--muted); display: block; font-weight: 400; font-size: 12.5px; }
#marks li .rowbtn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--neutral-600); border-radius: 50%; flex: none; }
#marks li .rowbtn.add { border: 1.5px solid var(--indigo-300); color: var(--ink); }
#marks:empty::after { content: attr(data-empty); color: var(--muted); font-size: 13.5px; display: block; padding: 0 0 8px; }
.nodef { display: flex; align-items: center; gap: 10px; padding: 8px 0 0; color: var(--ink); font-weight: 500; }
.nodef input { width: 22px; height: 22px; accent-color: var(--ink); }
.verdict { display: flex; gap: 8px; }
.verdict button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 600; font-size: 14.5px; }
.verdict button.on[data-v="pass"] { background: var(--sage-100); border-color: var(--sage); color: var(--sage-800); }
.verdict button.on[data-v="fail"] { background: var(--err-tint); border-color: var(--err); color: var(--err); }
.verdict button.on[data-v="unclear"] { background: var(--lite); border-color: var(--neutral-600); color: var(--neutral-600); }
.noteblock { display: flex; flex-wrap: wrap; gap: 0 18px; align-items: center; padding: 6px 14px; }
#note { width: 100%; font: inherit; color: var(--body); border: 1px solid #b5babe; border-radius: var(--r-sm); padding: 10px; margin: 6px 0 8px; }

.foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); z-index: 5; }
.foot .pill-primary { flex: 1.7; width: auto; }
.foot .pill-quiet { flex: none; min-height: 56px; }
.sync { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }

.sheet { position: fixed; inset: 0; background: rgb(14 20 36 / 0.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { background: var(--card); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: var(--r-card) var(--r-card) 0 0; padding: 14px 14px 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head b { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.015em; color: var(--ink); }
:lang(hi) .sheet-head b { font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dgrid button { text-align: left; padding: 9px 12px; line-height: 1.2; min-height: 52px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--card); font-weight: 600; font-size: 14.5px; color: var(--ink); }
.dgrid button small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.dgrid button.on { border-color: var(--ink); background: var(--indigo-100); }
.dgrid .sep { grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; color: var(--ink); opacity: 0.62; padding: 8px 2px 0; }
.dgrid .sep:empty { padding: 0; }
#sh-other { width: 100%; font: inherit; border: 1px solid #b5babe; border-radius: var(--r-sm); padding: 10px; margin-top: 8px; }
.sheet-foot { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); margin: 10px -14px 0; padding: 10px 14px max(14px, env(safe-area-inset-bottom)); }
.sheet-foot .kicker { margin-bottom: 6px; }
.sev { display: flex; gap: 8px; }
.sev button { flex: 1; min-height: 56px; border-radius: 999px; background: var(--ink); color: #fff; line-height: 1.15; }
.sev button b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
:lang(hi) .sev button b { font-family: var(--font-sans); font-weight: 600; }
.sev button small { display: block; font-size: 11.5px; color: var(--indigo-300); }

.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 12px 0 18px; }
.grid button { min-height: 44px; font-family: var(--font-mono); font-size: 13px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--card); }
.grid button.done { background: var(--sage-100); border-color: var(--verdict-border); color: var(--sage-800); font-weight: 600; }
.grid button.draft { background: var(--orange-100); border-color: var(--orange-100); color: var(--acc); font-weight: 600; }
.grid .gsep { grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; color: var(--ink); opacity: 0.62; padding-top: 8px; }

@media (min-width: 900px) {
  /* Two columns. Nothing is pinned: the page scrolls as one, so every control stays reachable. */
  .work { flex-direction: row; align-items: flex-start; padding-bottom: 96px; }
  .stagecol { flex: 1.5; min-width: 0; }
  .stage { height: min(62vh, calc(100vh - 340px)); min-height: 300px; }
  .panel { flex: 1; max-width: 460px; padding-bottom: 0; }
  .sheet { align-items: center; }
  .sheet-card { border-radius: var(--r-card); }
}
