/* [2026-10-19, SPEC 195d, A's pick 12A] DRAG TO RESIZE: EVERY EDGE DRAGS.
   Board 12 of https://claude.ai/artifact/C1fQaRWiM2rRuPn7H7XTcZ: a thin grey
   line between panes that turns sage (#465849) on hover with a col-resize
   cursor; double-click puts it back; each menu folds to icons; sizes are
   remembered per person. `resize-195.js` drives it. Record:
   `docs/facts/s195d.md`.

   IN A SHEET OF ITS OWN for `srm-shell.css`'s reason: `srm.css` is pinned by
   exact length. Linked by `_base.html` after the shell sheet and before the
   page sheets; every rule that must beat a page sheet carries the <html>
   attribute it depends on, so it wins on weight and not on order.

   THE WIDTHS. The CRM menu, the reply box column and the reading pane read
   `--r195-crm-w`, `--r195-lead-w` and `--r195-inc-w`, which the script sets
   on <html> together with `data-r195-crm`, `data-r195-lead`, `data-r195-inc`
   (and `data-r195-crm-fold`). With no attribute every rule below is inert and
   the page is drawn exactly as before. The main menu keeps SPEC 148b's
   `data-sidebar-w` (the 8 px table in `tokens.css`).

   THE PAGE NEVER SLIDES SIDEWAYS. Every pane a line moves gives way rather
   than push: the grid tracks are `minmax()` with a floor for the pane beside
   it (the lead page's cards keep 340 px, Incoming's list 240 px) and the
   moved pane takes what is left up to its pick; the CRM menu is capped so the
   page keeps 732 px (`tokens.css`'s own figure). Tokens only; square; no
   shadow; no transition (a resize is immediate). */

/* ---- 1. the line you drag: one look for all four -------------------------- */
.r195-grip {
  position: absolute; top: 0; bottom: 0; z-index: 3;
  width: 12px; cursor: col-resize; touch-action: none;
  background: transparent;
}
.r195-grip::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 2px;
  background: var(--border-strong);
}
.r195-grip:hover::after,
.r195-grip.is-dragging::after { left: 4px; width: 3px; background: var(--ag-sage); }
.r195-grip:focus-visible { outline: none; }
.r195-grip:focus-visible::after { left: 4px; width: 4px; background: var(--ag-sage); }
/* A drag in progress owns the cursor and selects no text it crosses. */
body.is-r195-dragging { cursor: col-resize; user-select: none; }

/* ---- 2. the fold press at each menu's foot ------------------------------- */
.r195-fold {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 40px; margin: var(--sp-4) 0 0;
  padding: var(--sp-2) var(--sp-2) var(--sp-2) calc(var(--sp-6) - 2px);
  border: 0; border-radius: 0; background: none; cursor: pointer;
  font-family: var(--ff-ui); font-size: var(--fs-2xs); line-height: 1.2;
  letter-spacing: var(--tracking-btn); text-transform: uppercase;
  color: var(--ag-sage); text-align: left; white-space: nowrap;
}
.r195-fold .ph { font-size: 20px; flex: 0 0 auto; }
.r195-fold:hover { background: var(--bg-hover-subtle); }
.r195-fold:focus-visible { outline: 2px solid var(--ag-sage); outline-offset: -2px; }
.r195-fold .r195-fold-open { display: none; }
/* folded: the open arrow, the word clipped (off-screen, still in the tree).
   The two menus' rules are written apart: SPEC 118's law is that no
   `is-navmin` selector names the CRM column. */
