/* ================================================================ BASE ====
   THE PART OF A THEME THAT IS NOT A COLOUR. Nothing in this file names a hue;
   it exists so that every themes/*.css beside it can be nothing but hexes.

   WHY IT IS A SEPARATE FILE. These three defaults used to live in the :root
   block that also held the light values, which made light.css secretly
   mandatory: loading only porcelain.css + style.css left eight hover rules
   with an unresolved var() - link hover, .btn-primary hover fill, table row
   hover, dropdown and list-group hover grounds - and nothing anywhere said so.
   Now the mandatory part has a name.

   ---------------------------------------------------------------------------
   THE CONTRACT a theme file has to fill. style.css reads exactly these, and
   nothing else - 31 required, 4 optional:

     accent   --tsx-accent --tsx-accent-dk --tsx-accent-ink --tsx-accent-ink-rgb
              --tsx-accent-fg --tsx-accent-a25
     grounds  --tsx-bg --tsx-panel --tsx-panel2 --tsx-line --tsx-plot
     text     --tsx-text --tsx-sub --tsx-sub-rgb --tsx-faint
     status   --tsx-good --tsx-good-rgb --tsx-good-fg
              --tsx-warn --tsx-warn-rgb
              --tsx-info --tsx-info-rgb --tsx-info-fg
              --tsx-danger --tsx-danger-rgb --tsx-danger-fg
     chrome   --tsx-sb --tsx-sb-line --tsx-sb-hi --tsx-chip --tsx-chip-dk

     optional --tsx-accent-hv --tsx-hover-ink --tsx-hover-tint  (see below)
              --tsx-info-ink   an outlined-info label, for when the info fill is
                               darker than the panel it would be drawn on.
                               style.css asks for it as
                               var(--tsx-info-ink,var(--tsx-info)), so leaving
                               it out is a decision, not an omission.

   THE -rgb TOKENS ARE NOT DECORATION. Four utilities and every alert composite
   a colour at partial alpha, and CSS cannot take a channel out of a hex, so the
   triplet has to be written beside its hex and kept equal to it. That is the
   one place a theme file can be internally wrong in a way nothing catches.
   ---------------------------------------------------------------------------

   Start a new theme from _template.css, which is this contract with the values
   left blank. _template.css is deliberately NOT linked from index.html. */
:root[data-theme]:not([data-theme^="bootstrap"]){
  /* HOVER IS A ROLE OF ITS OWN, and only the vibrancy family uses it as such.
     These three default to what every mode did before they existed - hover ==
     pressed == the darker accent - so a theme that wants a real hover colour
     points them somewhere else and changes hover alone, in that one mode,
     without a single new rule.
     Custom-property substitution is LAZY, which is what makes this work: the
     var() below is resolved when the rule is used, not here, so it picks up the
     accent-dk of whichever theme is active rather than freezing light's. */
  --tsx-accent-hv:var(--tsx-accent-dk);
  --tsx-hover-ink:var(--tsx-accent-ink);
  /* NOT --tsx-panel2, WHICH IS WHAT A ROW ALREADY IS. The striped lists paint
     their tinted rows with that token, so hovering one changed nothing and
     hovering a plain row turned it into what a tinted row looks like - the
     stripe moved and the pointer said nothing. A translucent wash has no such
     clash: it darkens whatever it is over, both stripes included, which is the
     shape vibrancy and _template.css already give this token.
     THE HUE IS THE THEME'S, through the -rgb form of its accent, so the wash is
     warm on parchment and cool on chalk without a rule per theme. */
  --tsx-hover-tint:rgba(var(--tsx-accent-ink-rgb),.12);
}

/* LIGHT, the original. Two selectors rather than one: the bare :root is the
   FALLBACK for a missing or unrecognised data-theme, and light is what the page
   should look like when nobody has chosen. That is the only thing special about
   this file - the shared, colour-free defaults moved to _base.css, so light is
   now an ordinary theme that happens to also answer for "no theme".
   ITS ONE WEAKNESS is documented in parchment.css, which exists to fix it:
   #fff panels on a #F7F8F7 page separate by 1.10:1, so a card dissolves into
   the page and the border carries the whole distinction at 1.23:1. */
:root[data-theme]:not([data-theme^="bootstrap"]){
  --tsx-accent:#FF5050; --tsx-accent-dk:#CC3030;
  --tsx-accent-ink:#FF5050; --tsx-accent-ink-rgb:255,80,80;
  --tsx-accent-fg:#fff; --tsx-accent-a25:rgba(255,80,80,.25);

  --tsx-bg:#F7F8F7; --tsx-panel:#fff; --tsx-panel2:#EEF0F2;
  --tsx-line:#E8E9EC; --tsx-plot:#FBFBFC;

  --tsx-text:#0B0D10; --tsx-sub:#444B58; --tsx-sub-rgb:68,75,88; --tsx-faint:#A8ADB8;

  --tsx-good:#16a34a;   --tsx-good-rgb:22,163,74;   --tsx-good-fg:#08181C;
  --tsx-warn:#d97706;   --tsx-warn-rgb:217,119,6;
  --tsx-info:#2563eb;   --tsx-info-rgb:37,99,235;   --tsx-info-fg:#fff;
  --tsx-danger:#d92d20; --tsx-danger-rgb:217,45,32; --tsx-danger-fg:#fff;

  --tsx-sb:#EEF0F2; --tsx-sb-line:#E8E9EC; --tsx-sb-hi:#DFE3E7;
  --tsx-chip:#EEF0F2; --tsx-chip-dk:#DFE3E7;
}

/* PROLOGUE-DARK, and the data-theme value spells that out - it used to be the
   bare "dark", which read in a theme list as the generic opposite of "light"
   rather than as the one dark theme this file describes.
   The accent is spelled out here rather than inherited: it used to be absent from
   this block, which meant dark quietly ran on light's coral and nothing in the
   file said so. Same two values, now visible - the token list is identical in
   every theme file so that a new one is a copy with new hexes. */
:root[data-theme="prologue-dark"]:not([data-theme^="bootstrap"]){
  --tsx-accent:#FF5050; --tsx-accent-dk:#CC3030;
  --tsx-accent-ink:#FF5050; --tsx-accent-ink-rgb:255,80,80;
  --tsx-accent-fg:#fff; --tsx-accent-a25:rgba(255,80,80,.25);

  --tsx-bg:#0B0D10; --tsx-panel:#141720; --tsx-panel2:#1E2330;
  --tsx-line:#262c3b; --tsx-plot:#10141c;

  --tsx-text:#fff; --tsx-sub:#A8ADB8; --tsx-sub-rgb:168,173,184; --tsx-faint:#6b7280;

  --tsx-good:#34d399;   --tsx-good-rgb:52,211,153;   --tsx-good-fg:#08181C;
  --tsx-warn:#fbbf24;   --tsx-warn-rgb:251,191,36;
  --tsx-info:#60a5fa;   --tsx-info-rgb:96,165,250;   --tsx-info-fg:#0B0D10;
  --tsx-danger:#f87171; --tsx-danger-rgb:248,113,113; --tsx-danger-fg:#0B0D10;

  --tsx-sb:#0B0D10; --tsx-sb-line:#ffffff14; --tsx-sb-hi:#241118;
  --tsx-chip:#1E2330; --tsx-chip-dk:#2a3040;
}

/* PARCHMENT, the second light. The first one's weakness is not its colour, it
   is its CONTRAST BETWEEN SURFACES: #fff panels on a #F7F8F7 page differ by
   1.6% in luminance, so a card does not sit on the page, it dissolves into it,
   and the border has to do all the work at 1.23:1. Pure white also glares
   under a room light in a way a screen full of panels makes worse.
   So: a warm PAPER page, panels a step LIGHTER than it but never white, and a
   line dark enough to be a line - 1.16:1 page-to-panel and 1.49:1 panel-to-
   line, both roughly double the stock light's. Hue held around 38 at 8-14%
   saturation across every ground; the text ramp is warm graphite rather than
   near-black, which is the other half of taking the glare out.
   THE ACCENT IS TERRACOTTA, not the coral: coral is a screen colour and on
   cream it reads as a sticker. Rust does both accent jobs - 5.8:1 as a fill
   under a white label, 5.5:1 as ink on the panel - so ink == fill here, as in
   light and dark.
   The muted greys are where this mode actually wins: --tsx-faint reaches 3.4:1
   against the panel where the stock light manages 2.25:1, so the 9px uppercase
   captions this page is full of stop being decoration.
   TWO ROLES ARE CONSTRAINED BY RULES ELSEWHERE, not by this block: warning and
   success have their labels hardcoded dark in section 3 (there is no
   --tsx-warn-fg), so both have to stay light enough to carry a dark label,
   which caps how deep they can go on paper. Amber lands at 5.2:1 under its
   dark label and 3.6:1 as alert text - the same trade the stock light makes at
   3.2:1, one step better rather than solved. */
:root[data-theme="parchment"]:not([data-theme^="bootstrap"]){
  --tsx-accent:#A8481C; --tsx-accent-dk:#8A3813;
  --tsx-accent-ink:#A8481C; --tsx-accent-ink-rgb:168,72,28;
  --tsx-accent-fg:#fff; --tsx-accent-a25:rgba(168,72,28,.25);

  --tsx-bg:#EDE7DA; --tsx-panel:#FBF8F1; --tsx-panel2:#E6DFD0;
  --tsx-line:#D6CDBA; --tsx-plot:#FBF8F1;

  --tsx-text:#2A2621; --tsx-sub:#5C554A; --tsx-sub-rgb:92,85,74; --tsx-faint:#8F8676;

  --tsx-good:#4E9A5F;   --tsx-good-rgb:78,154,95;   --tsx-good-fg:#241E16;
  --tsx-warn:#B87708;   --tsx-warn-rgb:184,119,8;
  --tsx-info:#2C5FA8;   --tsx-info-rgb:44,95,168;   --tsx-info-fg:#fff;
  --tsx-danger:#C13A2B; --tsx-danger-rgb:193,58,43; --tsx-danger-fg:#fff;

  --tsx-sb:#E6DFD0; --tsx-sb-line:#D6CDBA; --tsx-sb-hi:#D9D1BE;
  --tsx-chip:#E6DFD0; --tsx-chip-dk:#D9D1BE;
}

/* ============================================ THE LIGHT FAMILY, 1 OF 3 ====
   Three more lights, and they are siblings rather than three separate briefs:
   every one keeps the structure parchment introduced - page a step under the
   panel, a line dark enough to be a line, muted text that clears 3.4:1 - and
   differs only in TEMPERATURE and FINISH. Written as a set so the numbers can
   be compared:

                page->panel   panel->line   faint   accent
     light          1.10          1.23      2.25    coral      (the original)
     parchment      1.16          1.49      3.4     terracotta
     sandstone      1.20          1.53      3.6     mulberry   warm
     porcelain      1.19          1.52      3.7     teal       cool
     chalk          1.18          1.47      3.5     slate      matte

   SANDSTONE, the warm one, and it is warm in the RED half of warm where
   parchment is warm in the yellow half - apricot-tan grounds around hue 30
   against parchment's cream around 38. That alone would make them cousins, so
   the accent moves too: MULBERRY, not another rust. A cool-leaning red on a
   warm ground is the pairing that keeps the two modes from reading as one, and
   it inks at 5.9:1 as readily as it fills at 6.4:1. */
:root[data-theme="sandstone"]:not([data-theme^="bootstrap"]){
  --tsx-accent:#8C4A6B; --tsx-accent-dk:#703A55;
  --tsx-accent-ink:#8C4A6B; --tsx-accent-ink-rgb:140,74,107;
  --tsx-accent-fg:#fff; --tsx-accent-a25:rgba(140,74,107,.25);

  --tsx-bg:#EFE1CE; --tsx-panel:#FDF6E9; --tsx-panel2:#E9DAC3;
  --tsx-line:#DCC7A6; --tsx-plot:#FDF6E9;

  --tsx-text:#2E2620; --tsx-sub:#63564A; --tsx-sub-rgb:99,86,74; --tsx-faint:#8F8071;

  --tsx-good:#57964F;   --tsx-good-rgb:87,150,79;   --tsx-good-fg:#08181C;
  --tsx-warn:#B0710A;   --tsx-warn-rgb:176,113,10;
  --tsx-info:#2F5FA5;   --tsx-info-rgb:47,95,165;   --tsx-info-fg:#fff;
  --tsx-danger:#BC3A2A; --tsx-danger-rgb:188,58,42; --tsx-danger-fg:#fff;

  --tsx-sb:#E9DAC3; --tsx-sb-line:#DCC7A6; --tsx-sb-hi:#DDCBAF;
  --tsx-chip:#E9DAC3; --tsx-chip-dk:#DDCBAF;
}

