/* ---------- Inbox rail ------------------------------------------------------------------------- */

.inbox {
    grid-area: inbox;
    border-left: 1px solid var(--hairline);
    background: var(--surface);
    display: grid; grid-template-rows: minmax(0, 1fr);
    min-height: 0; overflow: hidden;
}
.inbox-full { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.inbox-collapsed-view { display: none; }
.shell.inbox-collapsed .inbox-full { display: none; }
.shell.inbox-collapsed .inbox-collapsed-view { display: flex; }
@media (max-width: 1439px) {
    .shell:not(.inbox-open) .inbox-full, .lifted-shell.inbox-open .inbox-collapsed-view { display: none; }
    .shell:not(.inbox-open) .inbox-collapsed-view { display: flex; }
    .lifted-shell.inbox-open .inbox-full { display: grid; }
}
.inbox-head h2 { margin: 0; font-weight: 400; }
.ticket-detail code { font-size: 11px; background: var(--surface); border: 1px solid var(--hairline); padding: 0 3px; }
.inbox-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--hairline); min-height: var(--bar-h); }
.inbox-head .label { display: block; margin-bottom: 6px; }
.inbox-head .v { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -0.04em; }
.inbox-head .v.zero { color: var(--ink-3); }
.inbox-list { overflow-y: auto; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
/* B-078: "Needs you" says whose tickets it shows, and a ticket from another deck names its deck. */
.inbox-scope { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; overflow-wrap: anywhere; }
.ticket-deck { font-size: 10px; overflow-wrap: anywhere; }
.inbox-more { align-self: flex-start; min-height: 44px; }
.inbox-collapsed-view { flex-direction: column; align-items: center; gap: var(--s2); padding-top: var(--s3); }
.inbox-collapsed-view .count { writing-mode: vertical-rl; font-family: var(--font-mono); font-size: 11px; }

/* Ticket: amber-edged slip. */
.ticket {
    background: var(--raised); border: 1px solid var(--hairline); border-left: 4px solid var(--sig-you);
    padding: var(--s3); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); min-width: 0;
    overflow-wrap: anywhere;
    animation: slip-in var(--t-settle) var(--ease-settle);
}
.ticket.alarm { border-left-color: var(--sig-alarm); }
.ticket.info { border-left-color: var(--ink-3); }
.ticket.snoozed { opacity: 0.6; }
.ticket-kind { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-width: 0; }
.ticket-title { font-weight: 600; font-size: 13px; line-height: 1.3; }
.ticket-detail { font-size: 12px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.ticket-detail code { overflow-wrap: anywhere; word-break: break-word; }
.ticket-evidence { min-width: 0; }
.ticket-evidence summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 12px; }
.ticket-evidence .ticket-detail { max-height: 280px; overflow: auto; overflow-wrap: anywhere; }
.ticket-actions { display: flex; gap: var(--s1); flex-wrap: wrap; min-width: 0; }
.ticket-actions > .muted { flex-basis: 100%; font-size: 12px; }
.ticket textarea { min-height: 52px; }
/* Vendor sign-in return: one mono field for the code the browser hands back, and a fill that drains as the window closes. */
.login-return { display: grid; gap: var(--s1); }
.login-return .input.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }
/* F-044: an agent's question with its choices. Each choice is a 44px target with its label and the agent's note; a single
   answer is a round mark, several are square, and a chosen one fills. Shape and fill, never color alone. */
.question-form { display: grid; gap: var(--s3); min-width: 0; }
.question { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s2); min-width: 0; }
.question legend { padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: baseline; font-size: 13px; font-weight: 600; line-height: 1.35; }
.question .hint { font-size: 11px; color: var(--ink-2); }
.question-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s2); min-width: 0; }
.question-choice {
    display: flex; align-items: flex-start; gap: var(--s2); min-height: 44px; padding: 10px var(--s3); text-align: left;
    background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); cursor: pointer; font: inherit; min-width: 0;
}
.question-choice:hover { border-color: var(--ink-3); }
.question-choice:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.question-choice.on { border-color: var(--sig-you); box-shadow: inset 3px 0 0 var(--sig-you); }
.question-choice:disabled { opacity: 0.6; cursor: default; }
.choice-mark { flex: none; width: 14px; height: 14px; margin-top: 2px; border: 1.5px solid var(--ink-2); }
.question-choice.single .choice-mark { border-radius: 50%; }
.question-choice.on .choice-mark { background: var(--sig-you); border-color: var(--sig-you); }
.choice-words { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.choice-label { font-weight: 600; font-size: 13px; }
.choice-description { font-size: 12px; color: var(--ink-2); }
.question-other { display: grid; gap: var(--s1); }
.question-actions .btn { min-height: 44px; height: auto; padding: 8px var(--s3); white-space: normal; }
.card-questions { display: grid; gap: var(--s2); }
/* F-044: steering the card's agent, under the drawer's actions on every tab. */
.steer-box { display: grid; gap: var(--s1); min-width: 0; }
.steer-row { display: flex; gap: var(--s2); align-items: stretch; min-width: 0; }
.steer-row textarea { flex: 1; min-width: 0; min-height: 44px; resize: vertical; }
.steer-row .btn { align-self: stretch; min-height: 44px; height: auto; }
.steer-box .hint { font-size: 11px; color: var(--ink-2); }
.steer-box.live .label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--sig-live); vertical-align: middle; }
@media (max-width: 600px) {
    .question-choices { grid-template-columns: minmax(0, 1fr); }
    .question-choice { padding: 12px var(--s3); }
    .choice-label { font-size: 15px; }
    .steer-row { flex-direction: column; }
    .steer-row textarea { font-size: 16px; }
}
.ticket .expiry { height: 2px; background: var(--hairline); overflow: hidden; }
.ticket .expiry i { display: block; height: 100%; width: calc(var(--fill, 1) * 100%); background: var(--sig-you); transition: width 1s linear; }
@keyframes slip-in { from { transform: translateX(16px); opacity: 0; } }

/* ---------- Sheets, drawer, flip --------------------------------------------------------------- */

.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 80; animation: fade var(--t-settle); }
@keyframes fade { from { opacity: 0; } }

