/* Agora, module 1. Values from agora-pack-14 reference/design-values.md (design-direction v1.1
   and the screens canvas); tokens.json leaves theme values null, so Agora sets them here under the
   framework's token names. No colour carries identity (design-direction §3). */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/newsreader-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/public-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/public-sans-latin-500-normal.woff2") format("woff2");
}

:root {
  --color-surface-default: #ffffff;
  --color-surface-secondary: #f3f1ea; /* the filled participant line */
  --color-text-primary: #1c1b18;
  --color-text-secondary: #5f5e5a; /* never lighter on white */
  --color-border-default: #d6d2c6; /* dividers and button outlines; the label names the control */
  /* Text boxes have no label inside them, so their edge must show (WCAG 1.4.11, 3:1): the same
     warm grey, darker. 3.67:1 on the paper. Accessibility pass, 2026-11-21. */
  --color-border-input: #8a857a;
  /* Agora's colour, warm stone (AG-03, closed 2026-11-21, from the Head's colour record of
     2026-11-19): primary actions and the focus ring only. Never on lines, headings, either side's
     words, or anything that marks one side. White on stone 7.35:1; stone on the paper (#ffffff)
     7.35:1, on the line fill 6.50:1. Hover is a darker stone, white on it 9.92:1. */
  --color-action-primary: #5c554c;
  --color-action-primary-hover: #48423a;
  --color-action-primary-text: #ffffff;
  --color-focus-ring: #5c554c;
  --color-hairline: #e4e2dd;
  /* Statuses, unused in module 1: amber is the hold notice only, green is module 4 only. */
  --color-status-amber-surface: #faeeda;
  --color-status-amber-text: #633806;
  --color-status-green-surface: #eaf3de;
  --color-status-green-text: #27500a;

  --font-family-display: "Newsreader", Georgia, serif;
  --font-family-body: "Public Sans", system-ui, sans-serif;

  /* Minimum sizes (design-direction §7) */
  --size-body: 17px;
  --size-meta: 14px;
  --touch: 44px;
  --touch-primary: 52px;
  --line-pad-y: 14px;
  --line-pad-x: 16px;
  --line-gap: 12px;
  --radius: 12px;
  --radius-small: 10px;

  /* One spacing scale (4, 8, 12, 16, 20, 24, 32, 48); the screen edge is 20 on every screen. */
  --edge: 20px;
  --space-group: 24px;
  --space-section: 32px;
  --size-control: 15px; /* every small control, as the Sokra block's (board 6) */
  --size-title: 32px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-surface-default);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-weight: 400;
  font-size: var(--size-body);
  line-height: 1.5;
}

main { max-width: 40rem; margin: 0 auto; padding: 0 var(--edge) 48px; }

/* The network's top bar (look E, screen spec 2026-11-22), in Agora's own type and colours. One way
   up at the top left: inside a screen, a chevron back to the track named Agora; on the track, the
   network's mark and Agora's name, with no way up (AG-40 c: no Home to return to yet). */
.masthead { border-bottom: 1px solid var(--color-hairline); margin: 0 0 var(--edge); }
.masthead .top {
  display: flex; align-items: center; max-width: 40rem; min-height: 56px; margin: 0 auto;
  padding: 0 var(--edge);
}
.masthead .name, .masthead .top-up {
  display: inline-flex; align-items: center; margin: 0; color: var(--color-text-primary);
  font-family: var(--font-family-display); font-weight: 500; font-size: 22px; line-height: 1.5;
  letter-spacing: -0.01em; text-decoration: none;
}
.masthead .top-name { gap: 8px; }
.masthead .top-up { gap: 4px; min-height: var(--touch); margin-left: -4px; }
.masthead .mark { width: 24px; height: 24px; flex: none; }
.masthead .chevron { width: 22px; height: 22px; flex: none; }

/* The Assist bar (shared frame, 2026-11-23): one per screen with a top bar, held at the foot above
   a phone's gesture bar. Agora runs no assistant, so it always opens the guide. */
.assist-wrap {
  position: sticky; bottom: 0; z-index: 5; max-width: 40rem; margin: 0 auto;
  padding: 8px var(--edge) max(16px, calc(8px + env(safe-area-inset-bottom, 0px)));
  background: var(--color-surface-default);
}
.assist-bar {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px;
  border: 1px solid var(--color-hairline); border-radius: var(--radius);
  background: var(--color-surface-default); color: var(--color-text-secondary);
  font-size: 16px; text-decoration: none;
}
.assist-icon { width: 20px; height: 20px; flex: none; }

