/* The components that show work, and the layout of the screens. */

/* Board */
.board { display: flex; gap: var(--s-4); overflow-x: auto; padding-bottom: var(--s-3); align-items: flex-start; scroll-snap-type: x proximity; }
.board-group { flex: none; }
.board-group-name { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-muted); font-family: var(--font-text); font-weight: 700; margin-bottom: var(--s-2); padding-bottom: var(--s-1); border-bottom: 2px solid var(--c-line-strong); }
.board-group-empty { opacity: 0.6; }
.board-columns { display: flex; gap: var(--s-2); align-items: flex-start; }
.board-flat { display: block; }
.board-flat .board-columns { overflow-x: auto; padding-bottom: var(--s-3); }
.column { width: var(--w-column); flex: none; background: var(--c-sunken); border-radius: var(--radius-l); padding: var(--s-2); min-height: 8rem; scroll-snap-align: start; border: 1px solid transparent; }
.column-gate { border: 1px dashed var(--c-line-strong); }
.column.drop { border: 1px solid var(--c-primary); background: var(--c-accent-tint); }
/* An empty step takes little room; a skipped one is struck through. Both still say which step they are. */
.column-empty, .column-skipped { width: 2.75rem; padding: var(--s-2) 0; }
.column-skipped { background: transparent; border: 1px dashed var(--c-line); }
.column-empty .column-head, .column-skipped .column-head { writing-mode: vertical-rl; align-items: center; gap: var(--s-2); margin: 0 auto; padding: var(--s-1) 0; white-space: nowrap; }
.column-empty h3 { color: var(--c-muted); }
.column-empty .count { writing-mode: horizontal-tb; }
.column-skipped h3 { text-decoration: line-through; color: var(--c-muted); }
.column-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-1) var(--s-1) var(--s-2); }
.column-head h3 { font-size: var(--fs-s); font-family: var(--font-text); font-weight: 600; }
.column-head .count { background: var(--c-surface); }
/* minmax(0, …): a card is as wide as its column, whatever stands in its head. */
.column-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.column-none { display: none; margin: 0; }
/* StepPicker: only where the board shows one column at a time. */
.board-steps { display: none; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); background: var(--c-accent-tint); border: 1px solid var(--c-primary); border-radius: var(--radius-m); margin-bottom: var(--s-3); position: sticky; top: 3.75rem; z-index: 4; }

/* RequirementCard */
.req-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: var(--s-2) var(--s-3); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
.req-card[draggable] { cursor: grab; }
.req-card:hover { border-color: var(--c-line-strong); }
/* The tick itself is the state: a card is marked the moment it is ticked, without drawing the board again. */
.req-card.selected, .req-card:has(.req-select:checked), .task-card.selected { border-color: var(--c-primary); box-shadow: inset 0 0 0 1px var(--c-primary); }
.req-card-head, .story-head { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.req-select { accent-color: var(--c-primary); margin: 0; }
.req-card-head .menu-wrap { margin-left: auto; flex: none; }
.req-card-head .avatar-small + .menu-wrap { margin-left: 0; }
.card-move { min-height: 1.5rem; width: 1.75rem; color: var(--c-muted); }
.req-card-head { flex-wrap: nowrap; }
.req-type { font-size: var(--fs-xs); color: var(--c-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Beside a mouse a card is dragged, so its "Move to" button takes no room
   from the head (the type would be cut short on every card): it lies over the
   corner when the card is pointed at or holds the keyboard. A finger has
   neither, and always sees it. */
@media (hover: hover) and (pointer: fine) {
  .req-card { position: relative; }
  .req-card-head .menu-wrap:has(.card-move) { position: absolute; top: var(--s-1); right: var(--s-1); margin: 0; }
  .card-move { opacity: 0; background: var(--c-surface); }
  .req-card:hover .card-move, .req-card:focus-within .card-move, .card-move[aria-expanded="true"] { opacity: 1; }
}
.req-title { color: var(--c-ink); text-decoration: none; font-weight: 500; line-height: 1.35; }
.req-title:hover { text-decoration: underline; }
.req-card-foot { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); align-items: center; }
.task-card, .issue-card { padding: var(--s-2) var(--s-3); display: grid; gap: var(--s-1); border-radius: var(--radius-m); }

/* RecordHeader, PhaseSteps, StatusButton */
.record-head { margin-bottom: var(--s-4); }
.record-head .steps { margin: var(--s-3) 0; }
.record-title-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); align-items: flex-start; }
.record-title { min-width: 0; flex: 1 1 20rem; }
.record-status { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.record-meta { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin: var(--s-2) 0 var(--s-3); color: var(--c-muted); font-size: var(--fs-s); }
.status-button { display: inline-flex; align-items: center; gap: var(--s-1); background: var(--c-surface); border: 1px solid var(--c-line-strong); border-radius: var(--radius-pill); padding: 0.2rem 0.5rem 0.2rem 0.25rem; cursor: pointer; }
.status-button:hover { background: var(--c-sunken); }
.phases { list-style: none; padding: 0; display: flex; gap: var(--s-3); margin: 0 0 var(--s-3); overflow-x: auto; }
.phases ol { list-style: none; padding: 0; margin: 0; display: flex; gap: 3px; }
/* A group is never narrower than its name: the name stays on one line and the strip scrolls sideways instead. */
.phase-group { flex: 1 1 auto; min-width: min-content; }
.phase-group-name { display: block; white-space: nowrap; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-muted); font-weight: 700; margin-bottom: 3px; }
.phase { flex: 1 1 0; min-width: 3.5rem; }
.phase-bar { display: block; height: 6px; border-radius: 3px; background: var(--c-line); }
.phase-name { display: block; font-size: var(--fs-xs); color: var(--c-muted); margin-top: 3px; line-height: 1.2; hyphens: auto; }
.phase-done .phase-bar { background: var(--c-success); }
.phase-current .phase-bar { background: var(--c-primary); }
.phase-current .phase-name { color: var(--c-ink); font-weight: 700; }
.phase-parked .phase-bar { background: repeating-linear-gradient(90deg, var(--c-warning) 0 6px, transparent 6px 10px); }
.phase-parked .phase-name { color: var(--c-ink); font-weight: 600; }
.phase-skipped .phase-bar { background: transparent; border: 1px dashed var(--c-line-strong); }
.phase-skipped .phase-name { text-decoration: line-through; }
.tab-body { min-width: 0; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: var(--s-5); align-items: start; }
.detail-side { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-l); padding: var(--s-4); }
.detail-side .section:last-child { margin-bottom: 0; }
.side-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0; }
.cost-total { font-size: var(--fs-l); }
/* CostBar: spent against the ceiling or the estimate. The amounts beside it carry the meaning; the bar and its colour only repeat them. */
.cost-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); min-width: 0; font-size: var(--fs-xs); color: var(--c-muted); }
.cost-bar progress { flex: 1 1 4rem; min-width: 3rem; max-width: 10rem; height: 0.375rem; accent-color: var(--c-primary); }
.cost-bar-text { overflow-wrap: anywhere; }
.cost-bar-warning progress { accent-color: var(--c-warning); }
.cost-bar-danger progress { accent-color: var(--c-danger); }
.cost-bar-danger .cost-bar-text { color: var(--c-danger); font-weight: 600; }
.req-card-foot .cost-bar { flex: 1 1 100%; }
.detail-side > .cost-bar { margin-top: var(--s-3); }
.tab-body > div > .cost-bar { margin-bottom: var(--s-3); font-size: var(--fs-s); }
.gate-estimate { margin: var(--s-1) 0 0; font-size: var(--fs-s); color: var(--c-muted); }
/* The summary of a dry run sits inside the alert that asks for the decision, or on its own on the phone screen. */
.dryrun-summary { margin-top: var(--s-2); }
.dryrun-summary .facts { margin: 0; }
/* A draft may get three answers (reject, dry run, submit): on a narrow phone they take a second line before one leaves the screen. */
.approve-actions { flex-wrap: wrap; }

