/* ═══════════════════════════════════════════════════════════════════════════
   accid-styles.css — THE STUB. One <link> in the head, forever.

   IMPORTS ONLY, plus the layer statement. Hand-written, static, and NOT on any
   regenerator's list — the bridge never touches this file.

   WHY IT EXISTS (Phase 5.2, 2026-08-19). Precedence used to be emergent from
   the order of eight <link> tags, which meant the only way to win a fight was
   `!important`. accid-layers.css says so in its own comments: its !important is
   there to beat accid_grid.css. Declare the order once and that fight is over —
   not overridden, ABSENT, because there is nothing left to override.

   THE ORDER IS THE POINT. Later layers win for normal declarations. It is
   chosen by what currently fights what, and grid comes before layers because
   that is the fight the comments document.

   ⚠ UNLAYERED BEATS EVERY LAYER. A sheet left outside is not "not yet
   converted", it is promoted above all of this. Partial layering is the one
   state worse than none. Anything that cannot be imported here — the injected
   <style> blocks, and project_styles.css whose path is per-project and so
   cannot be a static @import — gets its layer at the source instead. Grep for
   `@layer` in the injectors before assuming a sheet is covered.

   ⚠ @import MUST COME FIRST. Only @charset and @layer statements may precede
   it. One stray rule at the top of this file and every import below it is
   discarded silently. Keep this file imports-only.

   ⚠ !important REVERSES LAYER ORDER — earlier layers win for important
   declarations. So an !important down in `reset` or `grid` outranks everything
   generated. That is why the bulk deletion had to happen with this, not after:
   layering an !important entrenches it rather than settling it.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ⚠ THIS STATEMENT IS DERIVED, NOT AUTHORED — it must equal
   AccidCssEmit.layerStatement(), and the rung-order suite asserts exactly
   that. It is written here in text because a @layer statement has to be parsed
   BEFORE any layered CSS loads, and injecting it from JS would race the
   stylesheets it orders. Hand-written once, provably in sync.

   The middle ten are THE RUNGS, least specific first; reset..project and editor
   are infrastructure that brackets them.

   ⚠ `site` IS THE TOP RUNG NOW, AND `defaults` IS WHAT THE OLD `site` LAYER WAS
   CALLED (SPI-558, "The one ladder", 2026-09-17). One word for the top rung, and
   it was taken: `site` used to name the pre-`modules` layer that
   applySiteStyleVars writes its element defaults into (body type, links, the
   wrapper box, the wrap measure, the stage floor). That block MUST stay before
   `modules` — a generic h1 rule there beats .mddoc [data-role="h1"] if it sorts
   after, which cost a red suite once — so the layer kept its position and lost
   its name. The rung took the position `global` held, after `project`, because a
   site-column override has to beat the project stylesheet's body default. Changing the order means editing
   ACCID_RUNGS in accid-css-emit.js and copying the result here — the test tells
   you the moment you do only one. */
/* ⚠ THE ORDERING STATEMENT MOVED OUT (SPI-577, 2026-09-30) to
   accid-shared/accid-layers-order.css, which is linked before everything.
   It cannot live here: this sheet is not the first one loaded, so a statement
   here loses to any that comes earlier — which is exactly what happened when
   accid-palette.css grew one. The master list now names `palette` too, in
   first position, so tokens are the weakest layer rather than landing wherever
   their declaration happened to fall. Do not re-add an order here. */

/* `editor` IS LAST, ADDED 2026-08-21, and the reason is a bug it fixes.
   Editor-chrome VISIBILITY rules lived in accid-layers.css (layer `layers`) and
   could not hide .container-child-toolbar, because that toolbar is drawn by
   accid-chrome.css in layer `decoration` — which sorts AFTER `layers`, and
   later layers win. Observed directly: on one page a templates-sourced HTML
   module had its chrome correctly hidden (its toolbar comes from accid_grid.css
   in `grid`, an EARLIER layer) while a templates-sourced CONTAINER showed 4 of
   its 5 chrome elements. Same rule, same page, opposite results, decided
   entirely by which sheet drew the toolbar.

   Rules about whether chrome is SHOWN therefore have to outrank every sheet
   that draws it. This is the last layer, so they do. */

/* WHY `site` SITS BEFORE `modules`, learned the hard way 2026-08-19.
   accid-site-style (applySiteStyleVars) emits two different heights of rule in
   one block: element-level DEFAULTS — h1..h6, body, a — and the per-surface
   backgrounds. Putting the whole block in `global`, after `modules`, made the
   generic `h1` rule beat `.mddoc [data-role="h1"]`, because LAYER ORDER
   OVERRIDES SPECIFICITY. That is precisely the containment failure
   markdown-module.js documents and restates family and colour to prevent — and
   before layering it could not happen, since 0,2,0 beat 0,0,1 on specificity.
   md-rolecss caught it in one run.

   Early is correct for both jobs: module rules then beat site typography, and
   the surfaces still sit far below look / category / page, which is what lets a
   content template repaint them. */

