/* Vidor Overlay Requirements — design tokens.
 *
 * Loaded by BOTH pages. These definitions were lost when the single-page app was
 * split into index.html + admin.html: the slice started at the `*{box-sizing`
 * anchor and this block sat above it, so every var() on both pages resolved to
 * nothing and the whole palette went transparent. Restored here, in one file, so
 * the two pages cannot drift apart — the same reason shared.js exists.
 *
 * Copied byte for byte from the approved prototype
 * (/opt/vidor/scratch/prompt-02/overlay-requirements.original.html, md5
 * 1ce884137abc6f310de5beded79b38d5). Do not edit these values here; the
 * prototype is the spec.
 *
 * /opt/vidor/scratch/prompt-08/check_css_vars.js fails if either page references a property this file
 * does not define.
 */
:root{
  /* Platform contract tokens (Tool Theming Contract §3), defaulted to this
     tool's own palette. Embedded, ToolFrame pushes the active theme's values
     onto <html> as inline custom properties, which outrank this block — so the
     same declarations serve both contexts and nothing has to be swapped.
     Standalone, or if no vidor:theme message ever arrives, these defaults are
     what render. */
  --cb4-bg:#E4E1D8;
  --cb4-surface:#1C1E1A;
  --cb4-text:#17181A;
  --cb4-text-secondary:#6E7168;
  --cb4-border:#C6C2B6;
  --cb4-accent-contrast:#E4E1D8;

  /* This tool's own names, sourced from the tokens above. The hex values are
     the prototype's, unchanged — they now live as the var() fallbacks, so the
     standalone identity is byte-identical to what it always was. */
  --steel:var(--cb4-bg,#E4E1D8);
  --ink:var(--cb4-text,#17181A);
  --panel:var(--cb4-surface,#1C1E1A);
  /* NOT --cb4-text. This is text on the INVERTED panel, not body text: the
     result panel is dark on a light page, so standalone this must stay the
     prototype's light value. Routing it through --cb4-text put #17181A on
     #1C1E1A — 1.06:1 — because --cb4-text is defined just above, so the var()
     fallback never fired. Embedded, body.embedded below re-points it at the
     theme, where panel and page share one text colour. */
  --onDark:#E4E1D8;
  --sub:var(--cb4-text-secondary,#6E7168);
  --line:var(--cb4-border,#C6C2B6);

  /* NOT themed, deliberately. Amber and red encode severity on the warning
     alerts — the most safety-relevant element on the page. --cb4-accent is a
     single value and is purple on creamy_violet; routing severity through it
     would make STOP and WEIGHT indistinguishable. These stay put in every
     theme, which is also why the print stylesheet carries severity in border
     weight rather than colour. */
  --amber:#D9A521; --red:#B93A22;
}

/* Embedded: the platform draws the header, so the tool's own would be a second
   one. Hidden with a class rather than removed, so standalone is unaffected.

   The PRINT control is deliberately NOT hidden here. It was, briefly, on the
   reasoning that a button is chrome and a framed tool is not a print target —
   both wrong. A tech standing at a door wants the spec sheet from wherever the
   tool happens to be open, and sending them to a second URL to get it is
   friction with no upside. window.print() called inside the frame prints the
   frame's own document, and the @media print block below already forces a light
   background and literal colours, so the platform theme cannot follow it onto
   paper. The button still hides itself while printing — see .printbar in the
   print block. */
body.embedded header{display:none}

/* Once a theme has actually been applied, the result panel is the theme's
   surface rather than this tool's inverted slab, so text on it follows the
   theme. Keyed on `themed`, NOT `embedded`: the embedded class is set at first
   paint but tokens only arrive with vidor:theme, and may never arrive. In that
   window this tool keeps its own readable pair — contract §6.4, the tool must
   be usable before the handshake and if it never happens. */
body.themed{--onDark:var(--cb4-text,#E4E1D8)}