/* ============================================ THE LIGHT FAMILY, 2 OF 3 ====
   PORCELAIN, the cool one. Hue held near 210 at 10-20% saturation, and the
   panel is allowed to come close to white (#FAFCFD) because a COOL near-white
   does not glare the way a neutral #fff does - the blue in it is what the eye
   reads as "cold surface" rather than "lamp". The page is a fog step under it.
   DEEP TEAL is the accent and not a blue, for the reason darkslategray and
   popsicle both ran into: an informational blue is already in the token set,
   and two blues one step apart become one blue in a legend. Teal sits far
   enough round the wheel to stay separate while still belonging to the cold
   half of the page. It fills at 5.9:1 and inks at 5.7:1, so ink == fill. */
:root[data-theme="porcelain"]:not([data-theme^="bootstrap"]){
  --tsx-accent:#1C6E7A; --tsx-accent-dk:#145360;
  --tsx-accent-ink:#1C6E7A; --tsx-accent-ink-rgb:28,110,122;
  --tsx-accent-fg:#fff; --tsx-accent-a25:rgba(28,110,122,.25);

  --tsx-bg:#E4E9EE; --tsx-panel:#FAFCFD; --tsx-panel2:#DDE4EB;
  --tsx-line:#C6D0DA; --tsx-plot:#FAFCFD;

  --tsx-text:#1B2229; --tsx-sub:#4A5560; --tsx-sub-rgb:74,85,96; --tsx-faint:#79848F;

  --tsx-good:#3E9E6B;   --tsx-good-rgb:62,158,107;   --tsx-good-fg:#08181C;
  --tsx-warn:#A8790C;   --tsx-warn-rgb:168,121,12;
  --tsx-info:#2358A0;   --tsx-info-rgb:35,88,160;   --tsx-info-fg:#fff;
  --tsx-danger:#B33240; --tsx-danger-rgb:179,50,64; --tsx-danger-fg:#fff;

  --tsx-sb:#DDE4EB; --tsx-sb-line:#C6D0DA; --tsx-sb-hi:#CFD8E1;
  --tsx-chip:#DDE4EB; --tsx-chip-dk:#CFD8E1;
}

/* ============================================ THE LIGHT FAMILY, 3 OF 3 ====
   CHALK, the matte one, and matte is the only one of the three that is not a
   hue decision. The grounds are held at 4-6% saturation - barely off neutral,
   leaning the greenish-grey way that reads as chalk rather than as steel - but
   the mode is defined by what happens to the STATUS COLOURS: they are
   desaturated to match, so nothing on the page is more saturated than anything
   else. A sage green, an ochre, a dusty steel and a brick, each one a muted
   step of the vivid value the other lights use.
   THAT IS THE TRADE, stated plainly: a muted green and a muted red are further
   apart in luminance than in hue here, so this is the one light mode where
   good and danger should not be told apart by colour alone. The status pills on
   this page carry text, so they survive it; a bare coloured dot would not.
   The accent is a SLATE that is only just an accent - which is the point of a
   matte scheme, and it still fills at 6.3:1 and inks at 5.8:1. */
:root[data-theme="chalk"]:not([data-theme^="bootstrap"]){
  --tsx-accent:#4F6272; --tsx-accent-dk:#3C4C59;
  --tsx-accent-ink:#4F6272; --tsx-accent-ink-rgb:79,98,114;
  --tsx-accent-fg:#fff; --tsx-accent-a25:rgba(79,98,114,.25);

  --tsx-bg:#E5E3DE; --tsx-panel:#F6F5F2; --tsx-panel2:#DEDCD6;
  --tsx-line:#CFCCC4; --tsx-plot:#F6F5F2;

  --tsx-text:#262623; --tsx-sub:#575751; --tsx-sub-rgb:87,87,81; --tsx-faint:#84837C;

  --tsx-good:#6E9070;   --tsx-good-rgb:110,144,112;   --tsx-good-fg:#08181C;
  --tsx-warn:#9C7B3C;   --tsx-warn-rgb:156,123,60;
  --tsx-info:#5A7391;   --tsx-info-rgb:90,115,145;   --tsx-info-fg:#fff;
  --tsx-danger:#A15A55; --tsx-danger-rgb:161,90,85; --tsx-danger-fg:#fff;

  --tsx-sb:#DEDCD6; --tsx-sb-line:#CFCCC4; --tsx-sb-hi:#D2CFC7;
  --tsx-chip:#DEDCD6; --tsx-chip-dk:#D2CFC7;
}

/* THE MODE BOOTSTRAP DOES NOT HAVE, and it no longer takes its name literally:
   darkslategray (#2F4F4F) was the panel, and the green in it fought the deep
   ocean accent below - two hues 130 degrees apart, both muted, neither
   winning. The ground is now a MATTE BLUE-LEANING DARK GREY: hue held around
   220, saturation kept near 16% so it reads as grey that happens to be cool
   rather than as a blue panel, and every step taken darker than the slate it
   replaces. The value stays on the darkslategray key so nothing that switches
   on the attribute has to change.
   The three-step relationship is what survived: body a shade under the panel,
   borders a shade over, so panels read as raised instead of the flat
   single-colour wash. */
:root[data-theme="darkslategray"]:not([data-theme^="bootstrap"]){
  --tsx-accent:#14688F; --tsx-accent-dk:#0E4F6E;
  --tsx-accent-ink:#6FC7EE; --tsx-accent-ink-rgb:111,199,238;
  --tsx-accent-fg:#fff; --tsx-accent-a25:rgba(111,199,238,.28);

  --tsx-bg:#15181E; --tsx-panel:#1D2129; --tsx-panel2:#272C36;
  --tsx-line:#343A46; --tsx-plot:#12151A;

  --tsx-text:#EDF0F5; --tsx-sub:#B0B8C4; --tsx-sub-rgb:176,184,196; --tsx-faint:#7B8492;

  --tsx-good:#4ade80;   --tsx-good-rgb:74,222,128;   --tsx-good-fg:#08181C;
  --tsx-warn:#fcd34d;   --tsx-warn-rgb:252,211,77;
  --tsx-info:#A9B4F7;   --tsx-info-rgb:169,180,247;   --tsx-info-fg:#08181C;
  --tsx-danger:#fda4a4; --tsx-danger-rgb:253,164,164; --tsx-danger-fg:#08181C;

  --tsx-sb:#0F1116; --tsx-sb-line:#ffffff1a; --tsx-sb-hi:#13293C;
  --tsx-chip:#272C36; --tsx-chip-dk:#313742;
}

/* TREELINE. Four brand colours were given and they already name their own
   roles: pink HIGHLIGHT is the accent, bluewater LOWLIGHT is info, green
   TREELINE is success - and purple BASELINE was the ground until it turned out
   to be the loudest thing on the page. A saturated indigo behind saturated
   pink, teal and orange is four colours competing; the ground was the one with
   no information in it, so it is the one that gave way.
   In its place a NEUTRAL DARK GREY with a whisper of plum - hue near 290,
   saturation held at 9-11%, red and blue kept within a few points of each
   other so it never resolves into "blue" or "violet". Enough of the baseline
   survives to keep the mode's identity next to darkslategray's cool grey, not
   enough to be noticed as a colour.
   Pink does both accent jobs, like coral and unlike the ocean blue: 5.7:1 as a
   fill and 5.3:1 as ink on the new panel. So ink == fill here and the split
   introduced for darkslategray simply goes unused.
   ONE COMPROMISE SURVIVES, and it is in the brief's own green: #478559 is dark
   enough that as TEXT on these panels it reaches 3.6:1, under the 4.5:1 wanted
   for body copy. It is kept as given - it fills (white label, 4.4:1) and inks
   headings and badges fine; small green prose is the one thing to avoid. */
:root[data-theme="treeline"]:not([data-theme^="bootstrap"]){
  --tsx-accent:#f95d9b; --tsx-accent-dk:#D63C7C;
  --tsx-accent-ink:#f95d9b; --tsx-accent-ink-rgb:249,93,155;
  --tsx-accent-fg:#1C1A20; --tsx-accent-a25:rgba(249,93,155,.28);

  --tsx-bg:#1C1A20; --tsx-panel:#262229; --tsx-panel2:#302B34;
  --tsx-line:#3D3742; --tsx-plot:#18161B;

  --tsx-text:#F2F0F4; --tsx-sub:#BAB5BF; --tsx-sub-rgb:186,181,191; --tsx-faint:#878190;

  --tsx-good:#478559;   --tsx-good-rgb:71,133,89;   --tsx-good-fg:#fff;
  --tsx-warn:#F2C14E;   --tsx-warn-rgb:242,193,78;
  --tsx-info:#39a0ca;   --tsx-info-rgb:57,160,202;   --tsx-info-fg:#1C1A20;
  --tsx-danger:#E4572E; --tsx-danger-rgb:228,87,46; --tsx-danger-fg:#1C1A20;

  --tsx-sb:#141216; --tsx-sb-line:#ffffff1a; --tsx-sb-hi:#2F1E29;
  --tsx-chip:#302B34; --tsx-chip-dk:#3A3540;
}

/* VIBRANCY. The first brief that specifies a HOVER colour, and that is the one
   thing the four modes above could not express: hover and pressed were the
   same darker accent everywhere, so --tsx-accent-hv / --tsx-hover-ink /
   --tsx-hover-tint were split out for it. They default to the old behaviour,
   which is why nothing changes in the other modes.
   Now a COOL, mildly saturated read of the same idea: cyan fills, MINT HOVERS,
   deeper cyan when pressed - the press stays in the accent's own hue so a held
   button still reads as the same button. The neutrals are tinted blue rather
   than grey, which is what keeps the cyan from looking like a sticker on a
   warm page. Accent 2 (indigo) takes info and the selected-nav ground.
   Cyan (5.0:1) and mint (11.6:1) both want a DARK label against #16181C -
   white on the cyan manages only 3.2:1 - so one -fg serves the base and the
   hover, and -ink is a lighter step of the cyan (7.7:1) for text and outlines.
   WARNING STAYS WARM on purpose: amber is the one role where the hue carries
   meaning, so it is only pulled back from #FFC107 to a calmer #E5A93B rather
   than cooled. Indigo fills at 5.6:1 under a white label but is darker than
   the panel it sits ON, so outlined info gets the lighter -ink step. */
:root[data-theme="vibrancy"]:not([data-theme^="bootstrap"]),
:root[data-theme="vibrancy-crisp"]:not([data-theme^="bootstrap"]),
:root[data-theme="vibrancy-sharp"]:not([data-theme^="bootstrap"]){
  --tsx-accent:#2E9BC9; --tsx-accent-dk:#1B7FA8;
  --tsx-accent-ink:#4FB3DE; --tsx-accent-ink-rgb:79,179,222;
  --tsx-accent-fg:#16181C; --tsx-accent-a25:rgba(46,155,201,.32);
  /* THE ONLY MODE THAT USES THE HOVER TRIO AS A ROLE, and --tsx-info-ink with
     it: the indigo fill is darker than the panel it would be outlined on. */
  --tsx-accent-hv:#5FE3C8;
  --tsx-hover-ink:#5FE3C8;
  --tsx-hover-tint:rgba(95,227,200,.12);
  --tsx-info-ink:#8DA2FB;

  --tsx-bg:#16181C; --tsx-panel:#1D2026; --tsx-panel2:#262A32;
  --tsx-line:#343A44; --tsx-plot:#12141A;

  --tsx-text:#F2F5F8; --tsx-sub:#AEB6C2; --tsx-sub-rgb:174,182,194; --tsx-faint:#737C8A;

  --tsx-good:#2FBF8F;   --tsx-good-rgb:47,191,143;   --tsx-good-fg:#16181C;
  --tsx-warn:#E5A93B;   --tsx-warn-rgb:229,169,59;
  --tsx-info:#3B5BDB;   --tsx-info-rgb:59,91,219;   --tsx-info-fg:#fff;
  --tsx-danger:#EE5A76; --tsx-danger-rgb:238,90,118; --tsx-danger-fg:#16181C;

  --tsx-sb:#121419; --tsx-sb-line:#ffffff14; --tsx-sb-hi:#1B2C4A;
  --tsx-chip:#262A32; --tsx-chip-dk:#313742;
}
/* CORNER VARIANTS, and they live here because they are Vibrancy's -
   Two more values on data-theme that change SHAPE and nothing else - they
   share Vibrancy's token block above rather than copying it, so a colour edit
   lands on all three:

     vibrancy         .5rem-.875rem, Bootstrap's own scale   (unchanged)
     vibrancy-crisp   4px everywhere - still a corner, barely
     vibrancy-sharp   0

   The radii are LITERALS spread over Bootstrap's component variables
   (--bs-card-border-radius, --bs-modal-border-radius, --bs-dropdown-…) and
   this page's shell classes, so zeroing them token by token would mean
   finding all of them and keeping that list current as markup arrives. One
   descendant rule with !important does not need the list. */