/* The network's motion, settle (shared tokens.css and frame.css, 2026-11-23): a screen arrives
   with a short rise and fade; a press sinks at once and eases back. Nothing passes its place or
   bounces, and under reduced motion the shared tokens make every duration 0 and every scale 1. */
main {
  animation:
    an-arrive-move var(--an-motion-move) var(--an-ease-settle) backwards,
    an-arrive-fade var(--an-motion-move) var(--an-ease-glide) backwards;
}
button {
  transition: transform var(--an-motion-release) var(--an-ease-settle);
  -webkit-tap-highlight-color: transparent;
}
button:active:not(:disabled) {
  transform: scale(var(--an-motion-press-scale));
  transition-duration: var(--an-motion-press);
  transition-timing-function: var(--an-ease-glide);
}
button.primary:active:not(:disabled), button.secondary:active:not(:disabled) {
  transform: scale(var(--an-motion-press-scale-wide));
}
/* The shared tokens already make every duration 0 under reduced motion; this says it here too. */
@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  button { transition: none; }
  button:active:not(:disabled) { transform: none; }
}

/* One title size on every screen; one heading face. */
h1, .page-title {
  font-family: var(--font-family-display); font-weight: 500; font-size: var(--size-title);
  line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 16px;
}

/* Agora's voice: plain text, no block, no label. */
.notice { margin: 0 0 12px; }

.nav { display: flex; gap: 0 16px; flex-wrap: wrap; margin: 0 0 12px; }
.nav { font-size: 16px; }
.nav a {
  display: inline-flex; align-items: center; min-height: var(--touch);
  color: var(--color-text-primary); font-weight: 500;
}