.drawer {
    position: fixed; z-index: 90; top: calc(var(--bar-h) + 8px); bottom: 12px; left: 76px;
    width: min(620px, calc(100vw - 120px));
    background: var(--raised); border: 1px solid var(--ink);
    box-shadow: 6px 6px 0 var(--shadow);
    display: grid; grid-template-rows: auto auto 1fr;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    animation: drawer-out 260ms var(--ease-settle);
    transform-origin: left center;
}
@keyframes drawer-out { from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); } }
.drawer-mobile-bar { display: contents; }
.drawer-mobile-key, .drawer-actions-toggle { display: none; }
.drawer-controls { display: grid; gap: var(--s2); min-width: 0; }
.drawer-head { padding: var(--s4) var(--s4) var(--s3); display: grid; gap: var(--s2); border-bottom: 1px solid var(--hairline); position: relative; }
.drawer-head .key { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); display: flex; gap: var(--s2); align-items: center; }
.drawer-head h2 { font-size: 22px; line-height: 1.2; font-weight: 600; padding-right: 96px; }
.drawer-head h2 .title-edit { all: unset; cursor: text; border-bottom: 1px dashed transparent; overflow-wrap: anywhere; }
.drawer-head h2 .title-edit:hover { border-bottom-color: var(--ink-3); }
.drawer-head h2 .title-edit:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.drawer-head .title-input { font-size: 20px; }
.drawer .close { z-index: 3; position: absolute; right: var(--s3); top: var(--s3); }
.drawer .close .kbd { font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); border: 1px solid var(--hairline); padding: 0 4px; }
.waiver { display: grid; gap: var(--s2); border: 1px solid var(--hairline); border-left: 4px solid var(--sig-alarm); padding: var(--s3); background: var(--surface); font-size: 13px; }
.drawer-body:focus-visible { outline-offset: -2px; }

.drawer-action-select { width: auto; height: 28px; min-height: 28px; padding: 0 6px; font-size: 12px; }
.drawer-head .actions { display: flex; gap: var(--s1); flex-wrap: wrap; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--hairline); padding: 0 var(--s4); overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: var(--s2) var(--s3); cursor: pointer; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.drawer-body { overflow-y: auto; padding: var(--s4); display: grid; gap: var(--s4); align-content: start; }
/* A phone card is one document: expanded controls and long titles must never
   reserve a fixed header above a second, cramped scrolling region. */
@media (max-width: 767px), (pointer: coarse) and (max-width: 1024px) {
    .drawer { left: 0 !important; right: 0; top: 0; bottom: 0; width: 100vw !important; max-width: 100vw; border: 0; box-shadow: none; display: block; overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: 100px; }
    .drawer-mobile-bar { display: flex; align-items: center; gap: var(--s2); position: sticky; top: 0; z-index: 2; height: 52px; padding: 3px var(--s3); background: var(--raised); border-bottom: 1px solid var(--hairline); }
    .drawer-mobile-bar .drawer-mobile-key { display: block; flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 11px; }
    .drawer-mobile-bar .btn { min-height: 44px; }
    .drawer-head { padding: var(--s3); }
    .drawer-head .key > span:first-child, .drawer .close .kbd { display: none; }
    .drawer-actions-toggle { display: inline-flex; }
    .drawer .close { position: static; }
    .drawer-head h2 { padding-right: 0; font-size: 20px; }
    .drawer-controls { display: none; }
    .drawer-controls.open { display: grid; }
    .drawer-head .actions { gap: var(--s2); }
    .drawer-head .actions .btn, .drawer-head .actions select { min-height: 44px; }
    .drawer-action-select { font-size: 16px; max-width: 100%; }
    .drawer .tabs { position: sticky; top: 52px; z-index: 1; background: var(--raised); padding: 0 var(--s1); }
    .drawer .tabs button { min-height: 44px; padding: 12px var(--s3); }
    .drawer-body { overflow: visible; min-width: 0; padding: var(--s3); overflow-wrap: anywhere; }
    .drawer-body .kv { grid-template-columns: minmax(80px, 100px) minmax(0, 1fr); }
    .drawer-body .kv > span { min-width: 0; }
    .drawer-body .kv .input { max-width: 100%; }
}

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px var(--s3); font-size: 13px; }
.kv > span:nth-child(odd) { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--ink-2); letter-spacing: 0.06em; padding-top: 2px; }

/* Run tape: vertical strip of events. */
.tape { display: grid; gap: 0; border-left: 2px solid var(--hairline); margin-left: 6px; }
.tape-row { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: var(--s2); padding: 5px 0 5px var(--s3); position: relative; }
.tape-row::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; background: var(--bg); border: 1.5px solid var(--ink-3); }
.tape-row.text::before { border-radius: 50%; border-color: var(--ink); }
.tape-row.wait::before { background: var(--sig-you); border-color: var(--sig-you); }
.tape-row.file::before { transform: rotate(45deg); }
.tape-row.ok::before { background: var(--sig-done); border-color: var(--sig-done); }
.tape-row.fail::before { background: var(--sig-alarm); border-color: var(--sig-alarm); }
.tape-row.latest::before { background: var(--sig-live); border-color: var(--sig-live-line); box-shadow: 0 0 0 1px var(--light-ring), 0 0 6px var(--sig-live); }
.tape-row .t { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); padding-top: 1px; white-space: nowrap; }
.tape-row .line { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; padding: 0; text-align: left; min-width: 0; width: 100%; min-height: 20px; }
.tape-row .line.open { white-space: pre-wrap; }
.tape-row .prose { font-size: 14px; }
.run-picker { display: flex; gap: var(--s1); flex-wrap: wrap; }
.run-chip { border: 1px solid var(--hairline); background: var(--bg); padding: 4px 8px; min-height: 26px; cursor: pointer; font-family: var(--font-mono); font-size: 10px; display: flex; gap: 6px; align-items: center; }
.run-chip.on { border-color: var(--ink); background: var(--raised); }
.run-picker.tree { flex-direction: column; align-items: flex-start; }
.run-chip.depth-1 { margin-left: 1.25rem; }
.run-chip.depth-2 { margin-left: 2.5rem; }
.run-chip.depth-3 { margin-left: 3.75rem; }
/* Context transfers of a run (F-046.4): one line each, the handoff text one click away. */
.transfers { display: grid; gap: var(--s2); font-size: 13px; }
.transfers-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--ink-2); letter-spacing: 0.06em; }
.transfer { display: grid; gap: var(--s1); }
.handoff-text > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 12px; }
.handoff-text pre { background: var(--surface); border: 1px solid var(--hairline); padding: var(--s3); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; margin: 0; }
.activity { display: grid; gap: var(--s3); }
.activity-row { display: grid; grid-template-columns: 28px 1fr; gap: var(--s2); }
.activity-row .who { font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); }
.file-row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.file-row { gap: var(--s3); }
.file-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.file-row .add { color: var(--sig-done-text); }
.file-row .del { color: var(--sig-alarm-text); }

