/*
 * Visual base of the cockpit (S19, decision 0051). Plain CSS served by AssetMapper: tokens on
 * :root, redefined for the dark theme, which follows the system. No inline style anywhere (CSP):
 * every page is styled from here, by element and by the classes below.
 */

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal-dCzU-sz.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-400-normal-sJxWBUz.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal-mSIWrNY.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-500-normal-WZ6O2PS.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal-pA5FLX3.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-600-normal-EIcGoea.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal-78NWkmx.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-ext-400-normal-WlFXyXd.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal-QJNNIVc.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-ext-500-normal-Uqu9TNw.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Tokens. tests/Ui/ContrastTest reads both blocks: keep one `--name: #RRGGBB;` per line. */
:root {
    color-scheme: light;
    --bg: #F4F5F7;
    --surface: #FFFFFF;
    --ink: #16191F;
    --muted: #5B6270;
    --line: #E1E4EA;
    --field-line: #8A919E;
    --accent: #2B59C3;
    --accent-hover: #1E3F8F;
    --accent-ink: #FFFFFF;
    --focus: #2B59C3;
    --danger: #A32014;
    --danger-ink: #FFFFFF;
    --sidebar-bg: #171B22;
    --sidebar-ink: #C3C9D4;
    --sidebar-strong: #FFFFFF;
    --sidebar-muted: #8C94A3;
    --sidebar-active: #2A3550;
    --code-bg: #171B22;
    --code-ink: #D7DCE5;
    --ok-bg: #E3F3EA;
    --ok-ink: #17643E;
    --warn-bg: #FBF0DC;
    --warn-ink: #8A4B05;
    --down-bg: #FDECEA;
    --down-ink: #A32014;
    --neutral-bg: #EEF0F3;
    --neutral-ink: #4A5160;
    --info-bg: #E8EEFB;
    --info-ink: #1E3F8F;
    --dot-ok: #3DBA7A;
    --dot-down: #F0645A;
    --dot-unknown: #8C94A3;

    --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
    --radius: 10px;
    --radius-small: 6px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --gutter: clamp(16px, 4vw, 48px);
    --text-small: 13px;
    --text: 15px;
    --text-h3: 17px;
    --text-h2: 20px;
    --text-h1: 26px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0F1217;
        --surface: #181C24;
        --ink: #E6E9EF;
        --muted: #A3ABB9;
        --line: #2C323D;
        --field-line: #6B7383;
        --accent: #8AABF5;
        --accent-hover: #A9C1F8;
        --accent-ink: #0F1217;
        --focus: #8AABF5;
        --danger: #F28B82;
        --danger-ink: #0F1217;
        --sidebar-bg: #0A0C10;
        --sidebar-ink: #C3C9D4;
        --sidebar-strong: #FFFFFF;
        --sidebar-muted: #8C94A3;
        --sidebar-active: #24304A;
        --code-bg: #0A0C10;
        --code-ink: #D7DCE5;
        --ok-bg: #143323;
        --ok-ink: #7FD6A4;
        --warn-bg: #3A2A0F;
        --warn-ink: #F2C477;
        --down-bg: #3D1714;
        --down-ink: #F6A39B;
        --neutral-bg: #262B35;
        --neutral-ink: #C3C9D4;
        --info-bg: #1B2848;
        --info-ink: #A9C1F8;
        --dot-ok: #3DBA7A;
        --dot-down: #F0645A;
        --dot-unknown: #8C94A3;
    }
}

