/* web/css/boards.css
 *
 * The full-window boards: the task board (web/boards/taskboard.js), drafts
 * (web/drafts.js), and the schedule builder and panel (web/schedules.js).
 *
 * 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.
 */

/* ── the task board ──────────────────────────────────────────────────────
   Four columns over everything outstanding. Unlike the live board, which lets
   the grid pick its own column count, this one is exactly four: each column is
   a state, so losing one to a narrow window would lose a state rather than a
   row. Below the breakpoint they fold into two rows of two instead.

   Colour is the live board's, deliberately: a session that is blocked shows the
   same yellow here as it does there, and one running the same green. Two boards
   with two vocabularies for one fact is how you end up checking both. */

.tb-search {
    width: 260px;
    height: 34px;
    padding: 0 var(--sp-6);
    background: var(--s2);
    border-radius: var(--pill);
    color: var(--text);
    font: 400 var(--fs-md)/var(--lh-none) var(--sans);
    transition: background var(--dur-fast) var(--ease-standard);
}
.tb-search:hover, .tb-search:focus { background: var(--s3); }
.tb-search::placeholder { color: var(--text-3); }

.tb-body {
    flex: 1;
    min-height: 0;
    padding: 0 var(--pane-x, 28px) var(--sp-10);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--sp-6);
}

/* Focused: suggested tasks only, one column per project. Auto-flow rather than
   a fixed template, because here the number of columns *is* the data — the four
   above can be hardcoded because they are four states, and this is however many
   projects have a task outstanding. `.dr-body.cols` is the same shape for the
   same reason, and the 300px floor is the same trade: a crowded backlog scrolls
   sideways instead of squeezing twelve cards into twelve strips, while two
   projects still use the whole width. Vertical scrolling belongs to each
   `.tb-col-body`, which already does it, so the body itself must not. */
.tb-body.cols {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(300px, 1fr);
    overflow-x: auto;
    overflow-y: hidden;
}

/* A project name can be long and a column is narrow, so it gives way rather
   than pushing its count off the end; the `title` says the whole of it. */
.tb-focus-col .tb-col-head h2 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* One line of text, so it is capped rather than ruled across the whole board.
   It is a routine state of the focused view — an empty backlog, or a search
   that found nothing — and not only the place an error goes. */
.tb-note {
    grid-column: 1 / -1;
    align-self: start;
    max-width: 560px;
    padding: var(--sp-7) var(--sp-8);
    background: var(--s2);
    border-radius: var(--r);
    color: var(--text-3);
    font-size: var(--fs-base);
}
.tb-note p { margin: 0; }
.tb-note p + p { margin-top: var(--sp-3); }
.tb-note p.dim { color: var(--text-4); }

/* A column is a well, not a ruled-off area: the surface lifts where the column
   starts, the same way a project card does in the rail. */
.tb-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    background: var(--s1);
    border-radius: var(--r-lg);
}

.tb-col-head {
    flex: none;
    display: flex;
    /* Centred rather than on the baseline: Suggested's Focus pill is taller
       than a line of text, and baseline alignment dropped that column's head
       a couple of pixels below its neighbours'. */
    align-items: center;
    gap: var(--sp-5);
    padding: var(--sp-6) var(--sp-7) var(--sp-5);
}
.tb-col-head h2 {
    margin: 0;
    font: 500 var(--fs-md)/var(--lh-tight) var(--sans);
    color: var(--text-2);
}
.tb-count {
    margin-left: auto;
    font: 400 var(--fs-sm)/var(--lh-tight) var(--sans);
    color: var(--text-4);
    font-variant-numeric: tabular-nums;
}
/* The one column whose count is news gets to say so without being read. */
.tb-col[data-col="needs"] .tb-col-head h2 { color: var(--yellow); }

/* The way in to the focused view. Quiet but always there — it was briefly
   hover-only, which is a fine way to keep a header clean and a poor way to let
   anybody find out the view exists. It is a change of view rather than a thing
   to do, so it takes the count's colour rather than a button's. */