/* Flip card: every module has Front, Back and Source faces. */
.flip-host { position: fixed; z-index: 95; perspective: 1400px; width: 460px; max-width: calc(100vw - 24px); }
.flip-card { position: relative; transform-style: preserve-3d; transition: transform var(--t-flip) var(--ease-flip); animation: flip-in var(--t-flip) var(--ease-flip); }
@keyframes flip-in { from { transform: rotateY(-80deg); opacity: 0; } }
.flip-card.turning { transform: rotateY(90deg); }
.flip-face {
    background: var(--raised); border: 1px solid var(--ink); box-shadow: 6px 6px 0 var(--shadow);
    clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px);
    display: grid; grid-template-rows: auto auto 1fr auto; max-height: calc(100vh - 140px);
}
.flip-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--hairline); }
.flip-head .kind { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.flip-head h3 { font-size: 16px; }
.face-switch { display: flex; margin-left: auto; border: 1px solid var(--hairline); }
.face-switch button { border: 0; background: var(--bg); padding: 3px 8px; min-height: 26px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; color: var(--ink-2); }
.face-switch button.on { background: var(--accent); color: var(--accent-ink); }
.flip-body { padding: var(--s4); overflow-y: auto; display: grid; gap: var(--s3); align-content: start; }
.flip-foot { display: flex; gap: var(--s2); padding: var(--s3) var(--s4); border-top: 1px solid var(--hairline); align-items: center; }
.flip-foot .note { font-size: 11px; color: var(--ink-2); margin-right: auto; }
.source { width: 100%; min-height: 260px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; background: var(--bg); border: 1px solid var(--hairline); padding: var(--s3); resize: vertical; tab-size: 2; white-space: pre; }
.source.invalid { border-color: var(--sig-alarm); }
.channel-secret { display: grid; gap: var(--s2); border-top: 1px solid var(--hairline); padding-top: var(--s3); }
.channel-secret .copy-line code { font-size: 11px; }
.error-line { color: var(--sig-alarm-text); font-family: var(--font-mono); font-size: 11px; }
.big-number { font-family: var(--font-display); font-size: 64px; font-weight: 600; line-height: 0.9; letter-spacing: -0.05em; }

/* ---------- Console ---------------------------------------------------------------------------- */

.console {
    position: fixed; z-index: 100; left: 50%; top: 12vh; transform: translateX(-50%);
    width: min(680px, calc(100vw - 24px)); background: var(--raised); border: 1px solid var(--ink);
    box-shadow: 8px 8px 0 var(--shadow); animation: console-in 160ms var(--ease-settle);
}
@keyframes console-in { from { transform: translate(-50%, -8px); opacity: 0; } }
.console input { width: 100%; height: 56px; border: 0; border-bottom: 1px solid var(--hairline); padding: 0 var(--s4); background: transparent; font-size: 18px; }
.console input:focus { outline: none; }
.console input:focus-visible { box-shadow: inset 0 -2px 0 var(--focus); }
.console-results { max-height: 52vh; overflow-y: auto; padding: var(--s2) 0; }
.console-group { padding: var(--s2) var(--s4) var(--s1); }
.console-row { display: flex; align-items: center; gap: var(--s3); padding: 8px var(--s4); cursor: pointer; border-left: 2px solid transparent; }
.console-row.on { background: var(--surface); border-left-color: var(--accent); }
.console-row .hint { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); }
.help-sheet { padding: var(--s6); display: grid; gap: var(--s4); max-height: calc(100vh - 16vh); overflow-y: auto; }
.help-sheet .kv { grid-template-columns: 110px 1fr; }
.console-foot { border-top: 1px solid var(--hairline); padding: var(--s2) var(--s4); display: flex; gap: var(--s4); font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); }

/* ---------- Slips (toasts) --------------------------------------------------------------------- */

/* Slips sit bottom-right over the stage, clear of the columns people read first, above the transparent scrim of a
   card but below every sheet. Beside the coach when it is up, never on top of it. */
