/* ============================================================================
 * VENDORED COPY — Jarvis-Portal.
 *
 * Byte-for-byte copy (below this banner) of the Cortex app's own
 * app/public/tokens.css as of 2026-08-11. It is COPIED, not fetched: this
 * service loads nothing from any host
 * but its own, and its CSP is `default-src 'none'` with no external origin allowed.
 * Keeping the file identical is what makes the portal look like the transmittals
 * and owner packages the same counterparties already receive.
 *
 * TO RE-SYNC: copy the Cortex file over everything below this banner, re-run
 * `npm test`, and note the date here. Do not edit the token values in this copy —
 * a divergence here is a portal that quietly stops matching the house.
 *
 * The comment immediately below describes the CORTEX app; two of its notes do not
 * apply here (there is no comms.js and no jarvis-ui.css in this repo). The .chip
 * status vocabulary — ▣ current / ▲ watch / ■ fail / – na — is used verbatim by
 * public/portal.js.
 * ============================================================================ */

/* tokens.css — Concept C "Engineering Register" token layer for the Cortex app.
 *
 * PROVENANCE. The token values, the prefers-color-scheme block, the
 * :root[data-theme] overrides and the four .chip treatments below are copied
 * from the sheet-updater vendored twin:
 *   file:   ~/ClaudeBuilds/sheet-updater/templates/tokens.css
 *   which is itself the byte-identical twin of
 *   repo:   Construction-Estimating-System (CES)
 *   path:   plugin/construction-ops/shared/presentation/tokens.css
 *   commit: eb643349a6366b4f1d05d8ff415175ed765f970b (2026-07-29)
 * Design authority: ~/Jarvis/Plans/design-language/04_concept-C-engineering-
 * register-v1.md, section "HTML artifacts (light + dark)" + "STATUS CHIPS".
 * Item: T3-11a (10_track3-html-cornerstone-v1.md).
 *
 * TWO DELIBERATE DEVIATIONS from the vendored twin, both forced by this app and
 * both stated rather than smuggled:
 *
 *   1. THE .chip BASE IS SCOPED TO THE FOUR MODIFIERS. The twin declares a bare
 *      `.chip { … }` base. The Cortex app already ships a *label* chip under the
 *      same class name — deal names and counts emitted by assistant.js,
 *      dossier.js, comms.js, ask.js — which is not a status chip at all. A bare
 *      base would silently uppercase every deal name on eight pages. So the base
 *      properties are declared on `.chip.current, .chip.watch, .chip.fail,
 *      .chip.na` instead. The four-chip STATUS vocabulary is unchanged; only the
 *      selector that carries the shared properties is narrowed.
 *
 *   2. THE GLYPH IS A ::before, NOT MARKUP. The spec's markup form is
 *      `<span class="chip current">▣ CURRENT</span>`. Emitting the glyph from
 *      CSS keeps T3-11a's "no JS edits" scope honest — every status label in this
 *      app is generated by JS, and a ::before prefix reaches all of them without
 *      touching a single .js file. Nothing in this app's markup carries ▣ ▲ ■
 *      today, so there is nothing to double up.
 *
 *   3. FIVE LEGACY NAMES ARE ALIASED ONTO THE FOUR (P4b, 2026-08-05). comms.js
 *      emitted six tinted chip subclasses of its own — a SECOND status vocabulary
 *      living in comms.html's inline <style>, hue-encoded, with no counterpart in
 *      the canon. Its five status names (ok / owned / hold / new / known) are
 *      folded into the selector lists below, so there is exactly ONE definition of
 *      what each treatment looks like. They are aliases, not new states: nothing
 *      here draws a fifth thing. The two remaining names — `deal` and `from` —
 *      carry a CATEGORY (which deal, which hat), never a status, so they are
 *      deliberately absent: they fall through to the quiet outline LABEL chip that
 *      jarvis-ui.css declares as the bare `.chip` / `.tag` rule. Retire the aliases
 *      when comms.js is next edited and can emit the canonical names directly.
 *
 * THE COMPATIBILITY LAYER (second block, further down) is net-new here and has
 * no counterpart in the twin. It aliases the Cortex app's own long-standing
 * variable names onto the Concept C tokens so styles.css, jarvis-ui.css and the
 * inline <style> blocks become CONSUMERS of one token set instead of three. It
 * is what collapses the three retired accents — the desktop blue, the mobile
 * terracotta and the sheets red — onto the one --accent pair, and what gives the
 * desktop app the dark mode it has never had. (Their hex literals are named in
 * 10_track3-html-cornerstone-v1.md T3-11a and deliberately not repeated here:
 * the closing gate greps for those literals, and a comment that trips it would
 * be indistinguishable from a real survivor.)
 *
 * m.html and login.html do NOT link this file. jarvis-ui.css's header names them
 * the canonical self-contained references, so they carry an inline copy of the
 * block below and this file mirrors THEM — the order that header demands.
 */