.tb-focus-btn {
    flex: none;
    height: 18px;
    padding: 0 var(--sp-4);
    border: 0;
    border-radius: var(--pill);
    background: var(--s2);
    color: var(--text-4);
    font: 500 var(--fs-xs)/var(--lh-none) var(--sans);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.tb-focus-btn:hover { background: var(--s3); color: var(--text-2); }

.tb-col-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 var(--sp-4) var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.tb-empty {
    margin: var(--sp-3) var(--sp-4);
    font-size: var(--fs-md);
    color: var(--text-3);
}

/* A heading inside a column, for the projects the Suggested tasks came from. */
.tb-sub-head {
    display: flex;
    align-items: baseline;
    gap: var(--sp-4);
    margin: var(--sp-4) var(--sp-4) 0;
    font: 500 var(--fs-xs)/var(--lh-tight) var(--sans);
    color: var(--text-4);
}
.tb-sub-head:first-child { margin-top: var(--sp-1); }
.tb-sub-head span { margin-left: auto; }

/* ── a card ─────────────────────────────────────────────────────────────── */

.tb-card {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    padding: var(--sp-6);
    background: var(--s2);
    border-radius: var(--r);
    min-width: 0;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-standard);
}
.tb-card:hover { background: var(--s3); }

/* The dot in the head says which column a card is in. Only the cards waiting on
   you get more than that: their whole ground is tinted, because they are the
   ones the board exists to put in front of you. (Each card used to carry an
   edge stripe as well, which said what the dot says a second time.) */
.tb-card[data-col="needs"]   { background: var(--yellow-tint); }
.tb-card[data-col="needs"]:hover { background: var(--yellow-cont); }
/* A task whose conversation has been filed away. Still offered — dismissing is
   the gesture for "not this", and archiving must not become a second, silent
   one — but visibly the loose end it is. */
.tb-task[data-archived="true"] { opacity: 0.62; }

.tb-card-head { display: flex; align-items: flex-start; gap: var(--sp-4); }

.tb-dot {
    flex: none;
    width: 7px; height: 7px;
    /* Centred on the title's first line (14px at --lh-snug is ~20px). */
    margin-top: var(--sp-3);
    border-radius: 50%;
    background: var(--text-4);
}
.tb-card[data-col="needs"] .tb-dot   { background: var(--yellow); }
.tb-card[data-col="working"] .tb-dot {
    background: var(--green);
    animation: breathe var(--dur-loop) var(--ease-standard) infinite;
}
/* Stalled: the live card's rule, web/css/dashboard.css. */
.tb-card[data-stalled="true"] .tb-dot { background: var(--red); animation: none; }
.tb-task .tb-dot { background: var(--blue); }
/* Waiting on another task: greyed where it sits, never moved (held order). */
.tb-task[data-blocked="true"] { opacity: 0.78; }
.tb-task[data-blocked="true"]:hover { opacity: 1; }
.tb-task[data-blocked="true"] .tb-dot { background: var(--text-4); }
.tb-task[data-blocked="true"] .tb-card-title { color: var(--text-3); }
.tb-wait { color: var(--text-4); font-size: var(--fs-sm); }
.tb-accept { margin-top: 0; }
.tb-accept li { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Two lines, then an ellipsis. A task title is a sentence and a session title
   is often one too; one line loses the half that says which. The live card's
   size, so the same session reads the same on both boards. */
.tb-card-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;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tb-card:hover .tb-card-title,
.tb-card-title:hover { color: var(--blue); }

/* The archive button, hidden until the card is under the pointer — the same
   bargain the rail strikes, for the same reason: it is not what the card is
   for, and four columns of them would read as a page of controls. */
.tb-card-head .mini {
    flex: none;
    opacity: 0;
    transition: opacity var(--dur-fast) var(--ease-standard), background var(--dur-fast) var(--ease-standard);
}
.tb-card:hover .mini,
.tb-card-head .mini:focus-visible { opacity: 1; }

.tb-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-2);
    min-width: 0;
    font: 400 var(--fs-sm)/var(--lh-snug) var(--sans);
    color: var(--text-4);
}
.tb-card-meta .dot { opacity: 0.6; }
.tb-card-meta .tag-pin { display: inline-flex; color: var(--text-3); }