/* The participant mark: filled line, the same wherever it appears. */
.lines { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: var(--line-gap); }
.line {
  background: var(--color-surface-secondary);
  color: var(--color-text-primary);
  padding: var(--line-pad-y) var(--line-pad-x);
  border-radius: var(--radius);
}
.line .words { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.meta { margin: 4px 0 0; font-size: var(--size-meta); color: var(--color-text-secondary); }
.line-action {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px;
}
.line-action .meta { margin: 0; }

button {
  font: inherit; font-weight: 500; cursor: pointer;
  min-height: var(--touch); padding: 0 16px; border-radius: var(--radius);
}
button.primary {
  min-height: var(--touch-primary); width: 100%; border: 0;
  background: var(--color-action-primary); color: var(--color-action-primary-text);
}
button.primary:hover { background: var(--color-action-primary-hover); }
button.secondary {
  min-height: var(--touch-primary); width: 100%; background: var(--color-surface-default);
  color: var(--color-text-primary); border: 1px solid var(--color-border-default);
}
button.quiet {
  background: var(--color-surface-default); color: var(--color-text-primary);
  border: 1px solid var(--color-border-default); border-radius: var(--radius-small);
  padding: 0 14px; font-size: var(--size-control);
}
button[hidden] { display: none; }

textarea {
  width: 100%; font: inherit; color: var(--color-text-primary);
  border: 1px solid var(--color-border-input); border-radius: var(--radius-small);
  padding: var(--line-pad-y) var(--line-pad-x); margin: 0 0 12px;
}
/* A format hint, not a value: second ink, 6.49:1 (browsers default to as low as 2.35:1). */
::placeholder { color: var(--color-text-secondary); opacity: 1; }
.plain { background: var(--color-surface-default); }
.compose { margin-top: 8px; }

/* AG-43: Assist's views. Assist's own words are second ink, apart from the lines; the lines keep
   the participant mark. */
.section-title {
  font-family: var(--font-family-display); font-weight: 500; font-size: 18px; margin: 24px 0 8px;
}
.asked { margin: 0 0 8px; }
.assist-says { margin: 8px 0 16px; }
.views, .view-actions { margin-top: 24px; display: grid; gap: 12px; }
.view-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.view-list a { display: inline-flex; align-items: center; min-height: var(--touch); }
.inline-form { display: grid; gap: 8px; }
/* A one-line text box (Assist's request, a view's name): the textarea's edge and size. */
.text-input {
  width: 100%; min-height: var(--touch); font: inherit; color: var(--color-text-primary);
  border: 1px solid var(--color-border-input); border-radius: var(--radius-small);
  padding: 0 var(--line-pad-x); margin: 0 0 4px;
}
.leave { display: grid; gap: 12px; margin-top: 4px; }

:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Module 2 (boards 5-8). Same tokens as module 1; no new colour. */
.say-it { display: block; font-weight: 500; margin: 8px 0 6px; }
.footer-actions { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 4px; }
/* Side by side only where both labels fit on one line; stacked on phones. */
@media (min-width: 560px) { .footer-actions { grid-template-columns: 1fr 1fr; } }
.footer-actions form { margin: 0; }
.footer-actions button { min-height: var(--touch-primary); width: 100%; }
button.ask {
  background: transparent; color: var(--color-text-primary);
  border: 1px solid var(--color-text-primary);
}
.footer-actions.muted button {
  background: transparent; color: var(--color-text-secondary);
  border: 1px solid var(--color-border-default);
}
.hear-link { font-size: var(--size-meta); margin: 20px 0 0; }
.hear-link a, .move a { color: var(--color-text-primary); }
/* A whole target, not just the words (Agora's touch minimum, design-direction §7). */
.hear-link a { display: inline-flex; align-items: center; min-height: var(--touch); }

/* Agora's voice: notices are plain text, no block, no label. */
.agora-notice { margin: 4px 0; }

.hear-choice { display: grid; gap: 16px; margin: 12px 0; }
.hear-choice .notice { margin: 0; }
.choice { display: grid; gap: 10px; }
button.choice-button {
  min-height: var(--touch-primary); width: 100%; background: transparent;
  color: var(--color-text-primary); border: 1px solid var(--color-text-primary);
}

/* Sokra: an outlined, unfilled block with its label above (design-direction §3). */
.move { list-style: none; }
.move-label { font-size: var(--size-meta); font-weight: 500; margin: 0 0 6px; }
.sokra {
  display: grid; gap: 10px; background: transparent;
  border: 1.5px solid var(--color-text-primary); border-radius: var(--radius);
  padding: var(--line-pad-y) var(--line-pad-x);
}
.sokra p { margin: 0; }
.sokra .quote {
  display: block; background: var(--color-surface-secondary); color: var(--color-text-primary);
  border-radius: var(--radius-small); padding: 10px 12px; text-decoration: none;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.move-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.move-controls form { margin: 0; }
.move-controls button, .move-controls .control {
  display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 14px;
  background: var(--color-surface-default); color: var(--color-text-primary);
  border: 1px solid var(--color-border-default); border-radius: var(--radius-small);
  font-size: var(--size-control); font-weight: 500; text-decoration: none;
}
.why {
  border-top: 1px solid var(--color-border-default); padding: 12px 14px;
  display: grid; gap: 6px; font-size: 15px; color: var(--color-text-secondary);
}
.why-head { font-weight: 500; color: var(--color-text-primary); }
.folded {
  display: flex; justify-content: space-between; align-items: center; min-height: 48px;
  padding: 0 16px; border: 1px dashed var(--color-border-default); border-radius: var(--radius);
  font-size: 15px; color: var(--color-text-secondary); text-decoration: none;
}
.folded .show { font-weight: 500; color: var(--color-text-primary); }

/* Own counts (board 8): the only place a number appears. */
.own {
  border: 1px solid var(--color-border-default); border-radius: var(--radius);
  padding: var(--line-pad-y) var(--line-pad-x); margin-top: 8px; display: grid; gap: 8px;
}
.own p { margin: 0; }
.own-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 15px; }

/* Module 3 (boards 9-11): full-page screens, no header bar. */
main.full { padding: 32px var(--edge) 48px; display: grid; gap: 20px; align-content: start; }
main.full > * { margin: 0; }
.screen-title {
  font-family: var(--font-family-display); font-weight: 500; font-size: var(--size-title);
  line-height: 1.2; letter-spacing: -0.01em; margin: 0;
}
.erased-title { font-size: 28px; }
.secondary-text { color: var(--color-text-secondary); }
.stack { display: grid; gap: 12px; }
.stack form { margin: 0; }
.stack button { width: 100%; }
a.button {
  display: flex; align-items: center; justify-content: center; min-height: var(--touch-primary);
  border-radius: var(--radius); font-weight: 500; text-decoration: none;
}
a.button.secondary {
  background: var(--color-surface-default); color: var(--color-text-primary);
  border: 1px solid var(--color-border-default);
}
button.strong-outline {
  min-height: var(--touch-primary); background: var(--color-surface-default);
  color: var(--color-text-primary); border: 1px solid var(--color-text-primary);
}
.text-link {
  display: flex; align-items: center; justify-content: center; min-height: var(--touch);
  font-size: 16px; font-weight: 500; color: var(--color-text-primary);
}
/* The hold status: amber, its only use (design-direction §4). Never a text colour on its own. */
.status-hold {
  display: inline-block; background: var(--color-status-amber-surface);
  color: var(--color-status-amber-text); border-radius: var(--radius-small); padding: 8px 12px;
  font-size: 15px; font-weight: 500;
}

/* Module 4 (boards 12-16). Same tokens; green is "you both hold this" only (design-direction §4). */
.status-held {
  display: inline-block; margin: 6px 0 0; background: var(--color-status-green-surface);
  color: var(--color-status-green-text); border-radius: 8px; padding: 6px 10px;
  font-size: var(--size-meta); font-weight: 500;
}
.released { font-weight: 500; }
.line-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.line-actions .line-action { margin-top: 0; }
a.quiet-link {
  display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 14px;
  background: var(--color-surface-default); color: var(--color-text-primary);
  border: 1px solid var(--color-border-default); border-radius: var(--radius-small);
  font-size: var(--size-control); font-weight: 500; text-decoration: none;
}
.nav form { margin: 0; }
button.nav-button {
  min-height: var(--touch); padding: 0; background: none; border: 0; font-size: 16px;
  color: var(--color-text-primary); text-decoration: underline;
}
.entered { margin: 0 0 12px; }
.exchange-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.exchange-actions a.button { min-height: var(--touch); font-size: 15px; }
.code-box {
  display: grid; gap: 6px; justify-items: center; padding: 16px;
  border: 1px solid var(--color-border-default); border-radius: var(--radius);
}
.code-box p { margin: 0; }
.code {
  /* Scales with the screen; a long code breaks only after a hyphen. Public Sans with tabular
     figures: Newsreader is for Agora's name and titles only (Head record 2026-11-21-brand-image-plan,
     choice 1). */
  font-family: var(--font-family-body); font-weight: 500; font-size: clamp(22px, 6.4vw, 34px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em; user-select: all; overflow-wrap: anywhere; text-align: center;
}
.code-input {
  width: 100%; min-height: var(--touch-primary); padding: 0 14px; font: inherit;
  letter-spacing: 0.06em; color: var(--color-text-primary);
  border: 1px solid var(--color-border-input); border-radius: var(--radius);
}
hr.rule { border: 0; height: 1px; background: var(--color-border-default); width: 100%; }
.statement { display: grid; gap: 14px; }
.statement p { margin: 0; }
.forms { display: grid; gap: 10px; border: 0; margin: 0; padding: 0; min-width: 0; }
.form-choice {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--color-border-default); border-radius: var(--radius);
}
.form-choice input { width: 20px; height: 20px; margin: 0; }
a.button.strong {
  background: var(--color-surface-default); color: var(--color-text-primary);
  border: 1px solid var(--color-text-primary);
}
button.text-button {
  width: 100%; background: none; border: 0; color: var(--color-text-primary);
  text-decoration: underline;
}

/* Entry and gate: the name leads; Agora's text in groups, the last nearest Start. */
main.entry { gap: var(--space-group); }
.entry .tool-name { font-size: 40px; }  /* Agora alone leads; no wordmark (AG-37) */
.entry .agora-text { display: grid; gap: var(--space-group); }
.notice-group { display: grid; gap: 8px; }
.notice-group .notice { margin: 0; }
.notice-group.lead { color: var(--color-text-primary); }
.field-label { font-size: 16px; font-weight: 500; }

/* Board 2 (laptop): the record beside the track from 1024 px. Two columns of one width; the
   record stays in view while the track scrolls. Phones keep one column and the record's link. */
.record-beside { display: none; }
.beside-title {
  font-family: var(--font-family-display); font-weight: 500; font-size: 24px; line-height: 1.2;
  letter-spacing: -0.01em; margin: 0;
}
@media (min-width: 1024px) {
  body.beside main, body.beside .masthead .top, body.beside .assist-wrap { max-width: 72rem; }
  body.beside main {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px;
    align-items: start;
  }
  body.beside .nav .record-link { display: none; }
  .record-beside {
    display: grid; gap: 12px; align-content: start; position: sticky; top: 24px;
    max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto;
  }
  .record-beside > * { margin: 0; }
}

/* States pass: a plain link inside running text (the copy's fallback). */
a.inline-link { color: var(--color-text-primary); font-weight: 500; }