/* Thread and ChangeList */
.thread-filters { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-3); }
.day { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-muted); font-family: var(--font-text); font-weight: 700; margin: var(--s-4) 0 var(--s-2); }
.changes > .day:first-child { margin-top: 0; }
.events { list-style: none; padding: 0; margin: 0; position: relative; max-width: 52rem; }
.events::before { content: ''; position: absolute; left: 0.85rem; top: 0.5rem; bottom: 0.5rem; width: 1px; background: var(--c-line); }
.event { position: relative; display: flex; gap: var(--s-3); padding: var(--s-1) 0; }
.event .avatar { position: relative; z-index: 1; }
.event-main { flex: 1; min-width: 0; padding-top: 0.2rem; }
.event-head { display: flex; flex-wrap: wrap; gap: 0 var(--s-2); align-items: baseline; }
.event-what { color: var(--c-text); }
.event-meta { color: var(--c-muted); font-size: var(--fs-s); }
.event-when { margin-left: auto; color: var(--c-muted); font-size: var(--fs-xs); white-space: nowrap; }
.event-item { display: block; font-size: var(--fs-s); color: var(--c-text); text-decoration: none; }
.event-item:hover { text-decoration: underline; }
.event .prose { margin: var(--s-1) 0 var(--s-2); padding: var(--s-2) var(--s-3); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-m); }
.event-list { margin: var(--s-1) 0 var(--s-2); padding-left: var(--s-4); }
.event-warning .event-what { color: var(--c-warning); font-weight: 600; }
.event-danger .event-what { color: var(--c-danger); font-weight: 600; }
.event-success .event-what { color: var(--c-success); font-weight: 600; }
.event-quiet { padding: 0; font-size: var(--fs-xs); color: var(--c-muted); align-items: center; min-height: 1.25rem; }
.event-quiet .event-main { padding-top: 0; }
.event-quiet .event-who, .event-quiet .event-what { color: var(--c-muted); font-weight: 400; }
.event-tick { width: 1.75rem; flex: none; display: grid; place-items: center; position: relative; z-index: 1; }
.event-tick::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c-bg); border: 1px solid var(--c-line-strong); }
.event-fold > details { min-width: 0; }
.event-fold summary { cursor: pointer; }
.event-fold .events::before { display: none; }
.changes-more { margin: var(--s-4) 0 0; }
/* With a mouse the hour of an event is its tooltip. */
@media (hover: hover) and (pointer: fine) { .event-hour { display: none; } }
.composer { display: grid; gap: var(--s-2); margin-top: var(--s-4); max-width: 52rem; }
.thread-count { margin-top: var(--s-3); }