:root[data-theme="vibrancy-crisp"] *,
:root[data-theme="vibrancy-crisp"] *::before,
:root[data-theme="vibrancy-crisp"] *::after{border-radius:4px!important}
:root[data-theme="vibrancy-sharp"] *,
:root[data-theme="vibrancy-sharp"] *::before,
:root[data-theme="vibrancy-sharp"] *::after{border-radius:0!important}

/* WHAT THE BLANKET MUST NOT REACH. A radio is round so it does not read as a
   checkbox, and both spinners are rotating RINGS - squaring either is not a
   flatter corner, it is a broken control. They opt back out in both variants.
   Roundness that is only decoration is left to the variant: .avatar and the
   segment dot go square under -sharp on purpose, since one circle left over
   in a squared-off page reads as a miss rather than a choice. */
:root[data-theme="vibrancy-crisp"] .form-check-input[type=radio],
:root[data-theme="vibrancy-sharp"] .form-check-input[type=radio],
:root[data-theme="vibrancy-crisp"] .spinner-border,
:root[data-theme="vibrancy-sharp"] .spinner-border,
:root[data-theme="vibrancy-crisp"] .spinner-grow,
:root[data-theme="vibrancy-sharp"] .spinner-grow{border-radius:50%!important}

/* -crisp keeps the deliberate circles and pills - the brief was smaller
   corners, and a circle has none to shrink. */
:root[data-theme="vibrancy-crisp"] .avatar,
:root[data-theme="vibrancy-crisp"] .seg button.on::before,
:root[data-theme="vibrancy-crisp"] .rounded-circle{border-radius:50%!important}
:root[data-theme="vibrancy-crisp"] .rounded-pill,
:root[data-theme="vibrancy-crisp"] .form-switch .form-check-input{border-radius:2em!important}


/* POPSICLE. Four colours, and this time they are all GROUND except one - two
   navies, a grey-blue and a red - so the roles fall out by luminance rather
   than by their names: purple shadow (#091f36, the darkest) is the page, blue
   popsicle (#0f2862) the panel it sits under, grey blue leaf (#4f5f76) the
   borders between them, and redline (#9e363a) the accent.
   THE PANEL IS THE ONE THAT WAS WRONG. Blue popsicle is both LIGHTER and far
   more saturated than the page (73% against 71% at nearly twice the
   lightness), so a panel did not read as a surface raised over the ground - it
   read as a blue slab laid on top of it, and every widget inside it was then
   competing with its own background. The hue is kept and the chroma is halved:
   the panel is now a slate navy that still says navy, one step over the page
   instead of one leap. Same for panel2 and the chips, where #224591 was the
   loudest surface on the page and it was carrying progress tracks.
   THE LEAF SURVIVES UNCHANGED as the line - it is the one given value whose
   job the brief got right, and against the calmer panel it frames rather than
   cuts. THE LEAF IS STILL A LINE, NOT A LABEL: at 2.2:1 on the panel it cannot
   carry text, so the text ramp stays a lighter tint of the same blue-grey.
   Redline splits the way the ocean blue did - #9e363a fills at 6.9:1 under a
   white label but only 2.0:1 as ink, so ink is a lighter step of it, now 5.7:1
   on the deeper panel.
   The rest is invented: a mint, an amber and a sky that hold up on navy, and a
   brighter red for danger, since the accent already owns the muted brick and
   two reds a shade apart would be one red. The sky and the panel used to sit
   close enough to ask "which blue is that"; the panel dropping out of the
   question settles it. */
:root[data-theme="popsicle"]:not([data-theme^="bootstrap"]){
  --tsx-accent:#9e363a; --tsx-accent-dk:#7E2A2E;
  --tsx-accent-ink:#E97C80; --tsx-accent-ink-rgb:233,124,128;
  --tsx-accent-fg:#fff; --tsx-accent-a25:rgba(233,124,128,.28);

  --tsx-bg:#0A1B2E; --tsx-panel:#142438; --tsx-panel2:#1C2F47;
  --tsx-line:#4F5F76; --tsx-plot:#0A1725;

  --tsx-text:#EEF2F8; --tsx-sub:#B4C1D4; --tsx-sub-rgb:180,193,212; --tsx-faint:#7F8EA5;

  --tsx-good:#3FBF87;   --tsx-good-rgb:63,191,135;   --tsx-good-fg:#0A1B2E;
  --tsx-warn:#F0B429;   --tsx-warn-rgb:240,180,41;
  --tsx-info:#5AB0E2;   --tsx-info-rgb:90,176,226;   --tsx-info-fg:#0A1B2E;
  --tsx-danger:#F2545B; --tsx-danger-rgb:242,84,91; --tsx-danger-fg:#0A1B2E;

  --tsx-sb:#071320; --tsx-sb-line:#ffffff14; --tsx-sb-hi:#3A1418;
  --tsx-chip:#1C2F47; --tsx-chip-dk:#26405C;
}

/* ============================================== THE APPLICATION, LIGHT ====
   NOT A NEW PALETTE. Every value below is lifted from the running product -
   lib/JSAndCSS/style/color.css - so this mode is what the app
   actually looks like today, rendered through this page's widget set. The
   source token is named beside each one; nothing here was invented except the
   four status colours, and those are Bootstrap 5.3's stock values, which is
   also what the app renders (color.css defines no status colours at all - it
   lets .table-success and friends come from Bootstrap).

   THE ONE ROLE THAT HAD TO BE REASSIGNED is the page. color.css sets
   --ts-bg:#ffffff for the body and --ts-back-0:#f2ffff as the lightest ramp
   step, and those two differ by 1.02:1 - so with the app's own pairing a card
   does not sit on the page, it is the page. --ts-back-1 (#cddcf0) is used here
   instead, which brings it to 1.39:1. Still color.css's colour, one step over.
   Worth knowing about the product: this is the app's weakest surface
   relationship, thinner than the stock Bootstrap light this page started from
   (1.10:1) and far thinner than parchment's 1.16:1.

   TWO MORE MEASUREMENTS, reported rather than corrected, because they are the
   product's real numbers: the primary blue is 4.50:1 on white as both fill and
   ink - it passes, with nothing to spare - and --ts-back-4 as the muted text
   step is 4.44:1. Bootstrap's success green needs a WHITE label (4.53:1); a
   dark one drops it to 4.00:1, so --tsx-good-fg is white here and not the
   near-black the other light modes use. */
:root[data-theme="dau-light"]:not([data-theme^="bootstrap"]){
  --tsx-accent:#0d6efd; --tsx-accent-dk:#0a58ca;
  --tsx-accent-ink:#0d6efd; --tsx-accent-ink-rgb:13,110,253;
  --tsx-accent-fg:#ffffff; --tsx-accent-a25:rgba(13,110,253,.25);

  --tsx-bg:#cddcf0; --tsx-panel:#ffffff; --tsx-panel2:#efefef;
  --tsx-line:#cacfd4; --tsx-plot:#f4f9ff;

  --tsx-text:#000000; --tsx-sub:#3b4753; --tsx-sub-rgb:59,71,83; --tsx-faint:#6b798b;

  --tsx-good:#198754;   --tsx-good-rgb:25,135,84;   --tsx-good-fg:#ffffff;
  --tsx-warn:#ffc107;   --tsx-warn-rgb:255,193,7;
  --tsx-info:#0dcaf0;   --tsx-info-rgb:13,202,240;   --tsx-info-fg:#08181C;
  --tsx-danger:#dc3545; --tsx-danger-rgb:220,53,69; --tsx-danger-fg:#ffffff;

  --tsx-sb:#efefef; --tsx-sb-line:#cacfd4; --tsx-sb-hi:#d3d7dd;
  --tsx-chip:#efefef; --tsx-chip-dk:#d3d7dd;
}

/* =============================================== THE APPLICATION, DARK ====
   The dark half of color.css, same rule: every value is the product's own, the
   source token named beside it, statuses from Bootstrap 5.3's dark set because
   color.css has none.

   THE APP'S DARK MODE RAISES BY GETTING LIGHTER IN ONE PLACE AND DARKER IN
   ANOTHER, which is the interesting thing about it. --ts-bg is #455364, and
   the surfaces around it go both ways: --ts-table-item (#5b6573) is lighter,
   --ts-textarea-bg (#3b4753) and --ts-header-bg (#2f3d4d) are darker. So the
   page/panel pair is taken from the DARK side - #2f3d4d is the page, the app's
   body colour becomes the panel on it - which gives 1.41:1, the best surface
   separation of the two Dau modes and better than several themes here.

   ONE VALUE MOVED WITHIN color.css. --ts-front-3 (#8997ab) is the obvious
   muted-text step and it measures 2.65:1 on the panel, which is texture, not
   text - this page is full of 9px uppercase captions that would disappear.
   --ts-front-2 (#acbacf) is used instead: 3.99:1, still the product's colour,
   one step up the same ramp. That #8997ab is in the app as a text colour at
   2.65:1 is worth someone looking at.

   The link blue --ts-link-color (#98c2ff) measures 4.30:1 on the panel, just
   under the 4.5:1 wanted for body text. Left as the product has it. */
:root[data-theme="dau-dark"]:not([data-theme^="bootstrap"]){
  --tsx-accent:#0d6efd; --tsx-accent-dk:#0a58ca;
  --tsx-accent-ink:#98c2ff; --tsx-accent-ink-rgb:152,194,255;
  --tsx-accent-fg:#ffffff; --tsx-accent-a25:rgba(152,194,255,.28);

  --tsx-bg:#2f3d4d; --tsx-panel:#455364; --tsx-panel2:#5b6573;
  --tsx-line:#616f7d; --tsx-plot:#3b4753;

  --tsx-text:#F5F3F4; --tsx-sub:#cddcf0; --tsx-sub-rgb:205,220,240; --tsx-faint:#acbacf;

  --tsx-good:#75b798;   --tsx-good-rgb:117,183,152;   --tsx-good-fg:#08181C;
  --tsx-warn:#ffda6a;   --tsx-warn-rgb:255,218,106;
  --tsx-info:#6edff6;   --tsx-info-rgb:110,223,246;   --tsx-info-fg:#08181C;
  --tsx-danger:#ea868f; --tsx-danger-rgb:234,134,143; --tsx-danger-fg:#08181C;

  --tsx-sb:#132130; --tsx-sb-line:#ffffff14; --tsx-sb-hi:#35639e;
  --tsx-chip:#5b6573; --tsx-chip-dk:#56606e;
}