.tb-card-line { display: flex; align-items: baseline; gap: var(--sp-4); min-width: 0; }

.tb-from {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-width: 0;
    font: 400 var(--fs-sm)/var(--lh-snug) var(--sans);
    color: var(--text-4);
}
.tb-from .linky { font-size: var(--fs-sm); }

.tb-tag {
    flex: none;
    padding: 1px var(--sp-3);
    border-radius: var(--pill);
    background: var(--s3);
    font: 500 var(--fs-2xs)/var(--lh-base) var(--sans);
    color: var(--text-4);
}

/* What it is waiting on, said rather than answered. */
.tb-ask {
    margin: 0;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-sm);
    background: var(--yellow-cont);
    font-size: var(--fs-sm);
    line-height: var(--lh-base);
    color: var(--yellow);
}

/* The foot of the card. `margin-top: auto` pins it there when a card is
   stretched taller than its content, so a row of cards ends in one line of
   actions rather than wherever each one's text ran out. */
.tb-acts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-2);
    margin-top: auto;
    /* Back out the button's own side padding, so the first label lines up
       with the text above it rather than starting one pill-inset in. */
    margin-left: calc(-1 * var(--sp-5));
}

/* One filled action per card, and the rest as words. These used to be equal
   full-width buttons — "Run now / Resume / Edit / Delete" as a 2×2 grid — and
   four buttons of one weight say nothing about which is the point. A card
   names its main action with `.primary`; everything else is a quiet text
   button that only takes a ground under the pointer. The live board's `.lbtn`
   is the same button under its own names (`.ok`, `.no`; dashboard.css), so the
   two share one rule here. */