/* StoryCard, TodoItem, MockupCard, QuestionCard */
.story-card, .mockup-card, .question, .design-request { display: grid; gap: var(--s-2); }
.story-sentence { font-weight: 500; color: var(--c-ink); margin: 0; }
.criteria { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-1); }
.criterion { display: flex; gap: var(--s-2); padding: var(--s-1) var(--s-2); border-radius: var(--radius-s); background: var(--c-sunken); }
.criterion.pass { box-shadow: inset 3px 0 0 var(--c-success); } .criterion.fail { box-shadow: inset 3px 0 0 var(--c-danger); }
.criterion-id { font-family: var(--font-mono); font-size: var(--fs-s); color: var(--c-muted); }
.criterion-result { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-1); }
.story-links { list-style: none; padding: 0; margin: 0; }
.todos { list-style: none; padding: 0; display: grid; gap: var(--s-2); }
.todo { display: flex; gap: var(--s-2); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: var(--s-2) var(--s-3); }
.todo input { accent-color: var(--c-primary); margin-top: 0.25rem; }
.todo .pick { align-self: flex-start; }
.todo.done label { text-decoration: line-through; color: var(--c-muted); }
.todo-meta { display: flex; flex-wrap: wrap; gap: var(--s-2); font-size: var(--fs-xs); margin-top: 2px; }
.mockup-stage { position: relative; border: 1px solid var(--c-line); border-radius: var(--radius-m); overflow: hidden; background: #fff; }
.frame-box { min-height: 22rem; display: grid; }
.frame-tall { min-height: 34rem; }
.frame { width: 100%; height: 100%; min-height: inherit; border: 0; background: #fff; }
.mockup-pins { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--c-primary); color: var(--c-on-primary); display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; box-shadow: 0 0 0 2px #fff; pointer-events: auto; }
.mockup-layer { position: absolute; inset: 0; background: rgb(212 120 3 / 0.12); border: 2px dashed var(--c-primary); cursor: crosshair; }
.mockup-notes, .notes { padding-left: var(--s-5); }
.blob-image { border: 1px solid var(--c-line); border-radius: var(--radius-m); margin-top: var(--s-2); }
.question-head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; font-size: var(--fs-s); }
.question-item { flex-basis: 100%; text-decoration: none; color: var(--c-ink); font-weight: 600; }
.question-text { font-size: var(--fs-l); color: var(--c-ink); margin: 0; }
.question-open { border-left: 4px solid var(--c-warning); }
.suggested, .answer { background: var(--c-sunken); border-radius: var(--radius-m); padding: var(--s-3); }
.suggested-head { display: flex; justify-content: space-between; gap: var(--s-2); align-items: center; margin-bottom: var(--s-1); }
.suggested .prose, .answer .prose { margin: 0; }
.closed-questions { margin-top: var(--s-4); }
.closed-questions summary, .sub summary, .graph-text summary { cursor: pointer; color: var(--c-accent-text); font-weight: 600; margin-bottom: var(--s-2); }
.inbox { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s-5); align-items: start; }
.cycle-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); color: var(--c-muted); }
.cycle-nav { display: flex; gap: var(--s-2); }
.inbox-thread { list-style: none; padding: 0; display: grid; gap: var(--s-2); }
.inbox-thread li { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: var(--s-2) var(--s-3); }
.inbox-thread p { margin: var(--s-1) 0 0; }
.inbox-thread a { text-decoration: none; color: var(--c-ink); font-weight: 600; }

/* ReleaseCard, ReleaseHeader, ReleaseChecks */
.release-card { display: grid; gap: var(--s-2); }
.release-name { font-family: var(--font-title); font-weight: 700; font-size: var(--fs-l); color: var(--c-ink); text-decoration: none; }
.release-name:hover { text-decoration: underline; }
.release-facts { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); color: var(--c-muted); font-size: var(--fs-s); margin: 0; }
.envs { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-1); }
.record-head .envs { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.env { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-s); }
.env-name { font-weight: 600; color: var(--c-ink); }
.env-state { color: var(--c-muted); }
.env-muted .env-name { color: var(--c-muted); text-decoration: line-through; }
.checks-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.check-item { display: flex; gap: var(--s-2); align-items: flex-start; }
.check-text { min-width: 0; }
.check-mark { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 1px solid var(--c-line-strong); color: var(--c-muted); flex: none; }
.check-mark .icon { width: 0.75rem; height: 0.75rem; }
.check-pass .check-mark { background: var(--c-success); border-color: var(--c-success); color: var(--c-surface); }
.check-fail .check-mark { background: var(--c-danger); border-color: var(--c-danger); color: var(--c-surface); }
.check-skip { color: var(--c-muted); }
.sprint { margin-bottom: var(--s-3); }