/* ============================================================ COMPONENTS ==
   Everything that is NOT a colour. Every rule below reads --tsx-* and never a
   literal, which is why a theme is one file of hexes with no component rule in
   it, and why this file does not grow when a theme is added.

   The tokens live in themes/, one file per mode:

     themes/_base.css      the part of a theme that is NOT a colour - the hover
                           trio - plus the CONTRACT: which 31 tokens a theme
                           must define and which 4 are optional. Required.
     themes/_template.css  that contract with the values blank, and the four
                           ways a theme can be wrong without anything
                           complaining. Copy it to start a theme. NOT linked.
     themes/light.css      light, and its bare :root also answers for a missing
                           or unrecognised data-theme. Load before the rest.
     themes/prologue-dark.css
     themes/parchment.css   \
     themes/sandstone.css    | the light family - paper, warm, cool, matte
     themes/porcelain.css    |
     themes/chalk.css       /
     themes/darkslategray.css
     themes/treeline.css
     themes/vibrancy.css   vibrancy + vibrancy-crisp + vibrancy-sharp share one
                           token block and differ only in radius, so the radius
                           rules are in there rather than here
     themes/popsicle.css
     themes/dau-light.css  the running product's own palette, lifted from
     themes/dau-dark.css   lib/JSAndCSS/style/color.css rather than invented

   36 TOKENS FAN OUT TO 148 --bs-* VARIABLES here, which is the whole point of
   the layer: a theme writes 31 lines instead of 148, and the mapping is written
   once. --tsx-line alone is read in 32 places.
   THE LAYER IS ALSO CARRYING THREE THINGS BOOTSTRAP HAS NO VARIABLE FOR: the
   surfaces Wt paints itself (.Wt-dialog, .Wt-cal, .Wt-itemview), this page's
   chrome (sidebar, chips, plot ground), and the accent's split into fill / ink
   / label - which 5.2 does not have, and which darkslategray needs because a
   colour dark enough for a white label is too dark to read on its own panel.

   LOAD ORDER MATTERS TWICE: _base.css and light.css before the [data-theme]
   blocks, and all of them before this file. Between the theme files it does not.
   THREE RULES HERE STILL DEPEND ON THE GROUND - the select caret, the accordion
   chevron and .btn-close are images or filters and cannot read a token. They key
   off data-bs-theme rather than off theme names, so adding a theme file does not
   mean editing them; see the note above them. */
/* Native widgets - date pickers, scrollbars, form controls we do not paint -
   follow this and nothing else. */
/* GROUND, NOT MODE. Three rules below cannot read a token because they are
   images or filters - the select caret, the accordion chevron, .btn-close -
   so each needs one value per LIGHT-OR-DARK ground. That used to be spelled
   [data-theme="light"] against :not([data-theme="light"]), which worked while
   there was exactly one light mode; with five it would be a name list in every
   one of them, growing on each new theme and silently wrong the day one is
   forgotten (a pale grey caret on a cream panel is invisible, not obviously
   broken).
   data-bs-theme already carries the answer. The switcher writes it as light or
   dark from one Set, so these rules ask THAT instead and a sixth light mode
   touches only the Set. color-scheme moves with them for the same reason. */
:root[data-theme]:not([data-theme^="bootstrap"])[data-bs-theme="light"]{color-scheme:light}
:root[data-theme]:not([data-theme^="bootstrap"])[data-bs-theme="dark"]{color-scheme:dark}

/* ================================================= 2. BOOTSTRAP GLOBALS ==
   One mapping for every mode: the tokens are re-pointed by the blocks above
   and var() resolves at use, so these lines are written once. */
:root[data-theme]:not([data-theme^="bootstrap"]){
  --bs-body-bg:var(--tsx-bg);
  --bs-body-color:var(--tsx-text);
  --bs-body-font-family:'Inter',system-ui,-apple-system,sans-serif;
  --bs-body-font-size:.875rem;
  --bs-border-color:var(--tsx-line);
  --bs-border-color-translucent:var(--tsx-line);
  --bs-border-radius:.5rem; --bs-border-radius-sm:.375rem;
  --bs-border-radius-lg:.75rem; --bs-border-radius-xl:1rem;
  --bs-link-color:var(--tsx-accent-ink); --bs-link-hover-color:var(--tsx-hover-ink);
  --bs-code-color:var(--tsx-accent-ink);
  --bs-highlight-bg:rgba(var(--tsx-warn-rgb),.35);
  /* The -rgb triplets are what the bg-, text- and text-bg- utilities read, so
     overriding them recolours every utility in one line each. */
  /* primary carries the INK triplet, because text-primary is what reads it on
     a panel. The two fill utilities are pulled back to the fill colour just
     below - one triplet cannot serve both roles. */
  --bs-primary:var(--tsx-accent-ink); --bs-primary-rgb:var(--tsx-accent-ink-rgb);
  --bs-success:var(--tsx-good);     --bs-success-rgb:var(--tsx-good-rgb);
  --bs-warning:var(--tsx-warn);     --bs-warning-rgb:var(--tsx-warn-rgb);
  --bs-info:var(--tsx-info);        --bs-info-rgb:var(--tsx-info-rgb);
  --bs-danger:var(--tsx-danger);    --bs-danger-rgb:var(--tsx-danger-rgb);
  --bs-secondary:var(--tsx-sub);    --bs-secondary-rgb:var(--tsx-sub-rgb);
  --bs-emphasis-color:var(--tsx-text);
}
/* Bootstrap writes these two with !important, so the fill correction has to as
   well. Without them a primary badge would be ink-coloured with a white label. */
:root[data-theme]:not([data-theme^="bootstrap"]) .bg-primary{background-color:var(--tsx-accent)!important}
/* THE text-bg-* UTILITIES ARE NOT VARIABLE-DRIVEN IN 5.2 - each one writes a
   literal RGBA, so the -rgb overrides above miss them entirely and a badge
   comes out in stock Bootstrap colours. (5.3 fixes this; until the bump they
   are assigned by hand.) The label colour is the interesting half: bright
   fills need a dark label and dark fills a white one, which is why info and
   danger carry a per-mode -fg - their fill flips sides between the modes. */
