/* The eval site's one stylesheet. Light and quiet, in the Kuku Brand Book's
   colours: Kuku Indigo is the one accent, Kuku Yellow the main button, Kuku
   Cream behind the mascot. Values come from the Kuku app's tokens (kuku-social
   src/kuku/design-tokens.colors.ts, export kuku-design-tokens-260719) and name
   the token they mirror; values marked GAP have no Kuku token and are this
   site's own. Pages use classes only: no per-page styles. */

:root {
  /* Kuku brand (Brand Book v0.3) */
  --kuku-yellow: #FFDE3B;      /* Kuku Yellow, Brand/Primary/600 */
  --kuku-cream: #FEF79F;       /* Kuku Cream */
  --kuku-indigo: #4233BE;      /* Kuku Indigo, Neutral/Background/300 */
  --kuku-midnight: #241961;    /* Kuku Midnight */

  /* Neutral surfaces and text, all GAP: the app's neutrals are purples */
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F5F5F7;                 /* a grouped row: a fact, an option, a panel */
  --surface-sunk: #EDEDF1;              /* photo wells, tracks, tags */
  --surface-hover: #EBEBEF;
  --text: #1C1A29;
  --muted: #646175;                     /* 6.0:1 on white, 5.6:1 on --surface-2 */
  --stroke: #E6E6EB;                    /* dividers, card edges */
  --stroke-strong: #D4D3DD;             /* text fields, radio marks */
  --accent: var(--kuku-indigo);
  --accent-hover: #3729A6;              /* GAP */
  --accent-soft: #EFEDFC;               /* GAP: selected, current */
  --on-accent: #FFFFFF;
  --primary: var(--kuku-yellow);        /* the step's one call to action */
  --primary-hover: #F5D31F;             /* GAP */
  --on-primary: var(--kuku-midnight);   /* 11.9:1 on Kuku Yellow */
  --focus-ring: 0 0 0 3px rgba(66, 51, 190, .22); /* GAP */
  --error-bg: #FDF0F0;                  /* GAP */
  --error-text: #A1251F;                /* GAP: 6.7:1 on --error-bg */
  --error-stroke: #F1C6C3;              /* GAP */
  --draft-bg: var(--kuku-cream);
  --draft-text: #6B4E00;                /* GAP: 7.4:1 on Kuku Cream */
  --ok-bg: #EEF8F1;                     /* GAP */
  --ok-text: #146C2E;                   /* GAP: 6.4:1 on --ok-bg */
  --ok-stroke: #C9E7D3;                 /* GAP */

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;
  --page-pad: 32px;
  --tap: 44px;                          /* Apple's minimum touch target */
  --page: 1080px;
  --page-wide: 1180px;
  --column: 760px;                      /* the session's one reading column */
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  /* SF Pro Rounded where the system offers it (Safari, and every browser on
     iPhone); elsewhere the platform's own UI font. Apple's licence does not
     allow serving SF Pro from a website, so nothing is downloaded. */
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;

  /* Icons: masks, so each takes the colour of its text (generated, 24px grid) */
  --i-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");
  --i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.8 19.5h18.4z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E");
  --i-help: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.6 9.4a2.5 2.5 0 1 1 3.4 2.4c-.6.3-1 .8-1 1.5v.5M12 17h.01'/%3E%3C/svg%3E");
  --i-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5.5' width='18' height='13' rx='2.5'/%3E%3Cpath d='m3.8 7.2 8.2 5.8 8.2-5.8'/%3E%3C/svg%3E");
  --i-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E");
  --i-restart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5v5h5'/%3E%3Cpath d='M5.6 14.5A7 7 0 1 0 7 7.6L4 10'/%3E%3C/svg%3E");
  --i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  --i-skip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 6.5v11l8-5.5zM15 6.5v11M19 6.5v11'/%3E%3C/svg%3E");
  --i-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h13M12.5 6.5 18 12l-5.5 5.5'/%3E%3C/svg%3E");
  --i-arrow-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23241961' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h13M12.5 6.5 18 12l-5.5 5.5'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E");
  --i-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12.2 2.4 2.4 4.6-4.8'/%3E%3C/svg%3E");
  --i-person: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234233BE' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='9' r='3.6'/%3E%3Cpath d='M5.5 19.2c1.3-3 3.8-4.5 6.5-4.5s5.2 1.5 6.5 4.5'/%3E%3C/svg%3E");
  --i-review: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234233BE' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4.5' width='14' height='16' rx='2.5'/%3E%3Cpath d='M9 4.5V3.5h6v1M8.8 12.2l2 2 4.4-4.4M9 17.5h6'/%3E%3C/svg%3E");
  --i-people: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234233BE' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='9' r='3.2'/%3E%3Cpath d='M3.5 19c.9-2.9 3-4.4 5.5-4.4s4.6 1.5 5.5 4.4'/%3E%3Cpath d='M15.5 6.2a3 3 0 0 1 0 5.6M17.5 14.9c1.5.6 2.5 2 3 4.1'/%3E%3C/svg%3E");
  --i-session: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234233BE' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M10.2 8.6v6.8l5.3-3.4z'/%3E%3C/svg%3E");
}