/* DependencyGraph */
.graph-scroll { overflow: auto; border: 1px solid var(--c-line); border-radius: var(--radius-l); background: var(--c-surface); max-height: 70vh; }
.graph { display: block; max-width: none; }
.graph-node rect { fill: var(--c-surface); stroke: var(--c-line-strong); stroke-width: 1; }
.graph-node:hover rect, .graph-node:focus rect { stroke: var(--c-primary); stroke-width: 2; }
.graph-node-focus rect { stroke: var(--c-primary); stroke-width: 2; fill: var(--c-accent-tint); }
.graph-node-outside rect { stroke-dasharray: 5 4; fill: var(--c-sunken); }
.graph-key { font: 600 12px var(--font-mono); fill: var(--c-ink); }
.graph-status { font: 500 12px var(--font-text); fill: var(--c-muted); }
.graph-title { font: 400 12px var(--font-text); fill: var(--c-text); }
.graph-dot { fill: var(--c-line-strong); }
.graph-tone-done .graph-dot { fill: var(--c-success); } .graph-tone-warning .graph-dot { fill: var(--c-warning); } .graph-tone-danger .graph-dot { fill: var(--c-danger); }
.graph-edge { fill: none; stroke: var(--c-muted); stroke-width: 1.5; }
.graph-edge-blocks { stroke: var(--c-danger); }
.graph-edge-relates { stroke-dasharray: 4 4; }
.graph-arrow { fill: var(--c-muted); } .graph-arrow-blocks { fill: var(--c-danger); }
.graph-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin: var(--s-2) 0; font-size: var(--fs-s); color: var(--c-muted); }
.graph-legend li { display: flex; align-items: center; gap: var(--s-2); }
.legend-line { width: 1.5rem; border-top: 2px solid var(--c-muted); }
.legend-blocks { border-color: var(--c-danger); } .legend-relates { border-top-style: dashed; }
.legend-box { width: 1rem; height: 0.75rem; border: 1px dashed var(--c-line-strong); background: var(--c-sunken); border-radius: 2px; }

/* Knowledge base diff */
.diff { border: 1px solid var(--c-line); border-radius: var(--radius-m); margin-bottom: var(--s-3); overflow: hidden; }
.diff-head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; padding: var(--s-2) var(--s-3); background: var(--c-sunken); }
.diff-body { margin: 0; padding: var(--s-2) 0; overflow-x: auto; white-space: pre; }
.diff-line { display: block; padding: 0 var(--s-3); }
.diff-add { background: var(--c-success-tint); color: var(--c-success); } .diff-del { background: var(--c-danger-tint); color: var(--c-danger); } .diff-hunk { color: var(--c-muted); }
.files { list-style: none; padding: 0; columns: 18rem; }
/* A learned rule: the sentence that would enter the knowledge base, and what was said when it was learned. */
.rule-text { font-size: var(--fs-m); color: var(--c-ink); border-left: 3px solid var(--c-primary); padding-left: var(--s-3); overflow-wrap: anywhere; }
.rule-source { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.rule-source:hover { text-decoration: underline; }
.rule-quote { display: block; overflow-wrap: anywhere; }
@media (max-width: 56rem) {
  /* A block, not a flex box: that would drop the space between the key and the title. */
  .rule-source { display: block; min-height: var(--w-target-touch); padding-block: var(--s-2); }
}

/* SetupWizard */
.wizard { display: grid; gap: var(--s-3); max-width: 52rem; }
.wizard .steps { margin-bottom: 0; }
.wizard-step { padding: 0; }
.wizard-step summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-3) var(--s-4); cursor: pointer; list-style: none; }
.wizard-step summary::-webkit-details-marker { display: none; }
.wizard-title { font-family: var(--font-title); font-weight: 700; color: var(--c-ink); font-size: var(--fs-l); }
.wizard-summary { margin-left: auto; font-size: var(--fs-s); }
.wizard-done .step-mark { background: var(--c-success); border-color: var(--c-success); color: var(--c-surface); }
.wizard-todo { border-color: var(--c-primary); }
.wizard-todo .step-mark { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.wizard-blocked summary { color: var(--c-muted); }
.wizard-body { padding: 0 var(--s-4) var(--s-4); border-top: 1px solid var(--c-line); padding-top: var(--s-3); }
.wizard-progress { margin: 0; font-weight: 600; color: var(--c-ink); }
.sub { margin-top: var(--s-3); }
.howto { padding-left: var(--s-5); display: grid; gap: var(--s-2); }
.team-ready { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--s-1) var(--s-3); }
.env-card { margin-bottom: var(--s-4); max-width: 52rem; display: grid; gap: var(--s-3); }
.env-card .card-title { margin: 0; }

/* Sign-in */
.signin { display: grid; gap: var(--s-3); max-width: 26rem; margin: var(--s-7) auto 0; padding: var(--s-5); }
.signin h1 { font-size: var(--fs-2xl); }
.signin-providers { display: grid; gap: var(--s-2); }
.or { text-align: center; color: var(--c-muted); margin: var(--s-3) 0; }
.brand-top { padding: 0; }

