/* The console's one stylesheet (ADR 0280, ADR 0288): our own file, so the CSP
   needs no 'unsafe-inline'; the typefaces are our own files too. */
/* tokens: begin -- ADR 0288. This block is byte-equal in site/static/site.css
   and services/console/public/app.css (test_look); edit both or neither. The
   values are the design brief's (docs/design/session-45/design-brief.md). */
:root {
  color-scheme: light;
  --ground: #F4F6F5;
  --surface: #FFFFFF;
  --surface-sunk: #F8FAF9;
  --surface-hover: #E8EDEB;
  --ink: #142027;
  --ink-body: #26333B;
  --text-2: #3D4A52;
  --text-3: #55626B;
  --rule: #D3DBD8;
  --rule-soft: #E1E7E5;
  --border-control: #C3CDCA;
  --accent: #0B6B4F;
  --accent-hover: #084E3A;
  --accent-tint: #DCEFE6;
  --accent-wash: #F1F8F4;
  --focus: #1F4FA3;
  --on-ink-text: #E6ECEA;
  --on-ink-muted: #9FB0AB;
  --on-ink-rule: #2A3A43;
  --on-ink-action: #6FCF9F;
  --on-ink-action-text: #0B2A1F;
  --on-ink-comment: #8FA59E;
  --on-ink-border: #3A4B54;
  --chip-beta-text: #0B6B4F;
  --chip-beta-bg: #DCEFE6;
  --chip-beta-bar: #0B6B4F;
  --chip-verify-text: #1F4FA3;
  --chip-verify-bg: #E1E9F7;
  --chip-verify-bar: #1F4FA3;
  --chip-planned-text: #7A4F00;
  --chip-planned-bg: #F6EBD3;
  --chip-planned-bar: #E3B65A;
  --chip-absent-text: #3F4A51;
  --chip-absent-bg: #E6EAEC;
  --chip-absent-bar: #AEB8BE;
  --chip-unmetered-text: #FFFFFF;
  --chip-unmetered-bg: #5D6A72;
  --chip-unmetered-bar: #5D6A72;
  --window-stripe-a: #CFE7DB;
  --window-stripe-b: #DCEFE6;
  --window-border: #A9D2BF;
  --warning-bg: #F6EBD3;
  --warning-text: #3B2A00;
  --once-border: #E3B65A;
  --destructive-border: #7A4F00;
  --font-text: "Schibsted Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius-chip: 4px;
  --radius-control: 8px;
  --radius-panel: 12px;
  --radius-large: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 56px;
  --space-11: 64px;
  --space-12: 88px;
  --space-13: 96px;
}
/* tokens: end */
/* Session 47 (ADR 0295, the design brief's §5): light only, the console's own
   values outside the shared block -- the navigation's width and, since Run 9b
   (D3088), the three colours of a destructive action (test_look's
   CONSOLE_TEXT_PAIRS holds their contrast). */
:root { --nav-width: 248px; --danger-text: #8A2B16; --danger-bg: #FBE9E4; --danger-border: #B5482F; }
@font-face {
  font-family: "Schibsted Grotesk";
  src: url(/console/fonts/schibsted-grotesk.woff2) format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url(/console/fonts/jetbrains-mono.woff2) format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--ground); }
