/* web/css/dashboard.css
 *
 * The empty state, the dashboard and the live board (web/boards/live.js,
 * dashboard.js) in each of the places it docks.
 *
 * Linked from web/index.html in the order the sections had in the old
 * web/styles.css, and concatenated in that order they reproduce it exactly, so
 * the cascade is unchanged. A rule that moves between these files moves in the
 * cascade too: check what it now comes before and after.
 */

/* ── empty & modal ───────────────────────────────────────────────────── */

.empty[hidden] { display: none; }
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: var(--sp-6);
    color: var(--text-3);
    text-align: center;
    padding: var(--sp-10);
}
.empty h2 { margin: 0; font: 400 var(--fs-xl)/var(--lh-tight) var(--sans); color: var(--text-2); }
.empty p { margin: 0; max-width: 400px; font-size: var(--fs-base); line-height: var(--lh-prose); }

/* ── dashboard ───────────────────────────────────────────────────────── */
/* Work that outlived its conversation. Laid out as a board rather than as more
   rows: each line is a directory and carries its own signals on the right, so
   the eye can run down the right edge for "what needs doing" and down the left
   for "where". */

.dash, .live, .notes, .taskboard, .drafts, .sched, .settings {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
/* Not optional: `display: flex` above beats the `hidden` attribute on its own. */
.dash[hidden], .live[hidden], .notes[hidden], .taskboard[hidden],
.drafts[hidden], .sched[hidden], .settings[hidden] { display: none; }

/* ── the live board ──────────────────────────────────────────────────────
   A card per running session. The grid decides its own column count so that a
   half-width window and a second monitor both read well without a breakpoint
   for each. */

.live-head {
    flex: none;
    display: flex;
    align-items: flex-start;
    gap: var(--sp-7);
    padding: var(--sp-8) var(--pane-x, 28px) var(--sp-7);
}
.live-title { margin: 0; font: 400 var(--fs-2xl)/var(--lh-tight) var(--sans); color: var(--text); }
.live-sub {
    margin: var(--sp-2) 0 0;
    font-size: var(--fs-md);
    line-height: var(--lh-prose);
    color: var(--text-3);
}

.live-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 var(--pane-x, 28px) var(--sp-10);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: var(--sp-6);
    align-content: start;
}

/* ── docked under a conversation ─────────────────────────────────────────
   The board takes the height its cards need and no more, so the conversation
   keeps the rest of the window. One row, scrolled sideways past the third or
   fourth card, rather than a grid that wraps and eats the screen. */

.live[data-mode="dock"] {
    /* Allowed to shrink, below its own header if it must: in a short window
       the strip is the one that gives way, never the composer (below). */
    flex: 0 1 auto;
    min-height: 0;
    /* A card with a plan waiting on it is taller than one that is just working,
       and the dock follows. The ceiling is what keeps this a strip rather than
       a half-and-half split: on a laptop the cards would otherwise take about
       as much as the conversation, which is the thing this is not. */
    max-height: 38vh;
    border-top: 1px solid var(--s4);
    background: var(--bg);
}

/* The conversation over the strip keeps room for its header and its composer.
   `.conv` is `min-height: 0` so the transcript can scroll, and with the strip
   taking up to 38vh of a short window that let it shrink below the composer,
   which is `flex: none` — so the composer spilled out of the bottom of the
   conversation and its Model / Effort / Permissions row sat over the strip's
   header. An automatic minimum gives the conversation a floor of what it holds,
   and `contain: size` on the parts that scroll keeps a long transcript (or the
   orchestrator's board) out of that sum: they still fill whatever is left, but
   only the head, the docks and the composer are what the floor is made of. */
.main[data-dock="bottom"]:has(> .live[data-mode="dock"]:not([hidden])) > .conv { min-height: auto; }
.main[data-dock="bottom"]:has(> .live[data-mode="dock"]:not([hidden])) > .conv :is(.conv-body, .orch-page) {
    contain: size;
}

.live[data-mode="dock"] .live-head {
    padding: var(--sp-4) var(--pane-x, 28px) var(--sp-4);
    align-items: baseline;
    gap: var(--sp-5);
}
.live[data-mode="dock"] .live-head > div {
    display: flex;
    align-items: baseline;
    gap: var(--sp-5);
}
.live[data-mode="dock"] .live-title { font-size: var(--fs-md); color: var(--text-3); }
.live[data-mode="dock"] .live-sub { margin: 0; font-size: var(--fs-sm); }

/* A count in the subtitle that scrolls its group into view. Deliberately not a
   button to look at — it sits inside a sentence of plain facts, and only the
   underline on hover says it can be clicked. */