/* Elements: the pages written in plain semantic HTML read well without classes. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--text);
    line-height: 1.55;
}
h1, h2, h3 { margin: 0 0 var(--space-3); line-height: 1.25; font-weight: 600; }
h1 { font-size: var(--text-h1); letter-spacing: -0.01em; }
h2 { font-size: var(--text-h2); margin-top: var(--space-5); }
h3 { font-size: var(--text-h3); margin-top: var(--space-4); }
p, ul, ol, dl, table, form, pre { margin: 0 0 var(--space-4); }
ul, ol { padding-left: 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code, kbd, samp, pre { font-family: var(--mono); font-size: 0.9em; }
pre {
    background: var(--code-bg);
    color: var(--code-ink);
    border-radius: var(--radius-small);
    padding: var(--space-3) var(--space-4);
    overflow-x: auto;
    line-height: 1.6;
}
hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-5) 0; }
section { margin-bottom: var(--space-5); }
img, svg { max-width: 100%; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
th, td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: var(--text-small); font-weight: 600; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

label { display: block; font-weight: 500; margin: var(--space-3) 0 var(--space-1); }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea {
    display: block;
    width: 100%;
    max-width: 480px;
    min-height: 40px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--field-line);
    border-radius: var(--radius-small);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}
textarea { max-width: 100%; min-height: 120px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0 var(--space-2) 0 0; vertical-align: middle; accent-color: var(--accent); }
input[type=checkbox] + label, input[type=radio] + label { display: inline; font-weight: 400; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 40px;
    padding: 0 var(--space-4);
    margin: var(--space-2) var(--space-2) 0 0;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-hover); color: var(--accent-ink); text-decoration: none; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.button--secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--field-line); }
.button--secondary:hover { background: var(--bg); color: var(--ink); }
.button--danger { background: var(--danger); color: var(--danger-ink); }
.button--danger:hover { background: var(--danger); color: var(--danger-ink); opacity: 0.9; }

[role=alert] { background: var(--down-bg); color: var(--down-ink); border-radius: var(--radius-small); padding: var(--space-2) var(--space-3); font-weight: 500; }
[role=status] { background: var(--ok-bg); color: var(--ok-ink); border-radius: var(--radius-small); padding: var(--space-2) var(--space-3); }

/* Layout */
.skip-link { position: absolute; left: var(--space-2); top: -60px; z-index: 10; background: var(--surface); color: var(--accent); padding: var(--space-2) var(--space-3); border-radius: var(--radius-small); }
.skip-link:focus { top: var(--space-2); }

.layout { display: flex; min-height: 100vh; }
.sidebar {
    flex: 0 0 232px;
    background: var(--sidebar-bg);
    color: var(--sidebar-ink);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
.sidebar { position: relative; }
.sidebar__menu { display: flex; flex: 1; flex-direction: column; gap: var(--space-5); }
/* The folded copy of the menu, for narrow screens only. */
.sidebar__fold { display: none; }
.sidebar__toggle { display: flex; align-items: center; min-height: 40px; padding: 0 var(--space-3); border: 1px solid var(--sidebar-muted); border-radius: var(--radius-small); color: var(--sidebar-strong); cursor: pointer; list-style: none; }
.sidebar__toggle::-webkit-details-marker { display: none; }
.sidebar__fold[open] > .sidebar__toggle { background: var(--sidebar-active); }
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--space-2); color: var(--sidebar-strong); font-weight: 600; font-size: 15px; }
.sidebar__brand:hover { color: var(--sidebar-strong); text-decoration: none; }
.sidebar__group { display: flex; flex-direction: column; gap: 2px; }
.sidebar__group--bottom { margin-top: auto; }
.sidebar__heading { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sidebar-muted); padding: 0 var(--space-3) var(--space-1); }
.sidebar__group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar a, .sidebar button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 0 var(--space-3);
    border-radius: var(--radius-small);
    background: transparent;
    color: var(--sidebar-ink);
    font-size: 14px;
    font-weight: 400;
    justify-content: flex-start;
}
.sidebar a:hover, .sidebar button:hover { background: var(--sidebar-active); color: var(--sidebar-strong); text-decoration: none; }
.sidebar a[aria-current=page] { background: var(--sidebar-active); color: var(--sidebar-strong); }
.sidebar form { margin: 0; }
.sidebar__empty { padding: 0 var(--space-3); color: var(--sidebar-muted); font-size: var(--text-small); }

.dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--dot-unknown); }
.dot--ok { background: var(--dot-ok); }
.dot--down { background: var(--dot-down); }

.content { flex: 1 1 auto; min-width: 0; padding: var(--space-6) var(--gutter) 48px; }
.content > * { max-width: 1120px; }
.flashes { margin-bottom: var(--space-4); }

.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-5); padding: 40px 16px; background: var(--sidebar-bg); }
.auth__brand { display: flex; align-items: center; gap: var(--space-3); color: var(--sidebar-strong); font-weight: 600; font-size: 22px; }
.auth__card { width: 100%; max-width: 400px; background: var(--surface); color: var(--ink); border-radius: 12px; padding: 28px; }
.auth__card input:not([type=hidden]) { max-width: none; }
.auth__card button { width: 100%; margin-right: 0; }

/* Components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-4); }
/* The padding is the card's space: its first title adds none above it. */
.card > :first-child { margin-top: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--space-4) var(--space-5); margin: var(--space-4) 0; min-width: 0; }
legend { padding: 0 var(--space-2); font-weight: 600; }
.refusal::first-letter { text-transform: uppercase; }
.pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    padding: 3px 9px;
    border-radius: 99px;
    white-space: nowrap;
    background: var(--neutral-bg);
    color: var(--neutral-ink);
}
.pill--ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill--warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill--down { background: var(--down-bg); color: var(--down-ink); }
.pill--neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
.pill--info { background: var(--info-bg); color: var(--info-ink); }

