/* ============================================================================
   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 LIGHT ground and teal accent, carried across -------
     **RULED 2026-09-01 (dashboard shape and look): v7's look on every page,
     including the map. ONE token set -- the theme is not forked, and there is
     no dark variant to drift.** These five and the six below them are the only
     values that moved; the twelve TIA-598-C strand colours did NOT, because
     those are the industry's and not ours to choose. What makes a pale strand
     readable here is the BORDER the swatch already carried
     (`.sv-swatch { border: 1px solid var(--tfm-edge) }`) -- a rule written for
     a light panel back when the panel was dark, and only now doing its job. */
  --tfm-ground:     #f6f8fa;   /* page */
  --tfm-panel:      #ffffff;   /* cards, toolbars, panels */
  --tfm-panel-high: #f0f3f6;   /* a raised row inside a panel */
  --tfm-edge:       #d8dee4;   /* hairlines */
  --tfm-ink:        #1c2430;   /* 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:        #c0271f;   /* a located fault: the one red on the map */
  --tfm-ink-muted:  #5b6875;   /* secondary text */
  --tfm-accent:     #127f75;   /* TFM teal, darkened for a light ground -- same hue */
  --tfm-accent-ink: #ffffff;   /* text ON the accent */
  --tfm-live:       #127f75;   /* the "live" tag */
  --tfm-admin-tag:  #9a6206;   /* 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 -- **names, not hexes,
     which is what lets this surface pick its own values without breaking parity.** The
     hexes differ on purpose: these sit on this build's ground and the ones in the plugin
     sit on Qt's. **Lightened 2026-09-01** with the ruling: four dark tints meant to be read
     as fills BEHIND text, moved from a dark ground to a light one. */
  --tfm-splice-free:            #d5ecd9;
  --tfm-splice-circuit-gap:     #f6e7c2;
  --tfm-splice-spliced:         #e4e7ea;
  --tfm-splice-circuit-spliced: #f6d5d5;

  /* **THE TWO HIGHLIGHT SIDES** (brief 11, amendment 4 ruling 2). Picking a cable in the
     LEFT pane of the splice view and one in the RIGHT lights both on the map at once, in
     two colours, which is v7's own behaviour -- left blue, right yellow there. The same
     cable picked on both sides carries both, because v7 keys the feature by cable AND side.
     Here rather than in a module for the reason every colour is here: `p8_map_gate` rule 1
     refuses a colour literal anywhere else, and a hex in a module is a colour the theme
     cannot reach. */
  --tfm-hl-left:    #2f6fed;
  --tfm-hl-right:   #e3b341;
  /* The soft underlay beneath each splice curve. v7 draws `rgba(0,0,0,0.22)` -- 22% BLACK,
     under a fibre colour, on v7's WHITE sheet. **Copied literally onto this build's dark
     ground it is invisible**, which is half of why a port-to-port lane looked empty on
     2026-08-20. The role is "separate the curve from the ground it crosses"; the value is
     this surface's own, which is the colour decision of amendment 1 section 9 applied where
     it was written to apply. */
  --tfm-splice-lane-shadow: rgba(0, 0, 0, 0.22);
  /* **A SPLICE WITH NO FIBRE COLOUR STILL DRAWS A LINE** (amendment 6 ruling 2). A port has
     no colour, and the CELL rule is to leave an unknown colour unpainted rather than guess --
     which is right for a swatch and wrong for a line, because the line IS the splice. v7 falls
     back to grey for exactly this. */
  --tfm-splice-line-plain: #8b98a5;

  /* ---- the navigation rail (2026-09-01, look part two) --------------------
     **A DARK SIDEBAR ON A LIGHT PAGE IS NOT A SECOND THEME.** It is one surface
     inside the one token set -- there is no `data-theme`, no media query and no
     second file, which is what "do not fork the theme" rules out. The dark
     ground did not leave the build; it stopped being the page and became the
     rail, which is v7's own arrangement.

     **THE NEW PAIR IS MEASURED, NOT ASSUMED** (part two: "a dark sidebar with
     light text is a new pair nothing has checked yet"). Ratios against
     `--tfm-nav` are in `src/AS-BUILT.md` under 2026-09-01 and are re-measurable
     from this file alone. */
  --tfm-nav:            #0f1722;   /* the rail */
  --tfm-nav-high:       #1c2736;   /* the current item, and hover */
  --tfm-nav-ink:        #e6edf6;   /* a label */
  --tfm-nav-ink-muted:  #93a3b8;   /* the section caption above the items */
  --tfm-nav-edge:       #212d3e;   /* the rail's own hairline */
  --tfm-nav-mark:       #2fd4c4;   /* the current item's left rule -- v7's teal,
                                      which reads on the rail where the page's
                                      darkened accent would not */

  /* ---- states ------------------------------------------------------------ */
  --tfm-warn:       #b3261e;
  --tfm-ok:         #1a7f37;
  --tfm-muted:      #6a737d;
  --tfm-select:     #0969da;

  /* ---- 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;
}