.live-jump {
    color: inherit;
    font: inherit;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: var(--r-2xs);
}
.live-jump:hover { color: var(--text); text-decoration: underline; }
.live-jump:focus-visible { outline: var(--focus-w) solid var(--focus-colour); outline-offset: var(--focus-offset); }
.live-sep { white-space: pre; }

.live[data-mode="dock"] .live-body {
    padding: 0 var(--pane-x, 28px) var(--sp-6);
    /* One row: columns are laid out along the inline axis and the row scrolls,
       instead of wrapping into however many rows it takes. */
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 330px;
    overflow-x: auto;
    /* Only bites when a card is taller than the cap allows — a plan waiting on
       a short window. Normally the row fits and nothing scrolls vertically. */
    overflow-y: auto;
    align-content: stretch;
}
.live[data-mode="dock"] .live-note { grid-column: auto; min-width: 330px; }

/* ── the board's three groups ────────────────────────────────────────────
   All three arrangements are grouped. Shared here — the heading, and the fact
   that a group is a heading over a grid — then the arrangements differ below in
   the one way they differ everywhere else: the strip runs sideways, the column
   and the full-window grid run down.

   In each of them the grid .live-body used to own moves one level down onto
   .lgroup-body, unchanged. A group is exactly as wide as the body, so handing
   the same track list to each of three groups instead of to the one body lays
   the cards out identically — same columns, same widths, nothing reflows just
   because groups arrived. */

.live-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.lgroup-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    margin: 0;
    /* The task board's column head, so the two boards label a run of cards
       the same way: sentence case, the label at --text-2 and the count quiet
       beside it. These label a segment rather than offering to collapse it,
       so no hover state and no caret. */
    font: 500 var(--fs-md)/var(--lh-tight) var(--sans);
    color: var(--text-2);
}
.lgroup-count, .lgroup-more {
    font: 400 var(--fs-sm)/var(--lh-tight) var(--sans);
    color: var(--text-4);
    font-variant-numeric: tabular-nums;
}

/* What .live-body was before the groups arrived, one level down. Which way it
   flows is the arrangement's business. */
.lgroup-body {
    display: grid;
    gap: var(--sp-6);
    min-height: 0;
}

/* ── grouped along the strip ─────────────────────────────────────────────
   `data-dock` is written whether or not the board is docked, so the pair of
   attributes is exactly "the strip". Specific enough, too, to take the grid off
   .live-body above and hand it to each group instead. */

.live[data-mode="dock"][data-dock="bottom"] .live-body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    /* The gap is the divider's business now; without this it doubles up. */
    gap: 0;
}
.live[data-mode="dock"][data-dock="bottom"] .live-group {
    /* Each segment is as wide as its cards, and the strip scrolls. Left to flex
       to decide, the groups shared the visible width instead and their cards
       overflowed across each other — the 330px columns are a fixed size, so
       there is nothing there for shrinking to take out. */
    flex: none;
}
/* A rule between segments rather than a box around each: the strip is short and
   three nested panels in 38vh is mostly border. */
.live[data-mode="dock"][data-dock="bottom"] .live-group + .live-group {
    margin-left: var(--sp-7);
    padding-left: var(--sp-7);
    border-left: 1px solid var(--s4);
}
.live[data-mode="dock"][data-dock="bottom"] .lgroup-head {
    /* A dozen recent cards are several windows wide, so the heading follows its
       own segment along rather than scrolling off the left and leaving a row of
       unlabelled cards behind. `align-self` because a stretched flex item has no
       width of its own to stick with. */
    position: sticky;
    left: 0;
    align-self: flex-start;
}
.live[data-mode="dock"][data-dock="bottom"] .lgroup-body {
    grid-auto-flow: column;
    grid-auto-columns: 330px;
    align-content: stretch;
}

/* ── grouped down the column ─────────────────────────────────────────────
   The same three groups, turned ninety degrees: the column already scrolls
   downwards, so the groups are simply stacked and each heading sits above its
   own run of cards. */

.live[data-mode="dock"][data-dock="side"] .live-group + .live-group {
    margin-top: var(--sp-7);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--s4);
}
.live[data-mode="dock"][data-dock="side"] .lgroup-head {
    /* Held at the top while its own cards go past, which down a long column is
       worth more than it is along the strip. It needs the panel's own background
       to do that: a transparent heading with cards sliding under it is unreadable
       for the height of one line. Stretched rather than shrunk to its text, so
       nothing scrolls past beside it. */
    position: sticky;
    top: 0;
    z-index: 2;
    align-self: stretch;
    padding: var(--sp-3) 0 var(--sp-2);
    background: var(--bg);
}
.live[data-mode="dock"][data-dock="side"] .lgroup-body {
    /* `minmax(0, 1fr)` for the same reason .live-body needs it beside a
       conversation: `1fr` floors at min-content, and a nowrap headline is as wide
       as its text, so the cards hung off the side of a column that deliberately
       hides its overflow. */
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    align-content: start;
}