/* Light only. A dark page changes how a photo reads. */

/* Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* component display rules must not unhide */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  font: 16px/1.5 var(--font); color: var(--text); background: var(--bg);
  overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
/* The Evaluator's pages speak in Kuku's voice: a button is the person speaking,
   so it is lowercase (kuku-social DESIGN.md, UX copy). */
.student button { text-transform: lowercase; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; text-wrap: balance; }
h1 { font-size: 2rem; letter-spacing: -.02em; line-height: 1.12; }
h2 { font-size: 1.3125rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .85em; text-wrap: pretty; }
a { color: var(--accent); font-weight: 600; text-underline-offset: 2px; }
img { max-width: 100%; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.notice:not(.working)::before, .contact::before, .topbar .chip::before, #restart::before, summary::before, .skip::before, .add::before {
  content: ""; display: inline-block; flex: none; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--i-info) center / contain no-repeat; mask: var(--i-info) center / contain no-repeat;
}

/* Page shell: a plain bar, then the page. */
.topbar {
  display: flex; align-items: center; gap: 24px;
  width: 100%; height: 60px; padding: 0 24px;
  background: rgba(255, 255, 255, .88); border-bottom: 1px solid var(--stroke);
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  position: sticky; top: 0; z-index: 2;
  overflow-wrap: normal; white-space: nowrap;
}
.topbar p { margin: 0; }
/* The session's progress, as a line of Kuku Indigo along the foot of the bar. */
.bar { height: 2px; }
.bar > span {
  display: block; height: 100%; width: 0; border-radius: 0 2px 2px 0; transition: width .6s var(--ease-out);
  background: var(--accent);
}
.brand { flex: none; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; color: var(--text); text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted); font-size: .9375rem; font-weight: 500; text-decoration: none; }
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topbar .chip, .topbar #signout { margin-left: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 12px;
  border-radius: var(--radius-full); background: var(--surface-2);
  font-size: .8125rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums;
}
.chip:empty { display: none; }
/* In the bar the chip can be a long sentence (a walkthrough); it ends in an ellipsis. */
.topbar .chip { display: block; min-width: 0; max-width: 52vw; line-height: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .chip::before { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; -webkit-mask-image: var(--i-clock); mask-image: var(--i-clock); }
.topbar .chip:not(:has(+ #restart))::before { display: none; } /* only the session's chip is a clock */
.page { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 32px var(--page-pad) 80px; }
.page-wide { max-width: var(--page-wide); }
.page-center { display: block; }

/* Cards: a hairline edge, no shadow. */
.card, .stack > section, .stack > div {
  background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-lg);
  padding: 24px 28px;
}
.card > :last-child { margin-bottom: 0; }
.card section { border-top: 1px solid var(--stroke); margin-top: 28px; padding-top: 24px; }
.stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack > * { grid-column: 1 / -1; }
.stack > section, .stack > div { margin: 0; }
.stack > section > :last-child, .stack > div > :last-child { margin-bottom: 0; }
/* A heading with no body is a label for the cards under it, not a card of its own. */
.stack > section:has(> h2:only-child) {
  background: none; border: 0; padding: 12px 2px 0; border-radius: 0;
}
.hero { max-width: none; text-align: left; }
.mascot { display: block; width: 64px; height: auto; margin: 0 0 12px; image-rendering: pixelated; }

/* Home: the Kuku app icon (the one in the bar), the title, and a row per place to go. */
.home { display: grid; align-content: start; justify-items: center; padding-top: 64px; }
.home-card { width: 100%; max-width: 560px; text-align: center; animation: rise .5s var(--ease-out) both; }
.home-card:has(.destination + .destination) { max-width: 880px; }
.home-logo { display: block; width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 27px; }
.home-card h1 { font-size: 2.25rem; margin-bottom: 8px; }
.home-card #status { margin: 0 auto 24px; max-width: 46ch; }
.home-card #signin:not(.destinations) { display: flex; justify-content: center; min-height: 44px; }
.destinations { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; text-align: left; }
.destination {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 148px; padding: 20px 20px 18px;
  border-radius: var(--radius-lg); background: var(--surface-2);
  color: var(--text); text-decoration: none; font-weight: 500;
  transition: background-color .2s var(--ease-out);
}
.destination:hover { background: var(--surface-hover); }
.destination::before {
  content: ""; width: 40px; height: 40px; margin-bottom: 10px; border-radius: 12px;
  background: var(--surface) var(--i-session) center / 22px no-repeat;
}
.destination[href^="/review"]::before { background-image: var(--i-review); }
.destination[href^="/admin"]::before { background-image: var(--i-people); }
.destination[href^="/tasks"]::before { background-image: var(--i-ok); }
.destination strong { font-size: 1.0625rem; font-weight: 700; }
.destination span { color: var(--muted); font-weight: 400; font-size: .9375rem; padding-right: 36px; }
.destination::after {
  content: ""; position: absolute; right: 16px; bottom: 16px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent) var(--i-arrow) center / 15px no-repeat; transition: transform .3s var(--ease-out);
}
.destination:hover::after { transform: translateX(3px); }
/* One place to go (an Evaluator's session): a single wide row. */
.destinations:has(> .destination:only-child) { grid-template-columns: 1fr; }
.destination:only-child { min-height: 0; padding: 20px 64px 20px 76px; justify-content: center; }
.destination:only-child::before { position: absolute; left: 20px; top: 50%; margin: 0; transform: translateY(-50%); }
.destination:only-child::after { top: 50%; bottom: auto; transform: translateY(-50%); }
.destination:only-child:hover::after { transform: translate(3px, -50%); }

/* Session: the steps run across the top as a numbered track, the task below in
   one column on the page itself, with no frame around it. */
.workspace { display: grid; gap: 32px; align-items: start; }
.workspace > .steps, .workspace > #view { width: 100%; max-width: var(--column); justify-self: center; }
/* A fixture item keeps its photo beside the ratings on a wide screen. */
.workspace > #view:has(.split) { max-width: 1040px; }
.steps:empty { display: none; }
.steps { margin: 0; padding: 4px 0 0; }
.steps ol { list-style: none; display: flex; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 36px 4px 0; text-align: center; line-height: 1.3; counter-increment: step;
  font-size: .8125rem; font-weight: 500; color: var(--muted); overflow-wrap: normal;
}
.steps li::before {
  content: counter(step); position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface-sunk);
  font-size: .75rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums;
  transition: background-color .3s var(--ease-out);
}
.steps li + li::after { content: ""; position: absolute; top: 12.5px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 1px; background: var(--stroke); }
.steps li.is-done { color: var(--text); }
.steps li.is-done::before { content: ""; background: var(--accent) var(--i-check) center / 13px no-repeat; }
.steps li.is-done + li::after { background: var(--accent); }
.steps li.is-current { color: var(--text); font-weight: 700; }
.steps li.is-current::before { color: var(--on-accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.steps li small { font-size: .75rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps-note { margin: 14px 0 0; font-size: .8125rem; line-height: 1.5; color: var(--muted); text-align: center; }

/* The task: a small Indigo line naming the step, a large title and its counter. */
.workspace #view.card { position: relative; padding: 0; border: 0; border-radius: 0; background: none; }
.workspace #view[data-eyebrow]::before {
  content: attr(data-eyebrow); display: block; margin: 0 0 8px;
  color: var(--accent); font-size: .875rem; font-weight: 600;
}
.workspace #view[data-eyebrow=""]::before { display: none; }
.workspace #view > h2 { font-size: 2rem; letter-spacing: -.02em; line-height: 1.12; margin-bottom: .5em; }
.workspace #view > h2 + .counter {
  display: inline-block; margin: 0 0 18px; padding: 4px 12px; border-radius: var(--radius-full);
  background: var(--surface-2); color: var(--text); font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
/* Running text keeps a readable measure. */
#view > p:not([class]), #view > .muted, .card section > p.muted { max-width: 68ch; }
.workspace #view > p:not([class]) { font-size: 1.0625rem; }
/* A section of the task is one grouped panel. */
.workspace #view > section:not(.actions) {
  margin: 16px 0 0; padding: 20px 22px; border: 0; border-radius: var(--radius-lg); background: var(--surface-2);
}
.workspace #view > section:not(.actions) > :last-child { margin-bottom: 0; }

/* Buttons: a filled pill. The step's call to action is Kuku Yellow. */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 8px 18px; border-radius: var(--radius-full);
  font: inherit; font-size: .9375rem; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
  color: var(--text); background: var(--btn-bg, var(--surface-2)); border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out), box-shadow .2s var(--ease-out), transform .12s var(--ease-out);
}
button:hover:not(:disabled), .button:hover { background: var(--surface-hover); }
/* On a grouped (grey) panel a button is white, so it still reads as a button. */
.workspace #view > section:not(.actions), .game, details { --btn-bg: var(--surface); }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary, .button.primary {
  padding: 8px 22px; background: var(--primary); border-color: var(--primary); color: var(--on-primary);
}
button.primary:hover:not(:disabled), .button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
/* The step's call to action carries its own arrow. */
.workspace #view .primary:not(.picks .primary) { min-height: 50px; padding: 6px 7px 6px 24px; gap: 14px; font-size: 1rem; font-weight: 700; }
.workspace #view .primary:not(.picks .primary)::after {
  content: ""; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(36, 25, 97, .1) var(--i-arrow-dark) center / 16px no-repeat; transition: transform .3s var(--ease-out);
}
.workspace #view .primary:not(.picks .primary):hover:not(:disabled)::after { transform: translateX(3px); }
/* A two-click button (restart, revoke, delete) once armed. */
button[data-armed="1"] { color: var(--error-text); background: var(--error-bg); border-color: var(--error-stroke); }
button[data-armed="1"]:hover:not(:disabled) { color: var(--error-text); background: var(--error-bg); border-color: var(--error-text); }
#restart::before { width: 15px; height: 15px; -webkit-mask-image: var(--i-restart); mask-image: var(--i-restart); }
/* Skip is for walkthroughs only: it looks like a debug control, not a step. */
.skip { border: 1px dashed var(--stroke-strong); background: transparent; color: var(--muted); font-size: .8125rem; }
.skip::before { width: 15px; height: 15px; -webkit-mask-image: var(--i-skip); mask-image: var(--i-skip); }
.skip:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
#view > .skip { margin-top: 16px; }
.add::before { width: 15px; height: 15px; -webkit-mask-image: var(--i-plus); mask-image: var(--i-plus); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.invite-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.invite-line label { flex: 1 1 280px; font-size: .875rem; font-weight: 500; }
.invite-line input, .invite-line select { margin: 6px 0 0; }
.card section.actions, .workspace #view > section.actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 28px 0 0; padding: 22px 0 0; border-top: 1px solid var(--stroke);
}

