/* shell.css -- what every page of the application inherits, linked from each
   page's <head> (the shell pages, the four that have no shell, the phone
   app at /m/ and the front page -- not the offline screen, which loads
   nothing it might not have). A stylesheet and not more lines in
   shell.js, because the pages with no shell and the phone app load no shell.js
   and must look the same.

   CLASSIC SCROLLBARS, ALWAYS VISIBLE. The overlay kind -- hidden until the
   pointer moves -- hid the fact that a list went on: forty clips, thirty units
   and nineteen items in panes the height of the screen, and nothing saying
   there was more below the fold. So: 14px, a grey thumb on a light track, a
   darker thumb under the pointer, the same in Chrome, Edge, Safari and
   Firefox.

   TWO SYNTAXES, AND THEY MUST NOT MEET. Chrome and Edge from 121 obey the
   standard `scrollbar-color` / `scrollbar-width` when they are set, and then
   ignore ::-webkit-scrollbar entirely -- which on a Mac means the overlay
   style again. So the standard properties are given only to a browser that
   has no ::-webkit-scrollbar (Firefox); Chrome, Edge and Safari get the
   webkit rules, which are what make a Mac draw a classic bar. Firefox cannot
   be told a width in pixels: `auto` is its full-width bar, the nearest it
   offers. */

:root{
  --bb-sb-track:#eef1f4;
  --bb-sb-thumb:#9aa5b1;
  --bb-sb-thumb-hover:#6c7a8a;
}

/* THE PALETTE, the card colours (29 October 2026), defined here and nowhere
   else. Every page, the phone app and the front page read these; the PDFs
   read the same block through app/palette.py, which parses this file. The
   green look before it is the tag palette-green-v1 -- see REVERT.md.

   THREE STATES FOR A BUTTON OR A CHIP, and the colour is the state:
     not yet          --bb-idle bg, --bb-ink text
     active/selected  --bb-blue-light bg, 2px --bb-blue border, --bb-navy text
     done/positive    --bb-done bg, --bb-done-ink text -- a unit or clip after
                      Save, a floor fully reviewed, a milestone met, on track.
   GREEN MEANS DONE AND NOTHING ELSE: links, primary buttons, progress bars,
   the selected menu item and the "Build" of the wordmark are blue. Amber is
   behind or overdue; red is an error and nothing else.
   tests/test_palette.py holds all of that. */
:root{
  /* the chrome: header and sidebar, unchanged */
  --bb-navy:#0f2033;
  --bb-navy-2:#17304a;
  --bb-navy-3:#2a4767;
  --bb-navy-line:#1d3550;
  --bb-navy-ink:#cdd8e4;
  --bb-navy-muted:#6f89a6;
  /* the accent */
  --bb-blue:#175ba8;
  --bb-blue-dark:#124a8a;
  --bb-blue-light:#d6e2f0;
  /* the three states */
  --bb-idle:#e6ebf0;
  --bb-done:#087a52;
  --bb-done-ink:#fff;
  --bb-done-wash:#e3f4ea;
  /* behind and overdue; errors */
  --bb-amber:#a15c00;
  --bb-amber-light:#fff4e0;
  --bb-amber-line:#f0d9ae;
  --bb-red:#b42318;
  --bb-red-light:#fde8e6;
  --bb-red-line:#f3cfcb;
  /* text, lines, surfaces */
  --bb-ink:#132033;
  --bb-ink-soft:#44546a;
  --bb-muted:#66758a;
  --bb-faint:#8a97a6;
  --bb-control:#b8c4cf;
  --bb-line-strong:#cfd7df;
  --bb-line:#dde4ea;
  --bb-line-soft:#eef2f5;
  --bb-tint:#eef2f6;
  --bb-page:#f4f6f8;
  --bb-surface:#fff;
  --bb-video:#000;
}

/* The three states as classes, for anything that wants them whole. */
.bb-idle{background:var(--bb-idle);color:var(--bb-ink);border:1px solid var(--bb-idle)}
.bb-active{background:var(--bb-blue-light);color:var(--bb-navy);border:2px solid var(--bb-blue)}
.bb-done{background:var(--bb-done);color:var(--bb-done-ink);border:1px solid var(--bb-done)}

/* The page keeps the bar's room whether or not it scrolls, so a page does not
   jump sideways when it grows past the window. Given to the VERTICAL scroll
   areas by name rather than to everything: scrollbar-gutter also reserves
   room on a box that only clips (overflow:hidden for an ellipsis), and every
   chip and cell that does that would grow a blank 14px strip. */
html,
.pane > .body,
.bb-side,
dialog{scrollbar-gutter:stable}

::-webkit-scrollbar{width:14px;height:14px;background:var(--bb-sb-track)}
::-webkit-scrollbar-track{background:var(--bb-sb-track)}
::-webkit-scrollbar-thumb{background:var(--bb-sb-thumb);border-radius:7px;
  border:3px solid var(--bb-sb-track);min-height:40px}
::-webkit-scrollbar-thumb:hover{background:var(--bb-sb-thumb-hover)}
::-webkit-scrollbar-thumb:active{background:var(--bb-sb-thumb-hover)}
::-webkit-scrollbar-corner{background:var(--bb-sb-track)}

@supports not selector(::-webkit-scrollbar){
  *{scrollbar-width:auto;scrollbar-color:var(--bb-sb-thumb) var(--bb-sb-track)}
  *:hover{scrollbar-color:var(--bb-sb-thumb-hover) var(--bb-sb-track)}
}