/* ── grouped with the window to itself ───────────────────────────────────
   The side column's stack at the full board's width: the groups run down the
   page, each heading a band across the whole of its own segment, and inside it
   the auto-fill grid .live-body had before the groups arrived — so a window that
   showed four cards across still shows four, and they still step to five at the
   same width. */

.live[data-mode="full"] .live-body {
    /* One segment per row. The 330px columns are each group's business now;
       without this it is the groups themselves that get laid into them. */
    grid-template-columns: minmax(0, 1fr);
    /* The rule between segments carries that spacing, as it does down the
       column. Left at 14px it doubles up. */
    gap: 0;
}
.live[data-mode="full"] .live-group + .live-group {
    /* Vertical only, deliberately: any horizontal padding or border here would
       narrow the group against the body and cost the cards a column at some
       widths, which is the one thing this change is not allowed to do. */
    margin-top: var(--sp-7);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--s4);
}
.live[data-mode="full"] .lgroup-head {
    /* Held at the top while its own cards go past — the same trade as the side
       column, and worth more here, where a group is several rows of grid deep.
       --s1, not the column's --bg: this board has no background of its own and
       sits directly on .main. A transparent heading with cards sliding under it
       is unreadable for the height of one line. */
    position: sticky;
    top: 0;
    z-index: 2;
    align-self: stretch;
    padding: var(--sp-4) 0 var(--sp-3);
    background: var(--s1);
}
.live[data-mode="full"] .lgroup-body {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    align-content: start;
}

/* ── docked beside the conversation ──────────────────────────────────────
   The other way to divide the window: a column of cards down one side. Fewer
   fit across, many more fit down, which is the arrangement for watching a lot
   of sessions rather than reading one. */

.main[data-dock="side"] { flex-direction: row; }

/* Side by side, the conversation has to be willing to give way. A flex item's
   default minimum is its content, and a transcript's content is wide — so it
   held its full width and shoved the board off the edge of the window instead
   of sharing the room. */
.main[data-dock="side"] > .conv { min-width: 0; }
/* The same goes for a panel the board is kept up over (`live.over*`). */
.main[data-dock="side"] > :is(.dash, .notes, .taskboard, .drafts, .sched, .settings) { min-width: 0; }

/* After whatever it docks against. `#live` sits between the dashboard and
   History in the markup, so without this a board kept beside Tasks would come
   up on its left, and one kept under it would sit on top. */
.live[data-mode="dock"] { order: 1; }

.live[data-mode="dock"][data-dock="side"] {
    /* A share of the space beside the transcript rather than a share of the
       whole window: the rail is already spoken for, and sizing against it made
       the column too wide on a narrow screen. Wide enough for a card and its
       message box, never wide enough to crowd out the transcript. */
    flex: 0 0 clamp(300px, 32%, 440px);
    width: auto;
    max-height: none;
    border-top: 0;
    border-left: 1px solid var(--s4);
}

.live[data-mode="dock"][data-dock="side"] .live-head {
    padding: var(--sp-6) var(--sp-7) var(--sp-4);
    flex-wrap: wrap;
}

.live[data-mode="dock"][data-dock="side"] .live-body {
    padding: 0 var(--sp-7) var(--sp-7);
    /* Back to an ordinary single column that scrolls downwards.
       `minmax(0, 1fr)` rather than `1fr`, which is `minmax(auto, 1fr)` — that
       `auto` floor refuses to go below the content's min-content width, and a
       nowrap headline is as wide as its text. The cards were sized to their
       longest line and hung off the side of the window, clipped rather than
       scrollable because this column deliberately hides its overflow. */
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow-x: hidden;
    overflow-y: auto;
    align-content: start;
}
.live[data-mode="dock"][data-dock="side"] .live-note { min-width: 0; }

.live-note {
    grid-column: 1 / -1;
    padding: var(--sp-7) var(--sp-8);
    background: var(--s2);
    border-radius: var(--r);
    color: var(--text-3);
    font-size: var(--fs-base);
}
.live-note p { margin: 0; }