@media (max-width: 64rem) {
  .detail, .inbox { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 56rem) {
  /* Board: one column at a time, as wide as the screen; the StepPicker above it says which. */
  .board-steps { display: flex; gap: var(--s-2); align-items: center; margin-bottom: var(--s-3); }
  .board-steps .input { flex: 1 1 auto; min-width: 0; font-weight: 600; }
  .board-steps .btn-icon { flex: none; }
  .board-one { display: block; overflow: visible; padding: 0; }
  .board-one .board-group, .board-one .board-columns { display: block; overflow: visible; padding: 0; }
  .board-one .board-group-name, .board-one .column-head { display: none; }
  .board-one .column { display: none; width: auto; min-height: 0; padding: 0; background: none; border: 0; }
  .board-one .column.column-current { display: block; }
  .board-one .column-cards { grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); }
  .board-one .column-none { display: block; padding: var(--s-5) var(--s-4); text-align: center; border: 1px dashed var(--c-line-strong); border-radius: var(--radius-l); }
  /* A board of a few columns (tasks) stands them under each other. */
  .board-flat:not(.board-one) .board-columns { flex-direction: column; align-items: stretch; overflow: visible; padding: 0; }
  .board-flat:not(.board-one) .column { width: auto; }
  .bulk { top: calc(3.5rem + var(--safe-top)); }

  /* RequirementCard: the tick, the key, the title and the move button are each a full target. */
  .req-card-head .pick { margin: 0 calc(-1 * var(--s-2)) 0 calc(-1 * var(--s-3)); }
  .req-title, .release-name { display: flex; align-items: center; min-height: var(--w-target-touch); }
  /* A key, a space and a title: a flex box would drop the space and stand a
     long title beside the key, so these stay a block that is a finger high. */
  .event-item, .question-item, .inbox-thread a { display: block; min-height: var(--w-target-touch); align-content: center; }
  .card-move { min-height: var(--w-target-touch); width: var(--w-target-touch); margin-right: calc(-1 * var(--s-2)); }
  .card-move::after { content: none; }

  /* On a phone the strip is a progress bar only: the step is named in the status button above it. */
  .phase-name, .phase-group-name { display: none; }
  .phase { min-width: 0.75rem; }
  .event-when { margin-left: 0; flex-basis: 100%; }
  /* A quiet line with a link in it is still pressed with a finger. */
  .event-quiet:has(a) { min-height: var(--w-target-touch); }
  .signin { margin-top: var(--s-4); }
  .page-head { align-items: flex-start; }
  /* Small buttons that wrap under each other: their pressable areas reach
     0.25rem outside the button, so a 0.5rem row gap lets two of them meet. */
  .record-status, .side-actions { row-gap: var(--s-3); }
  /* A to-do is ticked on its text as well as on its box, and the box is a finger wide through its own label. */
  .todo label { display: flex; align-items: center; min-height: var(--w-target-touch); }
  .todo .pick { margin: 0 calc(-1 * var(--s-2)) 0 calc(-1 * var(--s-3)); }
  .todo input { width: 1.25rem; height: 1.25rem; margin-top: 0; flex: none; }
}

