/* ═══════════════════════════════════════════════════════════════════════════
   THE BOARD COLUMNS AND THE CLIENT DIALOG. Split out of board.css 2026-10-24.
   ═══════════════════════════════════════════════════════════════════════════

   WHY IT MOVED, and it is the same reason board.css itself exists. That file
   carries a cap asserting it stays under a derived number of CODE bytes —
   what it was the last time somebody read it whole — and the cap's own
   message says SPLIT rather than raise, because a 22KB stylesheet nobody has
   read end to end is where a dead rule hides.

   Adding the sidelined Started column took it 461 bytes over. I had already
   harvested the honest savings: two dead `vertical-align` declarations (no
   effect on a flex item, and every container holding the Trainerize mark is
   now one) and the <button> resets left on `.row` and `.bcard` after both
   became `<div role="button">`. Past that the file was simply carrying two
   jobs, so it now carries one each.

   THE SEAM IS THE VIEW. board.css is the page: palette, layout, the LIST
   view, the hand-tick controls and the hold/discard panel. This file is the
   BOARD view — the kanban columns — plus the client dialog both views open.
   Nothing here is referenced from the list and nothing there from the board,
   which is what made this the cut rather than a line count.

   ONE EXCEPTION, AND IT IS NOT A COMPROMISE. The narrow-screen @media block
   at the end of this file overrides LIST selectors too — `.row`, `.step`,
   `.why`, `.pips`, `.statrow`, `.stat` — so seven selectors are declared in
   both files. That is correct and has to stay: a media override must come
   AFTER every base rule it overrides, and those live in both halves, so the
   only place the block can sit is the end of the one that loads last.
   Checked, not assumed: all seven occurrences here are inside @media and
   none is a second base rule.

   WHICH MEANS LOAD ORDER IS LOAD-BEARING. board.css first, columns.css
   second, the same order these sections had in the monolith. Swap the two
   <link> tags and the narrow-screen layout silently stops applying —
   everything still renders, nothing fails, and the page is simply wrong
   under 560px. pipeline-page.test.cjs pins the order for that reason.

   Both are linked from index.html and both are scanned by the same tests —
   `_source-scan.cjs cssForPage()` gathers every local stylesheet the page
   links, so a rule does not escape a guard by moving between the two.
   ═══════════════════════════════════════════════════════════════════════════ */
  /* ── BOARD VIEW ────────────────────────────────────────────────────────
     The first board gave EVERY answer a column — including Undetermined,
     which held 55 of 80 — so one stack was enormous and nine were nearly
     empty. The fix is not a different grid, it is a different POPULATION:
     the board only ever shows people somebody can chase. Undetermined and
     Done are not stages anybody works on, so they are not columns; the list
     view and the filter chips still reach them. */
  /* `auto-fit` + a minimum means the browser decides how many columns fit.
     A fixed `repeat(5, 1fr)` is five columns on a laptop AND five on a phone,
     each 70px wide. The column count is a function of the screen, not of how
     many steps happen to be wired. */
  /* ── ONE ROW THAT SCROLLS SIDEWAYS, NOT A GRID THAT WRAPS ─────────────
     Georgiy, 2026-10-25: *"instead of having them at the bottom have them
     scrollable side to side so it works on all screensizes properly"*.

     `repeat(auto-fit, …)` WRAPS, which is why Reveal, Delayed start, Started
     and Discarded fell onto a second line on his screen — the pipeline reads
     left to right and a wrapped column breaks that reading in a way no width
     can fix. `grid-auto-flow:column` keeps every step on one line whatever
     the screen is, and the row scrolls when it does not fit.

     THE 1fr STILL MATTERS: on a wide screen the columns share the space and
     nothing scrolls. It only overflows once the minimums stop fitting.

     ── overflow-y IS DELIBERATELY NOT SET ───────────────────────────────
     Per the CSS overflow spec, a non-`visible` value on ONE axis forces the
     other to compute as `auto`, so this box IS a vertical scroll container
     whether I ask for it or not. That is the bug that jammed the Client Hub
     page on iOS (2026-08-07) — a nested scroller that traps the gesture.
     It is safe HERE and only because the board has no height: it is an
     auto-height grid, so it grows to its tallest column and the vertical
     axis never actually has anything to scroll. Give this element a height
     and that stops being true.

     `overscroll-behavior-x:contain` keeps a sideways flick from turning into
     a browser back-gesture once the row hits its end. */
  .board{display:grid;gap:10px;align-items:start;padding-bottom:10px;
         grid-auto-flow:column;
         grid-auto-columns:minmax(232px,1fr);
         overflow-x:auto;overscroll-behavior-x:contain}
  /* THE BAR IS VISIBLE ON PURPOSE. A row that scrolls with nothing saying so
     reads as a board that is missing columns — which is the complaint this
     replaced, pointed the other way. */
  .board::-webkit-scrollbar{height:10px}
  .board::-webkit-scrollbar-thumb{background:var(--line-2);border-radius:6px}
  .board::-webkit-scrollbar-thumb:hover{background:var(--ink-3)}
  .board::-webkit-scrollbar-track{background:transparent}
  .bcol{display:flex;flex-direction:column;gap:8px;min-width:0}
  /* ── THE COLUMN THAT IS NOT A QUEUE ──────────────────────────────────
     Started is where clients land when there is nothing left to chase, and
     it is the biggest column on the board — 41 of 88 today — so it dominates
     a view whose whole job is showing what needs doing. Georgiy, 2026-10-24:
     *"shift started to the right and have it be a little farther away from
     the rest since its not anything to really keep an eye on"*.
     The break is a RULE and a gap, not a colour: it has to read as "the
     board ends here" without implying the column is wrong or stale. */
  /* THE BREAK IS DRAWN ONCE, on the first set-aside column. Both of them
     carry `.aside`; only the first carries `.brk`, because a rule between
     two things that are both "set aside" says the wrong thing. */
  .bcol.aside{padding-left:11px}
  .bcol.brk{border-left:1px solid var(--line);margin-left:5px}
  /* ── COLLAPSED LOOKS LIKE OPEN, MINUS THE CARDS ─────────────────────────
     Georgiy, 2026-10-25: *"How it looks open is how it should look
     collapsed."*

     It used to be `grid-column:1/-1` — a full-width bar across the board,
     on the theory that "collapsed as a row" meant reclaiming the column.
     What it actually produced was a header stretched the entire width with
     its count floating a thousand pixels from its name (*"idk why the
     started bar is so damn long either"*), and it forced the second
     set-aside column onto a line of its own underneath — so Started and
     Discarded could never sit side by side.

     A collapsed column is just a column with no cards under it. It keeps its
     width, it keeps its place in the row, and the two of them sit together
     where they belong. */
  .bcol.shut{align-self:start}
  .bhead.tog{cursor:pointer;user-select:none}
  .bhead.tog:hover{border-color:var(--accent-line);background:var(--surface-2)}
  .bhead.tog:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
  /* The caret is the only thing that says "this opens" without a hover, so
     it sits at the far end where the eye finishes reading the header. */
  /* THE CARET FOLLOWS THE COUNT, it does not race it. `.bhead .n` already
     carries `margin-left:auto`, so a second auto margin here SPLITS the free
     space between them — harmless in a 232px column and absurd across a
     full-width collapsed bar, where it left the 41 floating in the middle of
     nothing. Measured in a browser before this was written down. */
  .bhead .cv{margin-left:7px;font-size:10px;color:var(--ink-3);line-height:1}
  /* `width:100%` IS LOAD-BEARING, and the EMPTY column is where it shows.
     Georgiy, 2026-10-25, on a Trainerize column whose header was a small box
     with the word wrapped inside it: *"This needs to be fixed too."*
     MEASURED in the browser: that header was 130px wide and 88px tall in a
     232px column, against 39px for every other header, so the label wrapped
     onto three lines. Setting `align-items:stretch` on the column does NOT
     fix it (still 130); `width:100%` does (232) — which is the same line
     `.bcard` below already carries, for the same reason. A column with cards
     in it hid the bug, because the cards set the width and the header sat
     above them looking fine. */
  .bhead{display:flex;align-items:baseline;gap:8px;padding:8px 11px;border-radius:var(--r-s);
         width:100%;box-sizing:border-box;
         background:var(--surface-2);border:1px solid var(--line)}
  .bhead .nm{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-2)}
  .bhead .n{font-size:14px;font-weight:800;font-variant-numeric:tabular-nums;margin-left:auto}
  /* `.vacant`, NOT `.empty` — see index.html. `.empty` is the page-level
     empty-state BOX further down this file, and a header wearing it picked
     up `padding:32px 18px; text-align:center`. */
  .bhead.vacant .nm,.bhead.vacant .n{color:var(--ink-3)}
  /* ── THE DELAYED START COLUMN READS DIFFERENTLY ────────────────────────
     Georgiy, 2026-10-23: *"change the color fo the delayed start header to
     beign a blue with a sleep emoji on it or soemthing to differ it"*.
     Every other column is a STAGE somebody is working through; this one is
     a pause, and sharing their grey made it look like a seventh stage.

     `--unknown` is the palette's existing slate blue, so this adds no new
     colour to keep in two themes and clears AA on its own soft background
     in both — 6.13 day, 7.12 night, measured, and pinned by the palette
     test beside the others. */
  .bhead.hold{background:var(--unknown-soft);border-color:var(--unknown)}
  .bhead.hold .nm,.bhead.hold .n{color:var(--unknown)}
  .bcard{width:100%;color:var(--ink);cursor:pointer;
         background:var(--surface);border:1px solid var(--line-2);border-radius:var(--r-s);
         padding:10px 11px;display:flex;flex-direction:column;gap:6px}
  .bcard:hover{border-color:var(--accent-line);background:var(--surface-2)}
  .bcard:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
  /* The open card is only MARKED, never widened — the detail is a dialog now,
     so a column never has to make room for it. */
  .bcard[aria-expanded="true"]{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
  .bcard .bn{display:flex;align-items:baseline;min-width:0;
             font-size:13.5px;font-weight:700;letter-spacing:-.02em;line-height:1.2}
  .bcard .bs{font-size:11.5px;color:var(--ink-3)}
  .bcard .bd{font-size:15px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.15}
  .bcard .bd em{display:block;font-size:10.5px;font-weight:600;font-style:normal;
                color:var(--ink-3);letter-spacing:0}
  .bcard .bd.late{color:var(--late)}
  /* ── A COUNTDOWN IS NOT A COUNT-UP ────────────────────────────────────
     Georgiy, 2026-10-23: *"The days until start should be different-looking
     than the days since they paid for the other people. Maybe make it a tag
     or some sort of outline thing."*
     Every other card counts UP from a payment and bigger is worse. This one
     counts DOWN to a date and small is urgent, so sharing the plain big
     number read as the same measurement pointed the wrong way. It becomes
     an outlined tag: a different SHAPE, not just a different colour. */
  .bcard .bd.hold{display:inline-flex;align-items:baseline;gap:5px;font-size:13px;
                  padding:3px 9px;border-radius:999px;
                  border:1px solid var(--unknown);color:var(--unknown);
                  background:var(--unknown-soft)}
  .bcard .bd.hold em{display:inline;font-size:10.5px;color:inherit}
  /* Five days out or less. Same shape, so the eye reads "a date" either way
     and only the urgency changes. */
  .bcard .bd.hold.late{border-color:var(--late);color:var(--late);background:var(--late-soft)}


  /* ── WAITING IS BLUE. LATE IS RED. ───────────────────────────────────
     Georgiy, 2026-10-31, looking at the first version: *"are these
     highlighted to be delayed? if so they should be a blue color...and make
     the red a little brighter or more visible here otherwise it blends in"*.

     He is right and it is a better rule than the one I shipped. I had both
     states in red at two strengths, which asks the viewer to judge a SHADE
     to tell "waiting, nothing wrong" from "this one is late". A shade is not
     a signal — it is the same mistake as the freshness dots being three
     olives, two hours later and in the same file.

     So the two facts get two COLOURS. Blue says a start date is coming and
     nothing is wrong. Red says it has passed. Nobody has to compare two
     cards to know which they are looking at.

     AND THE RED IS ITS OWN, BRIGHTER THAN --late. The board's `--late`
     (#9C4A32) is a muted brick chosen to read as TEXT; as a card wash it
     disappeared against the lavender page, which is exactly what he saw. */
  .bcard.delayed{
    --hold:#1E63D0; --hold-soft:#E8F0FD;
    border-color:var(--hold);background:var(--hold-soft)}
  .bcard.delayed.od{
    --hold:#E02B1D; --hold-soft:#FDE7E4;
    border-color:var(--hold);border-width:1.5px;background:var(--hold-soft)}
  .bcard.delayed.od .bn b{color:var(--hold)}

  /* ── A DELAYED START THAT FOLLOWS THE CLIENT ──────────────────────────
     Georgiy, 2026-10-30: *"the people that are delayed start should still
     show the X days till start delayed start badge even if in another
     bucket."* Once the hold stopped owning the column, the fact had to stop
     living in the column too.

     QUIET BY DEFAULT, LOUD ONLY WHEN THE DATE IS CLOSE. A client in the
     Contract column is there because of the contract; the start date is
     context, not the headline — until it is five days out or past, which is
     the same threshold the Delayed start column uses, from the same
     function, so one date cannot be urgent in one place and calm in
     another. */
  .bcard .bsb{display:inline-block;font-size:10px;font-weight:700;letter-spacing:.02em;
       padding:2px 7px;border-radius:var(--r-chip);margin:0 0 4px;
       border:1px solid #1E63D0;color:#1E63D0;background:#fff}
  .bcard .bsb.late{border-color:#E02B1D;color:#E02B1D;background:#fff}
  /* The list row carries it beside the step name rather than on its own
     line — the row is one line and must stay one line. */
  .row .step .bsb{display:inline-block;font-style:normal;margin-left:7px;
       font-size:10px;font-weight:700;padding:1px 6px;border-radius:var(--r-chip);
       border:1px solid #1E63D0;color:#1E63D0;background:#fff}
  .row .step .bsb.late{border-color:#E02B1D;color:#E02B1D;background:#fff}

  .bcard .bw{font-size:11.5px;color:var(--ink-2);line-height:1.35;
             display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .bnone{font-size:12px;color:var(--ink-3);padding:6px 2px}
  /* The one reason a whole column shares. Quieter than a card and NOT clamped:
     it is said once, so it can be read in full. */
  .ball{font-size:11.5px;color:var(--ink-2);line-height:1.4;
        background:var(--surface-2);border:1px solid var(--line);
        border-radius:var(--r-s);padding:8px 11px;margin-top:-2px}
  /* ── THE CLIENT OVERVIEW IS A DIALOG ───────────────────────────────────
     It was an inline drawer, which worked in the list and was unreadable in
     the board: a column is 232px wide and the evidence sentences are long, so
     the text came out one or two words per line. Widening the column pushed
     the rest of the board sideways.
     A dialog has nothing to fit inside. Native <dialog> rather than a div, so
     Escape closes it, focus is trapped, and the backdrop comes free. */
  dialog.sheet{
    border:1px solid var(--line-2); border-radius:var(--r); padding:0;
    background:var(--surface); color:var(--ink); box-shadow:0 24px 60px -20px rgba(0,0,0,.55);
    width:min(880px, calc(100vw - 32px)); max-height:min(86vh, 860px);
    overflow:auto; margin:auto;
  }
  dialog.sheet::backdrop{ background:rgba(10,8,14,.55); backdrop-filter:blur(2px) }
  .sheet-head{
    position:sticky; top:0; z-index:1; background:var(--surface);
    border-bottom:1px solid var(--line); padding:16px 18px 13px;
    display:flex; gap:14px; align-items:flex-start;
  }
  .sheet-head .sd{font-size:24px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1}
  .sheet-head .sd.late{color:var(--late)}
  .sheet-head .sd small{display:block;font-size:10.5px;font-weight:600;color:var(--ink-3);
                        line-height:1.25;margin-top:2px;max-width:92px}
  .sheet-who{min-width:0;display:flex;flex-direction:column;gap:2px}
  /* THE SHEET HAS ROOM, SO THE MARK GETS A REAL TARGET. On a card the mark
     is 15px because the card is dense and every pixel is competing; in the
     open sheet the name is 18px, nothing is competing, and the same 15px
     square reads as a speck next to it. Georgiy, 2026-10-24: *"have the
     trainerize button bigger when the pop up opens since its tough to click
     otherwise"*.
     24px is the number, not a guess: it is the minimum target size WCAG 2.2
     asks for, and it is what a finger or a quick mouse flick actually hits.
     The card stays at 15 — it is a glance surface, and he did not ask for
     that one to change. */
  .sheet-who b{display:flex;align-items:center;min-width:0;
               font-size:18px;font-weight:800;letter-spacing:-.025em;line-height:1.15}
  .sheet-who .lnk-tz{width:24px;height:24px;margin-left:9px;
                     border-radius:6px;font-size:13px;border-width:1.5px}
  .sheet-who span{font-size:12.5px;color:var(--ink-3);word-break:break-word}
  .sheet-x{
    margin-left:auto;flex:0 0 auto;font:inherit;font-size:13px;font-weight:700;cursor:pointer;
    border:1px solid var(--line-2);background:var(--surface-2);color:var(--ink-2);
    border-radius:var(--r-chip);padding:6px 14px;
  }
  .sheet-x:hover{background:var(--ink);color:var(--ground);border-color:var(--ink)}
  .sheet-x:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
  .sheet-body{padding:14px 18px 20px}
  .sheet-body .dgrid{grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));margin-top:0}
  @media (max-width:560px){ .sheet-head{padding:13px 14px 11px} .sheet-body{padding:12px 14px 18px} }

  .legend{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;
          padding-block:12px;border-bottom:1px solid var(--line)}
  .legend-item{display:flex;gap:6px;align-items:center;font-size:12.5px;color:var(--ink-2)}
  .note{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r);
        padding:13px 15px;font-size:13.5px;line-height:1.5;color:var(--ink-2)}
  .note.warn{background:var(--late-soft);border-color:color-mix(in srgb,var(--late) 28%,transparent);color:var(--late)}
  /* A "nobody here" that explains itself needs room to breathe and a readable
     measure; the one-liner it replaced was centred and grey. */
  .empty{padding:32px 18px;text-align:center;color:var(--ink-2);font-size:13.5px;
         line-height:1.55;max-width:46ch;margin-inline:auto}
  .empty b{color:var(--ink)}

  /* R53: a lag SAYS it is working. Never a 0, never a stale figure. */
  .skel{display:inline-block;border-radius:5px;min-width:1.6em;
        background:linear-gradient(90deg,var(--surface-2) 25%,var(--line) 37%,var(--surface-2) 63%);
        background-size:400% 100%;animation:sh 1.4s ease infinite;color:transparent}
  @keyframes sh{0%{background-position:100% 50%}100%{background-position:0 50%}}
  .loadbar{height:2px;border-radius:2px;overflow:hidden;background:var(--line)}
  .loadbar i{display:block;height:100%;width:40%;border-radius:2px;background:var(--accent);
             animation:slide 1.1s ease-in-out infinite}
  @keyframes slide{0%{transform:translateX(-100%)}100%{transform:translateX(260%)}}
  @media (prefers-reduced-motion:reduce){*{animation:none!important}}
  .na{color:var(--ink-3);font-style:italic}

  /* Below 1000 the reason column is the first thing that stops fitting, so
     it drops to its own line rather than being clipped to three words. Below
     700 the pips go with it, because 17px squares beside a name is the last
     thing to survive a phone. */
  @media (max-width:1000px){
    .row{grid-template-columns:52px minmax(0,1fr) auto auto;row-gap:5px}
    .why{grid-column:1 / -1;-webkit-line-clamp:3;padding-left:52px}
  }
  @media (max-width:700px){
    .row{grid-template-columns:48px minmax(0,1fr);row-gap:6px}
    .step{justify-self:start;grid-column:2}
    .pips{grid-column:2}
    .why{padding-left:0}
    .statrow{gap:6px}
    .stat{padding:6px 10px}
    .stat .v{font-size:17px}
  }
  footer.end{padding-block:20px 48px}