body { margin: 0; color: var(--ink); font: 400 15px/1.55 var(--font-text); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
code, pre { font-family: var(--font-mono); }
code { font-size: 0.9em; }
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 var(--space-3); }
h2 small { color: var(--text-3); font-weight: 400; font-size: 13px; }
p { margin: 0 0 var(--space-3); }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The top bar: the mark, Help, Notifications, the account menu. */
header.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--space-4); min-height: 56px; padding: var(--space-2) var(--space-4); background: var(--surface); border-bottom: 1px solid var(--rule); }
header.top .brand { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
header.top .grow { flex: 1; }
.top-links { display: flex; align-items: center; gap: var(--space-2); }
.top-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 10px; border-radius: var(--radius-control); color: var(--ink-body); text-decoration: none; font-weight: 500; }
.top-link:hover { background: var(--surface-hover); color: var(--ink); }
.account { position: relative; }
.account > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); font-weight: 700; font-size: 13px; }
.account > summary::-webkit-details-marker, .switch summary::-webkit-details-marker, .side > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; min-width: 220px; padding: var(--space-2); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); box-shadow: 0 8px 24px rgba(20, 32, 39, 0.12); }
.menu a, .menu span, .menu button { display: block; width: 100%; margin: 0; padding: 8px 10px; border-radius: 6px; color: var(--ink-body); text-decoration: none; text-align: left; }
.menu span { color: var(--text-3); font-size: 13px; }
.menu span strong { color: var(--ink); }
.menu a:hover, .menu button:hover { background: var(--surface-hover); }
.menu a[aria-current] { font-weight: 600; color: var(--accent); }
.menu button { min-height: 0; font: 500 15px/1.4 var(--font-text); background: none; border: 0; cursor: pointer; }
.menu .scope { display: inline; padding: 0; margin-left: 6px; font-size: 12px; }

/* The shell: the navigation beside the page. */
.shell { display: grid; grid-template-columns: var(--nav-width) minmax(0, 1fr); min-height: calc(100vh - 120px); }
.shell.bare { grid-template-columns: minmax(0, 1fr); }
.shell.bare .side-slot { display: none; }
.side-slot { min-width: 0; border-right: 1px solid var(--rule); background: var(--surface-sunk); }
.side > summary { display: none; }
.side-inner { position: sticky; top: 64px; display: grid; gap: var(--space-5); padding: var(--space-5) var(--space-4); }
.switch { display: grid; gap: 2px; }
.switch-label, .nav-title { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.switch details { position: relative; }
.switch summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 40px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border-control); border-radius: var(--radius-control); font-weight: 600; overflow-wrap: anywhere; }
.switch summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg) translateY(-2px); flex: none; }
.switch .menu { left: 0; right: auto; width: 100%; min-width: 0; }
.nav-group { display: grid; gap: 2px; }
.nav-group a { display: flex; align-items: center; min-height: 34px; padding: 6px 10px; border-radius: 6px; color: var(--ink-body); text-decoration: none; font-weight: 500; }
.nav-group a:hover { background: var(--surface-hover); color: var(--ink); }
.nav-group a[aria-current="page"] { background: var(--accent-tint); color: var(--accent); font-weight: 600; }

/* The page template: breadcrumb, title, purpose, help, the primary action. */
main { min-width: 0; padding: var(--space-6) var(--space-4) var(--space-11); }
.content { max-width: 960px; margin: 0 auto; display: grid; gap: var(--space-5); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--text-3); font-size: 13px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--rule); }
.crumbs a { color: var(--text-3); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3) var(--space-6); }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 62ch; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.head-actions > a:not(.help-link) { display: inline-flex; align-items: center; min-height: 40px; padding: 9px 16px; color: var(--surface); background: var(--accent); border-radius: var(--radius-control); font-weight: 600; text-decoration: none; }
.head-actions > a:not(.help-link):hover { background: var(--accent-hover); color: var(--surface); }
.help-link { font-size: 14px; font-weight: 500; }
.page-body { display: grid; gap: var(--space-5); min-width: 0; }
.stack { display: grid; gap: var(--space-4); min-width: 0; }
.stack:empty { display: none; }

/* Surfaces. */
.card { min-width: 0; padding: var(--space-5); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.card > :last-child { margin-bottom: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-3); }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.sub { display: block; }
.facts { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-7); margin: 0; }
.facts dt { color: var(--text-3); font-size: 13px; }
.facts dd { margin: 0; font-weight: 600; }
.empty { padding: var(--space-6); text-align: center; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border-control); border-radius: var(--radius-panel); }
.card .empty { border: 0; padding: var(--space-4); }
.empty p { margin: 0 0 var(--space-3); }
.empty > :last-child { margin-bottom: 0; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); background: var(--accent-wash); border: 1px solid var(--accent-tint); border-radius: var(--radius-control); }
.banner p { margin: 0; }
.callout { padding: var(--space-4); border-radius: var(--radius-control); background: var(--surface-sunk); border: 1px solid var(--rule); }
.callout.warn { background: var(--warning-bg); border-color: var(--once-border); color: var(--warning-text); }
.callout h3 { margin: 0 0 6px; font-size: 15px; color: inherit; }