.lcard {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    padding: var(--sp-6) var(--sp-7);
    background: var(--s2);
    border-radius: var(--r-lg);
    /* The whole card opens the session — see cardClickOpens for what is carved
       out of that. Anything with its own behaviour keeps its own cursor. */
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-standard);
    /* Everything on a card that would rather not wrap — a title, a headline, a
       worktree name — has to be allowed to give way instead, or its full width
       becomes the card's minimum and the card stops fitting its column. The
       ellipsis is what it gives way to. */
    min-width: 0;
    /* The band a card is sorted into, said again in colour along its edge, so
       that "who is blocked on me" survives a screen too full to read. */
    box-shadow: inset var(--edge-w) 0 0 var(--s4);
}
/* Stopped at the facts line by `live.compact`. Four short rows in a row-gap
   chosen for a card that also held a preview and a message box reads as a
   half-filled card, so the whole thing draws in a little. Spacing only — the
   colours above still do the work of saying which band it is in. */
.lcard[data-compact="1"] { gap: var(--sp-3); }

.lcard[data-reason="ask"]   { box-shadow: inset var(--edge-w) 0 0 var(--yellow); background: var(--yellow-tint); }
.lcard[data-reason="error"] { box-shadow: inset var(--edge-w) 0 0 var(--red); }
.lcard[data-reason="here"]  { box-shadow: inset var(--edge-w) 0 0 var(--green); }
/* Running, but not ours to stop — dimmer than the green of a turn this window
   is driving, and still clearly not the grey of an idle card. */
.lcard[data-reason="elsewhere"] { box-shadow: inset var(--edge-w) 0 0 var(--green-edge); }

.lcard-head { display: flex; align-items: center; gap: var(--sp-4); }

.lcard-dot {
    flex: none;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--text-4);
}
.lcard[data-reason="here"] .lcard-dot {
    background: var(--yellow);
    animation: breathe var(--dur-loop) var(--ease-standard) infinite;
}
.lcard[data-reason="ask"] .lcard-dot { background: var(--yellow); }
/* Running and saying nothing — web/css/rail.css's `.strip` rule, for the same
   reason: a breathing dot claims the work the badge beside it denies. */
.lcard[data-stalled="true"] .lcard-dot { background: var(--red); animation: none; }
.lcard[data-reason="error"] .lcard-dot { background: var(--red); }
/* Hollow, exactly as in the rail: running, but not by us. */
.lcard[data-reason="elsewhere"] .lcard-dot {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--yellow);
}