.slips {
    position: fixed; right: calc(var(--inbox-w) + 16px); bottom: calc(var(--strip-h) + 16px); z-index: 85;
    width: min(420px, calc(100vw - var(--rail-w) - var(--inbox-w) - 32px)); display: grid; gap: var(--s2); pointer-events: none;
}
.lifted-shell .slips { bottom: calc(var(--tray-h) + 16px); }
.shell:has(.coach) .slips { right: calc(var(--inbox-w) + 20px + 340px + 12px); width: min(360px, calc(100vw - var(--rail-w) - var(--inbox-w) - 400px)); }
.slip-count { flex: none; font-family: var(--font-mono); font-size: 11px; line-height: 18px; padding: 0 6px; border: 1px solid currentColor; border-radius: 999px; }
.slip-stack { display: grid; gap: var(--s2); }
.slip-stack:empty { display: none; }
.slip { pointer-events: auto; --focus: currentColor; background: var(--ink); color: var(--bg); padding: var(--s3) var(--s4); display: flex; gap: var(--s3); align-items: flex-start; font-size: 13px; animation: slip-up var(--t-settle) var(--ease-settle); clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px); }
.slip :focus-visible { outline-offset: -3px; }
.slip.alarm { background: var(--sig-alarm); color: #fff; }
.slip { flex-wrap: wrap; }
.slip-text { flex: 1 1 0; min-width: 0; }
.slip-actions { flex-basis: 100%; display: flex; gap: var(--s2); }
.slip-glyph { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.slip .slip-close { width: 24px; justify-content: center; padding: 0; flex: none; }
.pocket .slips { left: 12px; right: 12px; bottom: 12px; width: auto; z-index: 85; }
.slip-more { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s4); background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); font-size: 13px; }
.slips.compact .slip-text { max-height: 9.5em; overflow-y: auto; overflow-wrap: anywhere; }
.slips.compact .btn { min-height: 44px; }
.slips.compact .slip .slip-close { width: 44px; }
.slip.success { background: #17724B; color: #fff; }
.slip .btn { height: 24px; font-size: 12px; background: transparent; color: inherit; border-color: currentColor; }
@keyframes slip-up { from { transform: translateY(12px); opacity: 0; } }

/* ---------- Coach (first run) ------------------------------------------------------------------ */

.coach {
    position: fixed; z-index: 70; right: calc(var(--inbox-w) + 20px); bottom: calc(var(--strip-h) + 20px);
    width: 340px; background: var(--raised); border: 1px solid var(--ink); box-shadow: 6px 6px 0 var(--shadow);
    padding: var(--s4); display: grid; gap: var(--s3); animation: slip-up var(--t-settle) var(--ease-settle);
}
.lifted-shell .coach { bottom: calc(var(--tray-h) + 20px); }
/* Folded, the coach is one small tab in the same corner, so the plates under it are clear. */
.coach-head { display: flex; align-items: center; gap: var(--s2); }
.coach-head .step { flex: 1; }
.coach-fold { height: 24px; font-size: 12px; }
.coach.folded { width: auto; padding: var(--s2) var(--s3); }
.coach.folded .coach-fold { height: 28px; }
.coach .step { display: flex; gap: 3px; }
.coach .step i { width: 18px; height: 4px; background: var(--hairline); }
.coach .step i.on { background: var(--ink); }
.coach .step i.now { background: var(--sig-you-line); }
.coach h2 { font-size: 18px; margin: 0; }
.coach .actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.coach { max-height: calc(100vh - var(--strip-h) - 40px); overflow-y: auto; }
.coach p { margin: 0; }
.coach-now, .coach-next { display: grid; gap: 2px; font-size: 14px; }
.coach-now .label, .coach-next .label { font-size: 11px; }
.coach-substeps summary { cursor: pointer; font-size: 12px; color: var(--ink-2); min-height: 28px; display: flex; align-items: center; }
.coach-substeps ul { list-style: none; margin: var(--s1) 0 0; padding: 0; display: grid; gap: var(--s1); font-size: 13px; }
.coach-substeps li.done { color: var(--ink-2); }
.coach .command code { font-size: 11px; }
.machine-action { display: grid; gap: var(--s2); }
.machine-action .waiting { display: flex; gap: var(--s2); align-items: center; font-size: 13px; }

/* First-machine setup: three numbered steps, the current one outlined, done ones ticked. Shape and words, never color alone. */
.setup-progress { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s1); }
.setup-progress li { display: flex; gap: var(--s1); align-items: center; font-size: 12px; color: var(--ink-2); min-width: 0; }
.setup-progress li.now { color: var(--ink); font-weight: 600; }
.setup-progress .setup-mark { flex: none; width: 20px; height: 20px; display: inline-grid; place-items: center; border: 1px solid var(--hairline); font-family: var(--font-mono); font-size: 11px; }
.setup-progress li.now .setup-mark { border-color: var(--sig-you-line); border-width: 2px; }
.setup-progress li.done .setup-mark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.coach-substeps .setup-mark { display: inline-block; width: 1em; font-family: var(--font-mono); }

/* ---------- Signer (always graphite, most serious form) ---------------------------------------- */

