/*
 * The information page's structure (latentarena.ctgt.ai, site/styles.css): its ink and paper, Switzer
 * Light for the large titles and numbers, and hairline frames and rules. Interface text is Archivo, as on
 * the probe challenge. The color is the app's own sage and forest green with a soft sage and sand wash
 * behind the sign-in and statement pages, carried over from the earlier app design; signed-in pages are
 * flat. Cards are white, with hairline borders and small corners.
 */
@font-face {
  font-family: Switzer;
  src: url('fonts/Switzer-Light.otf') format('opentype');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: Switzer;
  src: url('fonts/Switzer-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Switzer;
  src: url('fonts/Switzer-Medium.otf') format('opentype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Archivo;
  src: url('fonts/Archivo-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Archivo;
  src: url('fonts/Archivo-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
/* The wordmark and large numbers stay Switzer Light, as on the information page. */
.wordmark, .card-value, .stat-value span:first-child, .card-time, .budget-number, .probe-number,
.result-outcome {
  font-family: Switzer, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
:root {
  color-scheme: light;
  font-family: Archivo, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Neutrals from one sage-tinted gray scale (Radix Colors sage), so grays sit with the greens. Paper is
     behind the sign-in and statement pages; signed-in pages are white with a sage sidebar. */
  --paper: #f6f6f6;
  --ink: #1a211e;
  --ink-2: #5f6563;
  --line: #dfe2e0;
  --line-strong: #cbcfcd;
  --subtle: #f7f9f8;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  /* Five type sizes, one job each; no rule sets a size outside them. Display is Switzer Light for large
     numbers; titles are Archivo Medium, as working dashboards set them; headings share the body size and
     differ by weight. Sizes a pixel or two apart read as mistakes, not hierarchy. */
  --text-display: 32px;
  --text-title: 24px;
  --text-heading: 16px;
  --text-body: 16px;
  --text-ui: 14px;
  --text-caption: 12px;
  --tracking-display: -.04em;
  --tracking-heading: -.01em;
  /* The app's greens: sage fills, forest text and marks on them, and a muted green for focus and hover,
     between the sage and the information page's brighter #0ca678. */
  --accent-soft: #dfe9e3;
  --action: #344c3d;
  --accent: #4b8b6d;
  --accent-tint: #eef5f1;
  /* The wash behind the sign-in and statement pages, soft enough that the hairline frames still read. */
  --glow-sage: rgba(150, 192, 174, .55);
  --glow-sand: rgba(228, 206, 160, .55);
  /* Cards and fields are white; hover and selected fills carry a trace of sage. */
  --surface: #ffffff;
  --field: #ffffff;
  --wash: #eef1f0;
  /* Secondary buttons are filled, one step darker than the hover wash, so they read as buttons without
     competing with the green of a form's submit. */
  --tonal: #e6e9e8;
  --tonal-strong: #dadedc;
  --danger: #96382d;
  /* Square corners throughout; rounded cards and buttons read as a template. */
  --radius: 0;
  /* Control heights: compact under a mouse, as working dashboards are, and back to 44px for touch. */
  --control: 36px;
  /* The phone bar's height, which the open menu fills the rest of the screen below. */
  --bar-height: 61px;
  --control-small: 32px;
  /* Older names, kept so the page scripts' class names read the same. */
  --muted: var(--ink-2);
  --border: var(--line);
  --primary: var(--ink);
  --secondary-soft: var(--accent-soft);
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: var(--text-body); line-height: 1.6; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, strong { font-weight: 500; }
h1 {
  margin: 0 0 12px; font-size: var(--text-title); line-height: 1.25; letter-spacing: var(--tracking-heading);
}
h2 {
  margin: 0 0 12px; font-size: var(--text-heading); line-height: 1.3; letter-spacing: var(--tracking-heading);
}
h3 { font-size: var(--text-heading); }
p { margin: 0 0 16px; }
::selection { background: var(--accent-soft); }
a {
  color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px; text-underline-offset: .2em;
  transition: color 150ms var(--ease), text-decoration-color 150ms var(--ease);
}
a:hover { color: var(--action); text-decoration-color: currentColor; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[tabindex='-1']:focus { outline: none; }
[hidden] { display: none !important; }

/* Application shell and focused authentication pages. */
.app-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { padding: 24px 16px; display: flex; flex-direction: column; gap: 32px; }
.nav { display: grid; gap: 2px; }
.nav-link {
  display: block; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--radius);
  text-align: left; background: transparent; color: var(--ink-2); text-decoration: none; width: 100%;
  font-weight: 400;
}
.nav-link:hover { background: var(--wash); color: var(--ink); }
.nav-link[aria-current] { background: var(--accent-soft); color: var(--action); font-weight: 500; }
.workspace { min-width: 0; background: transparent; margin: 0; }
.content { max-width: 1120px; margin: 0 auto; padding: 40px 32px 64px; }
.panel > p { max-width: 660px; }
.muted { color: var(--ink-2); }
.auth-header { display: none; }

/* Signed-out and registration screens: a white card on the sage and sand wash, with no application chrome. */
.app-layout.is-focused, .rules-page {
  display: flex; flex-direction: column; min-height: 100dvh; padding: 20px 24px;
  background:
    radial-gradient(65% 60% at 22% 85%, var(--glow-sage), transparent 72%),
    radial-gradient(60% 58% at 76% 72%, var(--glow-sand), transparent 72%),
    var(--paper);
}
.is-focused a { color: var(--ink); }
.is-focused .auth-header { display: flex; align-items: center; gap: 10px; min-height: 44px; }
#auth-header { justify-content: space-between; gap: 16px; }
/* Light and tight, as the information page's wordmark is. */
.wordmark {
  font-size: var(--text-title); font-weight: 300; letter-spacing: -.045em; line-height: 1; color: var(--ink);
}
.auth-role { font-size: var(--text-ui); color: var(--ink-2); }
.is-focused #logout {
  display: flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none;
  color: var(--ink-2); font-size: var(--text-ui); font-weight: 400;
}
.is-focused .workspace {
  flex: 1 1 auto; display: flex; margin: 0; border: 0; border-radius: 0; background: none;
}
.is-focused .content {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: none; margin: 0; padding: 32px 0 96px;
}
.is-focused .content:has(#signup:not([hidden])) { padding: 24px 0; }
/* White on the wash, framed by a hairline rather than a shadow. */
.is-focused .panel {
  display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 440px; padding: 28px 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.is-focused #accept { margin-top: 12px; }
.is-focused #invitation strong { color: var(--ink); overflow-wrap: anywhere; }
.is-focused .panel .auth-foot {
  display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px;
  color: var(--ink-2); font-size: var(--text-ui);
}
.is-focused .auth-foot a { color: var(--ink-2); }
.is-focused #signup, .is-focused #signup .form-stack { gap: 18px; }
.is-focused .panel p { margin: 0; }
.is-focused .muted { color: var(--ink-2); }
.is-focused h1 {
  margin: 0; font-size: var(--text-title); font-weight: 500; letter-spacing: var(--tracking-heading);
}
.is-focused .form-stack { display: flex; flex-direction: column; gap: 20px; margin: 0; max-width: none; }
.auth-icon, .is-focused .panel .round-button {
  display: flex; align-items: center; justify-content: center; background: var(--wash);
}
.auth-icon { width: 52px; height: 52px; background: var(--accent-soft); color: var(--action); }
.auth-heading { display: flex; flex-direction: column; gap: 4px; }
.auth-heading strong { color: var(--ink); overflow-wrap: anywhere; }
.is-focused .field { gap: 6px; }
.is-focused label:not(.checkbox) { font-size: var(--text-ui); color: var(--ink-2); }
.is-focused input:not([type='checkbox']) {
  height: 48px; padding: 0 14px; border-color: var(--line-strong); border-radius: var(--radius);
  font-size: var(--text-body);
}
.is-focused input:focus-visible { outline-width: 2px; outline-offset: 1px; }
.is-focused .panel button {
  width: 100%; min-height: 48px; border: 0; border-radius: var(--radius); font-size: var(--text-body);
}
.is-focused .panel .round-button {
  width: 44px; min-height: 44px; height: 44px; padding: 0;
}
.pill-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.pill-field legend {
  margin-bottom: 6px; padding: 0; font-size: var(--text-ui); font-weight: 500; color: var(--ink-2);
}
.pills { display: flex; gap: 8px; }
.is-focused .pill {
  position: relative; flex: 1 1 0; display: flex; align-items: center; justify-content: center;
  min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field);
  color: var(--ink); font-weight: 400; cursor: pointer;
}
/* The page's green rather than the primary black, so a chosen answer never reads as a button. */
.is-focused .pill:has(input:checked) {
  border-color: var(--action); background: var(--accent-soft); color: var(--ink); font-weight: 500;
}
.is-focused .pill:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The native radio stays over the whole pill, so validation bubbles and clicks land on the real control. */
.is-focused .pill input {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0;
  opacity: 0; cursor: pointer;
}
.is-focused .checkbox {
  gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--field); font-size: var(--text-ui); color: var(--ink);
}
.is-focused .checkbox input { flex: 0 0 20px; width: 20px; height: 20px; margin: 1px 0 0; }
.code-boxes { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.is-focused .code-boxes input {
  height: 54px; padding: 0; text-align: center; font-size: var(--text-heading);
}
.code-actions { display: flex; justify-content: center; }
.is-focused .code-actions button {
  width: auto; min-height: 44px; padding: 0 14px; background: none; color: var(--ink-2);
  font-size: var(--text-ui); font-weight: 400; text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: .2em;
}
.is-focused .dev-notice {
  width: 100%; max-width: 440px; margin: 0 0 16px; padding: 0; border: 0; font-size: var(--text-ui);
  text-align: center;
}
.is-focused .notice-box { width: 100%; max-width: 440px; }
.is-focused #notice { width: 100%; max-width: 440px; font-size: var(--text-ui); }
.is-focused #notice:not(:empty) { margin-bottom: 16px; }
/* Keeps quiet text in the accessibility tree without letting it move the card. */
/* :not(:empty) matches the visible notice rule, which would otherwise restore its padding and border. */
.sr-only, #notice[data-quiet='true'], #notice[data-quiet='true']:not(:empty) {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}


/* Forms, feedback and resource lists. */
.form-stack { display: grid; gap: 12px; margin: 24px 0; max-width: 460px; }
.field { display: grid; gap: 8px; }
label { font-weight: 500; }
/* Signed in, labels, field help and one-line statuses are interface text, not reading text. */
.shell-layout:not(.is-focused) :is(label, .field .muted, .admin-page > p.muted, .play-actions .muted) {
  font-size: var(--text-ui);
}
.shell-layout:not(.is-focused) .field .muted { margin: 0; }
.admin-page > p.muted { margin: 0 0 12px; }
input:not([type='checkbox']), select, textarea {
  min-width: 0; width: 100%; min-height: var(--control); padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius); color: inherit; background: var(--field); font-size: var(--text-ui);
}
textarea { resize: vertical; }
input[type='checkbox'] {
  width: 18px; height: 18px; accent-color: var(--action); vertical-align: middle; margin: 0 8px 0 0;
}
/* Forest green fills only the button that submits a page's form: sign-in, Send invitation, Save bundle,
   Save probe, Score prompt. Every other action, toggles, exports, navigation, refresh and actions inside
   table rows, is a white secondary button, and red appears only inside confirmations and row menus. */
button, .button {
  min-height: var(--control); padding: 0 14px; border: 1px solid var(--action); border-radius: var(--radius);
  background: var(--action); color: white; cursor: pointer; width: fit-content; font-size: var(--text-ui);
  font-weight: 500;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
button:not(.secondary, .nav-link, .text-button):hover { background: #2b4033; }
button.secondary, .button.secondary {
  border-color: transparent; background: var(--tonal); color: var(--ink);
}
button.secondary:hover, .button.secondary:hover { background: var(--tonal-strong); }
/* Disabled for a reason: faded, with a plain cursor. Controls held only while a request runs (data-held)
   keep their own look, even a radio invisible over its tile; the pressed button carries the progress. */
button:disabled:not([data-held]), input:disabled:not([data-held]), select:disabled:not([data-held]),
textarea:disabled:not([data-held]) { opacity: .55; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: default; }
/* Once a request has run long enough to notice, the pressed button shows a spinner before its label, which
   still says what is happening; quick requests show nothing. An icon button turns its own icon instead. */
button[data-pending]:not(.nav-link, .text-button, .menu-trigger, .refresh-button)::before {
  content: ""; display: inline-block; box-sizing: border-box; width: 0; height: 14px; margin-right: 0;
  vertical-align: -2px; border: 0 solid currentColor; border-right-color: transparent; border-radius: 50%;
  opacity: 0; animation: pending-show 0s 300ms forwards, pending-spin 700ms linear infinite;
}
.refresh-button[data-pending] svg { animation: pending-spin 700ms linear 300ms infinite; }
@keyframes pending-show { to { width: 14px; margin-right: 8px; border-width: 2px; opacity: 1; } }
@keyframes pending-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  button[data-pending]:not(.nav-link, .text-button, .menu-trigger, .refresh-button)::before {
    animation: pending-show 0s 300ms forwards;
  }
  .refresh-button[data-pending] svg { animation: none; }
}
/* A light green tint inside a hairline of the same hue; an error takes the danger hue. */
#notice:not(:empty) {
  margin: 0 0 24px; padding: 10px 16px; border: 1px solid var(--accent-soft); border-radius: var(--radius);
  background: var(--accent-tint); color: var(--ink); overflow-wrap: anywhere;
}
#notice[data-error='true'] { border-color: #f0d3cb; background: #fcf1ed; color: #7d3027; }
.dev-notice {
  border-top: 1px solid var(--line); margin-top: 32px; padding-top: 16px; font-size: var(--text-ui);
  color: var(--ink-2);
}
/* Small document utilities, shared by the focused and authenticated views. */
.skip-link {
  position: absolute; left: 16px; top: -80px; z-index: 1; padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--ink); border-radius: var(--radius);
}
.skip-link:focus { top: 16px; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.checkbox input { flex: 0 0 18px; margin: 3px 0 0; }

/* Shared confirmation; the dialog itself has no padding so a click on it can only be the backdrop. */
.confirm-dialog {
  width: calc(100% - 32px); max-width: 420px; padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--ink);
  box-shadow: 0 12px 32px rgba(23, 32, 27, .12);
}
.confirm-dialog::backdrop { background: rgba(23, 32, 27, .28); }
.confirm-card { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
.confirm-text { display: flex; flex-direction: column; gap: 4px; }
.confirm-text h2 {
  margin: 0; font-size: var(--text-heading); font-weight: 500; letter-spacing: var(--tracking-heading);
  line-height: 1.3;
}
.confirm-text p { margin: 0; color: var(--ink-2); }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.confirm-actions button { min-height: var(--control); padding: 0 14px; border-radius: var(--radius); }
.confirm-actions .secondary { border-color: transparent; color: var(--ink); font-weight: 400; }
button.confirm-destructive { border-color: var(--danger); background: var(--danger); }
button.confirm-destructive:hover { background: #7d2e25; }

/* Public statement: readable without an account, so it carries no application navigation. */
.rules-page { gap: 24px; }
.rules-header { display: flex; align-items: center; min-height: 44px; }
.rules-main {
  display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 640px;
  margin: 0 auto; padding-bottom: 40px;
}
.rules-title { display: flex; flex-direction: column; gap: 4px; }
.rules-title h1 {
  margin: 0; font-size: var(--text-title); font-weight: 500; letter-spacing: var(--tracking-heading);
  line-height: 1.25;
}
.rules-title p { max-width: 640px; margin: 0; color: var(--ink-2); }
/* A white card on the wash, its sections divided by hairlines as on the information page. */
.rules-card {
  display: flex; flex-direction: column; padding: 4px 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.rules-card section { display: flex; flex-direction: column; gap: 6px; padding: 20px 0; }
.rules-card section + section { border-top: 1px solid var(--line); }
.rules-card h2 {
  margin: 0; font-size: var(--text-heading); font-weight: 500; letter-spacing: var(--tracking-heading);
}
.rules-card p { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.rules-card p + p { margin-top: 6px; }
.rules-card ul {
  display: flex; flex-direction: column; gap: 4px; margin: 0; padding-left: 20px;
  color: var(--ink-2); overflow-wrap: anywhere;
}

/* Signed in: a sidebar that wraps above the page when the two no longer fit side by side. The page is flat,
   without the wash, since people work here rather than arrive. */
.shell-layout:not(.is-focused) {
  display: flex; flex-wrap: wrap; min-height: 100dvh; background: var(--surface);
}
/* Delivery notices only matter before sign-in. */
.shell-layout:not(.is-focused) .dev-notice { display: none; }
.shell-layout .sidebar {
  flex: 1 1 240px; gap: 16px; min-width: 0; padding: 16px 12px 12px;
  border-right: 1px solid var(--line); background: var(--subtle);
}
.shell-layout .sidebar .wordmark { color: var(--ink); }
/* The brand starts where the nav labels' icons do. */
.sidebar-brand { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 0 4px 10px; }
/* A role goes under the wordmark: beside it, the two and the collapse button need 237px of a 206px row. */
.brand-name { display: flex; flex-direction: column; gap: 2px; }
.brand-name .auth-role { line-height: 1.2; }
/* Folds the sidebar to its icons; it sits at the end of the brand row, and a phone has its menu instead. */
.shell-layout .sidebar-collapse {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--control-small);
  height: var(--control-small); min-height: var(--control-small); margin-left: auto; padding: 0; border: 0;
  background: transparent; color: var(--ink-2);
}
.shell-layout .sidebar-collapse:hover { background: var(--wash); color: var(--ink); }
.shell-layout .nav { display: flex; flex-direction: column; gap: 1px; }
.nav-section { display: flex; flex-direction: column; gap: 1px; }
.nav-section + .nav-section { margin-top: 16px; }
/* A group with no page this role can open takes no space, caption included. */
.nav-section:not(:has(.nav-link:not([hidden]))) { display: none; }
.nav-caption {
  margin: 0 0 4px; padding: 0 10px; color: var(--ink-2); font-size: var(--text-caption); font-weight: 500;
}
.shell-layout .nav-link {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--control-small);
  padding: 0 10px;
  border-radius: var(--radius); color: var(--ink-2); font-size: var(--text-ui); font-weight: 400;
}
/* Thin 16px icons, so they sit beside 14px labels instead of shouting over them. */
.shell-layout .nav-link svg { flex: none; width: 16px; height: 16px; stroke-width: 1.6; }
/* The current page is one quiet fill and darker text, nothing more. */
.shell-layout .nav-link[aria-current], .shell-layout .nav-link[aria-current]:hover {
  background: var(--wash); color: var(--ink); font-weight: 500;
}
.shell-layout .nav-external { margin-top: auto; }
/* A section that is not open yet: grayed, with a lock, and not selectable. */
.shell-layout .nav-link.is-locked { color: var(--line-strong); cursor: not-allowed; }
.shell-layout .nav-link.is-locked:hover { background: transparent; color: var(--line-strong); }
.nav-link .nav-lock { width: 14px; height: 14px; margin-left: auto; }
.nav-link:not(.is-locked) .nav-lock { display: none; }
.leaderboard-boards { display: flex; flex-direction: column; gap: 32px; }
.leaderboard-board h2 { margin: 0 0 8px; }
.leaderboard-board + .leaderboard-boards { margin-top: 32px; }
.data-table tr.is-you td { font-weight: 500; background: var(--subtle); }
.shell-layout .nav-link .external-mark { width: 14px; height: 14px; margin-left: auto; }
/* The account sits under a hairline; Sign out lives in its menu, away from stray clicks. */
.account { position: relative; padding-top: 8px; border-top: 1px solid var(--line); }
.account-summary {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius);
  cursor: pointer; list-style: none;
}
.account-summary::-webkit-details-marker { display: none; }
.account-summary:hover, .account[open] .account-summary { background: var(--wash); }
.account-chevron { flex: none; color: var(--ink-2); }
.avatar {
  display: flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px;
  background: var(--accent-soft); color: var(--action); font-size: var(--text-caption);
  font-weight: 500;
}
.sidebar-person { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.sidebar-handle {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-ui); font-weight: 500;
}
.sidebar-role { font-size: var(--text-caption); color: var(--ink-2); }
.account-menu {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(100% + 4px); padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 8px 24px rgba(26, 33, 30, .10);
}
.account-email {
  margin: 0; padding: 6px 8px; color: var(--ink-2); font-size: var(--text-caption); overflow-wrap: anywhere;
}
button.account-action {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--control-small); padding: 0 8px;
  border: 0; border-radius: 0; background: transparent; color: var(--ink); font-weight: 400;
}
button.account-action:hover { background: var(--wash); }
.shell-layout .icon-button {
  display: flex; align-items: center; justify-content: center; flex: 0 0 var(--control-small);
  width: var(--control-small); height: var(--control-small);
  padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink-2);
}
.shell-layout .icon-button:hover { background: var(--wash); color: var(--ink); }
.shell-layout:not(.is-focused) .workspace {
  flex: 999 1 560px; min-width: 0; margin: 0; border: 0; border-radius: 0; background: none;
}
/* One column for every signed-in page, so titles, notices and tables share a left edge across pages. */
.shell-layout:not(.is-focused) .content { max-width: 1104px; margin: 0 auto; padding: 40px 32px 64px; }
.shell-layout:not(.is-focused) .dev-notice {
  max-width: 640px; margin: 0 auto 16px; padding: 0; border: 0; font-size: var(--text-ui); text-align: center;
}
.shell-layout:not(.is-focused) #notice { max-width: none; margin-inline: 0; }
.shell-layout:not(.is-focused) .notice-box {
  position: fixed; z-index: 3; right: 24px; bottom: 24px; width: min(400px, calc(100vw - 32px));
}
.shell-layout:not(.is-focused) #notice:not(:empty) { margin: 0; }
/* Room below the last rows while a message floats, so it never sits over a row's actions. */
.shell-layout:not(.is-focused):has(#notice:not(:empty):not([data-quiet='true'])) .content {
  padding-bottom: 160px;
}
/* In and out the same way, short, and only when motion is welcome. */
@keyframes notice-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: no-preference) {
  .shell-layout:not(.is-focused) #notice:not(:empty) {
    animation: notice-in 200ms ease-out; transition: opacity 200ms ease, transform 200ms ease;
  }
  .shell-layout:not(.is-focused) #notice[data-leaving='true'] { opacity: 0; transform: translateY(8px); }
}
.shell-layout:not(.is-focused) #notice[data-error='true'] { padding-right: 44px; }
.notice-close {
  position: absolute; top: 4px; right: 4px; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; color: inherit; text-decoration: none;
}
.is-focused .notice-close { display: none; }
#home { display: flex; flex-direction: column; gap: 32px; max-width: 920px; }
.home-title {
  margin: 0; font-size: var(--text-title); font-weight: 500; letter-spacing: var(--tracking-heading);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
/* Three to a row; a shorter last row stretches, so a hidden card never leaves a gap. */
.home-cards { display: flex; flex-wrap: wrap; gap: 16px; }
.home-card {
  flex: 1 1 calc((100% - 32px) / 3); display: flex; flex-direction: column; gap: 4px;
  min-width: min(240px, 100%); min-height: 140px; padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.home-card h2 { margin: 0; font-size: var(--text-ui); font-weight: 500; color: var(--ink-2); }
.home-card p { margin: 0; }
.card-value {
  font-size: var(--text-display); font-weight: 300; letter-spacing: var(--tracking-display); line-height: 1.1;
}
#rate-limit { font-size: var(--text-ui); }
.stat-value { display: flex; align-items: baseline; gap: 2px; }
/* Light, as the information page's wordmark is, so large numbers read the same way. */
.stat-value span:first-child {
  font-size: var(--text-display); font-weight: 300; letter-spacing: var(--tracking-display); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-total { font-size: var(--text-body); color: var(--ink-2); }
/* Text still loading: a quiet bar in its place at its line height, so the page keeps its shape. */
.skeleton {
  display: inline-block; height: .9em; max-width: 100%; vertical-align: middle; border-radius: 2px;
  background: var(--tonal);
}
.skeleton-block { display: block; height: var(--control); margin-top: auto; }
@keyframes skeleton-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: skeleton-pulse 1.4s ease-in-out infinite; }
}
.shell-card {
  display: flex; flex-direction: column; gap: 12px; padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.shell-card h2 {
  margin: 0; font-size: var(--text-heading); font-weight: 500; letter-spacing: var(--tracking-heading);
}
.shell-card p { margin: 0; }
.shell-page { display: flex; flex-direction: column; gap: 24px; max-width: 640px; }
.shell-page .shell-card { gap: 16px; }
.card-heading { display: flex; flex-direction: column; gap: 4px; }
.shell-page label, .field-label { font-size: var(--text-ui); font-weight: 500; color: var(--ink-2); }
.field[aria-hidden] { gap: 6px; }
.key-field { position: relative; display: flex; }
.key-field input, .key-mask {
  flex: 1 1 auto; min-width: 0; height: var(--control); padding: 0 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--field); font-family: ui-monospace, Menlo, monospace;
  font-size: var(--text-ui);
}
.key-field input { padding-right: 40px; }
.key-field .icon-button { position: absolute; top: 2px; right: 2px; border-radius: var(--radius); }
.key-mask { display: flex; align-items: center; overflow: hidden; color: var(--ink-2); }
.shell-button { min-height: var(--control); padding: 0 14px; border: 0; border-radius: var(--radius); }
/* Organizer pages; Players follows its board, and undesigned pages only inherit the shell. */
.admin-page { max-width: 1040px; }
.admin-page > .rules-title { margin-bottom: 24px; }
.pill-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 24px; }
.pill-form input:not([type='checkbox']) {
  flex: 1 1 260px; width: auto; max-width: 420px; height: var(--control); padding: 0 10px;
  border-color: var(--line-strong);
  border-radius: var(--radius);
}
.pill-form button { min-height: var(--control); padding: 0 14px; border-radius: var(--radius); }
.pill-form .refresh-button, .refresh-button {
  display: flex; align-items: center; justify-content: center; flex: 0 0 var(--control);
  width: var(--control); height: var(--control); min-height: var(--control); padding: 0;
  border: 1px solid transparent; border-radius: var(--radius);
  color: var(--ink);
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.admin-page .page-head { margin-bottom: 24px; }
.load-more {
  display: block; min-height: var(--control); margin: 24px auto 0; padding: 0 14px;
  border-color: var(--line-strong); border-radius: var(--radius); color: var(--ink); font-weight: 400;
}
/* Table pager: the range on one side, page controls on the other, wrapping under it on narrow screens. */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px;
}
.pager-range { margin: 0; color: var(--ink-2); font-size: var(--text-ui); }
.pager-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.pager-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.pager-pages { display: flex; align-items: center; gap: 4px; }
.pager-jump { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: var(--text-ui); }
.pager-jump label { font-weight: 400; }
.pager-jump input {
  width: 64px; min-height: var(--control-small); height: var(--control-small); padding: 0 8px;
  text-align: center; font-variant-numeric: tabular-nums;
}
.pager .pager-button {
  display: inline-flex; align-items: center; justify-content: center; min-width: var(--control-small);
  min-height: var(--control-small); height: var(--control-small); padding: 0 8px; font-weight: 400;
  background: transparent;
}
.pager .pager-button:hover { background: var(--wash); }
/* Go submits the page number, so it keeps the filled secondary look the page numbers do not have. */
.pager .pager-jump .pager-button { background: var(--tonal); }
.pager .pager-jump .pager-button:hover { background: var(--tonal-strong); }
/* The current page carries the button fill; the other pages stay quiet so the row reads as one control. */
.pager .pager-button[aria-current="page"] { background: var(--tonal); color: var(--ink); font-weight: 500; }
/* Edge buttons stay disabled while idle, so they should not show the busy cursor. */
.pager .pager-button:disabled { cursor: default; opacity: .35; }
.pager-gap { padding: 0 2px; color: var(--ink-2); }
/* Organizers' Overview is the state of the competition: one row per subject, ruled off rather than boxed,
   with a label on the left, the state in the middle and its action on the right. */
#home.admin-home { gap: 0; max-width: 1040px; }
.overview-row {
  display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; align-items: start; gap: 8px 24px;
  padding: 20px 0; border-top: 1px solid var(--line);
}
.overview-row:last-child { border-bottom: 1px solid var(--line); }
.overview-label {
  margin: 0; font-size: var(--text-ui); font-weight: 500; letter-spacing: 0; line-height: 1.6;
}
.overview-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.overview-row > #scoring-note, .overview-row > .deadline-form { grid-column: 2 / -1; }
.deadline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.deadline-form label { flex: 1 1 100%; font-weight: 500; }
.deadline-form input { width: auto; }
/* A bundle check's answer: what a switch carries over and adds, or every reason it is refused. */
.bundle-report { margin: 0 0 24px; padding: 16px; border: 1px solid var(--line); }
.bundle-report.is-refused { border-color: var(--danger); }
.bundle-report h2 { margin: 0 0 12px; font-size: var(--text-heading); font-weight: 500; }
.bundle-report p { margin: 0 0 12px; font-size: var(--text-ui); }
.bundle-report .card-note { margin-top: 12px; }
/* The check's facts read left to right under their labels, unlike the overview's right-aligned values. */
.bundle-report .status-list { grid-template-columns: max-content 1fr; }
.bundle-report .status-list dt { padding-right: 24px; }
.bundle-report .status-list dd { text-align: left; }
.bundle-report .status-list div:last-child > * { border-bottom: 1px solid var(--line); }
.bundle-report ul { margin: 0 0 8px; padding-left: 20px; font-family: ui-monospace, Menlo, monospace;
  font-size: var(--text-ui); }
.bundle-report:focus { outline: none; }
.bundle-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* The probes page is one accordion of bundles under a small Bundles title. Each heading is a full-width
   button, a large target on a phone, with the bundle's name and layer on the left and its state and the
   action on the right; its probes open beneath in a table of their own, indented on a rule so they read as
   part of the bundle above. */
.admin-page > .bundles-title { margin: 8px 0 0; }
.bundle-list { margin: 8px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line-strong); }
.bundle-group { border-bottom: 1px solid var(--line-strong); }
.bundle-loading { padding: 18px 0; }
.bundle-empty { padding: 16px 0; font-size: var(--text-ui); }
.bundle-heading {
  margin: 0; font-size: var(--text-ui); font-weight: 400; letter-spacing: 0; line-height: 1.6;
}
.bundle-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas:
    "name status action" "meta status action";
  align-items: center; gap: 2px 16px; width: 100%; min-height: 0; padding: 12px 8px;
  border: 0; background: none; color: var(--ink); font-weight: 400; text-align: left;
}
button.bundle-head:hover { background: var(--wash); }
.bundle-name { grid-area: name; font-weight: 500; overflow-wrap: anywhere; }
.bundle-meta { grid-area: meta; color: var(--ink-2); font-size: var(--text-caption); }
.bundle-status { grid-area: status; }
.bundle-action { grid-area: action; display: inline-flex; align-items: center; gap: 8px; color: var(--action);
  font-weight: 500; white-space: nowrap; }