/* Controls. */
label { display: block; margin: var(--space-3) 0; font-size: 14px; font-weight: 600; }
label .hint { display: block; font-size: 13px; font-weight: 400; color: var(--text-3); }
input, select, textarea { font: 400 15px/1.4 var(--font-text); color: var(--ink); background: var(--surface); border: 1px solid var(--border-control); border-radius: var(--radius-control); }
input { display: block; width: 100%; max-width: 28rem; margin-top: var(--space-1); padding: 10px 12px; }
input[disabled] { background: var(--surface-sunk); color: var(--text-3); }
select { max-width: 100%; padding: 9px 12px; }
label select { display: block; margin-top: var(--space-1); }
textarea { font: 400 14px/1.6 var(--font-mono); resize: vertical; }
button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); margin: var(--space-2) var(--space-2) var(--space-2) 0; padding: 9px 16px; min-height: 40px; font: 600 15px/1.2 var(--font-text); color: var(--surface); background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-control); cursor: pointer; }
button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button[disabled] { cursor: not-allowed; color: var(--text-3); background: var(--surface-hover); border-color: var(--rule); }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.row-actions { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); }
.row-actions button { min-height: 32px; margin: 0; padding: 5px 10px; font-size: 13px; color: var(--ink); background: var(--surface); border-color: var(--border-control); }
.row-actions button:hover { background: var(--surface-hover); }
fieldset { border: 1px solid var(--border-control); border-radius: var(--radius-control); margin: var(--space-3) 0; }
label.inline { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; margin: var(--space-1) var(--space-4) var(--space-1) 0; font-weight: 500; }
label.inline input { display: inline; width: auto; margin: 0; }

/* Chips: the state word, its colour by class (ADR 0288). */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--radius-chip); font-size: 12px; font-weight: 600; line-height: 1.4; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state-ready { color: var(--chip-beta-text); background: var(--chip-beta-bg); }
.state-busy { color: var(--chip-verify-text); background: var(--chip-verify-bg); }
.state-asleep { color: var(--chip-planned-text); background: var(--chip-planned-bg); }
.state-gone { color: var(--chip-absent-text); background: var(--chip-absent-bg); }
.state-unknown { color: var(--chip-unmetered-text); background: var(--chip-unmetered-bg); }

/* Tables: only the table scrolls, in its own box. */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
th { color: var(--text-3); font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; background: var(--surface-sunk); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td code { word-break: break-all; }

/* Refusals: what is true, what to do, the API's word in small type. */
.refusal { color: var(--warning-text); }
p.refusal { padding: var(--space-3) var(--space-4); background: var(--warning-bg); border-radius: var(--radius-control); }
.refusal .word { display: block; margin-top: 4px; font-size: 12px; color: var(--warning-text); }
.refusal a { color: var(--warning-text); font-weight: 600; }

/* Shown once, code blocks and copy. */
.once { display: grid; gap: var(--space-3); padding: var(--space-5); background: var(--surface); border: 2px solid var(--once-border); border-radius: var(--radius-panel); }
.once p { margin: 0; color: var(--ink-body); }
.once p strong { display: block; }
code.secret { word-break: break-all; padding: 2px 6px; background: var(--surface); border: 1px solid var(--border-control); border-radius: var(--radius-chip); }
.code { min-width: 0; background: var(--ink); color: var(--on-ink-text); border-radius: var(--radius-control); }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--on-ink-rule); color: var(--on-ink-muted); font-size: 12px; }
.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.code code.secret { padding: 0; color: inherit; background: none; border: 0; word-break: break-all; white-space: pre-wrap; }
button.copy { min-height: 28px; margin: 0; padding: 3px 10px; gap: 6px; font: 600 12px/1 var(--font-text); color: var(--on-ink-text); background: transparent; border: 1px solid var(--on-ink-border); border-radius: 6px; }
button.copy:hover { background: transparent; border-color: var(--on-ink-muted); }
button.copy.copied { color: var(--on-ink-action-text); background: var(--on-ink-action); border-color: var(--on-ink-action); }
.inline-copy { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; max-width: 100%; }
.inline-copy code { padding: 4px 8px; background: var(--surface-sunk); border: 1px solid var(--rule); border-radius: var(--radius-chip); word-break: break-all; }
.inline-copy button.copy { color: var(--ink); border-color: var(--border-control); }
.inline-copy button.copy:hover { background: var(--surface-hover); }
.inline-copy button.copy.copied { color: var(--surface); background: var(--accent); border-color: var(--accent); }