.tb-btn, .lbtn {
    flex: none;
    min-width: 0;
    height: var(--ctl-sm);
    padding: 0 var(--sp-5);
    border: 0;
    border-radius: var(--pill);
    background: none;
    color: var(--text-3);
    font: 500 var(--fs-sm)/var(--lh-none) var(--sans);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.tb-btn:hover, .lbtn:hover { background: var(--s4); color: var(--text); }
/* The filled one sits back at the row's left edge: only the quiet labels need
   the inset undone, and a pill's ground would otherwise hang into the margin. */
.tb-acts > .tb-btn.primary:first-child { margin-left: var(--sp-5); }
.tb-btn.primary { background: var(--blue-cont); color: var(--blue); }
.tb-btn.primary:hover { background: var(--blue-cont-hover); color: var(--on-blue-cont); }
.tb-btn.quiet { color: var(--text-4); }
.tb-btn.quiet:hover { color: var(--text-2); }
/* Destructive, pushed to the far end of the row so it is never the thing a
   quick click lands on, and red only once the pointer is on it. */
.tb-btn.danger { margin-left: auto; }
.tb-btn.danger:hover { background: var(--red-cont); color: var(--red); }
.tb-btn:disabled, .lbtn:disabled { opacity: var(--disabled-opacity); cursor: default; }
.tb-btn:disabled:hover, .lbtn:disabled:hover { background: none; color: var(--text-3); }
.tb-btn.primary:disabled:hover { background: var(--blue-cont); color: var(--blue); }

/* ── the foot of a column ───────────────────────────────────────────────── */

/* The older idle sessions, behind one press. The gradient runs up over the last
   card so the column reads as cut rather than as ended — which is the honest
   picture, and the reason the count in the header is the total. */
.tb-more {
    flex: none;
    position: relative;
    /* Pulled up over the last card by a full step, then padded past it again,
       so the gradient covers the card's foot and the button clears it. */
    margin-top: calc(-1 * var(--sp-10));
    padding: calc(var(--sp-10) + var(--sp-3)) var(--sp-3) var(--sp-1);
    background: linear-gradient(to bottom, transparent, var(--s1) 55%);
    text-align: center;
}
.tb-more p {
    margin: var(--sp-4) var(--sp-1) 0;
    font-size: var(--fs-sm);
    line-height: var(--lh-base);
    color: var(--text-4);
}

/* A line for a task of your own, at the foot of the column the suggested ones
   are in. It opens the ordinary dialog rather than starting anything, so it is
   an entry point and is styled as one. */
.tb-new {
    flex: none;
    position: sticky;
    bottom: 0;
    display: flex;
    gap: var(--sp-3);
    margin-top: auto;
    padding: var(--sp-4) var(--sp-2) var(--sp-1);
    background: linear-gradient(to bottom, transparent, var(--s1) 40%);
}
.tb-new-box {
    flex: 1;
    min-width: 0;
    height: 30px;
    padding: 0 var(--sp-6);
    border: 1px solid var(--outline-soft);
    border-radius: var(--r-sm);
    background: var(--s2);
    color: var(--text);
    font: 400 var(--fs-md)/var(--lh-none) var(--sans);
}
.tb-new-box::placeholder { color: var(--text-4); }
.tb-new-box:focus-visible { outline: none; background: var(--s3); box-shadow: var(--ring-inset); }
/* Outside a card these are the only control in their spot, so they keep a
   ground: a bare word under a column, or beside a box, reads as a caption. */
.tb-new .tb-btn, .tb-more .tb-btn { background: var(--s3); color: var(--text-2); }
.tb-new .tb-btn:hover, .tb-more .tb-btn:hover { background: var(--s4); color: var(--text); }

/* ── drafts ──────────────────────────────────────────────────────────────
   Work set up but not started. Two layouts over one list, and which one you get
   is how many projects have a draft in them.

   With one, a single column: there is only one state a draft can be in, so a
   column per state would say nothing, and the width goes to the message instead
   — the part you came here to read before releasing it.

   With two or more, the task board's shape, a column per project. That is a
   different meaning for a column than the board gives it — a place rather than
   a state — which is why nothing here borrows the board's per-column colour.

   The card is the task board's card either way: same class, same meta line, same
   buttons, because it is the same object at a different moment. */


.dr-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 var(--pane-x, 28px) var(--sp-10);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    /* Wide enough to read a paragraph, narrow enough that the line length stays
       comfortable on a second monitor. The board next door is a grid and needs
       the whole width; a single column does not, and stretching one card to
       2000px would make the prompt unreadable. */
    max-width: 860px;
}

/* Two projects or more and the panel becomes the task board's shape. Auto-flow
   rather than a fixed template because the number of columns *is* the data —
   `.tb-body` can hardcode `repeat(4, …)` because its four columns are four
   states, and this one has however many projects you are working in.

   The 300px floor is what makes a crowded week scroll sideways instead of
   squeezing eight cards into eight strips; `1fr` above it means two projects
   still use the whole panel. Vertical scrolling moves down into each
   `.tb-col-body`, which already does it, so the body itself must stop. */
.dr-body.cols {
    max-width: none;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(300px, 1fr);
    gap: var(--sp-6);
    overflow-x: auto;
    overflow-y: hidden;
}

/* A project name can be long and a column is narrow, so it gives way rather
   than pushing its count off the end. The `title` on the heading is what says
   the whole of it. */
.dr-col .tb-col-head h2 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The message itself, which is the point of the card. Several lines of it, then
   an ellipsis: a draft is usually a paragraph, and one that is not should not
   push the buttons off the bottom of a card you cannot act on without scrolling
   past. `clip()` in app.js caps the text as well; this caps the height. */