:root {
  /* ---- light (default) ---- */
  --ink: #16191C;
  --graphite: #3C4249;
  --steel: #6B7480;
  --rule: #A8AFB8;
  --hairline: #D5D9DE;
  --vellum: #F1F0EC;
  --sheet: #FAF9F6;
  --paper: #FFFFFF;
  --accent: #C4361B;
  --accent-tint: #FBE7E2;

  /* ---- font stacks (three, exactly as tokens.py FONTS) ---- */
  --font-display: 'IBM Plex Sans Condensed', 'Helvetica Neue Condensed Bold', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'IBM Plex Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, 'Courier New', monospace;

  /* ---- the --mono/--cond/--sans aliases the design spec and this app both
     reference by name (present in the sheet-updater twin, absent from CES) ---- */
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --cond: 'IBM Plex Sans Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --sans: 'IBM Plex Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;

  /* Both polarities are real now, on every surface — so tell the UA, and let a
     stamped data-theme win below. */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E8E6E1;
    --graphite: #B9BDC2;
    --steel: #8A929B;
    --rule: #4A5058;
    --hairline: #2C3137;
    --vellum: #1C2025;
    --sheet: #121519;
    --paper: #171B20;
    --accent: #FF6A45;
    --accent-tint: #3A1D15;
  }
}

/* Explicit overrides win over prefers-color-scheme in BOTH directions, so a
   page's own light/dark toggle (which stamps data-theme on the root) is
   always authoritative regardless of OS setting. */
:root[data-theme="dark"] {
  --ink: #E8E6E1;
  --graphite: #B9BDC2;
  --steel: #8A929B;
  --rule: #4A5058;
  --hairline: #2C3137;
  --vellum: #1C2025;
  --sheet: #121519;
  --paper: #171B20;
  --accent: #FF6A45;
  --accent-tint: #3A1D15;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --ink: #16191C;
  --graphite: #3C4249;
  --steel: #6B7480;
  --rule: #A8AFB8;
  --hairline: #D5D9DE;
  --vellum: #F1F0EC;
  --sheet: #FAF9F6;
  --paper: #FFFFFF;
  --accent: #C4361B;
  --accent-tint: #FBE7E2;
  color-scheme: light;
}

/* ------------------------------------------------------------------------
 * COMPATIBILITY LAYER — the Cortex app's own variable names, repointed.
 *
 * These names are load-bearing across styles.css, jarvis-ui.css and fourteen
 * inline <style> blocks. Repointing them here is what makes every one of those
 * surfaces a consumer of this file without restructuring a single rule.
 *
 * The three status vocabularies collapse here too: --good/--warn/--bad were the
 * phone's hue-encoded states and --verified/--draft/--record the desktop's.
 * Concept C carries state in outline-vs-solid-vs-dashed plus a glyph, never in
 * hue, so the settled states fold onto --ink and the in-motion / failed states
 * onto --accent. The WORDS in the markup ("VERIFIED", "DRAFT", "RECORD",
 * "FAILED") still say which is which; the treatment says how loud it is.
 * ---------------------------------------------------------------------- */
