/* Hotkey's design tokens: the one place for the product's colors, fonts, type sizes, radii and
   spacing. Every surface loads this file: the console (web/console/tokens.css), the hub's own pages
   (sign-in card, consent, privacy, terms, start), the landing page (console-tokens.css, resolved
   at deploy) and the viewer (web/viewer/tokens.css). Those are symlinks to this file, and the hub
   image copies design/. design/README.md lists every consumer.

   Each color is written once, light first, with light-dark(): the browser picks the value from the
   element's color-scheme. :root follows the system unless a page sets data-theme on <html>, and any
   part of a page can force a scheme with color-scheme (the console's browser window is always light,
   because the remote pages are). Only values that aren't colors (shadows) need a dark block.

   Amber is the one loud color and always means "needs you"; blue means an agent is working. The
   dark greys are neutral, with no blue in them (2026-11-14), to sit on the near-black ink wallpaper.
   On 2026-11-15 the dark background and surfaces went up one step (#0f0f10 to #161618 and so on)
   so the layers part on a phone, where the console has no wallpaper.
   Text greys pass 4.5:1 on --color-panel and --color-bg in both schemes. The logo's colors are here too:
   `pnpm design` (design/build.mjs) reads them to write every logo file. */
:root {
  color-scheme: light dark;

  /* Type: Geist and Geist Mono (design/fonts.css). Sizes keep to this scale (no 10 px, badges included),
     named by their size so the names sort as the sizes do. */
  --font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-family-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-size-11: 11px; --font-size-12: 12px; --font-size-13: 13px; --font-size-14: 14px; --font-size-16: 16px; --font-size-18: 18px; --font-size-22: 22px;

  /* Radii and spacing. --radius-card is the cards' and fields' radius. */
  --radius-xs: 4px; --radius-sm: 6px; --radius: 8px; --radius-card: 10px; --radius-lg: 12px; --radius-xl: 16px; --radius-pill: 999px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;

  /* Surfaces and text. */
  --color-bg: light-dark(#f5f6f8, #161618);
  --color-panel: light-dark(#ffffff, #1e1e21);
  --color-sunk: light-dark(#eff1f4, #27272a);
  --color-hover: light-dark(#f3f4f6, #242427);
  --color-text: light-dark(#0f1217, #efeff0);
  --color-text-2: light-dark(#3b424d, #c9c9cd);
  --color-text-3: light-dark(#535b67, #9d9da3);
  --color-text-4: light-dark(#676e79, #8d8d93);
  --color-line: light-dark(#e6e8ec, #323236);
  --color-line-strong: light-dark(#d3d7dd, #414146);
  /* Text fields' edge: at least 3:1 against every surface a field sits on, the sunk fill and the
     window's toolbar included (WCAG 1.4.11; #8b929c and #6c6c73 until 2026-11-21 were 2.77:1 on
     the sunk fill and 2.67:1 on the dark window, test/a11y.mjs part fields). */
  --color-line-field: light-dark(#828993, #78787f);

  /* Meaning. Blue means an agent is working, and only that (design/BRAND.md "Colour", 2026-11-25):
     selection is ink (--color-text on --color-sunk), links are text with an underline, and a keyboard
     stop's ring is --color-focus. The accent was that working blue under its old name; since the
     landing page stopped using it (2026-11-26) it is in the alias block below. */
  /* Focus: the ring of a keyboard stop. The logo's pink, a hue clear of the working blue and of ink,
     at least 3:1 on every surface it meets (light 4.05:1 on the window's hover grey, dark 4.69:1 on
     the amber tint). */
  --color-focus: light-dark(#d42a55, #ff5c7f);

  /* Amber: an ask is waiting for the person ("needs you"). --color-on-wait is text on a filled amber. */
  --color-wait: light-dark(#b54708, #ffb15c);
  --color-wait-fill: light-dark(#f08c00, #f59f2a);
  --color-wait-tint: light-dark(#fff4e5, #33220f);
  --color-wait-line: light-dark(#fbd59f, #5a3c17);
  --color-wait-strong: light-dark(#ffe2b3, #4a3112);
  --color-on-wait: #1d1203;

  /* An agent is working (blue), done (green), failed (red), paused (purple), asleep (grey). */
  --color-work: light-dark(#2f5bea, #7c9bff);
  --color-work-tint: light-dark(#ebf0fe, #1b2140);
  --color-ok: light-dark(#0f7b4f, #5fd0a0);
  --color-ok-tint: light-dark(#e3f5ec, #112d24);
  --color-danger: light-dark(#c0362c, #ff8a80);
  --color-danger-tint: light-dark(#fdecea, #3a1715);
  --color-pause: light-dark(#6b3fa0, #c9a4f5);
  --color-pause-tint: light-dark(#efe6fa, #2b1f3d);
  --color-asleep: light-dark(#98a0aa, #737378);
  /* Chart series, in this order (the owner's Status page, web/console/status.css): the dataviz
     method's first three slots, checked with its validator against --color-panel in both themes.
     The light aqua is under 3:1 on white, so every chart that uses it has a legend and a readout. */
  --color-chart-1: light-dark(#2a78d6, #3987e5);
  --color-chart-2: light-dark(#eb6834, #d95926);
  --color-chart-3: light-dark(#1baf7a, #199e70);

  /* Shadows: the dark ones are deeper, so they have their own geometry (the dark block below). */
  --shadow-light: 0 1px 2px rgba(15, 18, 23, .05), 0 2px 8px rgba(15, 18, 23, .05);
  --shadow-dark: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow: var(--shadow-light);
  --shadow-lg: 0 12px 40px rgba(15, 18, 23, .16);

  /* The console's browser window (style.css, "One island"): its toolbar, field and hover, and the
     raised rows beside it. The window is always light; these dark values serve the settings block
     drawn like it. The address field's edge on the toolbar keeps 3:1 there. */
  --color-window: light-dark(#ffffff, #2c2c30);
  --color-window-field: light-dark(#eff1f4, #18181a);
  --color-window-hover: light-dark(#e6e9ee, #37373b);
  --color-window-line: light-dark(#d9dde3, #070708);
  /* The address field's edge on the window's light toolbar, which in dark lies on the dark wallpaper
     (208, 210, 213 drawn): 3.1:1 (WCAG 1.4.11; #7d848f until 2026-11-21 was 2.5:1 there). */
  --color-window-line-field: #6e7580;
  /* The window's line under its glass toolbar on a dark sheet, and the address at rest in it. */
  --color-window-line-glass: #c3c9d1;
  --color-window-text-2: #474e59;
  --color-raised: light-dark(#ffffff, #27272a);
  --color-window-edge-light: rgba(15, 18, 23, .14);
  --color-window-edge-dark: #4c4c52;
  --shadow-window-light: 0 1px 2px rgba(15, 18, 23, .06), 0 8px 28px rgba(15, 18, 23, .10);
  --shadow-window-dark: 0 12px 40px rgba(0, 0, 0, .6);

  /* The window's greys and amber text: the page's own, never the painted sheet's darker ones
     (style.css, "Text on the painted sheet"). Set here, at :root, they keep tokens.css's values
     wherever the sheet changes --color-text-3, --color-text-4 and --color-wait. */
  --color-window-text-3: var(--color-text-3);
  --color-window-text-4: var(--color-text-4);
  --color-window-wait: var(--color-wait);

  /* Greys and amber text a step darker on the console's painted sheet in light, where the wallpaper
     turns mauve (style.css, "Text on the painted sheet"). */
  --color-glass-text-3: #424953;
  --color-glass-text-4: #4d545f;
  --color-glass-wait: #9a3b06;

  /* White and black that stay so in both schemes: text and a switch's knob on a filled colour, the
     plate behind a picture, and the opaque part of a mask. */
  --color-white: #ffffff;
  --color-black: #000000;
  /* The chip behind a site's own icon when the icon would vanish on the panel: dark behind a white
     icon in light, light behind a black icon in dark (.sitemark.img in web/console/style.css). */
  --color-site-icon-plate-dark: #24292f;
  --color-site-icon-plate-light: #e6e8eb;

  /* The logo (design/logo.svg): an ink tile, a red band with a knot, one eye. */
  --color-logo-tile: light-dark(#0f1217, #eef0f3);
  --color-logo-band: light-dark(#e8365d, #ff5c7f);
  --color-logo-eye: light-dark(#ffffff, #0f1217);

  /* The plate behind the logo on an iPhone's home screen (apple-touch-icon.png). */
  --color-icon-plate: #e9ebf1;

  /* The browser marks' visor (web/console/shared/marks.js). */
  --color-mark-visor: #0f1217;

  /* The landing page's background (hotkey.so): white and black, under its wallpapers. */
  --color-landing-bg: light-dark(#ffffff, #000000);

  /* The viewer (web/viewer/): dark on its own; light only on a hand link's page in a light system
     (body.link), and its start page in the console's light theme. */
  --color-viewer-bg: light-dark(#f5f6f8, #0f1115);
  /* A page pane with nothing to show yet (no picture of the tab, or one of another shape): the
     viewer's dark stage in both themes, since a light one read as a white flash (2026-11-19). */
  --color-viewer-blank: #0f1115;
  --color-viewer-bar: light-dark(#ffffff, #181b21);
  --color-viewer-field: light-dark(#eff1f4, #23272f);
  --color-viewer-line: light-dark(#e3e6ea, #2e333c);
  --color-viewer-line-field: light-dark(#8b929c, #666d78);
  --color-viewer-text: light-dark(#0f1217, #e8eaee);
  --color-viewer-text-3: light-dark(#535b67, #8b919c);
  /* An agent working, in the viewer (its dot and state): the working blue, and only that (2026-11-25; --color-viewer-accent until then, which also drew selection and focus). */
  --color-viewer-work: light-dark(#2f5bea, #4c8dff);
  /* Filled buttons: white text on the dark --color-viewer-work was 3.2:1, on this 5.5:1. */
  --color-viewer-accent-fill: #2f5bea;
  /* Amber, "needs you", in the viewer. */
  --color-viewer-wait: #f5a524;
  /* Secondary text in its sheets, and text on its floating chips. */
  --color-viewer-hint: #9aa3b2;
  --color-viewer-on-chip: #f1f3f6;
  /* Text on that light chip (the hand bar's Done). */
  --color-viewer-ink: #15181c;
  /* The hand bar over the page (#handoff): its amber band, edge, heading and hint. */
  --color-viewer-wait-tint: #33240f;
  --color-viewer-wait-line: #5a3f17;
  --color-viewer-wait-text: #ffc46b;
  --color-viewer-wait-hint: #d8c8a6;
  /* The connection dot (green), the done check's disc, and a sleeping tab's dot. */
  --color-viewer-ok: #2fbf71;
  --color-viewer-ok-fill: #1f9d5c;
  --color-viewer-asleep: #6b7280;
  /* The sign-in sheet and the saved-password cards (web/viewer/style.css, "Sign-in sheet"): light in
     a light console or a light hand link, dark otherwise. Errors use --color-viewer-danger everywhere. */
  --color-viewer-sheet-field: light-dark(#ffffff, #1b1f27);
  --color-viewer-sheet-card: light-dark(#f5f6f8, #23272f);
  --color-viewer-sheet-card-edge: light-dark(#d3d7dd, #2e333c);
  --color-viewer-link: light-dark(#2149cc, #4c8dff);
  --color-viewer-danger: light-dark(#b42318, #ff9b8f);
  /* The page a blank tab shows (#startpage): it follows the system or the console's theme. */
  --color-viewer-start-bg: light-dark(#ffffff, #111318);
  --color-viewer-start-field: light-dark(#f3f4f6, #1d2027);
  --color-viewer-start-text-3: light-dark(#535b67, #a3a9b4);

  /* Popups (design/popups.css, research/modals-audit.md): five kinds (dialog, menu, offer, notice,
     toast) drawn from these in the console, the viewer and the hub's pages. The scrim dims what a
     dialog blocks; a popup is the raised surface with its edge, which keeps it visible on a dark page. */
  --color-scrim: light-dark(rgba(15, 18, 23, .36), rgba(0, 0, 0, .62));
  --color-popup: light-dark(#ffffff, #1e1e20);
  --color-popup-edge: light-dark(rgba(15, 18, 23, .08), #36363a);
  /* A destructive primary button: filled red, white text (4.5:1 in both schemes). */
  --color-danger-fill: light-dark(#c0362c, #c8352b);
  /* An error toast's mark: the toast is drawn in the other scheme's ink, so its red is the other scheme's too. */
  --color-toast-danger: light-dark(#ff8a80, #c0362c);
  --color-on-danger: #ffffff;
  --shadow-popup-light: 0 1px 2px rgba(15, 18, 23, .06), 0 16px 48px rgba(15, 18, 23, .18);
  --shadow-popup-dark: 0 16px 48px rgba(0, 0, 0, .6);
  --shadow-popup: var(--shadow-popup-light);
  --radius-popup: var(--radius-xl);
  --radius-menu: var(--radius-lg);
  /* Widths: a dialog, a large dialog (Settings), a menu's least, an offer; and the least size of a
     touch target. Below 700 px a dialog and a menu are bottom sheets. */
  --size-popup: 440px;
  --size-popup-wide: 1200px;
  --size-menu: 220px;
  --size-offer: 360px;
  --size-target: 44px;
  /* Motion: popups open in 180 ms and close in 120 ms; only a fade under reduced motion. */
  --duration-popup-in: 180ms;
  --duration-popup-out: 120ms;
  --ease-popup: cubic-bezier(.2, .8, .2, 1);
  /* Layers for what isn't a modal dialog (dialogs sit in the browser's top layer, above all). */
  --z-notice: 10;
  --z-offer: 20;
  --z-menu: 40;
  --z-toast: 50;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow: var(--shadow-dark); --shadow-popup: var(--shadow-popup-dark); } }
:root[data-theme="dark"] { --shadow: var(--shadow-dark); --shadow-popup: var(--shadow-popup-dark); }

/* Old names (design:aliases), kept for one release after a rename so a page opened before a deploy
   still draws: each is var(<new name>). `pnpm design --check` fails while our own files still use
   one (design/README.md, "Renaming a token"). The names of 2026-11-14 (design/README.md, "Naming") go
   after the next release. */
:root {
  --font: var(--font-family);
  --mono: var(--font-family-mono);
  --text-xs: var(--font-size-11);
  --text-sm: var(--font-size-12);
  --text-md: var(--font-size-13);
  --text-base: var(--font-size-14);
  --text-lg: var(--font-size-16);
  --text-xl: var(--font-size-18);
  --text-2xl: var(--font-size-22);
  --r: var(--radius-card);
  --bg: var(--color-bg);
  --panel: var(--color-panel);
  --sunk: var(--color-sunk);
  --hover: var(--color-hover);
  --lift: var(--color-raised);
  --ink: var(--color-text);
  --ink-2: var(--color-text-2);
  --ink-3: var(--color-text-3);
  --ink-4: var(--color-text-4);
  --line: var(--color-line);
  --line-2: var(--color-line-strong);
  --line-field: var(--color-line-field);
  --accent: var(--color-work);
  --accent-hover: var(--color-work);
  --accent-tint: var(--color-work-tint);
  --accent-ink: var(--color-work);
  --on-accent: var(--color-white);
  /* The accent blue, retired 2026-11-26: blue means working only (design/BRAND.md "Colour"). */
  --color-accent: var(--color-work);
  --color-accent-hover: var(--color-work);
  --color-accent-tint: var(--color-work-tint);
  --color-accent-text: var(--color-work);
  --color-on-accent: var(--color-white);
  --wait: var(--color-wait);
  --wait-fill: var(--color-wait-fill);
  --wait-tint: var(--color-wait-tint);
  --wait-line: var(--color-wait-line);
  --wait-strong: var(--color-wait-strong);
  --on-wait: var(--color-on-wait);
  --work: var(--color-work);
  --work-tint: var(--color-work-tint);
  --ok: var(--color-ok);
  --ok-tint: var(--color-ok-tint);
  --danger: var(--color-danger);
  --danger-tint: var(--color-danger-tint);
  --pause: var(--color-pause);
  --pause-tint: var(--color-pause-tint);
  --sleep: var(--color-asleep);
  --chrome: var(--color-window);
  --chrome-field: var(--color-window-field);
  --chrome-hover: var(--color-window-hover);
  --chrome-line: var(--color-window-line);
  --chrome-line-field: var(--color-window-line-field);
  --window-edge-light: var(--color-window-edge-light);
  --window-edge-dark: var(--color-window-edge-dark);
  --window-shadow-light: var(--shadow-window-light);
  --window-shadow-dark: var(--shadow-window-dark);
  --glass-ink-3: var(--color-glass-text-3);
  --glass-ink-4: var(--color-glass-text-4);
  --glass-wait: var(--color-glass-wait);
  --logo-tile: var(--color-logo-tile);
  --logo-band: var(--color-logo-band);
  --logo-eye: var(--color-logo-eye);
  --icon-plate: var(--color-icon-plate);
  --mark-visor: var(--color-mark-visor);
  --landing-bg: var(--color-landing-bg);
  --viewer-bg: var(--color-viewer-bg);
  --viewer-bar: var(--color-viewer-bar);
  --viewer-field: var(--color-viewer-field);
  --viewer-line: var(--color-viewer-line);
  --viewer-line-field: var(--color-viewer-line-field);
  --viewer-text: var(--color-viewer-text);
  --viewer-muted: var(--color-viewer-text-3);
  --viewer-accent: var(--color-viewer-work);
  --color-viewer-accent: var(--color-viewer-work);
  --viewer-accent-fill: var(--color-viewer-accent-fill);
  --viewer-warn: var(--color-viewer-wait);
  --viewer-hint: var(--color-viewer-hint);
  --viewer-on-chip: var(--color-viewer-on-chip);
  --viewer-sheet-field: var(--color-viewer-sheet-field);
  --viewer-sheet-card: var(--color-viewer-sheet-card);
  --viewer-sheet-card-edge: var(--color-viewer-sheet-card-edge);
  --viewer-link: var(--color-viewer-link);
  --viewer-error: var(--color-viewer-danger);
  --viewer-start-bg: var(--color-viewer-start-bg);
  --viewer-start-field: var(--color-viewer-start-field);
  --viewer-start-muted: var(--color-viewer-start-text-3);
}