/* The tracker: named steps, done / current / to come, no percentage. */
.meta-row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); color: var(--text-2); font-size: 14px; }
.meta-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.steps li:last-child { border-bottom: 0; }
.steps .time { font-variant-numeric: tabular-nums; color: var(--text-3); font-size: 13px; white-space: nowrap; }
.steps li.current strong { color: var(--chip-verify-text); }
.steps li.todo strong { color: var(--text-3); font-weight: 500; }
.steps li.stopped strong { color: var(--warning-text); }
.mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-control); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.done .mark { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.current .mark { border-color: var(--chip-verify-text); background: var(--chip-verify-bg); }
.current .mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--chip-verify-text); }
.stopped .mark { border-color: var(--once-border); background: var(--warning-bg); }
.indeterminate { position: relative; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--chip-verify-bg); overflow: hidden; }
.indeterminate::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: 3px; background: var(--chip-verify-text); animation: slide 1.8s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.steps .time { white-space: normal; text-align: right; max-width: 14rem; }
.meta-row b time { font-variant-numeric: normal; }
@media (max-width: 600px) {
  .steps li { grid-template-columns: 28px minmax(0, 1fr); row-gap: 2px; }
  .steps .time { grid-column: 2; text-align: left; max-width: none; }
}

/* Session 47 Run 5: the checklist, the token panel, the refusal before a form,
   the feed and the kinds of notification. */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; }
.checklist li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.checklist li:last-child { border-bottom: 0; }
.checklist .sub { color: var(--text-3); font-size: 13px; overflow-wrap: anywhere; }
.checklist li.unread .mark { border-style: dashed; }
.checklist > li > a { font-size: 14px; }
.token-panel { display: grid; gap: var(--space-3); padding: var(--space-5); background: var(--warning-bg); border: 2px solid var(--once-border); border-radius: var(--radius-panel); }
.token-panel h2 { margin: 0; font-size: 18px; }
.token-panel > p { margin: 0; }
.token-panel .once { padding: var(--space-4); }
.token-panel summary { cursor: pointer; font-weight: 600; padding: var(--space-1) 0; }
.token-panel details p { margin: var(--space-2) 0; }
.once-done { margin: 0; padding: var(--space-3) var(--space-4); background: var(--surface-sunk); border: 1px solid var(--rule); border-radius: var(--radius-control); color: var(--text-2); }
.callout .card-actions { margin: var(--space-3) 0 var(--space-2); }
.callout .word { font-size: 12px; color: inherit; background: none; border: 0; padding: 0; }
.callout p { margin: 0 0 var(--space-2); }
select[disabled] { background: var(--surface-sunk); color: var(--text-3); }
.field label { margin-bottom: var(--space-1); }
.field .hint { margin: 0 0 var(--space-3); max-width: 28rem; font-size: 13px; color: var(--text-3); }
.head-actions > button { margin: 0; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-4); padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--text-3); font-size: 13px; white-space: nowrap; }
.kinds { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-4); margin: 0; }
.kinds dt { font-weight: 600; }
.kinds dd { margin: 0; color: var(--text-2); }
time[title] { text-decoration: underline dotted var(--rule); text-underline-offset: 3px; }