:root {
  /* surfaces */
  --bg: var(--sheet);
  --chrome: var(--paper);
  --chrome-2: var(--vellum);
  --panel: var(--paper);
  --panel-2: var(--vellum);
  --raise: var(--vellum);

  /* rules */
  --line: var(--rule);
  --line-2: var(--hairline);

  /* text ramp */
  --ink-2: var(--graphite);
  --ink-3: var(--steel);
  --ink-faint: var(--rule);

  /* one accent pair, replacing the three retired ones (see header) */
  --accent-2: var(--accent);
  --accent-dim: var(--accent-tint);
  --accent-soft: var(--accent-tint);

  /* status: hue is no longer the carrier */
  --good: var(--ink);
  --warn: var(--accent);
  --bad: var(--accent);
  --verified: var(--ink);
  --verified-soft: var(--vellum);
  --draft: var(--accent);
  --draft-soft: var(--accent-tint);
  --record: var(--ink);
  --record-soft: var(--vellum);

  /* Concept C draws rules; it does not round corners. */
  --r: 0px;
  --r-sm: 0px;

  /* the desktop doc surface's reading serif is kept — Concept C's body rule
     ("never mono, never justified") does not forbid a text serif, and the
     AIA/Times gate argues a serif sits comfortably beside the grotesque. */
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;

  /* Concept C has no drop shadows. Kept as names so consumers need no edit. */
  --sh-1: none;
  --sh-2: none;
}

/* ------------------------------------------------------------------------
 * STATUS CHIPS — the one status vocabulary.
 *
 * No colored pills, no rounded corners. Outline vs. solid vs. dashed vs. glyph
 * carries the meaning; hue is redundant reinforcement only, so these survive
 * grayscale printing/screenshots and are colorblind-safe.
 * Markup: <span class="chip current">CURRENT</span>  (glyph added by CSS)
 *
 * FOUR TREATMENTS, read as a loudness ladder:
 *   fail  ■ solid accent   — it is blocking someone; the loudest thing on screen
 *   watch ▲ accent outline — in motion / wants a look
 *   current ▣ ink outline  — settled, this is the authoritative state
 *   na    – dashed steel   — parked, withheld, or nothing to do
 * The WORDS in the markup say WHICH state it is; the treatment says how loud.
 *
 * The legacy comms names ride along per deviation 3 in the header — aliases onto
 * these same four rules, never a fifth treatment.
 * ---------------------------------------------------------------------- */
.chip.current, .chip.ok, .chip.owned,
.chip.watch, .chip.hold, .chip.new,
.chip.fail,
.chip.na, .chip.known {
  display: inline-block;
  border-radius: 0;
  padding: 2px 7px;
  font: 500 11px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

.chip.current, .chip.ok, .chip.owned {
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
}
.chip.current::before, .chip.ok::before, .chip.owned::before { content: "\25A3\00A0"; }   /* ▣ */
/* comms.js writes a literal "✓ " inside the label of its `ok` chip, so the canonical glyph
   would double up there. Drop this override the moment that markup loses its own tick. */
.chip.ok::before { content: none; }

.chip.watch, .chip.hold, .chip.new {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
}
.chip.watch::before, .chip.hold::before, .chip.new::before { content: "\25B2\00A0"; }     /* ▲ */

.chip.fail {
  background: var(--accent);
  color: #FFFFFF;
  border: 1px solid var(--accent);
}
.chip.fail::before { content: "\25A0\00A0"; }      /* ■ */

.chip.na, .chip.known {
  border: 1px dashed var(--rule);
  color: var(--steel);
  background: transparent;
}
.chip.na::before, .chip.known::before { content: "\2013\00A0"; }        /* – */