/* ── the shipped sheets ─────────────────────────────────────────────────────
   grid before layers: accid-layers.css's overrides exist to beat accid_grid.css
   and can now be plain declarations. modules after grid so a module rule beats
   the grid's generic box. decoration is editor chrome. palette is last of the
   shipped set because it declares tokens the others consume. */
/* THE RESET GOES FIRST, and it must be in `reset` rather than wherever it
   happens to be written. It lived at the top of modules-styles.css until
   2026-08-20 and therefore entered layer(modules) — outranking every margin and
   padding in grid and site, because layer order overrides specificity and `*`
   being the weakest selector no longer protects anything. The slot below was
   declared from the start and left empty; that is what made the order look
   right here and be wrong in the browser. */
/* LOOK OUT FOR  
zoom-modal.css is the close-up image pop-up in the waypoint editor. That is why nothing changed on the styleguide. It belongs with the waypoint editor's CSS, not on every page.
accid_grid.css holds more than you saw break. By what its rules target, the biggest groups are containers (57 rules), the module wrapper (48), edit controls (39), then resize, drag and ruler states, the "add" buttons and the module type picker.
modules-misc.css is mostly table rules (19), plus nav (16), the category and tag index (6) and the date module (5).
*/
   
/* @import url("accid-reset.css"); — SPI-629: its rules moved into our-choices.css, inside @layer ours. The file stays. */ /* copied to salvaged.css 1 tag */
@import url("accid_grid.css"); /* necessary pieces copied to salvage.css nav dropdowns and chrome for editor buttons */
@import url("modules-styles.css");
/* @import url("salvaged.css"); has things I could see from other sheets - total 345 lines */
/* SPI-558 P1b: the module stylesheets that their own .js used to inject into
   document.head. They import AFTER modules-styles.css and in their old parse
   order, because within one layer later wins ties and these tags used to be
   appended to head — i.e. after everything the stub imported. The files carry
   no `@layer` of their own: an imported file that redeclares its layer nests as
   `modules.modules` and loses to plain `modules`. */
@import url("modules-gallery.css"); /* gallery stuff */
@import url("modules-markdown.css"); /* does it all for the markdown component */
@import url("modules-misc.css"); /* necesary pieces moved to salvage.css category and tag index pages */
/* accid-layers.css — MOVED to its own <link> in index.html (right after this file), 2026-10-06 (Shawn: "it deserves it"). THE LAYER CSS: the one home for anything about layers. Not imported here any more, so it is not hidden behind this hub. */
@import url("accid-edit-layer.css"); /* contained 2 tags copied to salavage.css */
/* @import url("data-streams.css"); — UNHOOKED 2026-10-06 (Shawn), NOT deleted. The import/scrape system's CSS (the streams panel, .sp-*, and the data-stream binding badge). No imported data on any site and none before launch; its JS (data-streams-panel.js, template-replicator.js) is unhooked in index.html too. Re-add this line when the import system comes back. */
/* @import url("zoom-modal.css"); — UNHOOKED 2026-10-06 (Shawn), NOT deleted. The WAYPOINT editor's close-up pop-up (.zoom-modal*, .waypoint-dot; used only by waypoint-editor.js, which loads in edit mode). Not the Config panel's Zoom slider. Waypoints are parked; re-add this line (or fold it into accid-editor.css) when they come back. */
/* palette REMOVED from the stub 2026-09-20 (SPI-558). It is base tokens, not
   a rung, and it is now a plain <link> in index.html -- first in the head, the
   same way every accid-views/*.html has always loaded it. `palette` also
   leaves the @layer statement above: a layer with nothing in it is a promise
   that something belongs there. */

/* project_styles.css is NOT imported here — its path is {dev_project}-accid/
   and @import cannot take a dynamic URL. index.html injects it into
   layer(project) with a one-line <style> instead. Its layer sits AFTER the
   shipped sheets, so a project can override ACCID's defaults, and BEFORE the
   generated files, so a page or category rule still wins. */

/* The generated files (Phase 5.1) are declared in the layer statement above but
   NOT imported until they exist: @import fails SILENTLY on 404, so importing a
   file that is not there yet buys nothing and hides a real break behind an
   identical non-event. They are added here as each is first written. */