.dr-prompt {
    margin: 1px 0 var(--sp-1);
    font-size: var(--fs-md);
    line-height: var(--lh-prose);
    color: var(--text-2);
    white-space: pre-wrap;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
}

/* The empty state, and the read-failure note, share it — both are one short
   block of prose in the middle of an otherwise blank panel. */
.dr-note {
    padding: var(--sp-7) var(--sp-2);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-5);
}
.dr-note p { margin: 0; max-width: 520px; font-size: var(--fs-base); line-height: var(--lh-prose); color: var(--text-2); }
.dr-note p.dim { font-size: var(--fs-md); color: var(--text-3); }

/* ── the schedule builder ────────────────────────────────────────────────
   The trigger picker in the new-session dialog, in schedule mode. Six rows, one
   selected, each with its own arguments on the same line — the shape Windows
   Task Scheduler uses, and it earns the copy: you read down the left edge to
   find the kind of schedule you want and the controls for it are already there,
   rather than behind a step.

   Native radios and checkboxes throughout, skinned but not replaced. Arrow keys
   move within a radiogroup, space toggles a checkbox, and a label points at its
   control — none of which is worth reimplementing for a form this small. The
   same argument renderQuestionDock makes.

   The one real trap here is the native date and time inputs. `.field
   input[type="text"]` is type-scoped, so those pick up nothing but the global
   reset and arrive unstyled; and with no `color-scheme` anywhere in this file,
   Chromium draws their pickers light-on-light inside a dark dialog. (The number
   spinner is drawn by base.css for every number input, not here.)
   Both are fixed on `.when-in` rather than on `:root`, because a global
   `color-scheme` would repaint every scrollbar and native control in the app. */

.when { display: flex; flex-direction: column; gap: var(--sp-1); }

/* A row, not a label — see the comment in index.html. `align-items: baseline`
   so "Every" sits on the same line as the number beside it however tall the
   controls turn out to be. */
.when-opt {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
    padding: var(--sp-4) var(--sp-6);
    border-radius: var(--r-sm);
    transition: background var(--dur-fast) var(--ease-standard);
}
.when-opt:hover { background: var(--s2); }
/* The selected row is tinted rather than outlined: six outlined boxes in a
   column read as six separate things, and this is one control. */
.when-opt:has(input[type="radio"]:checked) { background: var(--blue-tint); }

/* Wide enough that the six names line up and the arguments start at one column,
   which is what makes the list scannable. */
.when-pick {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    flex: none;
    width: 108px;
    margin: 0;
    font: 500 var(--fs-md)/var(--lh-base) var(--sans);
    color: var(--text-2);
    cursor: pointer;
}
.when-opt:has(input[type="radio"]:checked) .when-pick { color: var(--text); }
.when-pick input { flex: none; accent-color: var(--blue-deep); }

/* The arguments are dimmed until their row is the live one, so the column reads
   as one choice with details rather than as thirty controls. */
.when-args {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-3);
    font: 400 var(--fs-md)/var(--lh-base) var(--sans);
    color: var(--text-3);
}
.when-args.grow { flex: 1; min-width: 180px; }
.when-args.grow input { width: 100%; }
.when-opt:not(:has(input[type="radio"]:checked)) .when-args { opacity: 0.55; }

.when-in {
    background: var(--bg);
    border-radius: var(--r-xs);
    padding: var(--sp-3) var(--sp-4);
    font-family: var(--mono);
    font-size: var(--fs-sm);
    /* Without this the native date and time pickers come out light-on-light.
       Scoped here rather than on :root — see the section note. */
    color-scheme: dark;
}
.when-in:focus { outline: none; box-shadow: var(--ring-inset); }
.when-in.num { width: 58px; text-align: right; }
.when-args select {
    background: var(--s2);
    border-radius: var(--pill);
    padding: var(--sp-2) var(--sp-5);
    font: 400 var(--fs-sm)/var(--lh-tight) var(--sans);
    color: var(--text-2);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-standard);
}
.when-args select:hover { background: var(--s3); color: var(--text); }