.lcard-title {
    flex: 1;
    min-width: 0;
    padding: 0;
    background: none;
    border: 0;
    text-align: left;
    font: 500 var(--fs-base)/var(--lh-snug) var(--sans);
    color: var(--text);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Hovering anywhere on the card says what clicking it will do. */
.lcard:hover { background: var(--s3); }
.lcard:hover .lcard-title,
.lcard-title:hover { color: var(--blue); }
/* The parts that are not "open this session": they keep their own cursor, and
   the card's hover tint is not a promise they make. */
.lsend, .lask, .lcard-log { cursor: auto; }
.lsend-box { cursor: text; }

/* The rail's PR glyph, on Recent activity and Pinned cards. `flex: none` for the
   rail's reason: absent means "no pull requests", so it must not be squeezed out. */
.lcard-head .tag-pr {
    display: grid;
    place-items: center;
    flex: none;
    color: var(--pr-tint);
    opacity: var(--pr-fade);
}

.lcard-where {
    /* Shrinkable, not fixed: `flex: none` meant the whole worktree name counted
       towards the card's minimum width even though it ellipsises. */
    flex: 0 1 auto;
    min-width: 0;
    max-width: 40%;
    font: 400 var(--fs-xs)/var(--lh-none) var(--mono);
    color: var(--text-4);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lcard-line { display: flex; align-items: baseline; gap: var(--sp-4); min-width: 0; }
.lstate {
    flex: 1;
    min-width: 0;
    font-size: var(--fs-md);
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lstate.quiet { color: var(--text-4); }
.lstate.warn  { color: var(--yellow); }
.lstate.err   { color: var(--red); }
.lstate.ask   { color: var(--yellow); font-weight: 500; }
.lcard-clock { flex: none; font: 400 var(--fs-xs)/var(--lh-none) var(--mono); color: var(--text-4); }

/* Where the last turn left things — bridge/standing.js. One line, cut rather
   than wrapped, and kept on a compact card. */
.lcard-standing {
    min-width: 0;
    font-size: var(--fs-sm);
    line-height: var(--lh-base);
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lcard-standing[data-source="extract"] { font-style: italic; }

/* How far through its own task list the session is. */
.tbar {
    height: 3px;
    border-radius: var(--pill);
    background: var(--s4);
    overflow: hidden;
}
.tbar-fill {
    display: block;
    height: 100%;
    background: var(--blue);
    transition: width var(--dur-base) var(--ease-standard);
}

.lcard-facts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
    gap: var(--sp-2) var(--sp-4);
    font-size: var(--fs-sm);
    color: var(--text-4);
}
.lcard-facts .wait { font-size: var(--fs-xs); }
.lcard-ago { margin-left: auto; }

.lchip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    /* 1px, not a step: with --lh-snug it keeps the chip at the 17-18px it was,
       the height of the sans facts it sits among. */
    padding: 1px var(--sp-4);
    border: 0;
    border-radius: var(--pill);
    background: var(--blue-tint);
    color: var(--blue);
    font: 500 var(--fs-xs)/var(--lh-snug) var(--mono);
    transition: background var(--dur-fast) var(--ease-standard);
    cursor: pointer;
}
/* A DevBrowser tab name can be long, and a chip does not wrap — so the name
   gives way and the port number, the part that identifies it, never does. */
.lchip i {
    font-style: normal;
    color: var(--text-3);
    min-width: 0;
    max-width: 13ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lchip { max-width: 100%; }
.lchip:hover { background: var(--blue-cont); }
.lchip.busy { opacity: 0.6; }

/* What the session has stopped for. */
.lask {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-5);
    background: var(--s1);
    border-radius: var(--r);
}
.lask-what { font-size: var(--fs-sm); line-height: var(--lh-base); color: var(--text-3); }
.lask-what b {
    display: block;
    font: 500 var(--fs-sm)/var(--lh-snug) var(--mono);
    color: var(--text-2);
}
.lask-acts { display: flex; gap: var(--sp-3); }
/* A worker's ask its orchestrator has not got to yet — answerable, and saying
   whose it is first. The orchestrator page's sentence. */
.lask-for { font-size: var(--fs-xs); line-height: var(--lh-snug); color: var(--text-4); }

/* ── an orchestrator's workers, as the lower half of its card ─────────────
   One card, not two: the section is the card's own surface taken a tonal step
   down, divided from the head by a hairline, and bleeds to the card's edges so
   there is no second border, shadow or radius inside it. It stops short of the
   left edge by the accent's width, so the band colour runs the card's whole
   height. The tint is mixed toward the page rather than a fixed step, so it
   reads as one step down on an ask card's yellow as on a plain one. */
.lcard-workers {
    display: flex;
    flex-direction: column;
    margin: 0 calc(-1 * var(--sp-7)) calc(-1 * var(--sp-6)) calc(var(--edge-w) - var(--sp-7));
    padding: var(--sp-2) 0;
    border-top: 1px solid var(--outline-soft);
    border-radius: 0 0 var(--r-lg) 0;
    background: color-mix(in srgb, var(--bg) 35%, transparent);
    cursor: auto;
}
.lw-row {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    min-width: 0;
    padding: var(--sp-3) var(--sp-7) var(--sp-3) calc(var(--sp-7) - var(--edge-w));
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-standard);
}
.lw-row:hover { background: color-mix(in srgb, var(--s4) 45%, transparent); }
.lw-row[data-reason="queued"] { cursor: default; }
.lw-row[data-reason="queued"]:hover { background: none; }
.lw-main { display: flex; align-items: center; gap: var(--sp-4); min-width: 0; }

/* The card's dot, by the row's own band — not the card's, which is the host's. */
.lw-dot {
    flex: none;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-4);
}
.lw-row[data-reason="here"] .lw-dot {
    background: var(--yellow);
    animation: breathe var(--dur-loop) var(--ease-standard) infinite;
}
.lw-row[data-reason="ask"] .lw-dot { background: var(--yellow); }
.lw-row[data-reason="error"] .lw-dot,
.lw-row[data-stalled="true"] .lw-dot { background: var(--red); animation: none; }
.lw-row[data-reason="elsewhere"] .lw-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--yellow); }
.lw-row[data-reason="queued"] .lw-dot { background: transparent; box-shadow: inset 0 0 0 1px var(--text-4); }

.lw-title {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 45%;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    font: 500 var(--fs-sm)/var(--lh-snug) var(--sans);
    color: var(--text-2);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
span.lw-title { cursor: default; color: var(--text-3); }
.lw-row:hover .lw-title:is(button),
.lw-title:is(button):hover { color: var(--blue); }
.lw-say { display: flex; flex: 1; align-items: baseline; gap: var(--sp-3); min-width: 0; }
.lw-say .lstate { font-size: var(--fs-sm); }
.lw-row .tag-pr {
    display: grid;
    place-items: center;
    flex: none;
    color: var(--pr-tint);
    opacity: var(--pr-fade);
}
.lbtn.lw-stop { height: 22px; padding: 0 var(--sp-4); font-size: var(--fs-xs); }

/* The ask under its row: the card's block, a size down. */
.lask.lask-row {
    gap: var(--sp-3);
    margin-left: calc(6px + var(--sp-4));
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-sm);
}
.lask-row .lbtn { height: 24px; font-size: var(--fs-xs); }