/* ── The approval screen a notice opens: one requirement, one decision ──── */
.approve { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
.approve-head { display: grid; gap: var(--s-2); }
.approve-title h1 { margin: var(--s-1) 0 0; overflow-wrap: anywhere; }
.approve-meta { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.approve-estimate { margin: 0; }
.approve-mockup { margin: 0; display: grid; gap: var(--s-2); }
.approve-mockup figcaption { font-weight: 600; }
.approve-mockup .frame-box { border: 1px solid var(--c-line); border-radius: var(--radius-m); overflow: hidden; }
.approve-next { display: block; overflow-wrap: anywhere; }
.approve-more { margin: 0; }
/* The two answers stay in reach while what they rest on is read. */
.approve-actions { position: sticky; bottom: 0; z-index: 2; display: flex; gap: var(--s-3); justify-content: flex-end; margin: 0 calc(-1 * var(--s-4)); padding: var(--s-3) var(--s-4) calc(var(--s-3) + var(--safe-bottom)); background: var(--c-surface); border-top: 1px solid var(--c-line); }
/* The offer to show new activity stands at the foot of the screen too: the answers move above it. */
.main-col:has(.pulse-chip) .approve-actions { bottom: calc(4.5rem + var(--safe-bottom)); }

@media (max-width: 56rem) {
  .approve-actions .btn { flex: 1 1 0; min-height: 3rem; font-size: var(--fs-l); }
  .approve-next { min-height: var(--w-target-touch); align-content: center; }
}

/* Quality: a figure and, under it, the number of requirements it was worked out from. */
.figure { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-2); min-width: 0; }
.figure-basis { display: block; flex: 1 1 100%; font-size: var(--fs-xs); font-weight: 400; color: var(--c-muted); overflow-wrap: anywhere; }
/* Too few requirements behind it: the figure steps back, and the line under it says why in words. */
.figure-thin, .figure-thin > span { color: var(--c-muted); }
/* Eight columns with names that say what is counted: the names wrap, so the table needs no sideways scroll. */
.quality-table th { white-space: normal; vertical-align: bottom; }
.preset-compare-note { margin: 0 0 var(--s-3); font-size: var(--fs-s); }

/* ── Capture: a requirement from a note and a few images ────────────────── */
.capture { display: grid; gap: var(--s-3); grid-template-columns: minmax(0, 1fr); }
.capture > p { margin: 0; }
.capture-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
/* What is being heard, and that the draft is being written: it keeps its line, so nothing jumps when it speaks. */
.capture-live { margin: 0; flex: 1 1 8rem; min-height: 1.5em; color: var(--c-muted); overflow-wrap: anywhere; }
.capture-listening { border-color: var(--c-danger); color: var(--c-danger); }
.capture-thumbs { list-style: none; margin: 0 0 var(--s-2); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.capture-thumb { position: relative; aspect-ratio: 1; border: 1px solid var(--c-line); border-radius: var(--radius-m); overflow: hidden; background: var(--c-sunken); }
.capture-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.capture-thumb .btn { position: absolute; top: 0; right: 0; background: var(--c-surface); }
/* On the approval screen: the note as it was said, and the images that came with it. */
.capture-said { margin: var(--s-3) 0 0; padding-left: var(--s-3); border-left: 3px solid var(--c-line); }
.capture-said .prose { margin: 0; }
.capture-shown { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: var(--s-2); align-items: start; margin-top: var(--s-3); }
/* Shown whole, so a screenshot can be read; a tall one does not push the draft off the screen. */
.capture-shown .blob-image { width: 100%; height: auto; max-height: 16rem; object-fit: contain; margin: 0; background: var(--c-sunken); }

@media (max-width: 56rem) {
  /* Under the thumb on every page of a product; below the drawer, its shade and every sheet. */
  .btn.capture-fab { position: fixed; right: calc(var(--s-4) + var(--safe-right)); bottom: calc(var(--s-4) + var(--safe-bottom)); z-index: 9; width: 3.5rem; height: 3.5rem; min-height: 3.5rem; border-radius: 50%; justify-content: center; box-shadow: var(--c-shadow); }
  .btn.capture-fab .icon { width: 1.5rem; height: 1.5rem; }
  /* What is at the foot of a page can be scrolled out from under it. */
  .main-col:has(.capture-fab) main { padding-bottom: calc(var(--s-7) + 4.5rem + var(--safe-bottom)); }
  /* The offer to show new activity stands at the foot too: the button moves above it. */
  .main-col:has(.pulse-chip) .btn.capture-fab { bottom: calc(4.5rem + var(--s-4) + var(--safe-bottom)); }
  /* Where two answers already stand under the thumb, a third button over them would be pressed by mistake. */
  .main-col:has(.approve-actions) .btn.capture-fab { display: none; }
}

/* ── MonthReport: the figures of a month, what shipped, what is on its way ── */
/* Each figure is a number with what it counts above it and what stands behind it below. They
   wrap by themselves: four beside each other on a desk, two on a tablet, one on a phone. */
.report-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--s-3); }
.report-figure { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; padding: var(--s-3) var(--s-4); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-l); }
.report-figure-label { font-size: var(--fs-s); color: var(--c-muted); }
.report-figure-value { font-family: var(--font-title); font-size: var(--fs-xl); line-height: var(--lh-title); color: var(--c-ink); overflow-wrap: anywhere; }
.report-figure-basis { font-size: var(--fs-xs); color: var(--c-muted); overflow-wrap: anywhere; }
/* Too few behind it: the number steps back, and the line under it says why. */
.report-figure-thin .report-figure-value { color: var(--c-muted); }
.report-month { display: flex; flex-direction: column; gap: var(--s-1); min-width: 12rem; }
.report-portal-note { margin: var(--s-3) 0 var(--s-5); font-size: var(--fs-s); }
.report-releases, .report-steps { display: grid; gap: var(--s-3); grid-template-columns: minmax(0, 1fr); }
.report-release-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-1) var(--s-3); margin-bottom: var(--s-2); }
.report-items { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.report-item { min-width: 0; padding-top: var(--s-2); border-top: 1px solid var(--c-line); }
.report-items > .report-item:first-child { border-top: 0; padding-top: 0; }
.report-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-2); min-width: 0; }
.report-item-head strong { overflow-wrap: anywhere; min-width: 0; }
.report-item .prose { margin: var(--s-1) 0 0; }
.report-step-title { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.report-step { padding: var(--s-3) var(--s-4); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-l); }

/* ── The customer portal: a page of its own, without the frame of the app ── */
.portal { max-width: 52rem; margin: 0 auto; padding: calc(var(--s-5) + var(--safe-top)) calc(var(--s-4) + var(--safe-right)) calc(var(--s-6) + var(--safe-bottom)) calc(var(--s-4) + var(--safe-left)); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; gap: var(--s-5); }
.portal-head h1 { overflow-wrap: anywhere; }
.portal-org { margin: 0 0 var(--s-1); color: var(--c-muted); font-weight: 600; }
.portal-section > h2, .portal-report-head { margin-bottom: var(--s-3); }
.portal-report-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-2) var(--s-3); }
.portal-report-head h2 { margin: 0; }
.portal-note { margin: var(--s-2) 0 0; font-size: var(--fs-s); }
.portal-message { margin-top: var(--s-6); }
.portal-message h1 { font-size: var(--fs-l); margin-bottom: var(--s-2); }
/* Who operates it, small and at the very foot: the page is the customer's organisation's. */
.portal-foot { margin-top: auto; padding-top: var(--s-4); font-size: var(--fs-xs); color: var(--c-muted); text-align: center; }
.portal-foot a { color: inherit; }
@media (max-width: 56rem) {
  .report-month { min-width: 0; width: 100%; }
  .portal-report-head .report-month, .page-report .page-actions { width: 100%; }
}