/* Answers. An option is a filled row with a mark that fills when it is picked. */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices button { justify-content: flex-start; gap: 10px; padding: 8px 18px 8px 14px; white-space: nowrap; }
.choices button::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--stroke-strong); background: var(--surface);
  transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out);
}
.choices button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.choices button.on:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.choices button.on::before { border-color: var(--accent); background: var(--accent) var(--i-check) center / 11px no-repeat; }
.choices.options { display: grid; width: 100%; grid-template-columns: 1fr; }
@media (min-width: 800px) { .choices.options { grid-template-columns: 1fr 1fr; } }
.choices.options button { white-space: normal; text-align: left; padding: 12px 18px 12px 14px; border-radius: var(--radius-md); }
/* A fact's marks: a segmented control. */
.mark .choices { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; border-radius: var(--radius-full); background: var(--surface-sunk); }
.mark .choices button { justify-content: center; min-height: 38px; padding: 5px 16px; border: 0; background: transparent; color: var(--muted); }
.mark .choices button::before { content: none; }
.mark .choices button:hover:not(:disabled) { background: rgba(255, 255, 255, .8); color: var(--text); }
.mark .choices button.on, .mark .choices button.on:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); }
/* The 1-5 scale: big tiles. */
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.scale button { min-height: 56px; padding: 10px 0; border-radius: var(--radius-md); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.scale button.on, .scale button.on:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.scale-ends { display: flex; justify-content: space-between; margin: 8px 2px 20px; font-size: .8125rem; }

/* Notices */
.notice {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 12px 14px;
  border-radius: var(--radius-md); background: var(--surface-2); font-size: .9375rem;
}
.notice:not(.working)::before { margin-top: 2px; }
.notice-error { border: 1px solid var(--error-stroke); background: var(--error-bg); color: var(--error-text); font-weight: 500; }
.notice-error::before { -webkit-mask-image: var(--i-alert); mask-image: var(--i-alert); }
.draft {
  display: inline-block; margin: 0 0 12px; padding: 2px 10px; border-radius: var(--radius-full);
  background: var(--draft-bg); color: var(--draft-text); font-size: .75rem; font-weight: 700;
}
.status { display: flex; align-items: center; gap: 10px; min-height: 1.5em; margin: 8px 0 0; font-size: .875rem; }
.status .meter { flex: 1; margin: 0; }
.status:empty { min-height: 0; margin: 0; }
.working::before, .status:not(:empty)::before {
  content: ""; flex: none; display: inline-block; width: .95em; height: .95em; margin: .25em 0 0; vertical-align: -.1em;
  border: 2px solid var(--stroke); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
.status:not(:empty)::before { margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.meter { height: 6px; margin: 8px 0 10px; border-radius: var(--radius-full); background: var(--surface-sunk); overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .4s var(--ease-out); background: var(--accent); }
.meter.busy > span { width: 35%; transition: none; animation: meter-slide 1.2s ease-in-out infinite; }
@keyframes meter-slide { from { transform: translateX(-110%); } to { transform: translateX(320%); } }
.contact { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: .875rem; }
.contact::before { width: 16px; height: 16px; -webkit-mask-image: var(--i-mail); mask-image: var(--i-mail); }

/* Forms */
.agree {
  display: flex; align-items: flex-start; gap: 12px; margin: 24px 0 20px; padding: 16px 18px;
  border: 1px solid transparent; border-radius: var(--radius-lg); background: var(--surface-2); font-weight: 600;
  transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out);
}
.agree:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.agree input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.agree label { cursor: pointer; }
textarea, input[type="email"], input[type="text"], input[type="date"], input:not([type]), select {
  display: block; width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--stroke-strong); border-radius: var(--radius-md);
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
textarea { min-height: 4.75rem; margin: 0 0 12px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
/* Text fields (the /admin invite box), in the same language as textarea */
input[type="email"], input[type="text"], input[type="date"], input:not([type]), select { min-height: var(--tap); margin: 8px 0 12px; padding: 8px 12px; }
textarea::placeholder, input::placeholder { color: var(--muted); }
textarea:hover, input:hover, select:hover { border-color: #C2C1CD; }
textarea:focus, input[type="email"]:focus, input[type="text"]:focus, input[type="date"]:focus, input:not([type]):focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
}

/* Photo grid (uploads) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; margin: 14px 0 16px; }
.grid:empty { display: none; }
.thumb { position: relative; }
.thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-md); background: var(--surface-sunk); }
.thumb button {
  position: absolute; top: 0; right: 0; width: var(--tap); height: var(--tap); min-height: 0; padding: 0;
  border: 0; background: transparent; color: #fff; font-size: 1rem; isolation: isolate;
}
.thumb button:hover:not(:disabled) { background: transparent; }
.thumb button::before {
  content: ""; position: absolute; inset: 8px; z-index: -1; border-radius: 50%; background: rgba(0, 0, 0, .6); /* Neutral/Surface/a65 */
}

/* Stated-fact rating: each fact a grouped row, its three marks side by side (they wrap when narrow). */
.fact {
  display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px;
  margin: 0 0 12px; padding: 18px 22px 20px; border-radius: var(--radius-lg); background: var(--surface-2);
}
.fact > :first-child { margin-right: 10px; font-size: 1.0625rem; font-weight: 700; }
.fact::before { content: ""; flex-basis: 100%; order: 2; }
.fact .mark { order: 3; margin: 8px 32px 0 0; }
.mark p { margin: 0 0 6px; font-size: .8125rem; }
.fact .kind {
  order: 1; padding: 1px 8px; border-radius: var(--radius-full);
  background: var(--surface); color: var(--muted); font-size: .75rem; font-weight: 600;
}
.card .fact + section { margin-top: 24px; }

/* A screen led by the mascot (waiting, done) is a centred status message. */
#view:has(> .mascot) { text-align: center; padding-block: 24px 16px; }
#view:has(> .mascot) > *, #view:has(> .mascot) > p:not([class]) { max-width: 560px; margin-inline: auto; }
#view:has(> .mascot) .contact, #view:has(> .mascot) .notice { justify-content: center; }
#view > .mascot, .notice-waiting .mascot {
  width: 104px; margin: 0 auto 18px; padding: 16px; border-radius: 50%; background: var(--kuku-cream);
}
#view:has(> .mascot) .meter { margin-inline: auto; }
.notice-waiting { text-align: center; padding: 24px 16px; }
.notice-waiting h2 { text-align: center; }

/* What a Guess What is: the example and its guess */
details { margin: 0 0 20px; border-radius: var(--radius-lg); background: var(--surface-2); }
summary { min-height: var(--tap); display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: .9375rem; font-weight: 600; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { color: var(--accent); -webkit-mask-image: var(--i-help); mask-image: var(--i-help); }
summary::after {
  content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform .25s var(--ease-out);
}
details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
details[open] summary { border-bottom: 1px solid var(--stroke); }
details > .gw { padding: 16px; }
.gw-photo { display: block; width: 100%; max-width: 420px; margin: 4px 0 12px; border-radius: var(--radius-lg); object-fit: cover; aspect-ratio: 3 / 2; background: var(--surface-sunk); }
.question { margin: 0 0 12px; font-size: 1.1875rem; font-weight: 700; line-height: 1.3; }
.gw-replies { display: grid; width: 100%; grid-template-columns: 1fr; margin-bottom: 12px; }
@media (min-width: 600px) { .gw-replies { grid-template-columns: repeat(3, 1fr); } }
.gw-replies button { white-space: normal; }
.gw-result { margin: 0 0 12px; font-weight: 600; }

/* A Pair: the photo, two game cards, the pick */
.counter { margin: -6px 0 16px; font-size: .875rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.photo {
  display: block; width: auto; max-width: 100%; max-height: 460px; margin: 4px auto 24px; border-radius: var(--radius-xl);
  background: var(--surface-sunk);
}
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 4px; }
@media (max-width: 480px) { .pair { grid-template-columns: 1fr; } }
.game { padding: 20px 22px; border-radius: var(--radius-lg); background: var(--surface-2); }
.game-label {
  display: inline-block; margin-bottom: 10px; padding: 3px 10px; border-radius: var(--radius-full);
  background: var(--surface); color: var(--muted); font-size: .75rem; font-weight: 700;
}
.game .question { font-size: 1.125rem; }
.game ol { margin: 0; padding-left: 1.4em; }
.game li { margin: 4px 0; }
.game li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
/* What is wrong, then what they would send, in two groups. */
.critique { display: grid; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--stroke); }
/* The two Profile Reads (ALGO-148): each read's copy and its questions, in a .game card. */
.read .mark { margin: 0 0 14px; }
.read-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.read-tags span { padding: 2px 10px; border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent); font-size: .875rem; }
.sentence { margin: 0 0 4px; padding: 10px 0 0; border-top: 1px solid var(--stroke); }
.sentence > p { margin: 0 0 6px; }
.read textarea { width: 100%; }
.wrong-note { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }
.wrong-note[hidden] { display: none; }
.critique .ask:nth-child(3) { margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--stroke); }
.ask { display: flex; flex-direction: column; gap: 6px; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.ask textarea, .ask input { width: 100%; margin: 0; color: var(--text); }
.ask textarea { min-height: 3.75rem; }
/* The pick: the two options equal and No difference between them. */
.picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 24px 0 0; }
.picks button { min-height: 52px; padding: 10px 6px; border-radius: var(--radius-md); font-size: .9375rem; font-weight: 700; }