.lw-tail {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-2) var(--sp-7) var(--sp-2) calc(var(--sp-7) - var(--edge-w));
    font-size: var(--fs-xs);
    color: var(--text-4);
}
.lw-more {
    padding: 0;
    border: 0;
    background: none;
    font: 500 var(--fs-xs)/var(--lh-snug) var(--sans);
    color: var(--text-3);
    cursor: pointer;
}
.lw-more:hover { color: var(--blue); }

/* The idle-and-finished fold: a line under the active rows, and opened, the
   same rows a size quieter — no ask, no Stop, nothing breathing. */
.lw-fold {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    width: 100%;
    padding: var(--sp-2) var(--sp-7) var(--sp-2) calc(var(--sp-7) - var(--edge-w));
    border: 0;
    background: none;
    text-align: left;
    font: 500 var(--fs-xs)/var(--lh-snug) var(--sans);
    color: var(--text-3);
    cursor: pointer;
}
.lw-fold:hover { color: var(--blue); }
.lw-caret { width: 1em; color: var(--text-4); }
.lw-qrow { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.lw-qrow[data-reason="finished"] .lw-dot { background: transparent; box-shadow: inset 0 0 0 1px var(--text-4); }
.lw-qrow .lw-title { color: var(--text-3); }
/* The state word is two short words wide; the standing line gives way to it. */
.lw-qrow .lw-say .lstate { flex: none; }
.lw-standing {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--fs-xs);
    color: var(--text-4);
}
.lw-ago { flex: none; font-size: var(--fs-xs); color: var(--text-4); }
.lw-older {
    padding: var(--sp-2) var(--sp-7) var(--sp-2) calc(var(--sp-7) - var(--edge-w) + 6px + var(--sp-4));
    font-size: var(--fs-xs);
    color: var(--text-4);
}

.lcard-log {
    margin: 0;
    min-width: 0;
    padding: var(--sp-4) var(--sp-5);
    list-style: none;
    background: var(--s1);
    border-radius: var(--r);
    font: 400 var(--fs-xs)/var(--lh-prose) var(--mono);
    color: var(--text-4);
}
.lcard-log li {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* The newest line is the one you are actually reading. */
.lcard-log li:last-child { color: var(--text-2); }

/* A line back to the session, without going and opening it. */
.lsend {
    display: flex;
    align-items: flex-end;
    gap: var(--sp-3);
    min-width: 0;
    margin-top: auto;
    padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-6);
    background: var(--s3);
    border-radius: var(--r);
    transition: background var(--dur-fast) var(--ease-standard);
}
.lsend:focus-within { background: var(--s4); }

.lsend-box {
    flex: 1;
    min-width: 0;
    min-height: 30px;
    max-height: 84px;
    /* 7px, not a step: it centres the 16px line in the 30px the send button
       beside it is tall. */
    padding: 7px 0;
    border: 0;
    background: none;
    resize: none;
    color: var(--text);
    font: 400 var(--fs-md)/16px var(--sans);
    overflow-y: auto;
}
.lsend-box::placeholder { color: var(--text-4); }
.lsend-box:disabled { opacity: 0.5; }
.lsend-go { height: 30px; padding: 0 var(--sp-6); font-size: var(--fs-sm); }

/* The one case that gets no box: a session with a process that is not ours. */
.lsend.locked {
    display: block;
    padding: var(--sp-4) var(--sp-6);
    background: var(--s1);
    color: var(--text-4);
    font-size: var(--fs-sm);
    line-height: var(--lh-base);
}

/* Pinned to the card's foot, so a row of cards in the grid ends in one line of
   actions. The negative margin backs out a quiet button's side padding, so
   "Open" lines up with the text above it — the same as .tb-acts. */
.lcard-acts {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-top: auto;
    margin-left: calc(-1 * var(--sp-5));
}
/* Under the reply box, which already takes the slack: two auto margins split
   it and left a gap between the box and the buttons that belong to it. */
.lsend + .lcard-acts { margin-top: 0; }

/* The task board's button (its base rule is shared with `.tb-btn` in
   boards.css), in the live board's names: `.ok` is the one filled action,
   anything without it is a word that takes a ground under the pointer, and
   `.no` reddens only when it is about to be pressed. */
.lbtn.ok { padding: 0 var(--sp-6); background: var(--blue-cont); color: var(--blue); }
.lbtn.ok:hover { background: var(--blue-cont-hover); color: var(--on-blue-cont); }
.lbtn.no:hover { background: var(--red-cont); color: var(--red); }
.lbtn.ok:disabled:hover { background: var(--blue-cont); color: var(--blue); }