.bundle-action.muted { color: var(--ink-2); font-weight: 400; }
/* A drawn chevron, pointing down while closed and up while open; it is decoration, so it has no text. */
button.bundle-head .bundle-action::after {
  content: ''; width: 6px; height: 6px; margin-top: -3px; border: solid currentColor;
  border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform 150ms var(--ease);
}
button.bundle-head[aria-expanded="true"] .bundle-action::after {
  margin-top: 3px; transform: rotate(-135deg);
}
.bundle-panel { margin: 0 0 16px 8px; padding-left: 16px; border-left: 1px solid var(--line); }
.bundle-panel .table-card { border-bottom: 0; }
/* Bundle IDs are hex, so a fixed-width face lines their digits up for comparison. */
.cell-code { font-family: ui-monospace, Menlo, monospace; }
/* On a phone the header wraps to two lines, and each probe stacks: its name and state, then the seed prompt
   across the full width, then Edit, so nothing inside an open bundle scrolls sideways. */
@media (max-width: 640px) {
  .bundle-head {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name status" "meta action";
  }
  .bundle-panel { margin-left: 0; padding-left: 12px; }
  .bundle-panel .data-table, .bundle-panel .data-table tbody { display: block; }
  .bundle-panel .data-table thead, .bundle-panel .data-table colgroup { display: none; }
  .bundle-panel .data-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0;
    border-top: 1px solid var(--line);
  }
  .bundle-panel .data-table td { padding: 0; border: 0; }
  .bundle-panel .data-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .bundle-panel .data-table td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .bundle-panel .data-table td.cell-action { grid-column: 1 / -1; }
  .bundle-panel .data-table td.cell-action:empty { display: none; }
  .bundle-panel .data-table tr.probe-editor-row { padding: 0; border-top: 0; }
  .bundle-panel .data-table tr.probe-editor-row > td { grid-column: 1 / -1; grid-row: auto; }
}
/* A probe edited in place: its own row under the probe, on the quiet wash, so the probe stays in view. */
.data-table tr.probe-editor-row > td { padding: 16px 16px 20px; border-top: 0; background: var(--subtle); }
.probe-editor { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.probe-editor .field { display: flex; flex-direction: column; gap: 6px; }
.probe-editor label, .probe-editor legend { font-weight: 500; color: var(--ink); }
.probe-editor textarea { width: 100%; }
.release-field { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; border: 0; }
.release-field legend { padding: 0; margin-bottom: 8px; }
.release-options { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.probe-editor .release-option { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.probe-editor .release-option input {
  flex: none; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--action);
}
.schedule-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.schedule-fields input { width: auto; }
.form-error { margin: 0; color: var(--danger); font-size: var(--text-ui); }
.probe-editor [aria-invalid="true"] { border-color: var(--danger); }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.editor-actions .spacer { flex: 1; }
.data-table td.cell-action { text-align: right; }
/* A scheduled probe's release time sits whole on its own line under the chip. */
.cell-when { display: block; margin-top: 4px; color: var(--ink-2); white-space: nowrap; }
.overview-row .status-list { display: flex; flex-wrap: wrap; gap: 8px 40px; }
.overview-row .status-list div { display: flex; flex-direction: column; gap: 2px; }
.overview-row .status-list dt, .overview-row .status-list dd { padding: 0; border: 0; text-align: left; }
.overview-row .status-list dt { font-size: var(--text-caption); }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px 40px; }
.admin-home .home-card { flex: none; min-width: 0; min-height: 0; padding: 0; border: 0; background: none; }
.admin-home .home-card h2 { font-size: var(--text-caption); font-weight: 400; }
/* In a row of 14px values a count is one more value, not a headline. */
.admin-home .stat-value span:first-child {
  font-family: inherit; font-size: var(--text-ui); font-weight: 400; letter-spacing: 0; line-height: 1.6;
}
.admin-home .recent-list { gap: 4px; }
.overview-row > p { margin: 0; font-size: var(--text-ui); }
@media (max-width: 640px) {
  .overview-row { grid-template-columns: minmax(0, 1fr); }
  .overview-row > #scoring-note, .overview-row > .deadline-form { grid-column: auto; }
  .overview-actions { justify-content: flex-start; }
}
.shell-button.secondary { border: 1px solid transparent; color: var(--ink); }
/* An icon leads a button's label; the scoring button shows the icon for what it will do next. */
.shell-button { display: inline-flex; align-items: center; gap: 8px; }
.shell-button svg { flex: none; }
#scoring-action[data-paused="true"] .icon-pause, #scoring-action:not([data-paused="true"]) .icon-play {
  display: none;
}
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-time {
  font-size: var(--text-display); font-weight: 300; letter-spacing: var(--tracking-display); line-height: 1.2;
}
.card-note { color: var(--ink-2); font-size: var(--text-ui); }
/* Label and value on one hairline-ruled row each, as on the result card. */
.status-list { display: grid; grid-template-columns: auto 1fr; margin: 0; font-size: var(--text-ui); }
.status-list div { display: contents; }
.status-list dt, .status-list dd { padding: 8px 0; border-top: 1px solid var(--line); }
.status-list dt { color: var(--ink-2); }
.status-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.recent-list {
  display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; color: var(--ink-2);
  font-size: var(--text-ui); list-style: none;
}
.recent-list li { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); }
/* Tables sit on the page between hairlines, not in a card. Relative so the hidden Actions heading scrolls
   with the table instead of widening the page. */