/* A schedule's event trigger: the events as a row of ticks, then the filters
   two to a line. Empty filters match anything, so they read as placeholders. */
.trig-events {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-5);
    font-size: var(--fs-md);
    color: var(--text-2);
}
.trig-events label { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; }
.trig-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
}
/* Slimmer than the dialog's main boxes: eight optional filters, not the form. */
.trig-filters input[type="text"] {
    padding: var(--sp-4) var(--sp-6);
    font-family: var(--sans);
    font-size: var(--fs-md);
}
.trig-filters .gh-select { max-width: none; }
#new-trig-api-note code { overflow-wrap: anywhere; }

/* The day ticks sit on their own line under Weekly's time, indented to the
   argument column: seven pills plus a time do not fit on one 640px row, and
   wrapping them mid-week looked like two groups. */
.when-days {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    width: 100%;
    margin: var(--sp-3) 0 0;
    padding-left: 108px;
}
/* A checkbox skinned as a pill. The input stays in the DOM and focusable rather
   than `display: none`, so tabbing through the week still works; it is the
   `:focus-within` ring below that makes that visible. */
.when-day {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 27px;
    padding: 0 var(--sp-4);
    border-radius: var(--pill);
    background: var(--s2);
    font: 500 var(--fs-sm)/var(--lh-none) var(--sans);
    color: var(--text-3);
    cursor: pointer;
    user-select: none;
    transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.when-day input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.when-day:hover { background: var(--s3); color: var(--text); }
.when-day:focus-within { box-shadow: 0 0 0 var(--focus-w) var(--focus-colour); }
.when-day:has(input:checked) { background: var(--blue-cont); color: var(--blue); }

/* ── the schedules panel ─────────────────────────────────────────────────
   Drafts' layout, reused rather than restated: same head, same single scrolling
   column at the same width, same card vocabulary.

   Drafts' second layout too — a column per project once there are two. This
   panel held out against that for a while, and the objection is worth keeping
   because it is what the rest of the shape answers: a schedule is read to find
   out whether the thing you set up months ago is still firing, and splitting the
   list by directory would put two dead schedules in two different columns.

   So the columns arrived with a *vertical* split inside them — Active, Paused,
   Done — and that is what makes them safe. A dead schedule is loose in a list
   only while nothing is gathering them up; under a counted heading at the foot of
   its own column it is the first thing that column tells you. Done is a button
   rather than a heading because it is the band that only grows: nothing takes a
   spent one-time schedule out of it, so left open it would bury the live rows
   above it within a month.

   What is genuinely different from drafts is the *status line*. A draft's card is read to
   decide whether to release it, so the message is the point. A schedule has
   already been released, and you come here to find out whether it is still
   working — so the card gets a row of its own for the last run, coloured, above
   the message. It is the one line in this app whose job is to make "this quietly
   stopped happening" impossible to scroll past. */


.sched-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 var(--pane-x, 28px) var(--sp-10);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    max-width: 860px;
}

/* Two projects or more and the panel becomes the drafts board's shape, which is
   the task board's. Auto-flow because the number of columns *is* the data, and
   the same 300px floor: a crowded week scrolls sideways rather than squeezing
   eight cards into eight strips. Vertical scrolling moves down into each
   `.tb-col-body`, so the body itself must stop doing it. */
.sched-body.cols {
    max-width: none;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(300px, 1fr);
    gap: var(--sp-6);
    overflow-x: auto;
    overflow-y: hidden;
}

/* A project name can be long and a column is narrow, so it gives way rather
   than pushing its count off the end; the `title` says the whole of it. */
.sched-col .tb-col-head h2 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── the bands ───────────────────────────────────────────────────────────
   Active, Paused and Done inside each column. `.tb-sub-head` is the heading the
   panel already used for its project sub-headings, reused here for what it is
   actually good at — a quiet label with a count pushed to the end — now that the
   projects have columns of their own.

   The gap is the one `.sched-body` uses, because in the single-project layout
   the band is the only thing between the body and the cards and the spacing must
   not change when a second project appears. */