/* An urgent badge is a count of people waiting, not of things happening. */
.bar-badge.urgent { background: var(--yellow); color: var(--on-yellow); }

/* The board's own header controls: the Focus toggle sits here, beside the count. */
.live-btn {
    margin-left: auto;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-4);
    height: 30px;
    padding: 0 var(--sp-6);
    border: 0;
    border-radius: var(--pill);
    background: var(--s3);
    color: var(--text-3);
    font: 500 var(--fs-sm)/var(--lh-none) var(--sans);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.live-btn:hover { background: var(--s4); color: var(--text); }
/* Both header buttons carried `margin-left: auto`, which split the free space
   between them and left Stacked floating in the middle of the header. The
   first one pushes; the second sits beside it. */
.live-btn + .live-btn { margin-left: 0; }
.live-btn.on { background: var(--blue-cont); color: var(--blue); }
/* The dock toggle over a screen whose Live board visibility fixes the layout:
   it still shows the arrangement, it just is not the one deciding it. */
.live-btn:disabled { opacity: .55; cursor: default; }
.live-btn:disabled:not(.on):hover { background: var(--s3); color: var(--text-3); }
.live-btn.on:disabled:hover { background: var(--blue-cont); color: var(--blue); }
.live[data-mode="dock"] .live-btn { height: 24px; padding: 0 var(--sp-5); font-size: var(--fs-sm); }

/* Focus mode: the board with the window to itself, for a second monitor.
   Everything that is about driving one conversation goes, because there is no
   conversation here. */
.app[data-focus="1"] {
    grid-template-columns: 1fr;
    grid-template-areas: "bar" "main";
}
.app[data-focus="1"] .rail,
.app[data-focus="1"] .bar-search,
.app[data-focus="1"] #btn-dash,
.app[data-focus="1"] #btn-taskboard,
.app[data-focus="1"] .live-head { display: none; }
.app[data-focus="1"] .live-body { padding-top: var(--sp-7); }

/* The way out, and the only piece of chrome focus mode adds rather than takes
   away — the button that turned it on is inside the header it hides. */
#focus-exit { display: none; }
.app[data-focus="1"] #focus-exit { display: inline-flex; }

.dash-head {
    flex: none;
    display: flex;
    align-items: flex-start;
    gap: var(--sp-7);
    padding: var(--sp-8) var(--pane-x, 28px) var(--sp-7);
}

.dash-title { margin: 0; font: 400 var(--fs-2xl)/var(--lh-tight) var(--sans); color: var(--text); }
.dash-sub:empty { display: none; }

/* Whatever sits at the head's right: a button, a segmented control, a search
   box. One wrapper, so every panel lines these up the same way. */
.dash-tools {
    margin-left: auto;
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}
.dash-tools .dash-btn { margin-left: 0; }

.dash-sub {
    margin: var(--sp-2) 0 0;
    max-width: 640px;
    font-size: var(--fs-md);
    line-height: var(--lh-prose);
    color: var(--text-3);
}

.dash-btn {
    margin-left: auto;
    flex: none;
    height: 34px;
    padding: 0 var(--sp-7);
    border-radius: var(--pill);
    background: var(--s3);
    color: var(--text-2);
    font: 500 var(--fs-md)/var(--lh-none) var(--sans);
    transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.dash-btn:hover { background: var(--s4); color: var(--text); }
.dash-btn:disabled { color: var(--text-4); background: var(--s2); cursor: default; }

.dash-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 var(--pane-x, 28px) var(--sp-10);
}

.dash-note {
    padding: var(--sp-7) var(--sp-8);
    margin-bottom: var(--sp-6);
    background: var(--s2);
    border-radius: var(--r);
    color: var(--text-3);
    font-size: var(--fs-base);
}
.dash-note p { margin: 0; }
.dash-note.warn { color: var(--yellow); background: var(--yellow-cont); }
.dash-note.error { color: var(--red); background: var(--red-cont); }

/* One card per project, the same idea as a rail group: where one project ends
   is a change of surface, not a hairline. */
.dproj {
    background: var(--s2);
    border-radius: var(--r-lg);
    padding: var(--sp-2) var(--sp-2) var(--sp-4);
    margin-bottom: var(--sp-6);
}

