/* The shared design system's tokens (#765): one set for the ops portal and, later, the viewer. Two tiers.
   - Primitives (--aw-*): the 3.3.5 client's own colours from DESIGN.md, each keeping its game meaning. Never themed.
   - Semantics (--surface-*, --ink-*, --tone-*, --bar-*…): what a component reads. Dark is the default (the game's
     interface); light is [data-theme="light"], or the reader's light preference unless [data-theme="dark"] pins dark.
   A themed layer goes on top in the `aw.theme` layer: the viewer's game skin re-points semantics there (its frames over
   the terrain, its trim ring), without touching a component. Layer order, lowest first: */
@layer aw.tokens, aw.base, aw.components, aw.page, aw.theme;

@font-face { font-family: "Marcellus"; src: url(/fonts/marcellus.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo Narrow"; src: url(/fonts/archivo-narrow.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

@layer aw.tokens {
  :root {
    /* --- primitives: the game's colours (DESIGN.md), the same in every theme --- */
    --aw-black: #000;
    --aw-ground: #0a0b0d;
    --aw-frame: rgba(4, 5, 8, .82);
    --aw-frame-raised: #0e1016;
    --aw-frame-rim: #3a3d44;
    --aw-steel-edge-hi: #9ea3ad;
    --aw-slot-line: #23262c;
    --aw-slot-fill: #1b1d23;
    --aw-gold-trim: #a8853a;
    --aw-button-red: #4a1009;      /* DESIGN.md's button-red, and its lit top */
    --aw-button-red-hi: #6b2118;
    --aw-game-gold: #ffd100;
    --aw-parchment: #e8e6e1;
    --aw-grey: #a9a9a9;
    --aw-dim: #8c8c8c;
    --aw-hp: #13c213;
    --aw-hp-dk: #087008;
    --aw-hp-bg: #0a2209;
    --aw-hp-low: #e8c11a;
    --aw-hp-low-dk: #8a6b06;
    --aw-red: #ff3a3a;
    --aw-red-soft: #ff6a5a;
    --aw-rage-dk: #8a0c0c;
    --aw-mana-dk: #0f2fa8;
    --aw-mana-light: #4f86ff;
    --aw-power-bg: #08091a;
    --aw-cast-gold: #ffcc33;
    --aw-cast-gold-dk: #c78a00;
    --aw-cast-fight-dk: #a3200c;
    --aw-cast-track: #1c1a14;
    --aw-cast-edge: #5a4a1a;
    --aw-heal: #5aff5a;
    --aw-chat-plan: #ffb347;
    --aw-chat-system: #ffff00;
    --aw-chat-why: #7fd8f0;
    --aw-chat-time: #bdbdbd;
    --aw-selection: #6b5410;

    /* --- semantics, dark: the game's interface --- */
    --surface-ground: var(--aw-ground);
    --surface-wash: radial-gradient(120% 70% at 50% -10%, rgba(168, 133, 58, .10), transparent 60%);
    --surface-panel: var(--aw-frame);
    --surface-raised: var(--aw-frame-raised);
    --surface-tab: rgba(0, 0, 0, .45);
    --surface-button-red: linear-gradient(var(--aw-button-red-hi), var(--aw-button-red));   /* the game's red button, the same in either theme */
    --surface-hover: rgba(255, 255, 255, .025);
    --surface-head: linear-gradient(rgba(168, 133, 58, .09), transparent);
    --edge: var(--aw-frame-rim);
    --edge-strong: var(--aw-steel-edge-hi);
    --rule: var(--aw-slot-line);
    --trim: var(--aw-gold-trim);
    --ring: 0 0 0 1px var(--aw-black), 0 0 0 2px var(--trim), 0 0 0 3px var(--aw-black);
    --panel-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), var(--ring), 0 8px 22px rgba(0, 0, 0, .55);
    --ink: var(--aw-parchment);
    --ink-strong: #fff;
    --ink-muted: var(--aw-grey);
    --ink-dim: var(--aw-dim);
    --ink-name: var(--aw-game-gold);
    --ink-name-quiet: #b89a3a;
    --ink-link: var(--aw-game-gold);
    --ink-note: var(--aw-chat-why);
    --ink-time: var(--aw-chat-time);
    --ink-system: var(--aw-chat-system);
    --text-shadow: 1px 1px 0 #000, 0 0 2px #000;
    --bar-text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000, 0 0 3px #000;
    --selection: var(--aw-selection);
    --focus: var(--aw-game-gold);

    /* states: good is health green, warn low-health yellow, bad critical red, busy plan amber, quiet grey */
    --tone-good: var(--aw-hp);
    --tone-warn: var(--aw-hp-low);
    --tone-bad: var(--aw-red);
    --tone-busy: var(--aw-chat-plan);
    --tone-quiet: #4a4d55;
    --tone-good-ink: var(--aw-heal);
    --tone-warn-ink: var(--aw-hp-low);
    --tone-bad-ink: var(--aw-red-soft);
    --tone-busy-ink: var(--aw-chat-plan);
    --tone-quiet-ink: var(--aw-grey);
    --lamp-glow: .7;

    /* bars: the game's two-stop fills in their wells */
    --bar-well: inset 0 1px 2px rgba(0, 0, 0, .8);
    --bar-health: linear-gradient(var(--aw-hp), var(--aw-hp-dk));
    --bar-health-track: var(--aw-hp-bg);
    --bar-health-low: linear-gradient(var(--aw-hp-low), var(--aw-hp-low-dk));
    --bar-health-critical: linear-gradient(var(--aw-red), var(--aw-rage-dk));
    --bar-mana: linear-gradient(var(--aw-mana-light), var(--aw-mana-dk));
    --bar-mana-track: var(--aw-power-bg);
    --bar-cast: linear-gradient(var(--aw-cast-gold), var(--aw-cast-gold-dk));
    --bar-cast-fight: linear-gradient(var(--aw-red), var(--aw-cast-fight-dk));
    --bar-cast-track: var(--aw-cast-track);
    --bar-cast-edge: var(--aw-cast-edge);
    --bar-unknown: repeating-linear-gradient(135deg, var(--aw-slot-fill) 0 4px, #24272e 4px 8px);
    --bar-stale: linear-gradient(#5d626c, #33363d);

    /* type, shape, space */
    --font-display: "Marcellus", "Palatino Linotype", Palatino, serif;
    --font-body: "Archivo Narrow", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
    --text-body: .875rem;      /* 14px at the default root; rem, so a reader's font-size preference scales every surface alike (audit, 2026-10-26) */
    --text-small: .8125rem;    /* 13px */
    --text-label: .75rem;      /* 12px */
    --text-title: 1.0625rem;   /* 17px */
    --text-headline: 1.25rem;  /* 20px */
    --text-display: 2rem;      /* 32px */
    --radius-bar: 3px;
    --radius-slot: 4px;
    --radius-tab: 5px;
    --radius-panel: 6px;
    --space-1: 2px;
    --space-2: 4px;
    --space-3: 8px;
    --space-4: 10px;
    --space-5: 14px;
    --space-6: 22px;
    --space-7: 32px;
    --space-8: 48px;
    --page-max: 1480px;
    color-scheme: dark;
  }

  /* --- semantics, light: the same frames as printed matter, the game's meanings kept but darkened to read on paper --- */
  :root[data-theme="light"] {
    --surface-ground: #eeece6;
    --surface-wash: radial-gradient(120% 70% at 50% -10%, rgba(168, 133, 58, .14), transparent 60%);
    --surface-panel: #fbfaf7;
    --surface-raised: #ffffff;
    --surface-tab: #e2dfd6;
    --surface-hover: rgba(0, 0, 0, .03);
    --surface-head: linear-gradient(rgba(168, 133, 58, .12), transparent);
    --edge: #c9c4b6;
    --edge-strong: #6b6658;
    --rule: #e1ddd2;
    --trim: #b08d3c;
    --ring: 0 0 0 1px #d7d1c1, 0 0 0 2px var(--trim);
    --panel-shadow: var(--ring), 0 6px 18px rgba(60, 50, 20, .12);
    --ink: #24252a;
    --ink-strong: #0e0f12;
    --ink-muted: #5d5f66;
    --ink-dim: #5f6168;
    --ink-name: #7a5500;
    --ink-name-quiet: #8f7a45;
    --ink-link: #7a5500;
    --ink-note: #0b6b80;
    --ink-time: #6d6f75;
    --ink-system: #7a6a00;
    --text-shadow: none;
    --selection: #f1dd9a;
    --focus: #7a5500;
    --tone-good: #13a313;
    --tone-warn: #c9a20e;
    --tone-bad: #d92626;
    --tone-busy: #e08a1c;
    --tone-quiet: #a3a59f;
    --tone-good-ink: #0d7a0d;
    --tone-warn-ink: #876a00;
    --tone-bad-ink: #b81d1d;
    --tone-busy-ink: #a35a00;
    --tone-quiet-ink: #5d5f66;
    --lamp-glow: 0;
    --bar-well: inset 0 1px 2px rgba(0, 0, 0, .35);
    --bar-health-track: #d6e8d2;
    --bar-mana-track: #d5dcf2;
    --bar-cast-track: #ece4cc;
    --bar-cast-edge: #b08d3c;
    --bar-unknown: repeating-linear-gradient(135deg, #e3e0d7 0 4px, #d4d0c5 4px 8px);
    --bar-stale: linear-gradient(#a7a9a2, #8c8e88);
    color-scheme: light;
  }
}

@media (prefers-color-scheme: light) {
  @layer aw.tokens {
    :root:not([data-theme="dark"]) {
      --surface-ground: #eeece6;
      --surface-wash: radial-gradient(120% 70% at 50% -10%, rgba(168, 133, 58, .14), transparent 60%);
      --surface-panel: #fbfaf7;
      --surface-raised: #ffffff;
      --surface-tab: #e2dfd6;
      --surface-hover: rgba(0, 0, 0, .03);
      --surface-head: linear-gradient(rgba(168, 133, 58, .12), transparent);
      --edge: #c9c4b6;
      --edge-strong: #6b6658;
      --rule: #e1ddd2;
      --trim: #b08d3c;
      --ring: 0 0 0 1px #d7d1c1, 0 0 0 2px var(--trim);
      --panel-shadow: var(--ring), 0 6px 18px rgba(60, 50, 20, .12);
      --ink: #24252a;
      --ink-strong: #0e0f12;
      --ink-muted: #5d5f66;
      --ink-dim: #5f6168;
      --ink-name: #7a5500;
      --ink-name-quiet: #8f7a45;
      --ink-link: #7a5500;
      --ink-note: #0b6b80;
      --ink-time: #6d6f75;
      --ink-system: #7a6a00;
      --text-shadow: none;
      --selection: #f1dd9a;
      --focus: #7a5500;
      --tone-good: #13a313;
      --tone-warn: #c9a20e;
      --tone-bad: #d92626;
      --tone-busy: #e08a1c;
      --tone-quiet: #a3a59f;
      --tone-good-ink: #0d7a0d;
      --tone-warn-ink: #876a00;
      --tone-bad-ink: #b81d1d;
      --tone-busy-ink: #a35a00;
      --tone-quiet-ink: #5d5f66;
      --lamp-glow: 0;
      --bar-well: inset 0 1px 2px rgba(0, 0, 0, .35);
      --bar-health-track: #d6e8d2;
      --bar-mana-track: #d5dcf2;
      --bar-cast-track: #ece4cc;
      --bar-cast-edge: #b08d3c;
      --bar-unknown: repeating-linear-gradient(135deg, #e3e0d7 0 4px, #d4d0c5 4px 8px);
      --bar-stale: linear-gradient(#a7a9a2, #8c8e88);
      color-scheme: light;
    }
  }
}

/* The shared base (#765): the page ground, the two faces, the browser's own surfaces themed. Reads semantics only. */
@layer aw.base {
  *, *::before, *::after { box-sizing: border-box; }
  html { background: var(--surface-ground); scrollbar-color: var(--edge) var(--surface-ground); }
  body {
    margin: 0; min-height: 100vh; color: var(--ink);
    font: 500 var(--text-body)/1.35 var(--font-body); font-variant-numeric: tabular-nums;
    background: var(--surface-wash), var(--surface-ground);
    text-shadow: var(--text-shadow);
  }
  ::selection { background: var(--selection); color: var(--ink-strong); }
  a { color: var(--ink-link); text-decoration: none; text-underline-offset: 3px; }
  a:hover { color: var(--ink-strong); text-decoration: underline; }
  :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  ::placeholder { color: var(--ink-muted); opacity: 1; }
  /* read by a screen reader, never drawn */
  .aw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  h1, h2, h3 { margin: 0; font-weight: 400; font-family: var(--font-display); color: var(--ink-name); }
  p { margin: 0; }

  /* the page's frame: a centred column with the screen inset the game uses */
  .aw-page { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--space-5) 28px; }
  .aw-dim { color: var(--ink-dim); }
  .aw-sub { display: block; color: var(--ink-muted); font-size: var(--text-label); font-weight: 500; }
  @media (max-width: 760px) { .aw-page { padding: 0 var(--space-4) 20px; } }
}

/* The shared components' looks (#765), each reading semantic tokens only, so a theme re-points them all at once:
   page tabs, the lamp and status word, the panel, the table, key and value, the meters, the empty state. */
@layer aw.components {
  /* --- page tabs: the game's window tabs, one per page --- */
  .aw-tabs { display: flex; gap: var(--space-1); }
  .aw-tabs a {
    padding: 7px 14px 8px; font-size: var(--text-small); font-weight: 600; color: var(--ink-muted);
    background: var(--surface-tab); border: 1px solid var(--edge); border-bottom: 0; border-radius: var(--radius-tab) var(--radius-tab) 0 0;
  }
  .aw-tabs a:hover { color: var(--ink-strong); text-decoration: none; }
  .aw-tabs a[aria-current="page"] { color: var(--ink-name); background: var(--surface-raised); border-color: var(--edge-strong); }
  @media (pointer: coarse) { .aw-tabs a { min-height: 44px; display: inline-flex; align-items: center; } }

  /* --- the lamp: the viewer's latency lamp, one per state; and a status word beside it --- */
  .aw-lamp {
    flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: var(--tone-quiet); box-shadow: 0 0 0 1px rgba(0, 0, 0, .8);
  }
  .aw-lamp[data-tone="good"] { background: var(--tone-good); box-shadow: 0 0 0 1px rgba(0, 0, 0, .8), 0 0 6px rgba(19, 194, 19, var(--lamp-glow)); }
  .aw-lamp[data-tone="warn"] { background: var(--tone-warn); box-shadow: 0 0 0 1px rgba(0, 0, 0, .8), 0 0 6px rgba(232, 193, 26, var(--lamp-glow)); }
  .aw-lamp[data-tone="bad"] { background: var(--tone-bad); box-shadow: 0 0 0 1px rgba(0, 0, 0, .8), 0 0 8px rgba(255, 40, 40, var(--lamp-glow)); }
  .aw-lamp[data-tone="busy"] { background: var(--tone-busy); box-shadow: 0 0 0 1px rgba(0, 0, 0, .8), 0 0 5px rgba(255, 179, 71, var(--lamp-glow)); }
  .aw-status { display: inline-flex; align-items: center; gap: var(--space-3); font-weight: 600; white-space: nowrap; }
  [data-tone="good"] > .aw-status-word, .aw-ink-good { color: var(--tone-good-ink); }
  [data-tone="warn"] > .aw-status-word, .aw-ink-warn { color: var(--tone-warn-ink); }
  [data-tone="bad"] > .aw-status-word, .aw-ink-bad { color: var(--tone-bad-ink); }
  [data-tone="busy"] > .aw-status-word, .aw-ink-busy { color: var(--tone-busy-ink); }
  [data-tone="quiet"] > .aw-status-word, .aw-ink-quiet { color: var(--tone-quiet-ink); }
  .aw-ink-name { color: var(--ink-name); }

  /* --- the panel: a frame with the ring stack and a soft drop, a serif title in its head --- */
  .aw-panel {
    min-width: 0; background: var(--surface-panel); border: 1px solid var(--edge); border-radius: var(--radius-panel);
    padding: 0 0 6px; box-shadow: var(--panel-shadow);
  }
  .aw-panel-head {
    display: flex; align-items: baseline; gap: var(--space-4); padding: var(--space-4) var(--space-5) 9px;
    border-bottom: 1px solid var(--rule); background: var(--surface-head); border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  }
  .aw-panel-head h2 { font-size: var(--text-title); line-height: 1.1; }
  .aw-panel-note { color: var(--ink-muted); font-size: var(--text-small); }
  .aw-panel-count { margin-left: auto; color: var(--ink-strong); font-weight: 700; }

  /* --- the table: /who's ruled rows, gold names, white values --- */
  .aw-table { width: 100%; border-collapse: collapse; }
  .aw-table th, .aw-table td { padding: var(--space-3) var(--space-5); text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
  .aw-table tbody tr:last-child > * { border-bottom: 0; }
  .aw-table thead th { padding-bottom: 6px; color: var(--ink-muted); font-size: var(--text-label); font-weight: 600; }
  .aw-table tbody tr:hover { background: var(--surface-hover); }
  .aw-table .aw-num { text-align: right; white-space: nowrap; }
  .aw-table tbody th { font-weight: 500; white-space: nowrap; }
  .aw-name { font: 400 15px/1.2 var(--font-display); color: var(--ink-name); }
  @media (max-width: 760px) {
    /* a row becomes a block: the head goes, each cell says its own label */
    .aw-table thead { display: none; }
    .aw-table, .aw-table tbody, .aw-table tr { display: block; }
    .aw-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) 12px; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--rule); }
    .aw-table th, .aw-table td { display: block; padding: 0; border: 0; white-space: normal; }
    .aw-table .aw-wide { grid-column: 1 / -1; min-width: 0; }
    .aw-table .aw-num { text-align: left; }
    .aw-table td[data-label]::before { content: attr(data-label) " "; color: var(--ink-muted); font-weight: 500; }
    /* only a cell marked empty goes (`aw-none` on its one child: a dash, "none"); a dim value is still a value */
    .aw-table td:empty, .aw-table td:has(> .aw-none:only-child) { display: none; }
  }

  /* --- key and value: a muted label on the left, white on the right (gold is for names and titles) --- */
  .aw-kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--space-3) 12px; margin: 0; padding: 12px var(--space-5) var(--space-3); }
  .aw-kv dt { color: var(--ink-muted); font-weight: 600; }
  .aw-kv dd { margin: 0; min-width: 0; color: var(--ink-strong); }
  .aw-kv .aw-sub { display: inline; margin-left: var(--space-3); }
  .aw-kv .aw-line { display: block; }
  .aw-note { display: block; color: var(--ink-note); font-size: var(--text-small); overflow-wrap: anywhere; }

  /* --- meters: health, mana and the casting bar, as the unit frames draw them --- */
  .aw-meter {
    position: relative; display: block; height: 14px; overflow: hidden;
    border: 1px solid #000; box-shadow: var(--bar-well); background: var(--bar-health-track);
  }
  .aw-meter-fill { position: absolute; inset: 0; transform-origin: left center; background: var(--bar-health); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
  .aw-meter-text {
    position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600; line-height: 1;
    text-shadow: var(--bar-text-shadow);
  }
  .aw-meter[data-kind="health"][data-level="low"] .aw-meter-fill { background: var(--bar-health-low); }
  .aw-meter[data-kind="health"][data-level="critical"] .aw-meter-fill { background: var(--bar-health-critical); }
  .aw-meter[data-stale] { background: var(--bar-unknown); }
  .aw-meter[data-stale] .aw-meter-fill { background: var(--bar-stale); opacity: .7; }
  .aw-meter[data-kind="mana"] { height: 11px; background: var(--bar-mana-track); }
  .aw-meter[data-kind="mana"] .aw-meter-fill { background: var(--bar-mana); }
  .aw-meter[data-kind="cast"] {
    height: 26px; border: 1px solid var(--bar-cast-edge); border-radius: var(--radius-bar); background: var(--bar-cast-track);
    box-shadow: 0 0 0 2px var(--trim), 0 0 0 3px #000, var(--bar-well);
  }
  .aw-meter[data-kind="cast"] .aw-meter-fill { background: var(--bar-cast); }
  .aw-meter[data-kind="cast"][data-level="critical"] .aw-meter-fill { background: var(--bar-cast-fight); }
  .aw-meter[data-kind="cast"] .aw-meter-text { place-items: center start; padding-left: var(--space-4); font-size: var(--text-small); font-weight: 700; }
  @media (prefers-reduced-motion: reduce) { .aw-meter-fill { transition: none; } }

  /* --- the empty state: one quiet sentence where content would be --- */
  .aw-empty { margin: 0; padding: var(--space-5); color: var(--ink-muted); }
  .aw-empty[data-calm] { color: var(--ink); }

  /* --- freshness: how old what's on screen is --- */
  .aw-fresh { display: flex; align-items: center; gap: var(--space-3); color: var(--ink-muted); font-size: var(--text-small); }
}

/* The portal's pages for a person (page.ts), over the shared system (../web/shared): the strip with the realm's name,
   one column of panels, the forms inside them. Operate: the doorway from salt-n-bones.com's Play to a seat and an agent.
   ponytail: the strip and the red button repeat lore/page.css's; they move to web/shared's components when a third
   surface wears them. */
@layer aw.page {
  .strip { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3) var(--space-5); min-height: 52px; padding: 0 var(--space-1); border-bottom: 1px solid var(--rule); }
  .realm { display: flex; align-items: baseline; gap: var(--space-4); }
  .realm-name { font: 400 var(--text-headline)/1 var(--font-display); color: var(--ink-name); letter-spacing: .01em; }
  .realm-name:hover { color: var(--ink-strong); text-decoration: none; }
  .realm-note { color: var(--ink-muted); font-size: var(--text-small); }
  .account-link { display: inline-flex; align-items: center; min-height: 32px; white-space: nowrap; }

  /* one column on a narrow measure: the page is a task, read top to bottom */
  .portal main { max-width: 34rem; margin: 0 auto; padding-bottom: var(--space-6); }
  .page-title { padding: var(--space-6) var(--space-1) var(--space-4); font-size: var(--text-display); line-height: 1.1; text-wrap: balance; }
  .lead { margin: 0 var(--space-1) var(--space-5); color: var(--ink); font-size: 15px; line-height: 1.5; }
  .lead p + p { margin-top: var(--space-3); }
  .portal .aw-panel + .aw-panel { margin-top: var(--space-5); }
  .panel-body { padding: var(--space-5); line-height: 1.5; }
  .panel-body > * + * { margin-top: var(--space-4); }
  .panel-body ol { margin: 0; padding-left: 1.4em; }
  .panel-body li + li { margin-top: var(--space-3); }
  .panel-body ul { margin: 0; padding-left: 1.2em; }
  .note { color: var(--ink-muted); font-size: var(--text-small); }
  pre { overflow-x: auto; padding: var(--space-3); border: 1px solid var(--edge); border-radius: var(--radius-slot); background: var(--surface-tab); }
  pre code { white-space: pre; overflow-wrap: normal; }
  details > p + pre, details > pre + p { margin-top: var(--space-3); }
  code { font: 700 1em var(--font-body); color: var(--ink-strong); overflow-wrap: anywhere; }

  /* the forms: a label over its field, a note under it, the press below */
  form { display: grid; gap: var(--space-3); }
  label { display: grid; gap: var(--space-2); color: var(--ink-muted); font-size: var(--text-small); }
  input {
    min-height: 36px; padding: 6px 10px; border: 1px solid var(--edge); border-radius: var(--radius-slot);
    background: var(--surface-tab); color: var(--ink-strong); font: 500 var(--text-body) var(--font-body); caret-color: var(--ink-name);
  }
  input:focus-visible { border-color: var(--edge-strong); }
  button {
    justify-self: start; min-height: 32px; padding: 6px 16px; border: 1px solid var(--edge-strong); border-radius: var(--radius-slot);
    background: var(--surface-raised); color: var(--ink-strong); font: 600 var(--text-body) var(--font-body); cursor: pointer;
  }
  button:hover { background: var(--surface-hover); color: var(--ink-name); }
  /* the press that moves a person on: the game's red button, one on a page (DESIGN.md's Play Button) */
  button.play {
    border: 0; background: #4a1009; color: var(--aw-game-gold); font-weight: 700; box-shadow: var(--ring);   /* the tokens have no primitive for the red yet (lore/page.css's .play) */
  }
  button.play:hover { background: #4a1009; color: #fff; }
  @media (pointer: coarse) { button, input { min-height: 44px; } }

  details > summary { cursor: pointer; color: var(--ink-link); width: fit-content; }
  details > summary:hover { color: var(--ink-strong); }
  details[open] > summary { margin-bottom: var(--space-4); }

  /* what the last press did: the words say which; the ink agrees */
  .said { margin: 0 var(--space-1) var(--space-5); font-weight: 600; }
  .said[data-ok="true"] { color: var(--tone-good-ink); }
  .said[data-ok="false"] { color: var(--tone-bad-ink); }

  @media (max-width: 760px) { .portal .aw-page { padding-inline: 16px; } .page-title { font-size: var(--text-headline); padding-top: var(--space-5); } }
}