.signer-scrim { position: fixed; inset: 0; z-index: 150; background: rgba(8, 8, 9, 0.86); display: grid; place-items: center; animation: fade 200ms; }
.signer {
    --bg: #111213; --surface: #18191B; --raised: #202225; --ink: #EDEBE6; --ink-2: #9A988F; --ink-3: #77756E; --hairline: #2E3033;
    --focus: #EDEBE6; --field-border: #727479; --light-ring: transparent;
    --sig-live-text: #5CF2B4; --sig-you-text: #FFB020; --sig-alarm-text: #FF6B7A; --sig-done-text: #3FBF85;
    --sig-live-line: #5CF2B4; --sig-you-line: #FFB020;
    width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto;
    background: var(--bg); color: var(--ink); border: 1px solid var(--hairline);
    display: grid; gap: var(--s4); padding: var(--s6);
}
.signer-origin { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); border-bottom: 1px solid var(--hairline); padding-bottom: var(--s3); }
.signer-origin .signer-host { color: var(--ink); }
.signer-origin .signer-note { flex-basis: 100%; font-family: var(--font-text); font-size: 12px; }
.signer .kit-saved { align-items: flex-start; }
.signer .kit-saved input { margin-top: 4px; }
.signer-origin .lock { width: 14px; height: 14px; }
.signer h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.signer .sentences { display: grid; gap: var(--s2); font-size: 15px; }
.signer .sentences li { margin-left: 1em; }
.signer pre { background: var(--surface); border: 1px solid var(--hairline); padding: var(--s3); font-family: var(--font-mono); font-size: 11px; white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto; margin: 0; }
.anchor-words { font-family: var(--font-display); font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; word-break: break-word; }
.anchor-words span { display: inline-block; margin-right: 0.35em; }
.key-button {
    justify-self: start; height: 56px; padding: 0 var(--s6) 0 var(--s8); cursor: pointer;
    background: var(--ink); color: var(--bg); border: 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: 0.02em;
    clip-path: polygon(28px 0, 100% 0, 100% 100%, 28px 100%, 0 50%);
}
.key-button[disabled] { opacity: 0.4; cursor: wait; }
.sealed-lock { display: flex; gap: var(--s3); align-items: center; font-family: var(--font-mono); font-size: 12px; }
.sealed-lock svg { width: 36px; height: 36px; }
.sealed-lock .shackle { transform: translateY(-5px); transition: transform 260ms cubic-bezier(.5, 0, .2, 1.4); }
.sealed-lock.closed .shackle { transform: translateY(0); }
.command { display: flex; gap: var(--s2); align-items: stretch; }
.command code { flex: 1; font-family: var(--font-mono); font-size: 11px; background: var(--surface); border: 1px solid var(--hairline); padding: var(--s3); word-break: break-all; }
.words-compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.words-compare > div { border: 1px solid var(--hairline); padding: var(--s3); display: grid; gap: var(--s2); }
.words-compare .anchor-words { font-size: 22px; }
.signer .signer-close { margin-left: auto; color: var(--ink); }
.signer .signer-tiers { display: flex; gap: var(--s2); }
.signer .install-runnerd { display: grid; gap: var(--s2); }
.signer .install-runnerd .signer-tiers { flex-wrap: wrap; }
.signer .signer-simulate { justify-self: start; color: var(--ink); background: var(--surface); }
.signer .signer-bytes { cursor: pointer; }
.signer-wait { border: 1px solid var(--hairline); padding: var(--s3) var(--s4); display: grid; gap: var(--s2); }
.signer-wait a { color: var(--ink); }
.signer .signer-lede { font-size: 17px; font-weight: 600; }
.signer-before-list { display: grid; gap: var(--s2); margin: 0; padding-left: 1.2em; }
.signer .kit-confirmed { border-left: 2px solid var(--sig-done-text); padding-left: var(--s3); }
.passkey-gate, .owner-link { display: grid; gap: var(--s3); min-width: 0; }
.passkey-gate .gate-steps { display: grid; gap: var(--s2); margin: 0; padding-left: 1.2em; }
.passkey-gate > .btn { justify-self: start; }
.settings-anchor { font-size: 32px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* Security tasks share one readable layout on desktop and phone. */
.signer { max-height: calc(100dvh - 32px); }
.signer .key-button { min-height: 52px; height: auto; max-width: 100%; padding: var(--s3) var(--s4); border-radius: 6px; clip-path: none; white-space: normal; }
.signer .key-button[disabled] { opacity: 0.55; cursor: not-allowed; }
.signer .btn, .signer select, .signer input:not([type="checkbox"]) { min-height: 44px; font-size: 16px; }
.signer select { min-width: 0; max-width: 100%; width: 100%; }
.signer .btn { height: auto; white-space: normal; }
.signer .signer-tiers { flex-wrap: wrap; }
.signer .signer-tiers > button { text-align: left; }
.signer .signer-host, .signer p, .signer label { overflow-wrap: anywhere; }
.signer .check { min-height: 44px; padding: var(--s2) 0; cursor: pointer; }
.signer .security-detail, .security-settings .security-detail { border-top: 1px solid var(--hairline); min-width: 0; }
.signer .security-detail > summary, .security-settings .security-detail > summary { min-height: 44px; padding: var(--s3) 0; cursor: pointer; }
.signer .security-detail[open], .security-settings .security-detail[open] { display: grid; gap: var(--s3); }
.signer-wait .mono { overflow-wrap: anywhere; }
.signer-wait a { display: inline-flex; align-items: center; min-height: 44px; }
.security-settings { min-width: 0; }
.security-settings h3 { font-family: var(--font-text); font-size: 18px; font-weight: 600; }
.security-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3); }
.security-section-head > div { flex: 1 1 240px; }
.security-section-head p { margin-top: var(--s1); }
.passkey-list { display: grid; gap: var(--s3); }
.passkey-card { display: grid; gap: var(--s3); min-width: 0; padding: var(--s4); border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface); }
.passkey-card.removed { color: var(--ink-2); }
.passkey-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.passkey-card h4 { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.passkey-status { font-size: 13px; padding: 2px 8px; border: 1px solid var(--hairline); border-radius: 4px; }
.security-facts { display: grid; gap: var(--s2); margin: 0; }
.security-facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--s3); }
.security-facts dt { color: var(--ink-2); }
.security-facts dd { margin: 0; overflow-wrap: anywhere; }
.security-recovery { display: grid; gap: var(--s3); border-top: 1px solid var(--hairline); padding-top: var(--s4); }
.security-settings .btn { min-height: 44px; height: auto; max-width: 100%; white-space: normal; }
.security-settings .field input { min-height: 44px; font-size: 16px; }
.security-settings p { overflow-wrap: anywhere; }
.settings-nav a { min-height: 44px; display: flex; align-items: center; }
.security-recovery > button { justify-self: start; }