/* A fixture item: a game as a receiver sees it, then its two ratings. On a wide
   screen the photo stays in view beside the ratings. */
@media (min-width: 1100px) {
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .split-media { position: sticky; top: 92px; }
  .split-media .photo { max-height: calc(100vh - 124px); margin: 0 auto; }
  .split-body > section:not(.actions) { margin-top: 24px; padding-top: 0; border-top: 0; }
}
.replies { margin: 0; padding-left: 1.2em; }
.replies li { margin: 4px 0; }
.split-body h3, .card section > div > h3 { margin-top: 22px; }
.split-body section > h3:first-child { margin-top: 0; }

/* Admin: a page header, the two status panels side by side, then one card per person. */
.page-head { margin: 4px 0 24px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
@media (min-width: 900px) { .stack > .panel { grid-column: auto; } }
.stack > section > h2, .stack > div > h2 { font-size: 1.125rem; }
/* A label row above a group of cards: "Evaluators (4)" and its Show revoked toggle, or "Internal reviewers (1)" and its note. */
.stack > .group {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px;
  background: none; border: 0; padding: 12px 2px 0; border-radius: 0;
}
.stack > .group > :not(h2, .toggle) { grid-column: 1 / -1; }
.stack > .group > h2 { margin: 0 0 2px; font-size: 1.3125rem; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 500; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input {
  appearance: none; position: relative; flex: none; width: 40px; height: 24px; margin: 0; border-radius: var(--radius-full);
  background: var(--stroke-strong); cursor: pointer; transition: background-color .2s var(--ease-out);
}
.toggle input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(28, 26, 41, .25); transition: transform .2s var(--ease-out);
}
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); }
/* In a status panel, a plain notice is the good news. */
.panel .notice:not(.notice-error) { border: 1px solid var(--ok-stroke); background: var(--ok-bg); color: var(--ok-text); font-weight: 500; }
.panel .notice:not(.notice-error)::before { -webkit-mask-image: var(--i-ok); mask-image: var(--i-ok); }

