/* Bifocal's tokens, defined once. The installed app links this file; the run site's tokens.css imports it and sets the
   site's own --rer-* values over it. The look is the owner's hero H and logo 4 (design desk, 20 Oct 2026) and the
   owner's approved app look A (round 2, h1; 26 Oct 2026): cobalt, golden yellow, ink and white; Mona Sans for headings,
   numerals and the wordmark; the system UI face for app text; mono only for queries and rows. Never Inter.
   Base's sign-in, first-run setup, Lobby and local key page read the --rer-* names below. */
:root {
  --cobalt: #2e7dfd;
  --yellow: #fec502;
  --ink: #000000;
  --white: #fefdfd;
  /* Cobalt as text on white (the hero's cobalt is 3.8:1 there; this is 5.2:1) and the ink's quiet tints. */
  --cobalt-text: #1d5ed8;
  --ink-soft: #3b3b3b;
  --line: color-mix(in srgb, var(--ink) 16%, var(--white));
  --font-sans: 'Mona Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  /* The installed app. */
  --app-page: #ffffff;
  --app-surface: #ffffff;
  --app-sunk: #f6f7f9;
  --app-text: #111827;
  --app-text-2: #374151;
  --app-muted: #5b6475;
  --app-line: #e3e6ec;
  --app-field: #c9ced8;
  --app-field-strong: #9aa3b2;
  --app-link: var(--cobalt-text);
  --app-mark: var(--cobalt);
  --app-accent: var(--cobalt-text);
  --app-accent-hover: #174cb3;
  --app-on-accent: #ffffff;
  --app-select: #edf3fe;
  --app-soft: var(--app-select);
  --app-avatar: #dee1e8;
  /* h1's outline buttons: a firm grey edge, darker than a field's. */
  --app-button-line: #959aa6;
  --app-disabled: #dce7fb;
  --app-disabled-text: #4b5b78;
  --app-held: var(--yellow);
  --app-held-tint: #fffaed;
  --app-danger: #a3221b;
  --app-danger-tint: #fef3f2;
  --app-danger-line: #f1b5b0;
  --app-radius: 8px;
  --app-control: 6px;

  --rer-page: var(--app-sunk);
  --rer-surface: var(--app-surface);
  --rer-text: var(--app-text);
  --rer-muted: var(--app-muted);
  --rer-border: var(--app-field);
  --rer-focus: var(--app-mark);
  --rer-link: var(--app-link);
  --rer-accent: var(--app-accent);
  --rer-accent-text: var(--app-on-accent);
  --rer-font-body: var(--font-ui);
  --rer-font-heading: var(--font-sans);
  --rer-font-mono: var(--font-mono);
  --rer-radius: var(--app-radius);
  --rer-button-radius: var(--app-control);
  --rer-wordmark-weight: 700;
  --rer-wordmark-tracking: -.01em;
  --rer-logo: url('/brand/mark.svg');
  color-scheme: light;
}
/* The desk's dark app reference (h3): near-black ground, the same cobalt and yellow, mark 4's dark colours. */
@media (prefers-color-scheme: dark) {
  :root {
    --app-page: #0e1116;
    --app-surface: #12161c;
    --app-sunk: #181d25;
    --app-text: #eef1f5;
    --app-text-2: #c9d0da;
    --app-muted: #9aa4b2;
    --app-line: #262d38;
    --app-field: #3a4352;
    --app-field-strong: #5b6678;
    --app-link: #7fb0ff;
    --app-accent: #2e6fe0;
    --app-accent-hover: #3d7ff0;
    --app-select: #17284a;
    --app-avatar: #262d38;
    --app-button-line: #5b6678;
    --app-disabled: #253044;
    --app-disabled-text: #b4bfd0;
    --app-held-tint: #2b2306;
    --app-danger: #ffb4ab;
    --app-danger-tint: #2d1514;
    --app-danger-line: #6e2b26;
    --rer-logo: url('/brand/mark-dark.svg');
    color-scheme: dark;
  }
  html.rer-themed { color-scheme: dark; }
}

/* Base's frames (sign-in, first-run setup, the local key page) as one quiet card on the sunk ground. */
html.rer-themed body { background: var(--app-sunk); font-family: var(--font-ui); color: var(--app-text); }
html.rer-themed main { max-width: 440px; padding: 40px; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: var(--app-radius); box-shadow: none; }
html.rer-themed h1 { font: 700 28px/1.2 var(--font-sans); letter-spacing: -.015em; color: var(--app-text); margin: 0 0 20px; }
html.rer-themed h2 { font-family: var(--font-sans); }
html.rer-themed p, html.rer-themed dt { color: var(--app-muted); }
html.rer-themed dd { color: var(--app-text); }
html.rer-themed .brand, html.rer-themed .rer-brand { gap: 10px; margin: 0 0 32px; color: var(--app-text); font: 700 22px/1 var(--font-sans); letter-spacing: -.01em; }
/* Mark 4 is a wide lockup (two lenses on a bridge, 2.1:1); draw it at its own width beside the name. */
html.rer-themed .brand::before, html.rer-themed .rer-brand::before { width: 50px; height: 24px; }
html.rer-themed label { color: var(--app-text); font-size: 14px; font-weight: 600; }
html.rer-themed input:not([type=checkbox]):not([type=hidden]) { min-height: 44px; padding: 10px 12px; background: var(--app-surface); color: var(--app-text); border: 1px solid var(--app-field); border-radius: var(--app-control); }
html.rer-themed input:not([type=checkbox]):not([type=hidden]):focus-visible { outline: 2px solid var(--app-mark); outline-offset: 0; border-color: var(--app-mark); }
html.rer-themed input[type=checkbox] { accent-color: var(--app-accent); }
html.rer-themed button, html.rer-themed .action { min-height: 44px; border: 1px solid var(--app-accent); border-radius: var(--app-control); background: var(--app-accent); color: var(--app-on-accent); font-weight: 600; box-shadow: none; }
html.rer-themed button:hover, html.rer-themed .action:hover { background: var(--app-accent-hover); border-color: var(--app-accent-hover); box-shadow: none; }
html.rer-themed button:focus-visible, html.rer-themed .action:focus-visible { outline: 2px solid var(--app-mark); outline-offset: 2px; }
html.rer-themed button.secondary { background: var(--app-surface); color: var(--app-text); border-color: var(--app-field); }
html.rer-themed .notice { border: 1px solid var(--app-line); border-radius: var(--app-control); background: var(--app-sunk); padding: 10px 12px; color: var(--app-text); }
html.rer-themed .divider::before, html.rer-themed .divider::after { border-color: var(--app-line); }
html.rer-themed a { color: var(--app-link); }
img.mark { width: 2.2em; height: 1.05em; }
body .brand > img { width: 84px; height: 40px; }
@media (max-width: 480px) {
  html.rer-themed main { padding: 28px 20px; }
  html.rer-themed h1 { font-size: 26px; }
}