.dproj-head {
    display: flex;
    align-items: baseline;
    gap: var(--sp-5);
    padding: var(--sp-6) var(--sp-7) var(--sp-4);
}
.dproj-name { font: 500 var(--fs-base)/var(--lh-tight) var(--sans); color: var(--text); }
.dproj-repo { font: 400 var(--fs-xs)/var(--lh-tight) var(--sans); color: var(--text-4); }
.dproj-counts {
    margin-left: auto;
    font: 400 var(--fs-sm)/var(--lh-tight) var(--sans);
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.wsrow {
    padding: var(--sp-5) var(--sp-6) var(--sp-6);
    border-radius: var(--r);
    transition: background var(--dur-fast) var(--ease-standard);
}
.wsrow:hover { background: var(--s3); }

.wsrow-head {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    min-width: 0;
}

.ws-name {
    font: 500 var(--fs-base)/var(--lh-snug) var(--sans);
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* The main checkout is not a worktree and should not be mistaken for one. */
.wsrow[data-kind="checkout"] .ws-name { color: var(--blue); }
.wsrow[data-kind="gone"] .ws-name { color: var(--text-3); }

.ws-branch {
    flex: none;
    font: 400 var(--fs-xs)/var(--lh-snug) var(--mono);
    color: var(--text-4);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 34ch;
}
.ws-note { font: 400 var(--fs-sm)/var(--lh-snug) var(--sans); color: var(--text-4); font-style: italic; }

/* Signals sit on the right of every row at the same tab stops, so a column of
   them can be read down rather than hunted for. */
.wsrow-signals {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    flex: none;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sig {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-4);
    height: 26px;
    padding: 0 var(--sp-6);
    border-radius: var(--pill);
    font: 500 var(--fs-sm)/var(--lh-none) var(--sans);
    white-space: nowrap;
    background: var(--s4);
    color: var(--text-2);
}
.sig.dirty { background: var(--yellow-cont-hover); color: var(--yellow); }
.sig.dirty:hover, .sig.dirty.on { background: var(--yellow-cont-strong); }
.sig.quiet { background: var(--s3); color: var(--text-3); }
.sig.bad { background: var(--red-cont); color: var(--red); }

/* The hue is the shared one; the ground is mixed from it so a chip stays a pill
   rather than becoming plain coloured text like the other two surfaces. The
   `draft`/`approved`/`changes-requested` word-tags this used to carry are gone
   with them: the glyph says all three, and it says the seven states they left
   out. */
.sig.pr {
    background: color-mix(in srgb, var(--pr-tint) 15%, transparent);
    color: var(--pr-tint);
    opacity: var(--pr-fade);
    text-decoration: none;
}
.sig.pr:hover {
    background: color-mix(in srgb, var(--pr-tint) 26%, transparent);
    opacity: 1;
    text-decoration: none;
}
.sig .pr-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sig .pr-title {
    font-weight: 400;
    color: var(--text-3);
    max-width: 42ch;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The files behind a count, on demand. A dashboard that lists them all is a
   `git status` you did not ask for. */
.ws-files {
    list-style: none;
    margin: var(--sp-4) 0 var(--sp-1);
    padding: var(--sp-5) var(--sp-6);
    background: var(--bg);
    border-radius: var(--r-sm);
    font: 400 var(--fs-sm)/var(--lh-prose) var(--mono);
}
.ws-files li { display: flex; gap: var(--sp-6); }
.ws-files .fstat { flex: none; width: 9ch; color: var(--text-4); }
.ws-files .fstat[data-s="??"] { color: var(--green); }
.ws-files .fstat[data-s="UU"] { color: var(--red); }
.ws-files .fpath { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.ws-files .more { color: var(--text-4); }

.ws-sessions {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
    margin-top: var(--sp-4);
}

/* The way back to the conversation. Deliberately quieter than the signals: the
   row is about the work, and the session is how you go and do something about it. */
.schip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-4);
    /* The signal chips' height, so the two kinds of pill on a row line up. */
    height: 26px;
    padding: 0 var(--sp-6);
    border-radius: var(--pill);
    background: var(--s3);
    color: var(--text-2);
    font: 400 var(--fs-sm)/var(--lh-none) var(--sans);
    max-width: 100%;
    transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.wsrow:hover .schip { background: var(--s4); }
.schip:hover { background: var(--s5) !important; color: var(--text); }

.schip-dot {
    flex: none;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-4);
}
.schip[data-state="active"] .schip-dot { background: var(--blue); }
.schip[data-state="running"] .schip-dot {
    background: var(--green);
    /* The shared loop (composer.css), not a private copy of it: the two had
       drifted to 0.3 and 0.35 at the trough for no reason anyone could name. */
    animation: breathe var(--dur-loop) var(--ease-standard) infinite;
}

.schip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schip-ago { flex: none; color: var(--text-4); font-size: var(--fs-xs); }

.ws-more { font: 400 var(--fs-sm)/var(--lh-none) var(--sans); color: var(--text-4); padding: 0 var(--sp-2); }