/* Skeleton, toast. */
.skeleton { display: grid; gap: var(--space-4); max-width: 960px; margin: 0 auto; }
.sk { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-hover) 0%, var(--surface-sunk) 50%, var(--surface-hover) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk.h { height: 28px; width: 40%; }
.sk.w60 { width: 60%; }
.sk.block { height: 120px; border-radius: var(--radius-panel); }
@keyframes shimmer { to { background-position: -200% 0; } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 20; display: grid; gap: var(--space-2); }
.toast { padding: 10px 14px; background: var(--ink); color: var(--on-ink-text); border-radius: var(--radius-control); box-shadow: 0 8px 24px rgba(20, 32, 39, 0.2); font-size: 14px; }

/* Tabs. */
.tablist { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--rule); }
.tablist button { min-height: 36px; margin: 0; padding: 6px 12px; font: 500 14px/1.2 var(--font-text); color: var(--text-2); background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
.tablist button:hover { background: var(--surface-hover); }
.tablist button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Sign-in, enrolment, the invitation: one narrow panel. */
.panel-narrow { max-width: 420px; margin: var(--space-6) auto; padding: var(--space-7); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.panel-narrow h1 { margin-bottom: var(--space-4); }
.qr { display: block; width: 12rem; height: 12rem; margin: var(--space-4) 0; image-rendering: pixelated; }
.panel-narrow .qr { box-sizing: content-box; padding: 16px; background: var(--surface); }

/* Connect (the brief's screen 6): three numbered steps, the doors as two radio cards. */
.steps-num { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6); }
.steps-num > li { counter-increment: step; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--space-3); }
.steps-num > li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--surface); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.steps-num > li > div { display: grid; gap: var(--space-3); min-width: 0; }
.steps-num h2 { margin: 2px 0 0; font-size: 16px; }
.steps-num p { margin: 0; }
.segment { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--space-3); }
.segment label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; gap: 4px var(--space-3); margin: 0; padding: var(--space-4); font-weight: 400; background: var(--surface); border: 1px solid var(--border-control); border-radius: var(--radius-control); cursor: pointer; }
.segment label:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.segment input { grid-row: span 3; width: 18px; height: 18px; margin: 2px 0 0; padding: 0; accent-color: var(--accent); }
.segment .title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-weight: 700; }
.segment .desc { color: var(--text-2); font-size: 14px; }
.held { display: grid; gap: var(--space-3); padding: var(--space-4); border: 2px solid var(--once-border); border-radius: var(--radius-panel); }
.held > p, .once h3 { margin: 0; }
.where { display: grid; gap: 2px; margin: var(--space-2) 0 0; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.tabs, .tabs [role="tabpanel"], .held > * { min-width: 0; }
.code-head > span { min-width: 0; overflow-wrap: anywhere; }
.code-head > button.copy { flex: none; }
.tabs [role="tabpanel"] { padding-top: var(--space-3); }
.stack > button, .once > button, .steps-num > li > div > button { justify-self: start; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--space-5); }
.parts { display: grid; gap: var(--space-3); margin: 0 0 var(--space-3); }
.parts > div { display: grid; grid-template-columns: minmax(0, 8rem) minmax(0, 1fr); gap: var(--space-1) var(--space-4); align-items: start; }
.parts dt { font-weight: 600; }
.parts dt .sub { font-weight: 400; font-size: 12px; color: var(--text-3); }
.parts dd { margin: 0; min-width: 0; }
@media (max-width: 600px) { .parts > div { grid-template-columns: minmax(0, 1fr); } }