.tabs { display: flex; flex-wrap: wrap; gap: var(--space-5); border-bottom: 1px solid var(--line); margin-bottom: var(--space-5); }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--accent); }

.breadcrumb { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; font-size: var(--text-small); color: var(--muted); }
.breadcrumb li + li::before { content: '/'; margin-right: var(--space-2); }

.table-scroll { position: relative; overflow-x: auto; margin-bottom: var(--space-4); }
.table-scroll table { margin-bottom: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Home page (S20): the cards to decide, the costs and the activity. */
.decisions { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.decision { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: 0; }
.decision p { margin: 0; flex: 1; }
.decision .button { align-self: flex-start; }
.decision__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.home-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-4); }
.home-columns .card { margin-bottom: 0; min-width: 0; }
.spend, .activity { list-style: none; padding: 0; }
.spend li { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-3); }
.spend meter { grid-column: 1 / -1; width: 100%; height: 8px; }
.activity li { padding: var(--space-2) 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.activity li:last-child { border-bottom: 0; }
.activity .mono { display: block; font-size: var(--text-small); }

/* Project pages (S21): the shared header, the environment cards, sensitive actions. */
.project-header { margin-bottom: var(--space-5); }
.project-header__name { font-size: 1.5rem; font-weight: 600; margin: 0; }
.project-header .tabs { margin-top: var(--space-3); margin-bottom: 0; }
.subtabs { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-4); }
.subtabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--space-3); border-radius: var(--radius); color: var(--muted); }
.subtabs a[aria-current=page] { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.environments { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.environment { margin-bottom: 0; min-width: 0; }
.environment__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.environment__head h2 { margin: 0; }
.environment__since { color: var(--down-ink); background: var(--down-bg); border-radius: var(--radius); padding: var(--space-2) var(--space-3); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-4); margin: var(--space-3) 0; }
.facts dt { color: var(--muted); font-size: var(--text-small); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.environment__actions { display: flex; flex-direction: column; gap: var(--space-2); }
.sensitive { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.sensitive button { margin-right: 0; }
.sensitive__note { font-size: var(--text-small); }
.tree { list-style: none; padding: 0; columns: 2 220px; }

/* Idea to code (S22): page with a side column, the conversation, the spec, the run, the pull request. */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-5); align-items: start; }
.with-aside__side { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.with-aside__side.card, .with-aside__side .card { margin-bottom: 0; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose pre { overflow-x: auto; }
.thread { display: flex; flex-direction: column; gap: var(--space-4); }
.thread__messages { display: flex; flex-direction: column; gap: var(--space-3); }
.bubble { max-width: min(42rem, 88%); padding: var(--space-3) var(--space-4); border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow-wrap: anywhere; }
.bubble--user { align-self: flex-end; background: var(--info-bg); color: var(--info-ink); border-color: transparent; }
.bubble--assistant { align-self: flex-start; }
.bubble__who { font-size: var(--text-small); font-weight: 600; color: inherit; opacity: 0.8; margin: 0 0 var(--space-1); }
.sources { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-2) 0 0; font-size: var(--text-small); }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--space-2); border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
/* Model calls proposed by the orchestrator (S48): a card under the answer, the model's answer in it. */
.proposals { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-3); }
.proposals:empty { display: none; }
.proposal { margin-bottom: 0; overflow-wrap: anywhere; }
.proposal__title { font-size: 1rem; margin: 0 0 var(--space-2); }
.proposal__facts { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-2); }
.proposal__form { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.proposal__form textarea { width: 100%; max-width: none; }
.proposal__attachments { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin: 0; min-width: 0; }
.bubble--model { max-width: 100%; margin-top: var(--space-3); background: var(--bg); }
.proposal__image { margin-inline: 0; }
.proposal__image img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); }
.thread__compose { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--space-4); align-items: start; }
.thread__compose .card { margin-bottom: 0; }
.thread__compose textarea { width: 100%; max-width: none; }
.criteria, .tasks, .comments, .checks, .questions, .versions { list-style: none; padding: 0; }
.criteria { display: flex; flex-direction: column; gap: var(--space-3); }
.criterion { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); margin-bottom: 0; }
.criterion__id { font-weight: 600; color: var(--accent); }
.criterion__parts { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-3); margin: 0; }
.criterion__parts dt { color: var(--muted); font-weight: 600; }
.criterion__parts dd { margin: 0; }
.tasks { display: flex; flex-direction: column; gap: var(--space-3); }
.task { margin-bottom: 0; }
.task__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); align-items: center; }
.task__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin: 0; }
.questions li, .versions li { padding: var(--space-1) 0; }
.run-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); margin: 0 0 var(--space-4); }
.run-summary dt { color: var(--muted); font-size: var(--text-small); }
.run-summary dd { margin: 0; font-weight: 600; }
.tests { white-space: pre-wrap; }
.run-plan__steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.run-plan__step { display: flex; gap: var(--space-2); align-items: baseline; }
.run-plan__step[data-status="done"] span:last-child { color: var(--muted); text-decoration: line-through; }
.run-plan__step[data-status="doing"] span:last-child { font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline__step { position: relative; padding: 0 0 var(--space-4) var(--space-5); }
.timeline__dot { position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok-ink); border: 2px solid var(--surface); }
.timeline__step--failed .timeline__dot { background: var(--down-ink); }
.timeline__step--failed .timeline__what { color: var(--down-ink); font-weight: 600; }
.timeline__step--within { margin-left: 1.5rem; }
.timeline__step--within .timeline__what { font-size: .9em; }
.timeline__what, .timeline__meta { margin: 0; overflow-wrap: anywhere; }
.timeline__meta { font-size: var(--text-small); }
.checks li { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-1) 0; }
.comments { display: flex; flex-direction: column; gap: var(--space-3); }
.comment { margin-bottom: 0; }
.comment__meta { font-size: var(--text-small); margin: 0 0 var(--space-2); }
.comment__body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.choice { display: block; padding: var(--space-1) 0; }
/* Logs and status (S26, S71): the lines as plain text, the hosts. */
.log-lines { max-height: 30rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: .85em; }
.log-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-4); }
.log-filters label { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.log-filters input { max-width: 100%; }
.log-lines { list-style: none; padding: var(--space-3); margin: 0 0 var(--space-4); font-family: var(--mono); font-size: var(--text-small); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.log-lines li { padding: var(--space-1) 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.log-lines li:last-child { border-bottom: 0; }
.log-lines time { color: var(--muted); margin-right: var(--space-2); }
.log-lines__message { white-space: pre-wrap; }
.hosts { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.host { margin-bottom: 0; min-width: 0; }
.host h3 { margin: 0; overflow-wrap: anywhere; }
.incidents { list-style: none; padding: 0; margin: 0 0 var(--space-5); }
.incident { padding: var(--space-2) 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.incident:last-child { border-bottom: 0; }
.incident__head { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; }
.incident p { margin: var(--space-1) 0 0; font-size: var(--text-small); }

@media (max-width: 960px) {
    .with-aside, .thread__compose { grid-template-columns: minmax(0, 1fr); }
}

/* Sign-in, security and settings (S23). */
.auth__card h1 { margin-bottom: var(--space-1); }
.auth__step { margin-top: 0; font-size: var(--text-small); }
.auth__form { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.auth__form button { margin-top: var(--space-3); }
.auth__backup { margin: 0 0 var(--space-4); }
.auth__backup summary { cursor: pointer; color: var(--accent); min-height: 40px; display: flex; align-items: center; }
.backup-codes { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-2); }
.backup-codes code { font-size: 1rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.inline-form label { margin: 0; }
.spend-cell { min-width: 140px; }
.spend-cell meter { display: block; width: 100%; height: 8px; margin-top: var(--space-1); }

/* Narrow screens: the menu goes above the content, wide tables scroll in their own frame. */
@media (max-width: 720px) {
    .layout { flex-direction: column; }
    .sidebar { flex: none; gap: var(--space-4); padding: var(--space-4); }
    .sidebar__group--bottom { margin-top: 0; }
    .content { padding-top: var(--space-5); }
    table { display: block; overflow-x: auto; }
    .sidebar__menu { display: none; }
    .sidebar__fold { display: block; }
    .sidebar__fold[open] { display: flex; flex-direction: column; gap: var(--space-5); }
    /* « Menu » sits at the right of the brand; the links open below. */
    .sidebar__fold > .sidebar__toggle { position: absolute; top: var(--space-3); right: var(--space-4); }
    /* The project's tabs stay on one line and scroll inside themselves. */
    .tabs { flex-wrap: nowrap; overflow-x: auto; gap: var(--space-4); scrollbar-width: thin; }
    .tabs a { flex: none; }
}

/* The terminal of a workspace (S32): xterm draws in the screen, which sets its size. */
.terminal { margin-bottom: var(--space-4); }
.terminal__screen { height: 60vh; min-height: 18rem; padding: var(--space-2); background: #000; border-radius: var(--radius); overflow: hidden; }