@media (max-width: 600px) {
    .signer-scrim { padding: max(var(--s2), env(safe-area-inset-top)) var(--s2) max(var(--s2), env(safe-area-inset-bottom)); }
    .signer { width: 100%; padding: var(--s4); max-height: calc(100dvh - 32px); }
    .signer .key-button { width: 100%; }
    .signer h2 { font-size: 24px; }
    .words-compare { grid-template-columns: minmax(0, 1fr); }
    .security-facts > div { grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
    .security-settings .settings-actions > p { flex-basis: 100%; }
}

/* ---------- Hangar ----------------------------------------------------------------------------- */

.hangar { position: fixed; z-index: 90; left: calc(var(--rail-w) + 12px); right: calc(var(--inbox-w) + 12px); bottom: calc(var(--strip-h) + 12px); top: calc(var(--bar-h) + 12px);
    background: var(--surface); border: 1px solid var(--ink); box-shadow: 6px 6px 0 var(--shadow); display: grid; grid-template-rows: auto 1fr; animation: tray-up var(--t-settle) var(--ease-settle); }
.hangar.review { left: max(80px, calc(50vw - 460px)); right: max(80px, calc(50vw - 460px)); }
.review-body { overflow-y: auto; padding: var(--s4); display: grid; gap: 20px; align-content: start; min-height: 0; }
.review-issues { display: grid; gap: var(--s1); border-left: 4px solid var(--sig-alarm); padding-left: var(--s3); }
.review-issues h3 { margin: 0; }
.hangar-head { display: flex; align-items: flex-end; gap: var(--s4); padding: var(--s4); border-bottom: 1px solid var(--hairline); }
/* Rows are as tall as the bay they hold and the grid scrolls. Without max-content rows, the grid's definite height (the
   Hangar's 1fr track) let the browser stop each row at the bay's 260px minimum, and a bay with tools, headroom and
   details spilled over the Headroom rollup and the Add a machine card below it (B-077). */
.hangar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); grid-auto-rows: max-content; gap: var(--s4); padding: var(--s4); overflow-y: auto; align-content: start; min-height: 0; }
.bay { border: 1.5px solid var(--ink); background: var(--bg); display: grid; gap: var(--s3); padding: var(--s3); position: relative; min-height: 260px; min-width: 0; align-content: start; overflow-wrap: anywhere; }
.bay.empty { border-style: dashed; place-items: center; align-content: center; cursor: pointer; color: var(--ink-2); }
.bay.empty:hover { color: var(--ink); background: var(--raised); }
.bay-lights { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); list-style: none; margin: 0; padding: 0; }
.bay-lights > li { display: flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--ink-2); letter-spacing: 0.04em; }
.bay-lights .light { transition: background 200ms, box-shadow 200ms; }
.bay-name { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.bay-facts { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.bay-facts.runnerd-update { display: flex; gap: var(--s2); align-items: baseline; font-family: var(--font-text); margin-top: var(--s1); }
.bay-facts.runnerd-update.below-minimum { color: var(--ink); }
.tool-guidance { display: grid; gap: var(--s1); margin-top: var(--s1); }
.tool-guidance .command code { padding: var(--s2); }
.tool-guidance-note { font-size: 11px; margin: 0; }
.bay.revoked, .bay.offline { opacity: 0.6; }
.bay.flapping { border-color: var(--sig-you-line); }
/* A bay says one thing first: the machine, whether it can run, the one next step (2026-10-03). Its tools are rows with a
   word for their state; everything else is under Details. */
.bay-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.bay-top .bay-name { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.bay-status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.bay-status.alarm { color: var(--sig-alarm); }
.bay-sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.bay-next { display: grid; gap: var(--s2); padding: var(--s3); border-left: 3px solid var(--sig-you); background: color-mix(in srgb, var(--sig-you) 8%, var(--surface)); }
.bay-next.alarm { border-left-color: var(--sig-alarm); background: color-mix(in srgb, var(--sig-alarm) 8%, var(--surface)); }
.bay-next .label { font-size: 10px; }
.bay-next-text { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.bay-next .btn { justify-self: start; }
.tool-rows { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--hairline); }
.tool-rows > li { border-bottom: 1px solid var(--hairline); }
.cartridge {
    width: 100%; min-height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--s3);
    padding: 6px 2px; background: transparent; border: 0; color: var(--ink); text-align: left; cursor: pointer; font: inherit;
}
.cartridge .tool-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartridge .tool-ver { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.cartridge .tool-state { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; min-width: 64px; text-align: right; }
.cartridge.installed .tool-state { color: var(--sig-done); }
.cartridge.login .tool-state, .cartridge.ghost .tool-state { color: var(--sig-you); }
.cartridge.ghost .tool-name { color: var(--ink-2); }
.cartridge.ghost .tool-state { border: 1px solid var(--sig-you-line); padding: 4px 10px; }
.bay-details { width: 100%; }
.bay-details > summary { cursor: pointer; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); min-height: 44px; display: flex; align-items: center; }
.bay-details[open] { display: grid; gap: var(--s2); }
.lock-line { display: flex; align-items: center; gap: var(--s2); font-family: var(--font-mono); font-size: 10.5px; border-top: 1px solid var(--hairline); padding-top: var(--s2); }
.bay-actions { display: flex; gap: var(--s1); flex-wrap: wrap; }

/* ---------- Mission control (the Deck zoom level) ---------------------------------------------- */

.mission { padding: var(--s6); display: grid; gap: var(--s6); animation: zoom-in 380ms var(--ease-settle); transform-origin: top left; }
@keyframes zoom-in { from { transform: scale(1.35); opacity: 0; } }
.mission-numbers { display: flex; gap: var(--s12); flex-wrap: wrap; align-items: flex-end; }
.mission-numbers .stat .v { font-size: 64px; }
.spine-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.spine-strip { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; border-bottom: 1px solid var(--hairline); padding-bottom: var(--s3); cursor: pointer; color: inherit; text-decoration: none; }
.spine-strip:focus-visible { outline-offset: 4px; }
.agg-row { flex-wrap: wrap; }
.spine-signals { display: flex; gap: var(--s3); align-items: center; }
.spine-signals > span { display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.spine-signals .signal-word { color: var(--ink-2); }
.panel-label h3, .mission h3 { margin: 0; font-weight: 400; }
.spine-strip:hover .agg { background: var(--raised); }
.spine-strip .spine-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.agg-row { display: flex; gap: 6px; }
.agg { flex: none; width: 96px; height: 64px; background: var(--surface); border: 1px solid var(--hairline); position: relative; clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); padding: 6px 8px; display: grid; align-content: space-between; }
.agg::before { content: ""; position: absolute; left: -1px; top: -1px; width: 15px; height: 15px; background: linear-gradient(135deg, transparent 44%, var(--cat) 44% 62%, transparent 62%); }
.agg .n { font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1; letter-spacing: -0.04em; justify-self: end; }
.agg .s { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s4); }
.panel { background: var(--surface); border: 1px solid var(--hairline); display: grid; grid-template-rows: auto 1fr; min-height: 200px; }
.panel.stale .panel-label { border-bottom-style: dotted; }
.panel-label { display: flex; justify-content: space-between; align-items: center; padding: 6px var(--s3); border-bottom: 1px solid var(--hairline); background: var(--bg); }
.panel-body { padding: var(--s3); display: grid; gap: var(--s2); align-content: start; overflow: auto; max-height: 340px; }
.run-line { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s2); align-items: center; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--hairline); }
.run-line .sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); }
.audit-line { font-family: var(--font-mono); font-size: 10px; display: grid; grid-template-columns: 40px 1fr; gap: var(--s2); padding: 3px 0; }
.audit-line .h { color: var(--ink-2); }

/* ---------- Entry pages ------------------------------------------------------------------------ */

.entry { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr); }
.entry-art { border-right: 1px solid var(--hairline); padding: var(--s12); display: grid; align-content: space-between; background: var(--surface); position: relative; overflow: hidden; }
.entry-art .giant { font-family: var(--font-display); font-weight: 700; font-size: clamp(64px, 11vw, 168px); line-height: 0.85; letter-spacing: -0.06em; }
.entry-form { padding: var(--s12); display: grid; align-content: center; gap: var(--s6); max-width: 520px; }
.entry-form h1 { font-family: var(--font-display); font-size: 28px; letter-spacing: -0.03em; }
.deck-name-live { font-family: var(--font-display); font-weight: 600; font-size: clamp(40px, 7.5vw, 112px); line-height: 0.9; letter-spacing: -0.05em; overflow-wrap: break-word; hyphens: auto; min-height: 1em; }
.deck-name-live.long { font-size: clamp(32px, 4.6vw, 72px); line-height: 0.95; }
.starter .nm, .starter .bl { display: block; }
.starter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.starter { border: 1px solid var(--hairline); background: var(--raised); padding: var(--s3); display: grid; gap: var(--s2); cursor: pointer; text-align: left; }
.starter.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.starter .miniature { display: flex; gap: 2px; height: 34px; align-items: stretch; }
.starter .miniature i { flex: 1; background: var(--surface); border: 1px solid var(--hairline); border-top: 3px solid var(--cat); }
.starter .miniature.blank i { border-style: dashed; border-top: 1px dashed var(--hairline); }
.starter .nm { font-weight: 600; font-size: 13px; }
.starter .bl { font-size: 11px; color: var(--ink-2); }
.demo-spine { display: flex; gap: 6px; align-items: flex-end; }
.demo-spine i { width: 56px; background: var(--bg); border: 1px solid var(--hairline); clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); position: relative; }
.demo-spine i::before { content: ""; position: absolute; left: -1px; top: -1px; width: 15px; height: 15px; background: linear-gradient(135deg, transparent 44%, var(--cat) 44% 62%, transparent 62%); }
@media (max-width: 900px) { .entry { grid-template-columns: 1fr; } .entry-art { display: none; } }

