/* ============================================================================
   TFM v8 -- THE colour file.  src/web/shared/tfm-tokens.css

   EVERY COLOUR IN THIS BUILD IS DEFINED HERE AND NOWHERE ELSE. `p8_map_gate.py`
   rule 1 fails on a colour literal found in any other .css, .js or .html we
   wrote. One file is what makes a palette changeable; a hex code in a page is a
   palette nobody can find.

   WHY THIS IS CSS AND NOT JAVASCRIPT, WHICH IS WHERE IT USED TO LIVE.
   The palette was previously VALUES in shared/tfm-colors.js, written onto :root
   at run time by applyTheme(). That made every colour on every page depend on a
   module executing. On 2026-08-08 a module stopped executing and the effect was
   measured live: the sign-in page rendered completely unstyled -- not degraded,
   unstyled, because the stylesheet held nothing but var() references and none of
   them resolved.

   A stylesheet cannot fail to execute. It has no imports to link and no
   run-time errors. Defining the tokens here means the worst a broken module can
   now do is break that module, which is the blast radius it should have had.

   The .js half is the READER, not a second source: shared/tfm-colors.js resolves
   these same custom properties for the code that needs a colour as a string
   (OpenLayers styles, a border set from script). It holds no literal.
   ========================================================================== */

:root {
  /* ---- the shell. v7's dark ground and teal accent, carried across -------- */
  --tfm-ground:     #0b1220;   /* page */
  --tfm-panel:      #111a2b;   /* cards, toolbars, panels */
  --tfm-panel-high: #16233a;   /* a raised row inside a panel */
  --tfm-edge:       #1f2b40;   /* hairlines */
  --tfm-ink:        #e6edf6;   /* text */

  /* **THE TWELVE TIA-598-C FIBRE COLOURS** (brief 7 section 2.3). Here because `p8_map_gate`
     refuses a colour literal anywhere else, and it is right to: a swatch hard-coded in a
     module is a colour the theme cannot reach. The ORDER and the NAMES are the database's --
     `config.lookup_values` seeded them and `api.fn_fiber_color` serves them; these are only
     what each name looks like. **White and Slate carry a border** because a white dot on a
     light panel is an invisible dot. */
  --tfm-fibre-blue:   #1f6feb;
  --tfm-fibre-orange: #e8830c;
  --tfm-fibre-green:  #2ea043;
  --tfm-fibre-brown:  #8b5a2b;
  --tfm-fibre-slate:  #8b98a5;
  --tfm-fibre-white:  #f4f6f8;
  --tfm-fibre-red:    #e5484d;
  --tfm-fibre-black:  #24292f;
  --tfm-fibre-yellow: #e3b341;
  --tfm-fibre-violet: #a371f7;
  --tfm-fibre-rose:   #f778ba;
  --tfm-fibre-aqua:   #39c5cf;
  --tfm-bad:        #e02424;   /* a located fault: the one red on the map */
  --tfm-ink-muted:  #8fa3bf;   /* secondary text */
  --tfm-accent:     #2fd4c4;   /* TFM teal */
  --tfm-accent-ink: #04211f;   /* text ON the accent */
  --tfm-live:       #2fd4c4;   /* the "live" tag */
  --tfm-admin-tag:  #f0a92e;   /* the "admin" tag */

  /* ---- paper -------------------------------------------------------------
     A printed report is not the screen. These are the only colours the print
     block uses, and they live here for the same reason every other colour does:
     a hex code in a page's @media print rule is a second palette that the one
     colour file cannot see and rule 1 would refuse. */
  --tfm-paper:      #ffffff;
  --tfm-paper-ink:  #000000;
  --tfm-paper-edge: #999999;

  /* **THE FOUR SPLICE STATES** (brief 11, amendment 1 ruling 6). The status legend is
     MIRRORED from the QGIS splice window, and a legend is its labels AND the colours they
     explain -- so the tints stopped being hex literals in a Qt module the day the web had to
     show them. `core/spliceview.py` holds Qt's; these are the browser's, and
     `web_splice_parity_gate` binds the two to the same four NAMES. The hexes differ on
     purpose: these sit on this build's dark ground, and the ones in the plugin sit on Qt's. */
  --tfm-splice-free:            #1e5f2e;
  --tfm-splice-circuit-gap:     #7a5a1f;
  --tfm-splice-spliced:         #333333;
  --tfm-splice-circuit-spliced: #7a1f1f;

  /* ---- states ------------------------------------------------------------ */
  --tfm-warn:       #f85149;
  --tfm-ok:         #3fb950;
  --tfm-muted:      #8b949e;
  --tfm-select:     #58a6ff;

  /* ---- the ten served layers --------------------------------------------- */
  /* One per layer in the tile index. A layer with no token here is drawn in
     --tfm-muted and says so in the console: an unknown layer given a colour of
     its own reads as a decision somebody made. */
  --tfm-layer-conduits:        #8c6d3f;
  --tfm-layer-fiber_cables:    #1f6feb;
  --tfm-layer-splice_closures: #d29922;
  --tfm-layer-vaults:          #6e7681;
  --tfm-layer-panels:          #8957e5;
  --tfm-layer-nids_mpts:       #3fb950;
  --tfm-layer-onts:            #2ea043;
  --tfm-layer-field_issues:    #f85149;
  --tfm-layer-field_markups:   #e3b341;
  --tfm-layer-olt_devices:     #db61a2;
}