.table-card { position: relative; overflow-x: auto; border-bottom: 1px solid var(--line); }
/* Tables fit the page column and wrap long values; only a phone keeps a minimum width and scrolls sideways,
   since the table no longer sits in a card that would show where its scroll area ends. */
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--text-ui); }
/* Tabular figures, so ranks, counts and times line up down every column. */
.data-table td { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
/* Only tables of five or more columns keep a minimum width on a phone; four fit the screen as they are. */
@media (max-width: 640px) {
  .data-table:has(col:nth-of-type(5)) { min-width: 560px; }
}
.data-table th {
  padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2);
  font-size: var(--text-caption); font-weight: 500; text-align: left;
}
.data-table td { padding: 10px 12px; border-top: 1px solid var(--line); }
.data-table tr > :first-child { padding-left: 0; }
.data-table tr > :last-child { padding-right: 0; }
.data-table .cell-main { font-weight: 500; }
.data-table .cell-muted { color: var(--ink-2); }
.data-table .cell-actions { width: 48px; padding-block: 6px; }
.cell-actions .menu-trigger { margin-left: auto; }
/* Prompts keep the player's line breaks and wrap long words instead of widening the table. */
.data-table .cell-prompt, .seed-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.data-table .cell-prompt { max-width: 360px; }
/* Play: the composer on the left, the latest result beside it, and the query budget in the header. */
.play-page { display: flex; flex-direction: column; gap: 32px; max-width: 1040px; }
.play-head { align-items: flex-end; }
.play-head .rules-title { max-width: 560px; }
.budget { display: flex; flex-direction: column; gap: 8px; flex: 0 0 200px; }
.budget-label { margin: 0; color: var(--ink-2); font-size: var(--text-ui); text-align: right; }
.budget-number {
  margin-right: 2px; color: var(--ink); font-size: var(--text-display); font-weight: 300;
  letter-spacing: var(--tracking-display);
  line-height: 1; font-variant-numeric: tabular-nums;
}
/* A hairline with the remaining share in forest green, like the base of the information page's strip. */
.budget-bar { height: 3px; background: var(--line); }
.budget-bar span {
  display: block; height: 100%; background: var(--action); transition: width 300ms var(--ease);
}
.play-grid {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 40px; align-items: start;
}
.play-form { display: flex; flex-direction: column; gap: 28px; margin: 0; }
.play-page label, .play-page .field-label {
  font-size: var(--text-ui); font-weight: 500; color: var(--ink-2);
}
.probe-choice {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0;
}
.probe-choice legend { margin-bottom: 10px; padding: 0; }
.probe-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
/* The radio covers the whole tile, so clicks and validation land on the real control. */
.probe-option {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer;
  transition:
    border-color 150ms var(--ease), box-shadow 150ms var(--ease), background-color 150ms var(--ease);
}
.probe-option:hover { border-color: var(--line-strong); }
.probe-option input {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0;
  cursor: pointer;
}
.probe-option:has(input:checked) {
  border-color: var(--action); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--action);
}
.probe-option:has(input:checked) .probe-kicker, .probe-option:has(input:checked) .probe-number {
  color: var(--action);
}
.probe-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.probe-kicker { color: var(--ink-2); font-size: var(--text-caption); line-height: 1; }
.probe-number {
  font-size: var(--text-display); font-weight: 300; letter-spacing: var(--tracking-display); line-height: 1;
}
.seed { display: flex; flex-direction: column; gap: 10px; }
.seed-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.seed-text {
  margin: 0; padding: 4px 0 4px 14px; border-left: 2px solid var(--line-strong); color: var(--ink-2);
}
button.text-button {
  min-height: 0; padding: 0; border: 0; background: none; color: var(--ink-2); font-size: var(--text-ui);
  font-weight: 400; text-decoration: underline; text-decoration-color: var(--line-strong);
  text-underline-offset: .2em;
}
/* A link-style action still gets a full tap target: 24px at least, and a touch-sized one on touch screens. */
.seed-head .text-button { min-height: 24px; padding-block: 4px; }
@media (pointer: coarse) { .seed-head .text-button { min-height: var(--control); } }
button.text-button:hover { color: var(--action); text-decoration-color: currentColor; }
.play-form textarea { min-height: 168px; padding: 12px 14px; line-height: 1.5; }
.prompt-help {
  margin: 0; color: var(--ink-2); font-size: var(--text-caption); text-align: right;
  font-variant-numeric: tabular-nums;
}
.play-actions { display: flex; align-items: center; gap: 16px; }
.play-actions button { min-width: 168px; }
/* Play's right column: the result, then the recent prompts under it. */
.play-result { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 12px; }
.result-empty {
  display: flex; align-items: center; justify-content: center; min-height: 240px; margin: 0; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--ink-2); text-align: center;
}
.result {
  display: flex; flex-direction: column; gap: 20px; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.result h2 { margin: 0; }
/* The outcome in the page's light display type, with a square marker that turns green when it clears. */
.result-outcome {
  display: flex; align-items: center; gap: 14px; margin: 0; color: var(--ink-2);
  font-size: var(--text-display); font-weight: 300; letter-spacing: var(--tracking-display);
  line-height: 1.05;
}
.result-outcome::before {
  content: ''; flex: 0 0 12px; height: 12px; background: var(--line-strong);
}
.result-outcome[data-cleared='true'] { color: var(--action); }
.result-outcome[data-cleared='true']::before { background: var(--accent); }
.result-details { display: grid; grid-template-columns: 1fr auto; margin: 0; font-size: var(--text-ui); }
.result-details dt, .result-details dd { padding: 10px 0; border-top: 1px solid var(--line); }
.result-details dt { color: var(--ink-2); }
.result-details dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
/* A dot in the badge's own color, so state still reads where the fill is faint. The text side gets 3px
   more than the dot side: a small dot leaves its 8px looking airy, and text near the edge looks tight. */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 11px 1px 8px;
  font-size: var(--text-caption);
  white-space: nowrap;
}
.chip::before { content: ''; flex: 0 0 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-good { background: var(--accent-soft); color: var(--action); }
/* Amber for a state someone needs to act on, kept apart from red for something taken away. */
.chip-warn { background: #f6eedd; color: #7a5414; }
.chip-bad { background: #f6e8e6; color: var(--danger); }
.chip-muted { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
button.menu-trigger {
  display: flex; align-items: center; justify-content: center; width: var(--control-small);
  min-height: var(--control-small); height: var(--control-small);
  padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink-2);
}
button.menu-trigger.is-open, button.menu-trigger:hover { background: var(--wash); }
/* Drawn inside the button, since the table's scroll box would clip a ring outside its last column. */
.menu-trigger:focus-visible { outline-offset: -2px; }
.row-menu {
  position: fixed; z-index: 2; display: flex; flex-direction: column; width: 192px; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 4px 12px rgba(26, 33, 30, .08);
}
.row-menu button {
  width: 100%; min-height: var(--control-small); padding: 0 8px; border: 0; border-radius: 0;
  background: transparent;
  color: var(--ink); font-size: var(--text-ui); font-weight: 400; text-align: left; white-space: nowrap;
}
.row-menu button.is-danger { color: var(--danger); }
/* The menu focuses its first item for keyboards; only a keyboard focus or the pointer fills an item, so a
   click never shows an item as already chosen. */
.row-menu button:hover, .row-menu button:focus-visible { background: var(--wash); outline: none; }
.row-menu [role='separator'] { height: 1px; margin: 4px -4px; background: var(--line); }
/* Sign out and the page must stay in reach beside a long statement, but only when they sit side by side. */
@media (min-width: 849px) {
  /* Open, the sidebar keeps its width; folded, it narrows to the icons. Labels fade rather than vanish,
     and each row clips what no longer fits, so nothing wraps or spills while the width moves. */
  .shell-layout .sidebar { flex: 0 0 240px; }
  .shell-layout .sidebar :is(.sidebar-brand, .nav-link, .account-summary) {
    overflow: hidden; white-space: nowrap;
  }
  .shell-layout .sidebar-brand > :not(.sidebar-collapse) { flex: 0 1 auto; min-width: 0; overflow: hidden; }
  .shell-layout.sidebar-collapsed .sidebar { flex-basis: 64px; padding-inline: 14px; }
  .sidebar-collapsed .sidebar :is(.sidebar-brand > :not(.sidebar-collapse), .nav-label, .nav-lock,
    .external-mark, .nav-caption, .sidebar-person, .account-chevron) {
    opacity: 0;
  }
  /* Centred on the icons below it, which sit 10px into each 36px row. */
  .sidebar-collapsed .sidebar-brand { gap: 0; padding-left: 0; }
  .shell-layout.sidebar-collapsed .sidebar-collapse { margin-inline: auto; }
  .sidebar-collapsed .account-summary { padding-inline: 4px; }
  .sidebar-collapsed .account-menu { right: auto; width: 200px; }
  @media (prefers-reduced-motion: no-preference) {
    .shell-layout .sidebar { transition: flex-basis 220ms var(--ease), padding 220ms var(--ease); }
    .shell-layout .sidebar :is(.sidebar-brand, .account-summary) {
      transition: gap 220ms var(--ease), padding 220ms var(--ease);
    }
    .shell-layout .sidebar :is(.sidebar-brand > :not(.sidebar-collapse), .nav-label, .nav-lock,
      .external-mark, .nav-caption, .sidebar-person, .account-chevron) {
      transition: opacity 150ms var(--ease);
    }
  }
  /* At least the window's height, so the account sits at the bottom, and taller when it must be. Pinned at
     the top while the page scrolls; a sidebar taller than the window ends with the page, so the one page
     scroll reaches its account menu instead of a second, hidden scroll area. */
  .shell-layout .sidebar { position: sticky; top: 0; align-self: flex-start; min-height: 100dvh; }
}

/* Touch keeps 44px targets, and 16px fields so phones do not zoom into them. */
@media (pointer: coarse) {
  :root { --control: 44px; --control-small: 44px; }
  input:not([type='checkbox']), select, textarea { font-size: var(--text-body); }
}

/* Once the sidebar wraps above the page, a short page must not stretch it. */
/* Too narrow for the result beside the composer: it follows below, and the header stacks. */
@media (max-width: 1024px) {
  .play-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .play-result { position: static; }
  .result-empty { min-height: 0; }
}
@media (max-width: 640px) {
  /* Phones keep First, Previous, the current page, Next and Last. */
  .pager-button[id^="activity-page-"]:not([aria-current]), .pager-gap { display: none; }
  .play-head { flex-direction: column; align-items: stretch; }
  .budget { flex-basis: auto; }
  .budget-label { text-align: left; }
}

/* The menu button is a phone's; wider screens lay the panel's links straight into the sidebar. */
.nav-toggle { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu,
.nav-toggle:not([aria-expanded="true"]) .icon-close { display: none; }
.nav-panel { display: contents; }
.nav-locked { overflow: hidden; }
@media (max-width: 848px) {
  .shell-layout:not(.is-focused) { align-content: flex-start; }
  /* Wrapped above the page, the sidebar becomes a short bar pinned to the top: the name, the account's
     initial, and a menu button that opens the sections as a panel over the page below the bar. */
  .shell-layout .sidebar {
    position: sticky; top: 0; z-index: 4; flex: 1 1 100%; flex-flow: row nowrap; align-items: center;
    gap: 8px;
    min-height: var(--bar-height); padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .shell-layout .sidebar-brand { flex: 1 1 auto; padding: 0; }
  /* The bar shows the account as its initial alone; the menu still names it in full. */
  .account { order: 2; flex: none; padding: 0; border: 0; }
  .account-summary { padding: 4px; }
  .account .sidebar-person, .account-chevron { display: none; }
  .account-menu { left: auto; width: 240px; top: calc(100% + 4px); bottom: auto; }
  .nav-toggle {
    order: 3; display: inline-flex; align-items: center; justify-content: center;
    width: var(--control); height: var(--control); padding: 0; border: 0; background: none; color: var(--ink);
  }
  .nav-toggle:hover { background: var(--wash); }
  .nav-panel { display: none; }
  /* Open: every section stacked, as on a wide screen, filling the screen below the bar. */
  .sidebar.nav-open .nav-panel {
    position: absolute; top: 100%; left: 0; right: 0; height: calc(100dvh - var(--bar-height));
    display: flex; flex-direction: column; gap: 4px; padding: 16px; overflow-y: auto;
    border-top: 1px solid var(--line); background: var(--subtle);
  }
  .sidebar.nav-open .nav-external { margin-top: auto; }
  .shell-layout:not(.is-focused) .content { padding: 28px 16px 48px; }
  .topbar { padding: 12px 16px 0; }
  .shell-layout:not(.is-focused) .topbar + .content { padding-top: 16px; }
}

/* The sign-in layout on small screens. */
@media (max-width: 768px) {
  .app-layout { display: block; }
  .sidebar { padding: 20px; gap: 16px; }
  .nav { display: flex; flex-wrap: wrap; gap: 8px; }
  .nav-link { width: auto; }
  .workspace { margin: 0 8px 8px; }
  .content { padding: 28px 20px 40px; }
  .is-focused .content { padding: 24px 0 48px; }
}
@media (max-width: 400px) {
  .sidebar { padding: 16px; }
  .content { padding: 24px 16px; }
  .app-layout.is-focused, .rules-page { padding: 12px 16px; }
  .is-focused .content { padding: 16px 0 32px; }
  .is-focused .panel { padding: 20px 16px; }
  .code-boxes { gap: 4px; }
  #key-panel { padding: 16px; }
}

/* A guess sits in a table cell: the field and its button side by side, wrapping when narrow. */
.guess-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.guess-form input { flex: 1 1 12rem; width: auto; }

/* Signed in, every section opens under the account's bar: its API key, queries left, and Play, at the
   right of the page column. Square, as everything else here; only the status dot is round. */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px;
  max-width: 1104px; margin: 0 auto; padding: 20px 32px 0;
}
.shell-layout:not(.is-focused) .topbar + .content { padding-top: 16px; }
.topbar .status-pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px; width: auto;
  height: var(--control-small); min-height: var(--control-small); padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  font-size: var(--text-ui); font-weight: 400; white-space: nowrap;
}
.topbar button.status-pill:hover { border-color: currentColor; }
.status-dot { position: relative; flex: 0 0 8px; height: 8px; border-radius: 50%; background: currentColor; }
/* Green for a working key or plenty left, amber for something to do soon, red for nothing left. */
.topbar .status-pill[data-tone='live'] {
  border-color: #c5dccf; background: var(--accent-tint); color: var(--action);
}
.status-pill[data-tone='live'] .status-dot { background: var(--accent); }
.topbar .status-pill[data-tone='warn'] { border-color: #ead9b3; background: #fbf5e8; color: #7a5414; }
.topbar .status-pill[data-tone='off'] { color: var(--ink-2); }
.topbar .status-pill[data-tone='bad'] { border-color: #f0d3cb; background: #fcf1ed; color: var(--danger); }
/* A ring that grows and fades from the dot, so a live key reads at a glance; still for reduced motion. */
@keyframes status-pulse {
  from { transform: scale(1); opacity: .6; }
  to { transform: scale(2.8); opacity: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .status-pill[data-tone='live'] .status-dot::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
    animation: status-pulse 1.8s var(--ease) infinite;
  }
}
.queries-pill { cursor: default; font-variant-numeric: tabular-nums; }
.queries-number { font-weight: 500; }
/* The rate limit and usage behind the badge, on hover or keyboard focus. */
.pill-tip {
  position: absolute; z-index: 5; top: calc(100% + 8px); right: 0; display: flex; flex-direction: column;
  gap: 2px; min-width: 200px; padding: 10px 12px; border-radius: var(--radius); background: var(--ink);
  color: #fff;
  font-size: var(--text-caption); line-height: 1.5; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(26, 33, 30, .16); opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 150ms var(--ease), transform 150ms var(--ease), visibility 150ms;
}
.pill-tip span:empty { display: none; }
.queries-pill:hover .pill-tip, .queries-pill:focus-visible .pill-tip {
  opacity: 1; visibility: visible; transform: none;
}
.topbar .topbar-play {
  display: inline-flex; align-items: center; gap: 8px; height: var(--control-small);
  min-height: var(--control-small); padding: 0 16px; border-radius: var(--radius);
}

/* Players' Home: a card per probe, then the latest result beside the feedback level. */
#home.player-home { gap: 32px; max-width: 1040px; }
.signed-in-handle { color: var(--ink-2); font-weight: 500; }
.home-section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-head h2, .section-head .card-note { margin: 0; }
/* One row of fixed-width cards at every window size, scrolled sideways. A blurred fade covers each edge
   only while more cards lie beyond it, so reaching an end clears that side. */
.probe-rail { position: relative; }
.probe-cards {
  display: flex; gap: 12px; margin: 0; padding: 0 0 8px; overflow-x: auto; list-style: none;
  overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.probe-rail::before, .probe-rail::after {
  content: ''; position: absolute; z-index: 1; top: 0; bottom: 8px; width: 56px; pointer-events: none;
  opacity: 0; transition: opacity 200ms var(--ease);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.probe-rail::before {
  left: 0; background: linear-gradient(to right, var(--surface), rgba(255, 255, 255, 0));
  -webkit-mask-image: linear-gradient(to right, #000 30%, transparent);
  mask-image: linear-gradient(to right, #000 30%, transparent);
}
.probe-rail::after {
  right: 0; background: linear-gradient(to left, var(--surface), rgba(255, 255, 255, 0));
  -webkit-mask-image: linear-gradient(to left, #000 30%, transparent);
  mask-image: linear-gradient(to left, #000 30%, transparent);
}
.probe-rail[data-more-start]::before, .probe-rail[data-more-end]::after { opacity: 1; }
.probe-card {
  display: flex; flex: 0 0 260px; flex-direction: column; gap: 20px; padding: 16px;
  border: 1px solid var(--line); background: var(--surface); scroll-snap-align: start;
}
/* A cleared probe keeps the page's quiet frame, with the green along its top edge. */
.probe-card[data-state='cleared'] { box-shadow: inset 0 2px 0 var(--accent); }
.probe-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.probe-card-name { display: flex; flex-direction: column; gap: 6px; margin: 0; font-weight: 400; }
.probe-card[data-state='cleared'] .probe-number { color: var(--action); }
.probe-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 12px; margin: 0;
}
.probe-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.probe-stats dt { color: var(--ink-2); font-size: var(--text-caption); }
.probe-stats dd {
  margin: 0; font-size: var(--text-ui); font-weight: 500; overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.probe-card .probe-card-play { width: 100%; margin-top: auto; }
.home-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.home-panel {
  display: flex; flex-direction: column; gap: 16px; padding: 20px;
  border: 1px solid var(--line); background: var(--surface);
}
.home-panel-text, .home-panel .card-note { margin: 0; color: var(--ink-2); font-size: var(--text-ui); }
.home-panel .card-note:empty { display: none; }
/* The feedback level is one ruled row under the title, as on the organizers' overview. */
.player-home #home-feedback { border-bottom: 1px solid var(--line); }
/* A sent prompt as a quote; a long one scrolls inside about six lines instead of stretching its box. */
.prompt-quote { max-height: 9.6em; overflow-y: auto; font-size: var(--text-ui); }
.prompt-quote:empty { display: none; }
/* Recent prompts: probe, result and time on one line, then the prompt on one line, cut short with "…". */
.prompt-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.prompt-list li {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 0;
  border-top: 1px solid var(--line);
}
.prompt-item-head { display: flex; align-items: center; gap: 8px; font-size: var(--text-ui); }
.prompt-item-when {
  margin-left: auto; color: var(--ink-2); font-size: var(--text-caption); white-space: nowrap;
}
.prompt-item-text {
  /* min-width: 0 lets the line shrink inside the column, so a long prompt ends in "…" instead of
     widening the box or scrolling it. */
  margin: 0; min-width: 0; overflow: hidden; color: var(--ink-2); font-size: var(--text-ui);
  white-space: nowrap; text-overflow: ellipsis;
}