body.is-navmin .srm-sidebar .r195-fold .r195-fold-shut { display: none; }
body.is-navmin .srm-sidebar .r195-fold .r195-fold-open { display: inline-block; }
body.is-navmin .srm-sidebar .r195-fold-t {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
/* The CRM menu folds by the person (`data-r195-crm-fold`, remembered) or by
   the page to make room (`data-r195-crm-auto`, this view only); one look. */
:root[data-r195-crm-fold] .srm-subrail .r195-fold .r195-fold-shut,
:root[data-r195-crm-auto] .srm-subrail .r195-fold .r195-fold-shut { display: none; }
:root[data-r195-crm-fold] .srm-subrail .r195-fold .r195-fold-open,
:root[data-r195-crm-auto] .srm-subrail .r195-fold .r195-fold-open { display: inline-block; }
:root[data-r195-crm-fold] .srm-subrail .r195-fold-t,
:root[data-r195-crm-auto] .srm-subrail .r195-fold-t {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---- 3. the main menu: SPEC 148b's line, in 12A's look ------------------- */
@media (min-width: 980px) {
  .srm-sidebar-grip[data-r195-grip] { width: 12px; right: -6px; }
  .srm-sidebar-grip[data-r195-grip]::after { left: 5px; width: 2px; background: var(--border-strong); }
  .srm-sidebar-grip[data-r195-grip]:hover::after,
  body.is-sidebar-dragging .srm-sidebar-grip[data-r195-grip]::after { left: 4px; width: 3px; background: var(--ag-sage); }
  .srm-sidebar-grip[data-r195-grip]:focus-visible::after { left: 4px; width: 4px; background: var(--ag-sage); }
  /* A FOLDED MENU KEEPS ITS LINE (12A): drag it right to open the menu.
     `srm-shell.css` hides the line under `is-navmin`; this names the same
     state one attribute heavier. A line still waiting for script stays hidden
     (the global `[hidden]` rule is `!important`). */
  body.is-navmin .srm-sidebar-grip[data-r195-grip] { display: block; }
}

/* ---- 4. the CRM menu: its width, its line and its fold ------------------- */
@media (min-width: 1100px) {
  .srm-subrail { position: relative; }
  .srm-subrail > .r195-grip { right: -6px; }
  /* the pick, never wider than leaves the page its 732 px */
  :root[data-r195-crm] .srm-subrail {
    width: min(var(--r195-crm-w), max(200px, 100vw - var(--sidebar-w) - 732px));
    flex-basis: min(var(--r195-crm-w), max(200px, 100vw - var(--sidebar-w) - 732px));
  }
  /* FOLDED TO ICONS: 56 px, the main menu's own icon rung (`tokens.css`
     `--sidebar-w-min`), the names clipped and never removed (each link keeps
     its accessible name, and its `title` is the tooltip). */
  :root[data-r195-crm-fold] .srm-subrail,
  :root[data-r195-crm-auto] .srm-subrail { width: var(--sidebar-w-min); flex-basis: var(--sidebar-w-min); }
  :root[data-r195-crm-fold] .srm-subrail .srm-nav-link,
  :root[data-r195-crm-auto] .srm-subrail .srm-nav-link { position: relative; padding-right: var(--sp-2); }
  :root[data-r195-crm-fold] .srm-subrail .srm-nav-t,
  :root[data-r195-crm-auto] .srm-subrail .srm-nav-t {
    position: absolute; width: 1px; height: 1px;
    clip-path: inset(50%); overflow: hidden; white-space: nowrap;
  }
  :root[data-r195-crm-fold] .srm-subrail .srm-navbadge,
  :root[data-r195-crm-auto] .srm-subrail .srm-navbadge {
    position: absolute; top: 2px; right: 2px; margin-left: 0;
  }
}
.srm-subrail > .r195-grip,
.srm-subrail > .r195-fold { display: none; }
@media (min-width: 1100px) {
  .srm-subrail > .r195-grip { display: block; }
  .srm-subrail > .r195-fold { display: flex; }
}

/* ---- 5. the lead page: the reply box column ------------------------------
   The column is the conversation zone (`.crm-zone--comm`, 190b1's right-hand
   column from 860 px of page room). The line is a grid item in the SAME
   cell, at its left edge, centred in the 20 px gap, sticky like the column
   and as tall as it (`--r195-h`, from the script). */
.r195-grip--lead { display: none; }
@media (min-width: 900px) {
  @container lead-workbench (min-width: 860px) {
    :root[data-r195-lead] .srm-main--crm.crm-workbench-page.crm-leads-r2 .crm-wb {
      grid-template-columns: minmax(340px, 1fr) minmax(0, var(--r195-lead-w));
    }
    .srm-main--crm.crm-workbench-page.crm-leads-r2 .crm-wb > .r195-grip--lead {
      display: block; grid-area: comm; justify-self: start; align-self: start;
      position: sticky; top: calc(var(--header-h) + var(--sp-3)); bottom: auto;
      height: var(--r195-h, calc(100vh - var(--header-h) - var(--sp-6)));
      margin-left: calc(var(--sp-5) / -2 - 6px);
    }
  }
}

/* ---- 6. Incoming: the reading pane --------------------------------------
   The line sits on the reader's left edge (the list's hairline). With a
   pick, the list keeps at least 240 px and gives way first; the reader
   takes its pick or what is left. Full page has one pane and no line.
   MAKING ROOM (F-195d-1): with no pick the list also gives way first. Its
   track is today's width as a CEILING over a 240 px floor, and the reader's
   floor is 320 px or what is left after the list's floor (never more, so
   the grid never pushes past the page): wide enough, both are today's
   widths; tight, the list shrinks to 240 before the reader drops under 320,
   and only then does the script fold a menu. */
.r195-grip--inc { display: none; }
@media (min-width: 900px) {
  .crm-incoming-workspace:not(.is-full-page) .crm-inbox-grid {
    grid-template-columns: minmax(240px, max(280px, 34%)) minmax(max(0px, min(320px, 100% - 240px)), 1fr);
  }
}
@media (min-width: 900px) and (max-width: 1200px) {
  .crm-incoming-workspace:not(.is-full-page) .crm-inbox-grid {
    grid-template-columns: minmax(240px, 290px) minmax(max(0px, min(320px, 100% - 240px)), 1fr);
  }
}
@media (min-width: 900px) and (max-width: 979px) {
  .crm-incoming-workspace:not(.is-full-page) .crm-inbox-grid {
    grid-template-columns: minmax(240px, 310px) minmax(max(0px, min(320px, 100% - 240px)), 1fr);
  }
}
@media (min-width: 1600px) {
  .crm-incoming-workspace:not(.is-full-page) .crm-inbox-grid {
    grid-template-columns: minmax(240px, 370px) minmax(max(0px, min(320px, 100% - 240px)), 1fr);
  }
}
@media (min-width: 980px) {
  .crm-incoming-workspace.is-side-views:not(.is-full-page) .crm-inbox-grid {
    grid-template-columns: 200px minmax(240px, max(280px, 34%)) minmax(max(0px, min(320px, 100% - 440px)), 1fr);
  }
}
@media (min-width: 900px) {
  .crm-inbox-grid > .crm-mail-reading { position: relative; }
  .crm-inbox-grid > .crm-mail-reading > .r195-grip--inc { display: block; left: -6px; }
  .crm-incoming-workspace.is-full-page .crm-mail-reading > .r195-grip--inc { display: none; }
  :root[data-r195-inc] .crm-incoming-workspace:not(.is-full-page) .crm-inbox-grid {
    grid-template-columns: minmax(240px, 1fr) minmax(0, var(--r195-inc-w));
  }
}
@media (min-width: 980px) {
  :root[data-r195-inc] .crm-incoming-workspace.is-side-views:not(.is-full-page) .crm-inbox-grid {
    grid-template-columns: 200px minmax(240px, 1fr) minmax(0, var(--r195-inc-w));
  }
}

/* ---- 7. phones and narrow windows: today's stacked layouts, no lines ----- */
@media (max-width: 899px) {
  .r195-grip, .r195-fold { display: none; }
}