/* Reconnecting: a thin hairline across the top slowly fills. */
.reconnect-line { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; background: var(--hairline); }
.reconnect-line::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); animation: fill-line 8s linear forwards; }
@keyframes fill-line { from { width: 0; } to { width: 100%; } }

/* ---------- Tune (appearance) ----------------------------------------------------------------- */

.tune {
    position: fixed; z-index: 110; left: calc(var(--rail-w) + 12px); top: 12px; bottom: 12px; width: min(560px, calc(100vw - 100px));
    background: var(--raised); border: 1px solid var(--accent); box-shadow: 8px 8px 0 var(--shadow);
    display: grid; grid-template-rows: auto 1fr auto; animation: tune-in 260ms var(--ease-settle);
    clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
}
@keyframes tune-in { from { transform: translateX(-24px); opacity: 0; } }
.tune-head { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s6) var(--s6) var(--s4); border-bottom: 1px solid var(--hairline); }
.tune-head > div { min-width: 0; }
.tune-head h2 { font-size: 40px; font-weight: 600; margin: 4px 0 6px; overflow-wrap: anywhere; }
.tune-body { overflow-y: auto; padding: var(--s4) var(--s6); display: grid; gap: var(--s6); align-content: start; }
.tune-section { display: grid; gap: var(--s3); }
.tune-grid { grid-template-columns: repeat(3, 1fr); }
.tune-foot { display: flex; gap: var(--s2); align-items: center; padding: var(--s3) var(--s6); border-top: 1px solid var(--hairline); }
.tune-foot .faint { margin-right: auto; font-size: 12px; }
@media (max-width: 767px) {
    .tune { left: 12px; right: 12px; width: auto; grid-template-rows: auto minmax(0, 1fr) auto; }
    .tune-head { flex-wrap: wrap; gap: var(--s2); padding: var(--s4); }
    .tune-head > div { flex: 1 1 200px; max-height: 40vh; overflow-y: auto; }
    .tune-head .btn { flex-shrink: 0; align-self: flex-start; }
    .tune-head h2 { font-size: 32px; }
    .tune-body { min-width: 0; padding: var(--s4); }
    .tune-grid { grid-template-columns: minmax(0, 1fr); }
    .tune-foot { flex-wrap: wrap; padding: var(--s3) var(--s4); }
    .tune-foot > .muted { flex-basis: 100%; }
    .tune .mode-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tune .signal-legend { grid-template-columns: minmax(0, 1fr); }
}
/* Where an agent runs (docs/readiness.md): one hairline row per machine, its stage as a tag beside a light. */
.readiness { display: grid; gap: var(--s2); border-top: 1px solid var(--hairline); padding-top: var(--s3); min-width: 0; }
.readiness-machines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.readiness-machine { display: grid; gap: 4px; padding: var(--s2) 0; border-bottom: 1px solid var(--hairline); min-width: 0; overflow-wrap: anywhere; }
.readiness-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.readiness-name { font-weight: 600; }
.readiness-machine .btn { justify-self: start; }
.signer .policy-request, .signer .policy-changes { overflow-wrap: anywhere; }
.mode-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s2); }
.mode-tile { display: grid; gap: 6px; padding: 6px; border: 1px solid var(--hairline); background: transparent; cursor: pointer; text-align: left; }
.mode-tile.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mode-preview { height: 58px; display: flex; gap: 3px; padding: 6px; position: relative; }
.mode-preview i { flex: 1; border: 1px solid; opacity: 0.55; clip-path: polygon(4px 0, 100% 0, 100% 100%, 0 100%, 0 4px); }
.mode-preview b { position: absolute; right: 6px; bottom: 6px; width: 12px; height: 12px; border-radius: 50%; }
.mode-name { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); border: 2px solid var(--raised); box-shadow: 0 0 0 1px var(--hairline); cursor: pointer; padding: 0; display: grid; place-items: center; color: var(--bg); }
.swatch.on { box-shadow: 0 0 0 2px var(--accent); }
.swatch.custom { background: conic-gradient(#FF8A7A, #E8C99A, #6FD6E0, #8EC5FF, #B9A4FF, #FF7AB6, #FF8A7A); position: relative; overflow: hidden; }
.swatch.custom input { opacity: 0; position: absolute; inset: 0; cursor: pointer; }
.hex { width: 104px; font-family: var(--font-mono); font-size: 12px; }
.readout { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; font-size: 12px; }
.tag.ok { border-color: var(--sig-done); color: var(--ink); }
.tag.bad { border-color: var(--sig-alarm); color: var(--sig-alarm-text); }
.clash { color: var(--sig-you-text); font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--hairline); }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.tint-row { display: flex; gap: var(--s3); align-items: center; }
.tint-row input[type=range] { flex: 1; accent-color: var(--accent); }
.tint-row input[type=color] { width: 36px; height: 30px; border: 1px solid var(--hairline); background: none; padding: 2px; }
.signal-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 12px; color: var(--ink-2); }
.signal-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.signal-legend b { color: var(--ink); font-weight: 600; margin-right: 4px; }

/* ---------- Workspace switcher --------------------------------------------------------------- */

.switcher { position: fixed; z-index: 95; left: calc(var(--rail-w) + 8px); top: 8px; width: 360px; max-height: calc(100vh - 16px);
    background: var(--raised); border: 1px solid var(--accent); box-shadow: 6px 6px 0 var(--shadow); display: grid; grid-template-rows: auto 1fr auto; padding: var(--s3); gap: var(--s2);
    animation: tune-in 200ms var(--ease-settle); }
