/* ==========================================================================
   V098 · the rail: one control, and it starts where the reader can see it

   The report: "look at the sidebar carefully, I think there is something badly
   wrong with it. I just want to click the arrow and have it collapse. Do not
   add anything fancy."

   "Anything fancy" was measured, and there was something: the pin. V096 added a
   pin at the foot of the rail to hold it open, and it was still there -
   26x26 at (11, 864), `display: grid`. The report had already asked for exactly
   one control, and the arrow is it, so the pin is withdrawn rather than
   restyled.

   Then the default. Measured on a clean profile with nothing in localStorage:

       app className   "app sidebar-collapsed"
       localStorage    null            <- no key had ever been written
       width           48px

   A flag nobody wrote, and the rail is collapsed - so the state was not stored,
   it was DEFAULTED. The line is v085-shell.mjs:25

       const wantCollapsed = saved === null ? isDesktop() : saved === '1';

   On a desktop with no saved choice it adds `sidebar-collapsed` before anything
   else runs. That is also why the first profile reported `sidebarCollapsed` as
   `undefined` on `window` (it is a top-level `let`, not a property) and why
   intercepting `classList` from the page found no visible caller. Wrapping the
   prototype's `add` from an init script found it:

       at initSidebar (src/v085-shell.mjs:26:51)
       at boot        (src/v085-shell.mjs:135:9)

   The comment above it gives the reason it was done that way - "collapsed by
   default on desktop so the question area keeps the width". A reasonable call in
   v085, and this report reverses it: a reader arriving for the first time cannot
   learn what the rail is for from 48 pixels of icons, and the arrow that would
   teach them is the thing being asked to collapse it.

   Two things follow, and the second was not in the report but was measured while
   checking it:

   1. The default becomes OPEN when nothing is saved. A saved choice is still
      honoured - someone who collapsed it last week still gets it collapsed.

   2. There are TWO keys in this project for one setting:

          index.html:3987   'ial-sidebar-collapsed'
          v085-shell.mjs:7  'ial-sidebar-collapsed-v085'

      Both are read and both are written, by different code, for the same
      meaning. Measured on a clean profile: `ial-sidebar-collapsed` is null and
      `ial-sidebar-collapsed-v085` is absent as well, while the class is present -
      so the collapsed state came from the default and no stored value is involved
      either way. This is not the cause of anything measured today, and it is left
      alone rather than fixed here: two writers to one setting is a real hazard,
      but consolidating them is a change to a shipped file's behaviour that no
      report asked for. Recorded so the next reader knows it was looked at.

   The rule below sets the width directly rather than fighting for the class.
   `body.v097 .app.nav-pinned` and `body.ial-v030 .app:not(.sidebar-collapsed)
   .sidebar` already say 252px, and this file adds the one case nothing covered:
   an open rail with no class on `.app` at all, which is the state a reader sees
   before the first click.
   ========================================================================== */

/* ------------------------------------------------------- 1. the open default
   `width: 252px` on the open state, at the same weight as the rules that already
   do it, so it costs nothing when one of them applies and holds the width when
   none does. Deliberately NOT keyed on `.sidebar-collapsed`: the point is that
   the reader does not have to know about that class for the rail to be usable. */
body.v098 .app .sidebar { width: 252px !important; }

/* The collapsed state still wins, and it wins by class so the arrow is the only
   thing that can set it. Written twice because the two existing collapsed rules
   sit at different weights in different files (v085 `body.ial-v030
   .app.sidebar-collapsed .sidebar` at (0,4,1), v089 the same) and this one only
   has to beat the rule above it in this file. */
body.v098 .app.sidebar-collapsed .sidebar { width: 48px !important; }