.sched-band { display: flex; flex-direction: column; gap: var(--sp-4); }

/* Done's heading is a button. Everything here is undoing what a button is, since
   what it should look like is the two headings above it. */
.sched-band-head {
    width: 100%;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
    padding: 0;
    transition: color var(--dur-fast) var(--ease-standard);
}
.sched-band-head:hover { color: var(--text-2); }
.sched-band-head .twist {
    display: grid;
    place-items: center;
    color: var(--text-4);
    transition: transform var(--dur-fast) var(--ease-standard);
}
.sched-band-head[aria-expanded="true"] .twist { transform: rotate(90deg); }

/* A schedule offers four actions, which used to go two by two inside a 300px
   column because four equal buttons would not fit across it. As one filled
   button and three words they fit on one line; `.tb-acts` still wraps if a
   narrower column ever needs it. */

/* A finished schedule reads as finished whether or not the bridge also cleared
   its `enabled` — the one that never cleared it is the expression that matches no
   real date, which is the most finished of the lot. */
.sched-band[data-band="done"] .sched-card { opacity: 0.6; }
.sched-band[data-band="done"] .sched-when { text-decoration: line-through; }


/* A paused schedule is dimmed rather than hidden or moved: it is a decision you
   made and may want back, and sorting it to the bottom would mean the card you
   went looking for is not where you left it. The same treatment an archived task
   gets next door, for the same reason. */
.sched-card.is-off { opacity: 0.6; }
.sched-card.is-off .sched-when { text-decoration: line-through; }

.sched-dot.is-ok    { background: var(--green); }
.sched-dot.is-warn  { background: var(--yellow); }
.sched-dot.is-bad   { background: var(--red); }
.sched-dot.is-quiet { background: var(--text-4); }

.sched-last {
    margin: var(--sp-1) 0 0;
    font-size: var(--fs-md);
    line-height: var(--lh-base);
    color: var(--text-3);
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--sp-3);
}
.sched-last.is-bad  { color: var(--red); }
.sched-last.is-warn { color: var(--yellow); }
.sched-last .dim { color: var(--text-4); }

/* Inline in the status line rather than down with the buttons: it belongs to the
   sentence it follows — "ran 3h ago — BLOCK, open" — and putting it in the action
   row would have made it look like a fifth thing you can do to the schedule
   rather than a way into what it produced. */
.sched-open {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--blue);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.sched-open:hover { color: var(--on-blue-cont); }

/* Deliveries: what reached an event-triggered schedule, one line each. */
.sched-dl {
    list-style: none;
    margin: var(--sp-2) 0 0;
    padding: var(--sp-2) 0 0;
    border-top: 1px solid var(--outline-soft);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    max-height: 220px;
    overflow-y: auto;
    font-size: var(--fs-sm);
}
.sched-dl-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-1) var(--sp-3);
}
.sched-dl-when { color: var(--text-4); min-width: 5.5em; }
.sched-dl-what { color: var(--text-2); overflow-wrap: anywhere; }
.sched-dl-out.is-ok { color: var(--green); }
.sched-dl-out.is-bad { color: var(--red); }
.sched-dl-out.is-quiet { color: var(--text-3); }
.sched-dl-detail { color: var(--text-4); flex-basis: 100%; padding-left: 5.5em; }
.sched-dl-note { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--text-3); }
.sched-dl-note.is-bad { color: var(--red); }

/* The expression in English, with the raw text on the title attribute. Slightly
   brighter than the rest of the meta line because it is the field the card is
   really about. */
.sched-when { color: var(--text-2); }

/* The bad state of the "what this means" note under the cron box. Only ever set
   from the bridge's own parser error, so it says something specific. */
#new-cron-note.bad { color: var(--red); }