/* The SQL editor (ADR 0285, the brief's screen 7): the state bar at the top. */
.statebar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius-control); }
.statebar.off { border-color: var(--rule); }
.statebar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.statebar.off .dot { background: var(--chip-absent-bar); }
.statebar dl { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; font-size: 13px; min-width: 0; }
.statebar dl div { display: flex; gap: 4px; min-width: 0; }
.statebar dt { color: var(--text-3); }
.statebar dd { margin: 0; font-family: var(--font-mono); overflow-wrap: anywhere; }
.statebar .grow { flex: 1; }
.statebar .status { flex-basis: 100%; margin: 0; color: var(--text-2); font-size: 14px; }
.statebar button, .run-row button { margin: 0; }
button.secondary { color: var(--ink); background: var(--surface); border-color: var(--border-control); }
button.secondary:hover { background: var(--surface-hover); border-color: var(--border-control); }
button.secondary[disabled] { color: var(--text-3); background: var(--surface-sunk); }
#main textarea { display: block; width: 100%; padding: 12px; }
.run-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.run-row p { margin: 0; flex: 1 1 16rem; }
section.result { display: grid; gap: var(--space-2); min-width: 0; }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); font-size: 13px; color: var(--text-3); }
.result-meta strong { color: var(--ink); }
.result-meta button.copy { color: var(--ink); border-color: var(--border-control); }
.result-meta button.copy:hover { background: var(--surface-hover); }
.result-meta button.copy.copied { color: var(--surface); background: var(--accent); border-color: var(--accent); }
.results { max-height: 360px; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius-control); }
.results table { font-family: var(--font-mono); font-size: 13px; }
.results th { position: sticky; top: 0; z-index: 1; }

/* Session 47 Run 9b (D3088, the brief's §4 and screen 9): a destructive
   action in its own card, confirmed in a modal dialog. */
.card.danger-zone { border-color: var(--danger-border); }
.card.danger-zone > h2 { color: var(--danger-text); }
button.danger { color: var(--surface); background: var(--danger-border); border-color: var(--danger-border); }
button.danger:hover { color: var(--surface); background: var(--danger-text); border-color: var(--danger-text); }
button.danger[disabled] { color: var(--text-3); background: var(--surface-hover); border-color: var(--rule); }
.row-actions button.danger-quiet { color: var(--danger-text); background: var(--surface); border-color: var(--danger-border); }
.row-actions button.danger-quiet:hover { color: var(--danger-text); background: var(--danger-bg); }
dialog.dialog { width: min(480px, calc(100vw - 32px)); padding: var(--space-6); color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); box-shadow: 0 16px 48px rgba(20, 32, 39, 0.24); }
/* Centred: a card gives its last child no bottom margin, which a modal needs. */
dialog.dialog[open] { margin: auto; }
dialog.dialog::backdrop { background: rgba(20, 32, 39, 0.45); }
dialog.dialog h2 { margin: 0 0 var(--space-3); font-size: 18px; }
dialog.dialog input { max-width: none; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-5); }
.dialog-actions button { margin: 0; }
data[title] { text-decoration: underline dotted var(--rule); text-underline-offset: 3px; }
.card > .facts { margin: var(--space-4) 0; }

footer { padding: var(--space-5) var(--space-4); color: var(--text-3); font-size: 13px; border-top: 1px solid var(--rule); background: var(--surface); }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side-slot { border-right: 0; border-bottom: 1px solid var(--rule); }
  .side > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 8px 16px; cursor: pointer; list-style: none; font-weight: 600; }
  .side > summary .where-now { color: var(--text-3); font-weight: 500; font-size: 14px; }
  .side-inner { position: static; padding-top: 0; }
  .top-link .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .top-link:not(:first-child) { display: none; }
  h1 { font-size: 24px; }
  .panel-narrow { padding: var(--space-5); }
}
/* Session 47 Run 9 (the brief's §8): the ring on every control and on every
   element a script makes focusable (a tab panel); reduced motion stops the bar,
   the skeleton and the spinner -- `!important` and the pseudo-elements, since a
   class's animation outranks `*` and `*` does not match `::after`. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