.person { padding: 22px 26px 24px; }
.person-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.person > h3, .person-head h3 { min-width: 0; display: flex; align-items: center; gap: 12px; margin: 0; font-size: 1.125rem; font-weight: 700; }
.person > h3::before, .person-head h3::before {
  content: ""; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-soft) var(--i-person) center / 18px no-repeat;
}
.person-head button { flex: none; white-space: nowrap; min-height: 36px; padding: 4px 14px; font-size: .8125rem; color: var(--error-text); border-color: var(--error-stroke); background: transparent; }
.person-head button:hover:not(:disabled) { background: var(--error-bg); border-color: var(--error-text); }
.person > .notice { margin-bottom: 12px; }
.person > p.muted { margin: 0; font-size: .875rem; }
.person.is-revoked { background: var(--surface-2); border-style: dashed; }
.person.is-revoked .stats { opacity: .75; }
/* A person's numbers: a plain grid, no box inside the card. */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 20px; margin: 0 0 14px; padding: 0; }
.stats div { min-width: 0; }
.stats dt { margin: 0; font-size: .75rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.stats dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Payments: title and total on the left, Add payment on the right, then the table and the form. */
.payments { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--stroke); }
.payments > * { grid-column: 1 / -1; }
.payments > .pay-title { grid-column: 1; margin: 0; padding: 0; border: 0; }
.payments > .pay-title + p { grid-column: 1; margin: 2px 0 0; font-size: .875rem; }
.payments > button:last-child { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
.pay { width: 100%; border-collapse: collapse; margin: 14px 0 0; font-size: .875rem; font-variant-numeric: tabular-nums; }
.pay th, .pay td { text-align: left; padding: 9px 14px 9px 0; vertical-align: middle; }
.pay th { font-size: .75rem; font-weight: 500; color: var(--muted); }
.pay td { border-top: 1px solid var(--stroke); }
.pay .button-row { margin: 0; justify-content: flex-end; flex-wrap: nowrap; }
.pay button { min-height: 32px; padding: 4px 12px; font-size: .8125rem; }
.pay-form { display: grid; grid-template-columns: 8rem 9rem 11rem minmax(0, 1fr); gap: 10px 12px; align-items: start; margin: 14px 0 0; padding: 16px 0 0; border-top: 1px solid var(--stroke); }
.pay-form label { display: grid; gap: 4px; font-size: .75rem; font-weight: 500; color: var(--muted); }
.pay-form .span-2 { grid-column: span 2; }
.pay-form .pay-actions { grid-column: 1 / -1; margin: 0; }
.pay-form input, .pay-form select { margin: 0; width: 100%; height: var(--tap); }
.signin { display: flex; justify-content: flex-start; min-height: var(--tap); margin-bottom: 12px; }

/* Entry: each new item rises in. Waiting screens refresh every few seconds, so they stay still. */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.workspace #view > * { animation: rise .4s var(--ease-out) both; }
.workspace #view > :nth-child(2) { animation-delay: .03s; }
.workspace #view > :nth-child(3) { animation-delay: .06s; }
.workspace #view > :nth-child(4) { animation-delay: .09s; }
.workspace #view > :nth-child(n+5) { animation-delay: .12s; }
.workspace #view:has(> .mascot) > *, .workspace #view:has(> .notice-waiting) > * { animation: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* A phone: tighter gutters, the bar keeps only the brand, the chip and the button,
   and the step track keeps its markers and the current label. */
@media (max-width: 720px) {
  :root { --page-pad: 16px; }
  .topbar { gap: 12px; padding: 0 16px; }
  /* The brand keeps only its icon, so the active-time chip fits beside restart. */
  .topbar .brand { font-size: 0; gap: 0; }
  .topbar .chip { max-width: none; }
  .topnav { display: none; }
  .card, .stack > section, .stack > div { padding: 20px 18px; }
  .page { padding-top: 24px; }
  .workspace { gap: 24px; }
  .workspace #view > h2 { font-size: 1.625rem; }
  .steps li { font-size: 0; padding-top: 30px; }
  .steps li.is-current { font-size: .75rem; }
  .steps li small { display: none; }
  .workspace #view > section:not(.actions) { padding: 18px; }
  .fact { padding: 16px; }
  .fact .mark { width: 100%; margin-right: 0; }
  .mark .choices { display: flex; }
  .mark .choices button { flex: 1 1 0; min-width: 0; padding: 5px 6px; white-space: normal; }
  .person { padding: 18px; }
  .pay { display: block; overflow-x: auto; white-space: nowrap; }
  .pay-form { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-form .span-2 { grid-column: 1 / -1; }
  .home { padding-top: 32px; }
  .home-card h1 { font-size: 2rem; }
}

/* Narrower still (a 320px phone, or restart armed): the chip takes two lines, so the
   minutes stay visible. */
@media (max-width: 380px) {
  .topbar .chip { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; line-height: 1.2; padding: 4px 10px; border-radius: 12px; }
}
/* While restart waits for its second click on a phone, its prompt takes the bar. */
@media (max-width: 720px) {
  .topbar:has(#restart[data-armed="1"]) .chip { display: none; }
  .topbar:has(#restart[data-armed="1"]) #restart { margin-left: auto; }
}