/* ── ScreenshotPairs: before and after, or a mockup at two widths ── */
.shots { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
.shot-group { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.shot-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); overflow-wrap: anywhere; }
/* Beside a mouse the panes stand next to each other: both are seen without doing anything. */
.shot-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s-3); align-items: start; border-radius: var(--radius-m); }
.shot-pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); align-content: start; }
.shot-name { font-size: var(--fs-xs); font-weight: 600; color: var(--c-muted); }
.shot-open { display: block; width: 100%; min-height: 6rem; padding: 0; border: 1px solid var(--c-line); border-radius: var(--radius-m); overflow: hidden; background: var(--c-sunken); cursor: zoom-in; }
.shot-open .blob-image { display: block; width: 100%; height: auto; margin: 0; border: 0; border-radius: 0; }
/* Until its bytes are there an image shows nothing: its words are for a screen reader, not a caption over an empty box. */
.shot-open .blob-image:not([src]) { visibility: hidden; min-height: 6rem; }
/* A phone screen is drawn no wider than a phone: stretched over half a desktop it says nothing about the phone. */
.shot-phone .shot-open { max-width: 22.5rem; }
.shot-switch { display: none; }
.shot-switch .btn[aria-pressed="true"] { border-color: var(--c-primary); background: var(--c-accent-tint); color: var(--c-accent-text); }
.shot-alone { margin: 0; font-size: var(--fs-s); }
.shots[data-show="phone"] .shot-group[data-width="desktop"], .shots[data-show="desktop"] .shot-group[data-width="phone"] { display: none; }
.shot-full { overflow: auto; }
.shot-full .blob-image { display: block; max-width: none; margin: 0; }
.shot-member + .shot-member { margin-top: var(--s-5); }
.shot-member-head { margin: 0 0 var(--s-2); font-weight: 600; overflow-wrap: anywhere; }
.shot-member-head a { display: block; }
@media (max-width: 56rem) {
  /* On a phone one pane fills the width and the other is a swipe away; the edge of it shows that it is there. */
  .shot-track { display: flex; align-items: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
  .shot-track::-webkit-scrollbar { display: none; }
  .shot-pane { flex: 0 0 88%; scroll-snap-align: center; }
  .shot-pane:only-child { flex-basis: 100%; }
  .shot-phone .shot-open { max-width: none; }
  .shot-switch { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
}

/* ── DesignProposals: three to choose from, side by side or a swipe apart ── */
.proposals { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
.proposal-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); align-items: start; border-radius: var(--radius-m); }
.proposal { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); align-content: start; }
.proposal-chosen { border-color: var(--c-primary); box-shadow: inset 0 0 0 1px var(--c-primary); }
.proposal-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); overflow-wrap: anywhere; }
.proposal-head h3 { margin: 0; font-size: var(--fs-m); }
.proposal-letter { display: inline-grid; place-items: center; min-width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--c-accent-tint); color: var(--c-accent-text); font-weight: 800; }
.proposal-why { margin: 0; color: var(--c-muted); overflow-wrap: anywhere; }
.proposal-view { border: 1px solid var(--c-line); border-radius: var(--radius-m); overflow: hidden; background: var(--c-sunken); }
/* A mockup is drawn at the width of its screen and made smaller to fit: the frame never decides the layout. */
.proposal-screen { position: relative; overflow: hidden; min-height: 6rem; }
.proposal-canvas { transform-origin: 0 0; display: grid; }
.proposal-canvas .frame-box { min-height: 0; height: 100%; }
.proposal-shot .blob-image { display: block; width: 100%; height: auto; margin: 0; border: 0; border-radius: 0; }
.proposal-shot .blob-image:not([src]) { visibility: hidden; min-height: 6rem; }
.proposal-choose { display: grid; }
.proposal-enlarge { justify-self: start; }
.proposal-round { margin: 0; }
/* An enlarged proposal: as wide as the screen allows, so a desktop design is drawn near its own size. */
.dialog.dialog-full { width: min(84rem, calc(100vw - 2rem)); }
.proposal-large { min-width: 0; }
.proposal-switch { display: none; }
.proposal-switch .btn[aria-pressed="true"] { border-color: var(--c-primary); background: var(--c-accent-tint); color: var(--c-accent-text); }
.proposal-none { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.proposal-declined ul { margin: var(--s-1) 0 0; padding-left: var(--s-4); }
@media (max-width: 56rem) {
  /* On a phone one card fills the width and the next is a swipe away; the edge of it shows that it is there. */
  .proposal-track { display: flex; align-items: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
  .proposal-track::-webkit-scrollbar { display: none; }
  .proposal { flex: 0 0 88%; scroll-snap-align: center; }
  .proposal-switch { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
  /* On a phone an enlarged proposal is a sheet like every dialog. */
  .dialog.dialog-full { width: 100%; }
}

/* Run the teams: a command or a message to paste, whole and wrapping, with its copy button under it. */
.run-steps > li { min-width: 0; }
.paste { margin: var(--s-2) 0 0; min-width: 0; }
.paste-label { margin: 0 0 var(--s-1); color: var(--c-muted); font-size: var(--fs-s); }
.paste-value { background: var(--c-sunken); padding: var(--s-3); border-radius: var(--radius-m); margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.paste-actions { display: flex; justify-content: flex-end; margin-top: var(--s-1); }
.run-teams { display: flex; flex-wrap: wrap; gap: var(--s-1); align-items: center; }
.page-run .form-actions { justify-content: flex-start; }

/* Design system: a token is a row with what it looks like, its name, its value and its contrast; on a phone the value wraps under the name. */
.ds-tokens { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.ds-token { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-2) 0; border-bottom: 1px solid var(--c-line); min-width: 0; }
.ds-token-name { font-weight: 600; color: var(--c-ink); min-width: 8rem; overflow-wrap: anywhere; }
.ds-token-value { font-family: var(--font-mono); font-size: var(--fs-s); color: var(--c-muted); overflow-wrap: anywhere; min-width: 0; flex: 1 1 10rem; }
.ds-swatch { width: 2.25rem; height: 2.25rem; flex: none; border-radius: var(--radius-m); border: 1px solid var(--c-line-strong); }
.ds-sample { width: 3rem; flex: none; font-family: var(--font-title); color: var(--c-ink); line-height: var(--lh-title); }
.ds-bar { height: var(--s-3); max-width: 100%; flex: none; background: var(--c-primary); border-radius: var(--radius-s); }
.ds-box { width: 2.25rem; height: 2.25rem; flex: none; background: var(--c-accent-tint); border: 1px solid var(--c-line-strong); }
.ds-box-raised { background: var(--c-surface); border-color: var(--c-line); border-radius: var(--radius-m); }
.ds-subtitle { font-size: var(--fs-m); margin: var(--s-4) 0 var(--s-2); color: var(--c-ink); }
.ds-index { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.ds-component, .ds-proposal { min-width: 0; }
.ds-component-name { font-size: var(--fs-l); margin: 0; }
.ds-rules ul { margin: 0; padding-left: var(--s-4); }
.ds-example .frame-box { border: 1px solid var(--c-line); border-radius: var(--radius-m); overflow: hidden; min-height: 12rem; margin-top: var(--s-2); }
.ds-done > summary { cursor: pointer; min-height: var(--w-target); display: flex; align-items: center; color: var(--c-muted); }
@media (max-width: 56rem) {
  .ds-done > summary { min-height: var(--w-target-touch); }
  .ds-token-name { min-width: 0; flex: 1 1 auto; }
}

/* New products from repositories: one card per proposal, as wide as a form, and why it was proposed. */
.intake-card { max-width: 44rem; margin-bottom: var(--s-4); }
.intake-card .card-title { overflow-wrap: anywhere; }
.intake-signals li { overflow-wrap: anywhere; }
.intake-result { display: grid; gap: var(--s-1); }

/* Readiness: one line per check the server made, and what to do under each that failed. */
.readiness { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.readiness-check { display: flex; gap: var(--s-2); align-items: flex-start; min-width: 0; }
.readiness-mark { flex: none; display: inline-flex; width: 1.25rem; height: 1.25rem; align-items: center; justify-content: center; border-radius: var(--radius-pill); }
.readiness-ok .readiness-mark { color: var(--c-success); background: var(--c-success-tint); }
.readiness-failed .readiness-mark { color: var(--c-danger); background: var(--c-danger-tint); }
.readiness-text { display: grid; gap: var(--s-1); min-width: 0; overflow-wrap: anywhere; }
.readiness-todo { color: var(--c-muted); font-size: var(--fs-s); }
.readiness-product { display: grid; gap: var(--s-3); }
.readiness-head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; justify-content: space-between; }
.readiness-products { display: grid; gap: var(--s-3); }
.readiness-head h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* The readiness and the onboarding under the setup steps stand apart from the last step. */
.wizard ~ .section { margin-top: var(--s-5); }

/* Settings › Import: a preview per product, each item a row to keep or leave out. */
.import-product { max-width: 52rem; margin-bottom: var(--s-4); display: grid; gap: var(--s-2); }
/* A grid item is as wide as its longest word unless told otherwise: one unbroken title would widen the page. */
.import-product > * { min-width: 0; }
.import-product .card-title, .import-items code, .import-errors code { overflow-wrap: anywhere; }
/* A ref on a record: a flex item that may shrink, and break anywhere. */
.import-ref { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.import-state { margin: 0; overflow-wrap: anywhere; }
.import-counts, .import-items, .import-results, .import-errors, .import-warnings { list-style: none; padding: 0; margin: 0; }
.import-counts { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.import-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.import-group legend { font-weight: 600; font-size: var(--fs-s); padding: 0; margin-bottom: var(--s-1); }
.import-items { display: grid; gap: var(--s-1); }
.import-item-text { display: grid; min-width: 0; }
.import-item-title { min-width: 0; overflow-wrap: anywhere; }
.import-item-meta { font-size: var(--fs-s); overflow-wrap: anywhere; }
.import-errors { display: grid; gap: var(--s-1); }
.import-results { display: grid; gap: var(--s-2); max-width: 52rem; }
.import-result p { margin: 0; overflow-wrap: anywhere; }
