:root {
  --ink: #1b1f23;
  --muted: #5b6570;
  --line: #d8dee4;
  --bg: #ffffff;
  --panel: #f6f8fa;
  --accent: #10508a;
  --error: #8a1c10;
  --notice: #0a5c2e;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 62rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 .5rem; }
section { margin-bottom: 2rem; }
a { color: var(--accent); }
small, .muted { color: var(--muted); }

.shell {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand { font-weight: 600; text-decoration: none; color: var(--ink); }
nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.badge {
  background: var(--accent); color: #fff; border-radius: 1rem;
  padding: 0 .45rem; font-size: .8rem;
}
/* ADM-09. A lockout is a refusal in progress, so it reads as the error colour
   rather than the accent one — an administrator scanning the list is looking
   for the row that is stuck, not for a decoration. */
.badge.locked { background: var(--error); }
footer {
  max-width: 62rem; margin: 0 auto; padding: 1rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem;
}

/* Author-origin, so it beats the rules below. The UA stylesheet's own
   `[hidden] { display: none }` does not: origin outranks specificity, so any
   author `display` on the element — `label` immediately below, for one — wins
   and renders an element the markup asked to hide. */
[hidden] { display: none; }

.stack { display: flex; flex-direction: column; gap: .85rem; max-width: 34rem; }
/* Wide enough for a sentence on one line. A column of fields reads better
   narrow, but a single-line acknowledgement wrapped at 34rem puts its text
   under its own checkbox. */
.stack.wide { max-width: 44rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-weight: 500; }
/* A checkbox belongs beside its text, not above it — the opposite of what
   every other control in a form wants, hence the modifier rather than a
   change to the rule above. `flex-start` keeps the box on the text's first
   line once the text does wrap, on a narrow screen. */
label.check { flex-direction: row; align-items: flex-start; gap: .5rem; font-weight: 400; }
label.check input { flex: none; margin-top: .25rem; padding: 0; }
input, select, textarea {
  font: inherit; padding: .5rem; border: 1px solid var(--line); border-radius: 4px;
  background: #fff; color: var(--ink);
}
button {
  font: inherit; font-weight: 500; padding: .55rem 1rem; border: 0;
  border-radius: 4px; background: var(--accent); color: #fff; cursor: pointer;
  align-self: flex-start;
}
button.danger { background: var(--error); }
button.link {
  background: none; color: var(--accent); padding: 0; text-decoration: underline;
}
/* `button.link` and `button.danger` have equal specificity, so the later of
   the two would otherwise decide the colour and a destructive link would read
   as an ordinary one. */
button.link.danger { color: var(--error); }
/* A disabled control has to look disabled. `DS-13` gates Start on the
   acknowledgement, and a button that refuses to respond while looking
   ordinary reads as a broken page rather than an unmet condition. */
button:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
button.link:disabled { background: none; }
form.inline { display: inline; }
/* Controls that belong side by side: Start next to the way out of the same
   screen. */
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

.alert { padding: .7rem .9rem; border-radius: 4px; border-left: 4px solid; }
.alert.error { background: #fdf2f1; border-color: var(--error); color: var(--error); }
.alert.notice { background: #f1f8f3; border-color: var(--notice); color: var(--notice); }
.disclosure {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  padding: .7rem .9rem; font-size: .92rem; color: var(--muted);
}

table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
th { font-weight: 600; background: var(--panel); }
tr.exhausted td { color: var(--error); }

/* UI-05 stage 3: dataset columns become table columns, controls pinned in the
   header so they stay visible while reading values (ui.md). */
.preview-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); }
.preview { font-variant-numeric: tabular-nums; }
.preview thead th {
  position: sticky; top: 0; z-index: 2; background: var(--panel);
  vertical-align: top; min-width: 9rem;
}
.preview thead th .name {
  display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85rem; word-break: break-all;
}
.preview thead th select { width: 100%; font-size: .8rem; padding: .2rem; }
.preview thead th .evidence { display: block; font-weight: 400; font-size: .75rem; color: var(--muted); }
.preview tbody td { white-space: nowrap; }
.preview tbody th {
  position: sticky; left: 0; background: var(--bg); font-weight: 400;
  font-size: .85rem; white-space: nowrap;
}

.notifications { list-style: none; padding: 0; }
.notifications li { border-bottom: 1px solid var(--line); padding: .6rem 0; }
.notifications li.unread { border-left: 3px solid var(--accent); padding-left: .6rem; }
.notifications time { color: var(--muted); font-size: .85rem; }
.crumbs { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }

.actions { white-space: nowrap; }
.actions form { display: inline-flex; gap: .25rem; align-items: center; margin-right: .5rem; }
.actions input[type="text"] { width: 10rem; padding: .25rem; font-size: .85rem; }
.actions button { padding: .25rem .6rem; font-size: .85rem; }
.danger-text { color: var(--error); }
small.warn { color: var(--error); }
.request { border: 1px solid var(--line); border-radius: 4px; padding: 1rem; margin-bottom: 1rem; }
.request blockquote { margin: .5rem 0; padding-left: .8rem; border-left: 3px solid var(--line); color: var(--muted); }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input { flex: 1 1 12rem; }

/* Rendered tutorial Markdown (DOC-03). */
.prose { max-width: 44rem; }
.prose h1 { margin-top: 0; }
.prose h2 { border-bottom: 1px solid var(--line); padding-bottom: .2rem; }
.prose code {
  background: var(--panel); padding: .1rem .3rem; border-radius: 3px;
  font-size: .9em;
}
.prose pre {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  padding: .8rem; overflow-x: auto;
}
.prose pre code { background: none; padding: 0; }
.prose blockquote {
  margin: 1rem 0; padding-left: .9rem; border-left: 3px solid var(--accent);
  color: var(--muted);
}
.prose table { margin: 1rem 0; }
.prose li { margin: .25rem 0; }
.contents { line-height: 1.9; }
.pager {
  margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line);
  display: flex; gap: 1rem; flex-wrap: wrap; font-size: .95rem;
}

/* UI-05 stage 2 — the gap timeline (D-133). Colour is set here rather than in
   the script so the chart follows the palette, and so a theme change never
   means editing JavaScript. */
.gap-timeline { margin: 1rem 0 0; }
.gap-timeline svg {
  width: 100%; height: 34px; display: block;
  border: 1px solid var(--line); border-radius: 3px;
}
.gap-timeline-base { fill: var(--panel); }
/* The same colour the refusal and error states use: a gap is missing data, and
   a second red would suggest a second kind of severity. */
.gap-timeline-span { fill: var(--error); }
.gap-timeline-axis {
  display: flex; justify-content: space-between;
  margin: .25rem 0 0; font-size: .8rem; color: var(--muted);
}
.gap-timeline figcaption { font-size: .85rem; color: var(--muted); }