:root[data-theme]:not([data-theme^="bootstrap"]) .text-bg-primary{background-color:var(--tsx-accent)!important;color:var(--tsx-accent-fg)!important}
:root[data-theme]:not([data-theme^="bootstrap"]) .text-bg-success{background-color:var(--tsx-good)!important;color:var(--tsx-good-fg)!important}
:root[data-theme]:not([data-theme^="bootstrap"]) .text-bg-warning{background-color:var(--tsx-warn)!important;color:#08181C!important}
:root[data-theme]:not([data-theme^="bootstrap"]) .text-bg-info{background-color:var(--tsx-info)!important;color:var(--tsx-info-fg)!important}
:root[data-theme]:not([data-theme^="bootstrap"]) .text-bg-danger{background-color:var(--tsx-danger)!important;color:var(--tsx-danger-fg)!important}
:root[data-theme]:not([data-theme^="bootstrap"]) .text-bg-secondary{background-color:var(--tsx-chip)!important;color:var(--tsx-sub)!important}
:root[data-theme]:not([data-theme^="bootstrap"]) .text-bg-light{background-color:var(--tsx-panel2)!important;color:var(--tsx-text)!important}
:root[data-theme]:not([data-theme^="bootstrap"]) .text-bg-dark{background-color:var(--tsx-sb)!important;color:#fff!important}

/* ================================================= 3. BUTTONS (btn-*) ====
   Wt emits "btn btn-secondary" for a plain WPushButton and Widget::PushButton
   swaps in btn-<style> / btn-outline-<style>, so both families are covered.

   Two variables per variant, two shared blocks for the twelve --bs-btn-* each
   needs. Written the other way round - a full block per variant - this is 120
   lines that all say the same thing. */
:root[data-theme]:not([data-theme^="bootstrap"]) .btn{--bs-btn-font-weight:600;--bs-btn-focus-box-shadow:0 0 0 .2rem var(--tsx-accent-a25)}
/* --btnc-hv is the hover fill and --btnc-dk the pressed one. Only the accent
   distinguishes them; every other variant leaves --btnc-hv unset and the
   fallback in the shared block below puts it back to --btnc-dk. */
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-primary,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-primary{--btnc:var(--tsx-accent);--btnc-dk:var(--tsx-accent-dk);--btnc-hv:var(--tsx-accent-hv);--btnfg:var(--tsx-accent-fg)}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-success,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-success{--btnc:var(--tsx-good);--btnc-dk:var(--tsx-good);--btnfg:var(--tsx-good-fg)}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-danger,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-danger{--btnc:var(--tsx-danger);--btnc-dk:var(--tsx-danger);--btnfg:var(--tsx-danger-fg)}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-warning,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-warning{--btnc:var(--tsx-warn);--btnc-dk:var(--tsx-warn);--btnfg:#0B0D10}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-info,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-info{--btnc:var(--tsx-info);--btnc-dk:var(--tsx-info);--btnfg:var(--tsx-info-fg);
                                      --btnc-ink:var(--tsx-info-ink,var(--tsx-info))}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-secondary,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-secondary{--btnc:var(--tsx-chip);--btnc-dk:var(--tsx-chip-dk);--btnfg:var(--tsx-sub)}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-light,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-light{--btnc:var(--tsx-panel2);--btnc-dk:var(--tsx-chip-dk);--btnfg:var(--tsx-text)}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-dark,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-dark{--btnc:var(--tsx-sb);--btnc-dk:#000;--btnfg:#fff}

:root[data-theme]:not([data-theme^="bootstrap"]) .btn-primary,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-secondary,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-success,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-danger,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-warning,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-info,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-light,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-dark{
  --bs-btn-bg:var(--btnc);--bs-btn-border-color:var(--btnc);--bs-btn-color:var(--btnfg);
  --bs-btn-hover-bg:var(--btnc-hv,var(--btnc-dk));--bs-btn-hover-border-color:var(--btnc-hv,var(--btnc-dk));--bs-btn-hover-color:var(--btnfg);
  --bs-btn-active-bg:var(--btnc-dk);--bs-btn-active-border-color:var(--btnc-dk);--bs-btn-active-color:var(--btnfg);
  --bs-btn-disabled-bg:var(--btnc);--bs-btn-disabled-border-color:var(--btnc);--bs-btn-disabled-color:var(--btnfg)}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-primary,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-secondary,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-success,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-danger,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-warning,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-info,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-light,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-dark{
  /* --btnc-ink, falling back to the fill: an outlined button's label is drawn
     on the PANEL, so a fill that is darker than the panel cannot also be the
     label. Only the mode that has such a fill defines the token. */
  --bs-btn-bg:transparent;--bs-btn-color:var(--btnc-ink,var(--btnc));--bs-btn-border-color:var(--btnc);
  --bs-btn-hover-bg:var(--btnc);--bs-btn-hover-border-color:var(--btnc);--bs-btn-hover-color:var(--btnfg);
  --bs-btn-active-bg:var(--btnc-dk);--bs-btn-active-border-color:var(--btnc-dk);--bs-btn-active-color:var(--btnfg);
  --bs-btn-disabled-color:var(--btnc);--bs-btn-disabled-border-color:var(--btnc)}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-secondary,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-secondary,
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-light{--bs-btn-border-color:var(--tsx-line)}
/* THE TWO OUTLINES WHOSE FILL COLOUR CANNOT BE THEIR TEXT COLOUR. Every other
   variant is a saturated colour that reads on both surfaces; secondary and
   light are surfaces themselves, so painting the label with them leaves grey
   on grey (and, in darkslategray, slate on slate). The label takes the text
   ramp instead and only the fill keeps the chip colour. */
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-secondary{--bs-btn-color:var(--tsx-sub);--bs-btn-hover-color:var(--tsx-text);
  --bs-btn-hover-bg:var(--tsx-chip);--bs-btn-hover-border-color:var(--tsx-faint);
  --bs-btn-active-color:var(--tsx-text);--bs-btn-active-bg:var(--tsx-chip-dk);
  --bs-btn-active-border-color:var(--tsx-faint);--bs-btn-disabled-color:var(--tsx-faint)}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-light{--bs-btn-color:var(--tsx-text);--bs-btn-hover-color:var(--tsx-text);
  --bs-btn-active-color:var(--tsx-text);--bs-btn-disabled-color:var(--tsx-faint)}
/* Style::Dark outlined is the mirror case: the sidebar black IS the darkest
   surface, so in a dark mode its label vanishes. The border keeps it, the
   label follows the text ramp - readable in all three modes. */
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-dark{--bs-btn-color:var(--tsx-text);--bs-btn-disabled-color:var(--tsx-faint)}
/* An outlined primary is a label on the panel, so it inks; the fill only
   appears once it is hovered or pressed. In light and dark ink == fill and
   these four lines change nothing. */
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-outline-primary{--bs-btn-color:var(--tsx-accent-ink);--bs-btn-border-color:var(--tsx-accent-ink);
  --bs-btn-hover-bg:var(--tsx-accent-hv);--bs-btn-hover-border-color:var(--tsx-accent-hv);
  --bs-btn-disabled-color:var(--tsx-accent-ink);--bs-btn-disabled-border-color:var(--tsx-accent-ink)}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-link{--bs-btn-color:var(--tsx-accent-ink);--bs-btn-hover-color:var(--tsx-hover-ink);--bs-btn-disabled-color:var(--tsx-faint)}
:root[data-theme]:not([data-theme^="bootstrap"]) .btn-close{filter:none}
:root[data-theme]:not([data-theme^="bootstrap"])[data-bs-theme="dark"] .btn-close{filter:invert(1) grayscale(100%) brightness(200%)}

/* ==================================================== 4. FORM CONTROLS ===
   5.2 still writes these colours literally, so they are assigned rather than
   re-pointed. Focus is the accent ring in every mode - the default is
   Bootstrap blue, which nothing else on the page uses. */
:root[data-theme]:not([data-theme^="bootstrap"]) .form-control,
:root[data-theme]:not([data-theme^="bootstrap"]) .form-select,
:root[data-theme]:not([data-theme^="bootstrap"]) .form-control-plaintext{
  background-color:var(--tsx-panel2);color:var(--tsx-text);border-color:var(--tsx-line)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-control:focus,
:root[data-theme]:not([data-theme^="bootstrap"]) .form-select:focus{
  background-color:var(--tsx-panel2);color:var(--tsx-text);
  border-color:var(--tsx-accent);box-shadow:0 0 0 .2rem var(--tsx-accent-a25)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-control:hover:not(:disabled):not([readonly]),
:root[data-theme]:not([data-theme^="bootstrap"]) .form-select:hover:not(:disabled){border-color:var(--tsx-faint)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-control::placeholder{color:var(--tsx-faint);opacity:1}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-control:disabled,
:root[data-theme]:not([data-theme^="bootstrap"]) .form-select:disabled,
:root[data-theme]:not([data-theme^="bootstrap"]) .form-control[readonly]{
  background-color:var(--tsx-panel);color:var(--tsx-faint);border-color:var(--tsx-line)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-label,
:root[data-theme]:not([data-theme^="bootstrap"]) .col-form-label{color:var(--tsx-sub);font-weight:600;font-size:.75rem}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-text{color:var(--tsx-faint)}
:root[data-theme]:not([data-theme^="bootstrap"]) .input-group-text{background-color:var(--tsx-chip);color:var(--tsx-sub);border-color:var(--tsx-line)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-floating>label{color:var(--tsx-faint)}

/* The caret is a baked-in data URI with a dark stroke - invisible on a dark
   panel - and a data URI cannot read a token, so it is one image per ground
   rather than one per mode. Every dark mode's caret is the same pale grey;
   at 16px the tint each mode would have contributed is not visible. */
:root[data-theme]:not([data-theme^="bootstrap"])[data-bs-theme="light"] .form-select{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23444B58' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e")}
:root[data-theme]:not([data-theme^="bootstrap"])[data-bs-theme="dark"] .form-select{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23B5B5B5' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e")}

/* Checkbox / radio / switch - WCheckBox, WRadioButton, Widget::SwitchCheckBox */
:root[data-theme]:not([data-theme^="bootstrap"]) .form-check-input{background-color:var(--tsx-panel2);border-color:var(--tsx-faint)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-check-input:checked{background-color:var(--tsx-accent);border-color:var(--tsx-accent)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-check-input:indeterminate{background-color:var(--tsx-accent);border-color:var(--tsx-accent)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-check-input:focus{border-color:var(--tsx-accent);box-shadow:0 0 0 .2rem var(--tsx-accent-a25)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-check-input:disabled{opacity:.45}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-check-input:disabled~.form-check-label{color:var(--tsx-faint);opacity:1}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-switch .form-check-input:not(:checked){background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23A8ADB8'/%3e%3c/svg%3e")}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-check-input.is-invalid{border-color:var(--tsx-danger)}
:root[data-theme]:not([data-theme^="bootstrap"]) .valid-feedback{color:var(--tsx-good)} .invalid-feedback{color:var(--tsx-danger)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-control.is-invalid,
:root[data-theme]:not([data-theme^="bootstrap"]) .form-select.is-invalid{border-color:var(--tsx-danger)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-control.is-invalid:focus{box-shadow:0 0 0 .2rem rgba(var(--tsx-danger-rgb),.25)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-control.is-valid,
:root[data-theme]:not([data-theme^="bootstrap"]) .form-select.is-valid{border-color:var(--tsx-good)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-control.is-valid:focus{box-shadow:0 0 0 .2rem rgba(var(--tsx-good-rgb),.25)}

/* WSlider with nativeControl(true) */
:root[data-theme]:not([data-theme^="bootstrap"]) .form-range{background:transparent}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-range::-webkit-slider-runnable-track{background-color:var(--tsx-chip-dk)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-range::-moz-range-track{background-color:var(--tsx-chip-dk)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-range::-webkit-slider-thumb{background-color:var(--tsx-accent-ink)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-range::-moz-range-thumb{background-color:var(--tsx-accent-ink)}
:root[data-theme]:not([data-theme^="bootstrap"]) .form-range:disabled::-webkit-slider-thumb{background-color:var(--tsx-faint)}

/* ==================================== 5. SURFACES, DATA, NAV, OVERLAYS ===
   All var-driven in 5.2, so these are re-points rather than rewrites. */
:root[data-theme]:not([data-theme^="bootstrap"]) .card{--bs-card-bg:var(--tsx-panel);--bs-card-color:var(--tsx-text);
  --bs-card-border-color:var(--tsx-line);--bs-card-cap-bg:var(--tsx-panel2);
  --bs-card-cap-color:var(--tsx-text);--bs-card-border-radius:.75rem;
  --bs-card-inner-border-radius:calc(.75rem - 1px);--bs-card-spacer-y:1rem;--bs-card-spacer-x:1.0625rem}
:root[data-theme]:not([data-theme^="bootstrap"]) .table{--bs-table-bg:transparent;--bs-table-color:var(--tsx-text);
  --bs-table-border-color:var(--tsx-line);
  --bs-table-striped-bg:var(--tsx-panel2);--bs-table-striped-color:var(--tsx-text);
  --bs-table-hover-bg:var(--tsx-hover-tint);--bs-table-hover-color:var(--tsx-text);
  --bs-table-active-bg:rgba(var(--tsx-accent-ink-rgb),.18);--bs-table-active-color:var(--tsx-text)}
/* A SELECTED ROW ON A STRIPED TABLE LOSES IN STOCK BOOTSTRAP: .table-active is
   one class, and the stripe rule that also sets --bs-table-accent-bg is three
   deep, so the stripe wins and the selection disappears on every other row.
   Both of those classes are on the app's tables, so the selection is put back
   with a selector that outranks the stripe. */
:root[data-theme]:not([data-theme^="bootstrap"]) .table>tbody>tr.table-active>*{--bs-table-accent-bg:var(--bs-table-active-bg)}
:root[data-theme]:not([data-theme^="bootstrap"]) .table>thead th{font-size:.625rem;text-transform:uppercase;letter-spacing:.03em;
  color:var(--tsx-faint);font-weight:700}
:root[data-theme]:not([data-theme^="bootstrap"]) .progress{--bs-progress-bg:var(--tsx-chip-dk);--bs-progress-bar-bg:var(--tsx-accent);--bs-progress-bar-color:var(--tsx-accent-fg);
  --bs-progress-font-size:.625rem;--bs-progress-border-radius:.3125rem}
:root[data-theme]:not([data-theme^="bootstrap"]) .nav{--bs-nav-link-color:var(--tsx-sub);--bs-nav-link-hover-color:var(--tsx-hover-ink);
  --bs-nav-link-disabled-color:var(--tsx-faint);--bs-nav-link-font-weight:600}
:root[data-theme]:not([data-theme^="bootstrap"]) .nav-tabs{--bs-nav-tabs-border-color:var(--tsx-line);
  --bs-nav-tabs-link-hover-border-color:var(--tsx-line);
  --bs-nav-tabs-link-active-bg:var(--tsx-panel);--bs-nav-tabs-link-active-color:var(--tsx-accent-ink);
  --bs-nav-tabs-link-active-border-color:var(--tsx-line)}
:root[data-theme]:not([data-theme^="bootstrap"]) .nav-pills{--bs-nav-pills-link-active-bg:var(--tsx-accent);--bs-nav-pills-link-active-color:var(--tsx-accent-fg)}
:root[data-theme]:not([data-theme^="bootstrap"]) .navbar{--bs-navbar-color:var(--tsx-sub);--bs-navbar-hover-color:var(--tsx-text);
  --bs-navbar-active-color:var(--tsx-accent-ink);--bs-navbar-brand-color:var(--tsx-text);
  --bs-navbar-brand-hover-color:var(--tsx-text);--bs-navbar-disabled-color:var(--tsx-faint)}
/* :not(.sidenav) EXCLUDES THE COMPACT MENU'S PANEL. That panel is a Bootstrap
   dropdown carrying .sidenav so its entries look like the sidebar column's, and
   shell.css repoints the same --bs-dropdown-* variables for it - on a dark ground
   rather than a panel one. Without this exclusion the rule below wins on
   specificity (the scope prefix puts it two classes ahead) and the panel comes out
   light with pale grey entries on it. */
:root[data-theme]:not([data-theme^="bootstrap"]) .dropdown-menu:not(.sidenav),
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-dropdown-menu{--bs-dropdown-bg:var(--tsx-panel);--bs-dropdown-color:var(--tsx-text);
  --bs-dropdown-border-color:var(--tsx-line);--bs-dropdown-link-color:var(--tsx-text);
  --bs-dropdown-link-hover-bg:var(--tsx-hover-tint);--bs-dropdown-link-hover-color:var(--tsx-text);
  --bs-dropdown-link-active-bg:var(--tsx-accent);--bs-dropdown-link-active-color:var(--tsx-accent-fg);
  --bs-dropdown-link-disabled-color:var(--tsx-faint);--bs-dropdown-divider-bg:var(--tsx-line);
  --bs-dropdown-header-color:var(--tsx-faint);--bs-dropdown-border-radius:.625rem}
:root[data-theme]:not([data-theme^="bootstrap"]) .list-group{--bs-list-group-bg:var(--tsx-panel);--bs-list-group-color:var(--tsx-text);
  --bs-list-group-border-color:var(--tsx-line);--bs-list-group-action-hover-bg:var(--tsx-hover-tint);
  --bs-list-group-action-hover-color:var(--tsx-text);--bs-list-group-active-bg:var(--tsx-accent);--bs-list-group-active-color:var(--tsx-accent-fg);
  --bs-list-group-active-border-color:var(--tsx-accent);--bs-list-group-disabled-color:var(--tsx-faint);
  --bs-list-group-disabled-bg:var(--tsx-panel)}
:root[data-theme]:not([data-theme^="bootstrap"]) .accordion{--bs-accordion-bg:var(--tsx-panel);--bs-accordion-color:var(--tsx-text);
  --bs-accordion-border-color:var(--tsx-line);--bs-accordion-btn-color:var(--tsx-text);
  --bs-accordion-btn-bg:var(--tsx-panel2);--bs-accordion-active-bg:var(--tsx-panel2);
  --bs-accordion-active-color:var(--tsx-accent-ink);
  --bs-accordion-btn-focus-box-shadow:0 0 0 .2rem var(--tsx-accent-a25);
  --bs-accordion-btn-focus-border-color:var(--tsx-accent-ink);--bs-accordion-border-radius:.625rem}
/* THE CHEVRON IS AN IMAGE, so its colour cannot come from a token - and the
   stock pair is wrong twice over: Bootstrap's OPEN arrow is its own blue
   (#0c63e4), and the dark override this replaces had a coral one hardcoded,
   which stayed coral in the blue, purple and orange modes. One neutral pair
   per ground instead; the open panel is already marked by its accent-coloured
   label, so the arrow does not need to carry it. */
:root[data-theme]:not([data-theme^="bootstrap"])[data-bs-theme="light"] .accordion{
  --bs-accordion-btn-icon:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23444B58'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  --bs-accordion-btn-active-icon:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23444B58'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}
:root[data-theme]:not([data-theme^="bootstrap"])[data-bs-theme="dark"] .accordion{
  --bs-accordion-btn-icon:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23B5B5B5'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  --bs-accordion-btn-active-icon:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23B5B5B5'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}
:root[data-theme]:not([data-theme^="bootstrap"]) .modal{--bs-modal-bg:var(--tsx-panel);--bs-modal-color:var(--tsx-text);
  --bs-modal-border-color:var(--tsx-line);--bs-modal-header-border-color:var(--tsx-line);
  --bs-modal-footer-border-color:var(--tsx-line);--bs-modal-border-radius:.875rem}
:root[data-theme]:not([data-theme^="bootstrap"]) .pagination{--bs-pagination-bg:var(--tsx-panel);--bs-pagination-color:var(--tsx-sub);
  --bs-pagination-border-color:var(--tsx-line);--bs-pagination-hover-bg:var(--tsx-panel2);
  --bs-pagination-hover-color:var(--tsx-text);--bs-pagination-hover-border-color:var(--tsx-line);
  --bs-pagination-active-bg:var(--tsx-accent);--bs-pagination-active-color:var(--tsx-accent-fg);--bs-pagination-active-border-color:var(--tsx-accent);
  --bs-pagination-disabled-bg:var(--tsx-panel);--bs-pagination-disabled-color:var(--tsx-faint);
  --bs-pagination-disabled-border-color:var(--tsx-line);
  --bs-pagination-focus-box-shadow:0 0 0 .2rem var(--tsx-accent-a25)}
:root[data-theme]:not([data-theme^="bootstrap"]) .breadcrumb{--bs-breadcrumb-divider-color:var(--tsx-faint);--bs-breadcrumb-item-active-color:var(--tsx-text)}
:root[data-theme]:not([data-theme^="bootstrap"]) .tooltip{--bs-tooltip-bg:var(--tsx-sb);--bs-tooltip-color:#fff;--bs-tooltip-opacity:1}
:root[data-theme]:not([data-theme^="bootstrap"]) .popover{--bs-popover-bg:var(--tsx-panel);--bs-popover-border-color:var(--tsx-line);
  --bs-popover-header-bg:var(--tsx-panel2);--bs-popover-body-color:var(--tsx-text);
  --bs-popover-header-color:var(--tsx-text)}
:root[data-theme]:not([data-theme^="bootstrap"]) .alert-primary{--bs-alert-bg:rgba(var(--tsx-accent-ink-rgb),.12);--bs-alert-color:var(--tsx-accent-ink);--bs-alert-border-color:rgba(var(--tsx-accent-ink-rgb),.3)}
:root[data-theme]:not([data-theme^="bootstrap"]) .alert-success{--bs-alert-bg:rgba(var(--tsx-good-rgb),.12);--bs-alert-color:var(--tsx-good);--bs-alert-border-color:rgba(var(--tsx-good-rgb),.3)}
:root[data-theme]:not([data-theme^="bootstrap"]) .alert-warning{--bs-alert-bg:rgba(var(--tsx-warn-rgb),.12);--bs-alert-color:var(--tsx-warn);--bs-alert-border-color:rgba(var(--tsx-warn-rgb),.3)}
:root[data-theme]:not([data-theme^="bootstrap"]) .alert-danger{--bs-alert-bg:rgba(var(--tsx-danger-rgb),.12);--bs-alert-color:var(--tsx-danger);--bs-alert-border-color:rgba(var(--tsx-danger-rgb),.3)}

/* ======================================================= 6. Wt-* HOOKS ===
   Widgets Wt paints itself. Bootstrap has no variables for these, so the
   application's stylesheet has to carry them - this is the list. */
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-dialog,
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-panel{background-color:var(--tsx-panel);color:var(--tsx-text);border:1px solid var(--tsx-line);border-radius:.875rem}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-dialog .titlebar{background-color:var(--tsx-panel2);color:var(--tsx-text);border-bottom:1px solid var(--tsx-line)}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-spinbox{background-color:var(--tsx-panel2)}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-cal,
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-datepicker{background-color:var(--tsx-panel);color:var(--tsx-text);border:1px solid var(--tsx-line);border-radius:.625rem}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-cal th,
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-cal td{color:var(--tsx-text);padding:3px 6px}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-cal th{color:var(--tsx-faint);font-weight:700}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-cal-oom,
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-cal-oor{color:var(--tsx-faint)}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-cal td.Wt-cal-sel{background-color:var(--tsx-accent);color:var(--tsx-accent-fg);border-radius:.25rem}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-cal-now{outline:1px solid var(--tsx-accent-ink)}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-itemview{background-color:var(--tsx-panel);border-color:var(--tsx-line)}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-itemview .Wt-headerdiv{background-color:var(--tsx-panel2);color:var(--tsx-faint)}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-itemview .Wt-tv-row:hover,
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-itemview .Wt-item:hover{background-color:var(--tsx-panel2)}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-itemview .Wt-selected{background-color:rgba(var(--tsx-accent-ink-rgb),.18)}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-suggest-dropdown{background-color:var(--tsx-panel);border:1px solid var(--tsx-line);border-radius:.625rem}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-suggest-dropdown-hover,
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-suggest .active{background-color:var(--tsx-accent);color:var(--tsx-accent-fg)}
:root[data-theme]:not([data-theme^="bootstrap"]) .Wt-slider-bg{background-color:var(--tsx-chip-dk)}

/* Section 7 was GALLERY CHROME and is now shell.css, beside this file: the
   page's own frame is not Bootstrap and does not want this file's scope - it has
   to survive the two bootstrap-* modes, where every rule here switches off. */

/* STATE SIMULATION. :hover / :focus / :active cannot be photographed side by
   side, so three classes paint them from Bootstrap's own hover/active/focus
   variables - the specimen shows the real values, not an approximation. Only
   this page needs them; the application gets the states from the browser. */
:root[data-theme]:not([data-theme^="bootstrap"]) .sim-hover.btn{color:var(--bs-btn-hover-color);background-color:var(--bs-btn-hover-bg);border-color:var(--bs-btn-hover-border-color)}
:root[data-theme]:not([data-theme^="bootstrap"]) .sim-active.btn{color:var(--bs-btn-active-color);background-color:var(--bs-btn-active-bg);border-color:var(--bs-btn-active-border-color)}
:root[data-theme]:not([data-theme^="bootstrap"]) .sim-focus.btn{box-shadow:var(--bs-btn-focus-box-shadow)}
:root[data-theme]:not([data-theme^="bootstrap"]) .sim-focus.form-control,
:root[data-theme]:not([data-theme^="bootstrap"]) .sim-focus.form-select,
:root[data-theme]:not([data-theme^="bootstrap"]) .sim-focus.form-check-input{
  border-color:var(--tsx-accent);box-shadow:0 0 0 .2rem var(--tsx-accent-a25)}
:root[data-theme]:not([data-theme^="bootstrap"]) .sim-hover.form-control,
:root[data-theme]:not([data-theme^="bootstrap"]) .sim-hover.form-select{border-color:var(--tsx-faint)}


/* ============================================================ THE SHELL ==
   The page's own frame - sidebar, brand, side navigation, top bar, segmented
   control, content column - and the specimen furniture that documents widgets:
   captions, swatches, API blocks, notes.
   NONE OF IT IS BOOTSTRAP. .sidenav is not .nav, .seg is not .btn-group, .sw and
   .tok have no Bootstrap equivalent at all. These are this project's own classes,
   which is why they live in their own file with their own widgets beside them in
   ModernUI/Shell.h - a shell element is added in C++ and gets its look from here,
   with nothing to remember at the call site.
   UNSCOPED, unlike style.css. Every rule in style.css carries
   :root[data-theme]:not([data-theme^="bootstrap"]) so that Bootstrap's own light
   and dark come through untouched - and the shell must survive those two modes,
   or picking bootstrap-light would leave the page a bare list of links.
   WHICH IS WHY EVERY TOKEN HERE HAS A FALLBACK, and the fallback is a --bs-*
   variable wherever Bootstrap has an equivalent: under our themes the shell reads
   --tsx-*, under Bootstrap's it reads Bootstrap's, and under neither it reads a
   literal. Three levels deep in places, which is verbose and is the price of one
   frame that works in all sixteen modes.
   THE SIDEBAR'S OWN THREE - --tsx-sb, --tsx-sb-line, --tsx-sb-hi - HAVE NO
   BOOTSTRAP NAME, so they read the nearest surface Bootstrap does have:
   --bs-tertiary-bg, --bs-border-color, --bs-secondary-bg. They used to fall
   straight to the dark literals, which under bootstrap-light painted a near-black
   panel and then Bootstrap's dark body colour on top of it - the sidebar came out
   unreadable. The literals stay as the third level, for the case where neither
   layer is present.
   THE SIDEBAR IS NOT ALWAYS DARK ANY MORE. It used to be - --tsx-sb was a
   near-black in every one of the sixteen modes, which is why the text on it was
   written as literals (#A8ADB8, #fff, a white veil on hover) that needed no
   per-theme value. The six light themes now give --tsx-sb a light surface, so
   those literals were exactly wrong there: white on cream. Every colour in the
   shell reads a token now.
   THE HOVER VEIL IS BUILT FROM --tsx-sub-rgb at 18%, which is the one trick worth
   naming: a mid-tone grey at low alpha darkens a light ground and lightens a dark
   one, so a single value works on both instead of one veil per polarity. */
.brandfont{font-family:'Quicksand',sans-serif}
/* overflow-x:clip IS WHAT MAKES THE COLLAPSE SYMMETRIC. The slide is a negative
   margin, and a browser treats the two directions differently: pulled left the
   sidebar goes to -236px and is simply clipped, because overflow past the inline
   start is not scrollable; pushed right it lands past the viewport and the page
   grows a horizontal scrollbar instead, so nothing looks hidden - it just becomes
   scrollable, with a sliver still showing.
   CLIP RATHER THAN HIDDEN, deliberately: overflow:hidden would make .app a scroll
   container, and .sidebar is position:sticky inside it - it would then stick to
   .app instead of the viewport. overflow-x:clip clips without creating one, and
   pairing it with an unset overflow-y leaves that visible rather than promoting it
   to auto. */
.app{display:flex;min-height:100vh;overflow-x:clip}
/* KAYAN SEY MENU, KENAR CUBUGUNUN TAMAMI DEGIL. Once `overflow-y:auto` burada
   duruyordu ve marka satiri ile en alttaki surum notu menuyle birlikte kayiyordu:
   menu uzun olan urunde ( perf, Admin Tools'ta sekiz satir fazla ) surum notu
   goruntunun altinda kaliyor ve hic gorunmuyordu - EP'de kisa menu yuzunden
   goruniyordu, ayni kod. Simdi kenar cubugu tasmiyor, kayma .sidenav'in. */
.sidebar{width:236px;flex-shrink:0;background:var(--tsx-sb,var(--bs-tertiary-bg,#0B0D10));color:var(--tsx-sub,var(--bs-secondary-color,#6c757d));
  position:sticky;top:0;height:100vh;border-left:4px solid var(--tsx-accent-ink,var(--bs-primary,#0d6efd));
  display:flex;flex-direction:column;overflow:hidden}

/* min-height:0 ZORUNLU: bir flex ogesinin varsayilan min-height:auto degeri onu
   icerigin altina inmeye birakmiyor, dolayisiyla overflow cocuga degil EBEVEYNE
   tasiyor - duzeltilen sey tam olarak buydu.
   COCUK SECICI: .sidenav sinifini ust bardaki acilir menu de tasiyor
   ( AppShell.cpp, "dropdown-menu dropdown-menu-end sidenav" ); oraya overflow
   vermek acilir menuyu kirpardi. */
.sidebar > .sidenav{flex:1 1 auto;min-height:0;overflow-y:auto}
/* MARKA SATIRININ KENDI ZEMINI YOK: kenar cubugunun zeminini surdurur. Bir ara
   --tsx-panel verilmisti ( sicak temalarda logonun altindaki krem gitsin diye ) ama
   o da koyu temalarda logonun arkasinda ayri renkte bir blok birakiyordu - satir
   cubugun bir parcasi , ayri bir yuzey degil. */
/* MARKA IKI SATIR: ustte mark ile urun adi yan yana , altta sirketin adi satirin
   TAMAMINI kullanarak. Once ucu de tek satirdaydi ve sirket adi , logo ile urun adi
   arasindaki dar sutuna sikisip iki parcaya bolunuyordu. */
.brand{padding:15px 18px;display:flex;flex-direction:column;gap:4px;
  border-bottom:1px solid var(--tsx-sb-line,var(--bs-border-color,#ffffff14))}
.brand-row{display:flex;align-items:center;gap:11px}
/* MARKIN KUTUSU. Sinif adi "mark" DEGIL: Bootstrap-in kendi .mark sinifi var
   ( _reboot , <mark> vurgusu ) ve background-color:var(--bs-highlight-bg) yaziyor -
   logonun arkasindaki sari/zeytin blok oydu. brandmark ile cakisma bitti.

   CIZIMIN KENDISI. Eskiden vurgu renginde bir kare ve ortasinda bir harf vardi;
   zemin de kose de harfin altligiydi. Dosyayi AppShell.cpp'deki Brand arka plan
   olarak veriyor - acik ve koyu zemin icin iki ayri dosya var ve dosyayi zemine gore
   yalnizca bir kural degistirebilir. */
.brandmark{width:34px;height:34px;flex-shrink:0;
  background-size:contain;background-repeat:no-repeat;background-position:center}
/* ALT SATIR , SIRKETIN ADI. 7.5px ve 1.5px harf araligi tek kelimelik "AWSOLS" icin
   bir vurguydu; "Advanced Wireline Solutions INC" gibi bir ad orada okunmuyordu -
   harfler birbirinden uzak , punto ise gozun secebileceginin altinda.
   display:block : WText bir <span> , yani satirin tamamini kendiliginden kaplamaz. */
.brand-top{display:block;font-size:11.5px;line-height:1.35;letter-spacing:.2px;
  color:var(--tsx-text,var(--bs-body-color,#212529));opacity:.8;font-weight:500}
.brand-name{color:var(--tsx-text,var(--bs-body-color,#212529));font-weight:700;font-size:16px;letter-spacing:.4px;line-height:1.15}
.sidenav{padding:8px 10px;flex:1}
.sidenav a{display:block;padding:7px 13px;border-radius:8px;color:var(--tsx-sub,var(--bs-secondary-color,#6c757d));cursor:pointer;
  font-size:12.5px;font-weight:500;text-decoration:none}
/* A cool blue-black hover was fine while every sidebar was blue-black -
   parchment's is warm, so the hover becomes a white veil that takes the hue of
   whatever it is drawn on rather than a literal colour of its own. */
.sidenav a:hover{background:rgba(var(--tsx-sub-rgb,108,117,125),.18);color:var(--tsx-text,var(--bs-body-color,#212529))}
.sidenav a.on{background:var(--tsx-sb-hi,var(--bs-secondary-bg,#241118));color:var(--tsx-text,var(--bs-body-color,#212529));box-shadow:inset 3px 0 0 var(--tsx-accent-ink,var(--bs-primary,#0d6efd))}
/* THE ENTRY DOT, muted until the entry is the selected one - the Spartan sidebar
   carries it and this one did not, so the two read as different navigations.
   A ::before RATHER THAN A WIDGET, which is why there is no C++ beside this:
   ".seg button.on::before" three rules down draws its dot the same way, and an
   element added in MenuItem would have to be kept in step through addItem, the
   mirror and every group. A pseudo-element cannot fall out of step.
   :not(.submenu-toggle) BECAUSE A GROUP HEADER IS NOT AN ENTRY - it opens a panel
   rather than choosing something, and a dot beside it would claim otherwise.
   The accent is --tsx-accent-ink, THE SAME TOKEN AS THE INSET BAR it sits next to
   on the selected row: two accents on one row that could differ by theme is two
   places for a theme to look wrong. */
.sidenav a:not(.submenu-toggle)::before{content:"";width:6px;height:6px;border-radius:50%;
  background:var(--tsx-faint,var(--bs-tertiary-color,#6c757d));
  display:inline-block;margin-right:11px;vertical-align:middle}
.sidenav a.on:not(.submenu-toggle)::before{background:var(--tsx-accent-ink,var(--bs-primary,#0d6efd))}
.sidenav .sec{font-size:10px;letter-spacing:1.1px;color:var(--tsx-faint,var(--bs-tertiary-color,#6c757d));font-weight:700;padding:12px 13px 4px}

/* A BREAK BETWEEN TWO GROUPS - Menu::addSeparator. A ".sec" with no text was the
   obvious alternative and it is not the same thing: a heading says what comes
   next, a rule only says "these two are not one list".

   THE 13px MATCHES ".sidenav a"'s SIDE PADDING, so the line begins where the
   entry text begins rather than at the panel edge - a rule that runs wider than
   the rows it divides reads as the panel's own edge.

   flex:0 0 auto BECAUSE ".sidenav" IS A FLEX COLUMN: the default flex-shrink
   would let a 1px item collapse to nothing the first time a long menu overflows,
   which is exactly the menu that needs dividing.

   --tsx-sb-line is the sidebar's own line token - the one the brand row and the
   dropdown border already use - so the divider tracks the sidebar in all sixteen
   modes instead of being a second decision about the same edge. */
.sidenav .sep{height:1px;margin:8px 13px;flex:0 0 auto;
  background:var(--tsx-sb-line,var(--bs-border-color,#dee2e6))}
.main{flex:1;min-width:0}
.topbar{min-height:56px;background:var(--tsx-panel,var(--bs-body-bg,#fff));border-bottom:1px solid var(--tsx-line,var(--bs-border-color,#dee2e6));
  display:flex;align-items:center;gap:14px;padding:8px 22px;position:sticky;top:0;z-index:20;flex-wrap:wrap}
.seg{display:flex;background:var(--tsx-chip,var(--bs-secondary-bg,#e9ecef));border-radius:9px;padding:3px;gap:3px}
.seg button{border:none;background:none;padding:6px 13px;border-radius:7px;font-size:11px;
  font-weight:600;color:var(--tsx-faint,var(--bs-tertiary-color,#6c757d));cursor:pointer;font-family:inherit;white-space:nowrap}
.seg button.on{background:var(--tsx-panel,var(--bs-body-bg,#fff));color:var(--tsx-text,var(--bs-body-color,#212529));box-shadow:0 1px 2px rgba(0,0,0,.2)}
.seg button.on::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--tsx-accent-ink,var(--bs-primary,#0d6efd));
  display:inline-block;margin-right:6px;vertical-align:middle}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--tsx-accent,var(--bs-primary,#0d6efd));color:var(--tsx-accent-fg,#fff);
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px}
/* PADDING ONLY. This carried max-width:1180px from the first commit, where .content
   was the static page's documentation column and the cap was its reading width. It
   is AppShell::content() now - the holder for whatever an application shows - and a
   table, a chart or a live plot wants the width it is given. A reading limit belongs
   to the text that needs one, so a prose section asks for it with a col-* of its
   own; the holder does not impose it on everything. */
.content{padding:20px 24px}
.content:has(> .ai-analysis-panel){padding-left:0;padding-right:0}
.sec-h{font-size:19px;font-weight:800;letter-spacing:-.2px;margin:26px 0 4px}
.sec-s{color:var(--tsx-sub,var(--bs-secondary-color,#6c757d));font-size:12.5px;margin-bottom:14px}
/* THE PAGE HEADER - what ManagerPanelContainer emits, and NOT .sec-h above.
   .sec-h is a heading INSIDE a page and carries a 26px top margin for the gap
   above a section; a page's own title is the first thing on screen, where that
   margin is a gap above nothing. Three rules rather than reusing two with an
   override, because an override would have to win against a rule that is right
   where it is used.
   THE VALUES ARE THE SPARTAN PAGE'S ( spartan.css: .sp-title / .sp-sub ), so a
   Wt page and a Vue page open the same way - that is the whole point of the
   widget. */
.pagehead{margin-bottom:16px}
.pagehead .t{font-size:23px;font-weight:800;letter-spacing:-.2px;color:var(--tsx-text,var(--bs-body-color,#212529))}
.pagehead .d{color:var(--tsx-sub,var(--bs-secondary-color,#6c757d));font-size:12.5px;margin-top:3px}
.wt-name{font-weight:700;font-size:12.5px}
/* THE DOM ELEMENT the widget above actually renders as - taken from each
   class's domElementType() in the Wt sources, not guessed from the CSS class.
   It sits next to the Wt name rather than in .emit because .emit carries the
   Bootstrap classes, and "which element" and "which class" are two questions.
   Where a widget has more than one, the list is every element it can emit:
   WPushButton is a <button> until it is given a link, WText a <span> until it
   is set block-level, WSlider a <div> until nativeControl(true). */
.elem{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;
  color:var(--tsx-accent-ink,var(--bs-primary,#0d6efd));font-weight:600;white-space:nowrap}
.emit{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10.5px;
  color:var(--tsx-faint,var(--bs-tertiary-color,#6c757d));background:var(--tsx-panel2,var(--bs-secondary-bg,#e9ecef));border-radius:6px;padding:2px 7px}
.api{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--tsx-sub,var(--bs-secondary-color,#6c757d));
  background:var(--tsx-panel2,var(--bs-secondary-bg,#e9ecef));border:1px solid var(--tsx-line,var(--bs-border-color,#dee2e6));border-radius:8px;
  padding:8px 11px;margin-bottom:12px;white-space:pre-wrap;overflow-x:auto}
.api b{color:var(--tsx-accent-ink,var(--bs-primary,#0d6efd));font-weight:600}
.spec{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end}
.spec>figure{margin:0}
.spec figcaption,
.cap{font-size:9px;text-transform:uppercase;letter-spacing:.5px;
  color:var(--tsx-faint,var(--bs-tertiary-color,#6c757d));font-weight:700;margin-bottom:5px}
/* The overview strip's square. Fixed 40x40 and unlabelled - the token name is
   the caption above it and the title attribute, so nothing has to be legible
   ON the colour, which is what forces .sw below to carry a text shadow. */
.tok{width:40px;height:40px;border-radius:8px;border:1px solid var(--tsx-line,var(--bs-border-color,#dee2e6))}
.sw{height:44px;border-radius:8px;border:1px solid var(--tsx-line,var(--bs-border-color,#dee2e6));display:flex;
  align-items:flex-end;padding:4px 6px;font-size:8.5px;font-weight:700;color:#fff;
  /* A swatch label sits on whatever colour is being shown, including a bright
     yellow, so it is carried by an outline rather than by contrast. */
  text-shadow:0 0 3px #000,0 1px 2px #000,0 0 6px #000}
.note{font-size:11px;color:var(--tsx-faint,var(--bs-tertiary-color,#6c757d));margin-top:10px}
.plot{background:var(--tsx-plot,var(--bs-body-bg,#fff));border:1px solid var(--tsx-line,var(--bs-border-color,#dee2e6));border-radius:8px}

/* THE CARD A PAGE IS DRAWN ON, and it is the Vue pages' .sp-card written for the
   Wt side: the same panel ground, hairline border and 12px radius, on the same
   tokens, so the two halves of the product do not drift apart through a theme.

   THE ACCENT IS ONE EDGE OF FOUR and a separate class, because the side is a
   property of the card that uses it - top for a page, left for a list - and a
   card that changes its mind swaps one class instead of being rebuilt.

   ModernUI::Widget::SPCardContainer puts these on its content(), never on itself:
   the outer element is what a grid column or a margin is applied to. */
.spcard{background:var(--tsx-panel,var(--bs-body-bg,#fff));
  border:1px solid var(--tsx-line,var(--bs-border-color,#dee2e6));
  border-radius:12px;padding:17px}

.spcard.acc-top{border-top:3px solid var(--tsx-accent,var(--bs-primary,#0d6efd))}
.spcard.acc-left{border-left:3px solid var(--tsx-accent,var(--bs-primary,#0d6efd))}
.spcard.acc-right{border-right:3px solid var(--tsx-accent,var(--bs-primary,#0d6efd))}
.spcard.acc-bottom{border-bottom:3px solid var(--tsx-accent,var(--bs-primary,#0d6efd))}

/* THE SPARTAN BUTTON, in four heights. ModernUI::Widget::SPButton adds .spbtn and
   one of the four size classes; everything it looks like is here.

   THE SELECTOR CARRIES ITS ELEMENT ( button.spbtn , a.spbtn ) FOR A REASON: Wt's
   Bootstrap theme puts .btn on every WPushButton, and .btn sets padding,
   font-size and line-height. A bare .spbtn would be the same weight as .btn and
   would win or lose on the order the two stylesheets happen to load in. An
   element plus a class outranks a class outright, so this does not depend on it -
   and it says so without a single !important.

   Wt renders a WPushButton as <button> until it is given a link, when it becomes
   an <a>. Both are listed so a button that grows a link does not lose its look.

   THE SIZE IS A HEIGHT, and the label is centred in it by inline-flex rather than
   by line-height alone: a fixed line-height guesses at the font's leading and
   pushes the text off centre the moment the font changes. */
button.spbtn,
a.spbtn{display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border:none;border-radius:8px;font-weight:600;line-height:1;white-space:nowrap;
  text-decoration:none;cursor:pointer;
  background:var(--tsx-accent,var(--bs-primary,#0d6efd));
  color:var(--tsx-accent-fg,#fff)}

button.spbtn:hover,
a.spbtn:hover{background:var(--tsx-accent-hv,var(--tsx-accent-dk,#0a58ca));
  color:var(--tsx-accent-fg,#fff)}

/* Bootstrap disables a button with the attribute, not a class. */
button.spbtn:disabled,
a.spbtn.disabled{opacity:.5;cursor:not-allowed}

/* THE FOUR HEIGHTS. min-height beside height because a flex item can be stretched
   by its container, and a button that is asked to fit a row must not be. */
button.spbtn-xs,
a.spbtn-xs{height:18px;min-height:18px;padding:0 8px;font-size:10.5px;border-radius:5px}

button.spbtn-sm,
a.spbtn-sm{height:24px;min-height:24px;padding:0 10px;font-size:11px}

button.spbtn-md,
a.spbtn-md{height:32px;min-height:32px;padding:0 14px;font-size:12.5px}

button.spbtn-lg,
a.spbtn-lg{height:40px;min-height:40px;padding:0 18px;font-size:14px}

/* THE COMPACT MENU'S PANEL, which is a Bootstrap dropdown wearing .sidenav so the
   entries inside are styled by the two rules above and look exactly like the
   column's. For that they need the same GROUND as the column, not Bootstrap's own
   panel colour - so the panel is repointed to --tsx-sb through BOOTSTRAP'S OWN
   VARIABLES rather than by overriding its properties: --bs-dropdown-bg and the two
   border variables are what .dropdown-menu reads, and setting them leaves
   Bootstrap in charge of the shadow, the radius and the positioning. The entry
   colours below are the same tokens ".sidenav a" uses, so the two agree in all
   sixteen modes.
   flex:1 comes along with .sidenav and does nothing here - a dropdown panel is
   absolutely positioned, so it is not a flex item. Left rather than fought. */
.dropdown-menu.sidenav{
  --bs-dropdown-bg:var(--tsx-sb,var(--bs-tertiary-bg,#0B0D10));
  --bs-dropdown-border-color:var(--tsx-sb-line,var(--bs-border-color,#ffffff14));
  --bs-dropdown-link-color:var(--tsx-sub,var(--bs-secondary-color,#6c757d));
  --bs-dropdown-link-hover-bg:rgba(var(--tsx-sub-rgb,108,117,125),.18);
  --bs-dropdown-link-hover-color:var(--tsx-text,var(--bs-body-color,#212529));
  --bs-dropdown-header-color:var(--tsx-faint,var(--bs-tertiary-color,#6c757d));

  /* THE DIVIDER TOO, and it was the one Bootstrap variable this block had left
     alone. addStretch and addSeparator both come out as .dropdown-divider here -
     a content-sized panel has no leftover height for a spacer to take - and the
     line was still drawn in Bootstrap's --bs-border-color-translucent, which is
     an edge for a light panel and all but invisible on the sidebar's ground. */
  --bs-dropdown-divider-bg:var(--tsx-sb-line,var(--bs-border-color,#ffffff14));
  min-width:15rem}

/* COLLAPSING THE MENU. One class on .app, and a MARGIN rather than a transform: a
   translated sidebar would slide away and leave its 236px of space behind, while a
   negative margin lets the content column reclaim the width. The transition sits on
   the sidebar so both directions animate from the one declaration.
   THE HANDLES ARE PLACED BY BOOTSTRAP - position-absolute, top-50,
   translate-middle-y, end-0 / start-0 - so all that is left here is what a handle
   looks like, and it is written through Bootstrap's own button variables so the
   two grounds and the sixteen modes are already handled. */
.sidebar{transition:margin-left .18s ease,margin-right .18s ease}
.app.menu-collapsed .sidebar{margin-left:-236px}

.menu-toggle{--bs-btn-padding-x:2px;--bs-btn-padding-y:10px;--bs-btn-font-size:14px;
  --bs-btn-line-height:1;
  --bs-btn-color:var(--tsx-sub,var(--bs-secondary-color,#6c757d));
  --bs-btn-bg:var(--tsx-panel2,var(--bs-secondary-bg,#e9ecef));
  --bs-btn-border-color:var(--tsx-line,var(--bs-border-color,#dee2e6));
  --bs-btn-hover-color:var(--tsx-text,var(--bs-body-color,#212529));
  --bs-btn-hover-bg:var(--tsx-chip-dk,var(--bs-tertiary-bg,#f8f9fa));
  --bs-btn-hover-border-color:var(--tsx-faint,var(--bs-tertiary-color,#6c757d));
  z-index:10}
.sidebar .menu-toggle{border-radius:6px 0 0 6px}
.main > .menu-toggle{border-radius:0 6px 6px 0}

/* THE SIDEBAR ON THE RIGHT. Bootstrap's flex-row-reverse on .app does the layout -
   what it cannot do is mirror anything that names a side explicitly, so those
   are here, under one class AppShell adds beside it.
   THE COLLAPSE MARGIN IS THE ONE TO WATCH: margin-left has to be cleared as
   margin-right takes over, or the sidebar keeps the old pull and slides twice as
   far. Both are in the transition for the same reason. */
.app.sidebar-right .sidebar{
  border-left:0;
  border-right:4px solid var(--tsx-accent-ink,var(--bs-primary,#0d6efd))}

.app.sidebar-right.menu-collapsed .sidebar{margin-left:0;margin-right:-236px}

.app.sidebar-right .sidenav a.on{
  box-shadow:inset -3px 0 0 var(--tsx-accent-ink,var(--bs-primary,#0d6efd))}

.app.sidebar-right .sidebar .menu-toggle{border-radius:0 6px 6px 0}
.app.sidebar-right .main > .menu-toggle{border-radius:6px 0 0 6px}

/* AND THE CONTENTS MIRROR TOO. Reversing .app moves the column; everything INSIDE
   it still reads left to right, which on the right-hand side leaves the labels
   hugging the edge the content column is on and the dots pointing away from the
   menu. Five more things name a side of their own: */

/* 1. THE ROWS READ TOWARDS THE EDGE THE SIDEBAR IS ON. One declaration covers the
      entries, the group headers and the section captions, because all three are
      inline content in a block. */
.app.sidebar-right .sidenav a,
.app.sidebar-right .sidenav .sec{text-align:right}

/* 2. THE ENTRY DOT CHANGES ENDS, and it changes pseudo-element with it: ::before is
      first in the line box whatever is done to its margins, so the mirror is an
      ::after with the ::before turned off. Everything else about it is the same
      declaration as the left-hand one - inline-block and vertical-align:middle put
      it on the row's centre line, which a float could not. */
.app.sidebar-right .sidenav a:not(.submenu-toggle)::before{display:none}
.app.sidebar-right .sidenav a:not(.submenu-toggle)::after{content:"";width:6px;height:6px;border-radius:50%;
  background:var(--tsx-faint,var(--bs-tertiary-color,#6c757d));
  display:inline-block;margin-left:11px;vertical-align:middle}
.app.sidebar-right .sidenav a.on:not(.submenu-toggle)::after{background:var(--tsx-accent-ink,var(--bs-primary,#0d6efd))}

/* 3. THE GROUP CHEVRON POINTS THE OTHER WAY AND SITS ON THE OTHER SIDE - a single
      left guillemet floated left, so a closed group still points away from the
      labels. The rotation is untouched: 90 degrees turns either glyph downwards. */
.app.sidebar-right .submenu-toggle::after{content:"\2039";float:left}

/* 4. THE BRAND ROW REVERSES, which puts the mark against the outward edge and the
      two lines of text beside it. text-align on the row is inherited by both. */
.app.sidebar-right .brand{text-align:right}
.app.sidebar-right .brand-row{flex-direction:row-reverse}

/* 5. THE COMPACT BAR REVERSES TOO, which is the same menu below lg: the hamburger
      crosses to the sidebar's side and the brand takes the other end. .navbar is
      already justify-content:space-between, so reversing the direction is the whole
      move - the two stay at opposite ends and only swap which.
      The brand's own row reverses with it, for the reason the sidebar's does: the
      mark belongs against the outward edge. The panel that hangs off the hamburger
      is anchored by a Bootstrap class instead - AppShell sets it, because Popper
      reads that class and would overwrite a rule written here. */
.app.sidebar-right .navbar{flex-direction:row-reverse}
/* Ters cevrilen , markanin ust satiri: .navbar-brand artik iki satirlik bir sutun ,
   yon degistirmesi gereken mark ile urun adinin durdugu satir. */
.app.sidebar-right .navbar-brand{text-align:right}

/* A COLLAPSIBLE GROUP inside the menu. The opening is Bootstrap's .collapse; what is
   left here is the header row, which is styled as an entry by ".sidenav a" and only
   needs the chevron that says which way it will go.
   THE CHEVRON IS A PSEUDO-ELEMENT AND IT ROTATES, keyed on aria-expanded rather than
   on a class of ours - Bootstrap maintains that attribute on the toggle, so the arrow
   follows the panel without anything having to keep the two in step. */
/* A GROUP HEADER IS A STEP HEAVIER THAN AN ENTRY - 600 against ".sidenav a"'s 500.
   Enough to read as the thing the entries under it belong to, not enough to compete
   with .sec, which is 700 and uppercase.
   THE SELECTOR HAS TO REACH PAST ".sidenav a", which is (0,1,1) - a bare
   .submenu-toggle is (0,1,0) and loses, whatever the order. */
.sidenav a.submenu-toggle{font-weight:600}
/* THE CHEVRON IS SIZED IN em, not px: 1.5em off the row's 12.5px puts it near 19px
   and keeps it proportional if the row's size ever changes. line-height:.7 pulls the
   glyph back onto the row - a single guillemet carries a lot of leading of its own,
   and at this size it would otherwise push the row taller. */
.submenu-toggle::after{content:"\203A";float:right;transition:transform .15s ease;
  display:inline-block;font-size:1.5em;line-height:.7}
.submenu-toggle[aria-expanded="true"]::after{transform:rotate(90deg)}
/* THE GROUP READS AS ONE BLOCK, a step off the sidebar's own ground so the header and
   the entries it opens belong together.
   A WASH AND NOT A COLOUR: rgba of the menu's own text colour, the same technique the
   hover rule above uses at .18 - it lifts whatever ground it sits on, so one value
   works on a dark sidebar and on a light one without a rule per theme.
   THE RADIUS IS ".sidenav a"'S, so the block lines up with the rows inside it, and the
   margin keeps two neighbouring groups from merging into one slab. */
.sidenav .submenu{background:rgba(var(--tsx-sub-rgb,108,117,125),.07);
  border-radius:8px;margin:2px 0}