.switcher-list { overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.switcher-org { padding: var(--s2) 4px 2px; }
.switcher-row { display: flex; align-items: center; gap: var(--s2); padding: 6px; text-decoration: none; border: 1px solid transparent; }
.switcher-row:hover, .switcher-row:focus-visible { border-color: var(--hairline); }
.switcher-row.on { border-color: var(--accent); }
.switcher-add { display: grid; gap: 6px; padding: 6px; border: 1px dashed var(--hairline); }
.switcher-foot { display: flex; gap: var(--s2); border-top: 1px solid var(--hairline); padding-top: var(--s2); }
.wordmark.small { width: 26px; height: 26px; font-size: 10px; margin: 0; clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px); }
button.wordmark { border: 0; cursor: pointer; }

/* ---------- Settings (the allowed exception to "no settings pages") --------------------------- */

.settings { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
/* The 240px column exists only for a nav. A page using this shell without one (a conversation) would otherwise put its
   whole body into that column; minmax(0, 1fr) keeps a wide table from pushing the body past the screen. */
.settings:has(> .settings-nav) { grid-template-columns: 240px minmax(0, 1fr); }
.settings-head { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--s6); border-bottom: 1px solid var(--hairline); background: var(--surface); }
.settings-head h1 { font-size: 28px; font-weight: 600; }
.settings-head .wordmark { margin: 0; }
.settings-head-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: flex-end; }
.role-means { font-size: 12px; max-width: 70ch; }
.role-list { display: grid; gap: var(--s1); margin: 0; }
.role-list > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s3); font-size: 13px; }
.role-list dt { font-weight: 600; }
.role-list dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.switcher-note { font-size: 11px; line-height: 1.4; }
.elsewhere { display: grid; gap: var(--s2); border: 1px solid var(--hairline); padding: var(--s3); }
.elsewhere-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: var(--s4); border-right: 1px solid var(--hairline); }
.settings-nav a { text-decoration: none; padding: 8px 10px; border-left: 2px solid transparent; font-size: 14px; }
.settings-nav a.on { border-left-color: var(--accent); background: var(--surface); }
.settings-body { padding: var(--s6); display: grid; gap: var(--s4); align-content: start; max-width: 980px; min-width: 0; }
.settings-body section { display: grid; gap: var(--s4); }
.settings-body h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.conversation { list-style: none; display: grid; gap: var(--s3); padding: 0; }
.conversation li { border: 1px solid var(--hairline); border-left: 4px solid var(--hairline); padding: var(--s3) var(--s4); background: var(--raised); }
.conversation li.orchestrator { border-left-color: var(--sig-live); }
.conversation li p { overflow-wrap: anywhere; }
.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid-table th { text-align: left; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); font-weight: 400; padding: 6px 8px; border-bottom: 1px solid var(--hairline); }
.grid-table td { padding: 8px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.grid-table td.when, .grid-table td.nowrap { white-space: nowrap; }
/* Free text (an agent's last words, an event) keeps a readable measure: the table scrolls sideways before it squeezes
   the text to a word per line. */
.grid-table td.prose { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 16em; }
.grid-table select { width: auto; }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.hook-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s2); align-items: end; }
.hook-form > .btn { justify-self: start; }
.event-list { display: grid; gap: var(--s1); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.choice { display: flex; gap: var(--s3); padding: var(--s3); border: 1px solid var(--hairline); cursor: pointer; }
.choice.on { border-color: var(--accent); }
.table-scroll { overflow-x: auto; max-width: 100%; contain: paint; }
/* Deck access for Contributors: one list per person; each row wraps on a phone and keeps a 44px button. */
.deck-access-person { display: grid; gap: var(--s2); }
.deck-access-person h3 { font-family: var(--font-text); font-size: 16px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); overflow-wrap: anywhere; }
.deck-access-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.deck-access-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--hairline); }
.deck-access-list .deck-access-name { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.deck-access-list .btn { min-height: 44px; height: auto; margin-left: auto; }
.table-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* On a phone the nav is one scrollable row of tabs and the header wraps; nothing is wider than the screen. */
@media (max-width: 767px) {
    .settings { grid-template-columns: minmax(0, 1fr); }
    .settings:has(> .settings-nav) { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
    .settings-head { flex-wrap: wrap; gap: var(--s3); padding: var(--s3) var(--s4); }
    .settings-head > div { min-width: 0; }
    .settings-head-actions { margin-left: 0; flex-basis: 100%; justify-content: flex-start; }
    .role-list > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .settings-head h1 { font-size: 22px; }
    .settings-nav { flex-direction: row; overflow-x: auto; contain: paint; gap: 4px; padding: var(--s2) var(--s4); border-right: 0; border-bottom: 1px solid var(--hairline); scrollbar-width: thin; }
    /* contain: paint keeps the row's scrollable tabs out of the document width; overflow alone still leaks it in Chromium. */
    .settings-nav a { white-space: nowrap; flex: none; border-left: 0; border-bottom: 2px solid transparent; }
    .settings-nav a.on { border-bottom-color: var(--accent); }
    .settings-nav p { display: none; }
    .settings-body { padding: var(--s4); min-width: 0; }
    .copy-line code { overflow-wrap: anywhere; }
}
.settings-body section > .btn, .settings-body section > button, .settings-body section > a.btn { justify-self: start; }
.coach .model-lines { display: grid; gap: var(--s1); }
.coach .model-lines p { margin: 0; font-size: 12px; display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }

/* Deep links (F-013.1): what a link pointed at is outlined, not recoloured, so its signal colour still reads. */
.ticket.linked, .bay.linked, .tape-row.linked { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Headroom (F-047.1): one line per subscription, wrapping at phone width. Machine-reported text never forces a scroll. */
.headroom-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); min-width: 0; }
.headroom-sub { display: grid; gap: 2px; padding: var(--s2) 0; border-bottom: 1px solid var(--hairline); min-width: 0; }
.headroom-name { font-weight: 600; overflow-wrap: anywhere; }
.headroom-machines, .headroom-window { overflow-wrap: anywhere; white-space: normal; }
.headroom-window { font-size: 12px; }
.headroom-note { font-size: 11px; margin: 0; }
.bay-headroom { display: grid; gap: var(--s1); }
.hangar-grid > .headroom-rollup { grid-column: 1 / -1; min-height: 0; }
