/* Governance dashboard styles (Phase 3a-5, story #1104). Dependency-free. */
/* The brand's fonts (planning-docs/2026-11-29-dashboard-brand-skin-design.md): Inter for text, Manrope for headings,
   self-hosted in ./fonts (latin, woff2; README and licences beside them). */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('./fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('./fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('./fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap; src: url('./fonts/manrope-latin-500-normal.woff2') format('woff2'); }
:root {
  /* The Critical Propulsion brand (planning-docs/2026-11-29-dashboard-brand-skin-design.md), from the website redesign's
     Figma export; the brand's names in brackets. Contrast figures are WCAG 2 ratios on --surface. */
  --bg: #001220;                    /* navy-900: the page */
  --surface: #051624;               /* navy-850: panels, tables, cards, dialogs */
  --surface-2: #152532;             /* navy-800: a row under the pointer, nested tables, controls */
  --border: #283742;                /* navy-600 */
  --border-strong: #f2f2f2;         /* offwhite: the rules around a table's header row */
  --border-hover: rgba(242, 242, 242, 0.4); /* offwhite-a40: a control's edge under the pointer */
  --text: #f2f2f2;                  /* offwhite: 16.4:1 */
  --muted: #8ba2b4;                 /* slate-400: 6.9:1, and 5.9:1 on --surface-2. The darker slate-500 is never text: 3.9:1 */
  --accent: #ff6701;                /* orange-500: actions only, 6.3:1 */
  --accent-active: #e05a00;         /* orange-600: the accent under the pointer */
  --on-accent: #00070c;             /* navy-950: text on the accent (6.9:1) and on every toast */
  --accent-secondary: #3b91e5;      /* blue-500: links, information, chart series; 5.6:1, and 4.7:1 on --surface-2 */
  --focus: #f2f2f2;                 /* offwhite: the focus ring */
  --ok: #4ade80;                    /* green-400 */
  --warn: #f5b956;                  /* cp-gold: orange means "action", so warnings take the company's earlier gold */
  --err: #e5484d;                   /* the brand has no red */
  --current: #4ade80;
  --stale: #f5b956;
  --dark: #8ba2b4;
  --walled: #7a5cff;                /* the brand has no purple */
  /* Lighter than --err: as chip text on its own tint it keeps a 4.5:1 contrast on both surfaces. */
  --invalid: #ff969b;
  --font-body: Inter, "Helvetica Neue", Arial, sans-serif;      /* the brand's body stack */
  --font-heading: Manrope, "Helvetica Neue", Arial, sans-serif; /* the brand's heading stack; Manrope ships at 500 only */
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 0.875rem/1.5 var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* Headings, the app title and a ring's name are Manrope, at the one weight shipped. A browser sets headings bold and
   controls in its own font; these two rules undo both. */
h2, h3, h4, h5, .title { font-family: var(--font-heading); font-weight: 500; }
button, input, select, textarea { font-family: inherit; }
.app-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: min-content; }
.app-bar-actions { margin-left: auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
/* Who is signed in, "name · role" (story 2055), before the text-size toggle. On a phone it gives way to the rest of the
   bar and ends in an ellipsis, rather than widening the page. position: it contains its screen-reader-only "Signed in as". */
.session-identity {
  position: relative; color: var(--muted); font-size: 0.8125rem; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The CP mark is 1.25rem tall, not the spec's "about 1.5rem": 1.5 crowds the phone bar. It is sized in rem, so the
   text-size toggle scales it with the title. On a phone (the max-width: 640px block below) it is 1.5rem by 1.04rem, the
   same proportions, so that at 320px and A+ the toggle stays on screen. */
.logo { color: var(--text); width: 1.8rem; height: 1.25rem; flex: 0 0 auto; }
.title { font-size: 0.9375rem; }
.subtitle { color: var(--muted); font-size: 0.75rem; }

/* Hamburger — hidden on desktop, revealed at the drawer breakpoint. */
.nav-toggle {
  display: none; background: none; border: none; color: var(--text);
  font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 4px 8px;
}

/* Sidebar + content grid. The sidebar fills the column height so the profile card can pin
   to the bottom; main can shrink (min-width:0) so wide tables scroll inside it rather than
   the page. */
.layout { flex: 1 1 auto; display: grid; grid-template-columns: 240px 1fr; min-height: 0; }
.sidebar {
  display: flex; flex-direction: column; gap: 20px;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 12px; overflow-y: auto;
}
.nav { display: flex; flex-direction: column; gap: 20px; }
.nav-section { display: flex; flex-direction: column; gap: 4px; }
.nav-heading {
  margin: 0 0 4px; padding: 0 8px; color: var(--muted);
  font-size: 0.6875rem;
}
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: block; padding: 8px 10px; border-radius: 4px; text-decoration: none;
  color: var(--muted); font-size: 0.875rem; cursor: pointer;
}
a.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.nav-link[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }
.nav-link.stub { color: var(--muted); opacity: 0.55; cursor: not-allowed; }
.nav-link.stub::after { content: " · coming soon"; font-size: 0.6875rem; }
.nav-refresh { margin-top: 8px; align-self: flex-start; }
/* The navigation while it is switched off (story 2055, app.mjs): on every page load while GET /api/me is out, and after
   the answer as well for a person whose access an Admin has switched off. */
.nav[inert] { opacity: 0.5; }

.profile-card {
  margin-top: auto; display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; padding: 10px; cursor: pointer; text-align: left;
}
.profile-card:hover { border-color: var(--border-hover); }
.profile-avatar { color: var(--text); font-size: 1.25rem; line-height: 1; }
.profile-meta { display: flex; flex-direction: column; min-width: 0; }
.profile-name { font-weight: 600; font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-sub { color: var(--muted); font-size: 0.6875rem; }

main { padding: 20px; min-width: 0; overflow-x: auto; }
.panel { animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.empty, .note { color: var(--muted); }
.note { font-size: 0.75rem; margin-top: 12px; }

.controls { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.filter { color: var(--muted); font-size: 0.8125rem; }
.filter select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 2px; padding: 5px 8px; margin-left: 4px;
}
.count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
/* count-group: wraps the count span and a termInfo ⓘ button so they sit side-by-side. The group is what the controls
   push to the right, so the count inside it takes no margin of its own: the group's gap alone spaces the ⓘ. */
.count-group { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.count-group .count { margin-left: 0; }

table.grid { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 4px; overflow: hidden; }
table.grid th, table.grid td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
table.grid th { color: var(--muted); font-weight: 600; font-size: 0.75rem; }
/* The header row between two strong rules, as the website's data table draws it. */
table.grid thead th { border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); }
table.grid tbody tr:hover { background: var(--surface-2); }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
/* A state chip is the state's colour as text, on a tint of that colour. For dark and walled the
   text is the colour lightened with white: unlightened, it is below 4.5:1 against its own tint on
   one surface or both (#1353). Current keeps the 7% it took under the old palette; green-400 alone
   reads 6.4:1 and 5.4:1. Only the text is lightened; the tint is unchanged.
   tests/smoke/dashboard-state-chip-contrast.spec.mjs holds every state chip at 4.5:1. */
.state-current { background: color-mix(in srgb, var(--current) 22%, transparent); color: color-mix(in srgb, var(--current), white 7%); }
.state-stale { background: color-mix(in srgb, var(--stale) 22%, transparent); color: var(--stale); }
.state-dark { background: color-mix(in srgb, var(--dark) 25%, transparent); color: color-mix(in srgb, var(--dark), white 27%); }
.state-walled { background: color-mix(in srgb, var(--walled) 22%, transparent); color: color-mix(in srgb, var(--walled), white 34%); }
/* A stored pin or channel that cannot be read (#1340): the state of an install, or of an
   engagement none of whose installs can be read, and the count beside an engagement's installs. */
.state-invalid, .chip.invalid-count { background: color-mix(in srgb, var(--invalid) 22%, transparent); color: var(--invalid); }
.chip.invalid-count { margin-left: 6px; }
/* position: the cell contains its screen-reader-only text, so that scrolls with the table
   inside <main> instead of widening the page when the column is off-screen on a phone. */
.fleet-installs { white-space: nowrap; position: relative; }
/* Text for a screen reader only: in the accessibility tree, not on screen. */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
/* Blue on its own tint reads 4.0:1, so the words are lightened (5.5:1), as the Internal data badge's are. */
.chip.recommended { background: color-mix(in srgb, var(--accent-secondary) 22%, transparent); color: color-mix(in srgb, var(--accent-secondary), white 25%); }
.action-promote { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.action-rollback { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.action-release { background: color-mix(in srgb, var(--accent-secondary) 22%, transparent); color: color-mix(in srgb, var(--accent-secondary), white 25%); }

.ladder { display: flex; gap: 16px; flex-wrap: wrap; }
.ring-card {
  flex: 1 1 220px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.ring-head { display: flex; align-items: center; justify-content: space-between; }
/* The ring's name is its card's heading (h3), drawn as the plain label it was: no margin, the card's size, in the
   heading face. */
.ring-name { margin: 0; font-size: inherit; text-transform: capitalize; }
.ring-version { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
/* ring-version-row / soak-row: flex wrappers that place the value beside its termInfo ⓘ button. */
.ring-version-row { display: flex; align-items: center; gap: 6px; }
.soak-row { display: flex; align-items: center; gap: 6px; }
.soak { font-size: 0.75rem; padding: 3px 8px; border-radius: 4px; align-self: flex-start; }
.soak.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.soak.gated { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.soak.terminal { background: var(--surface-2); color: var(--muted); }
.ring-actions { display: flex; gap: 8px; margin-top: auto; }

.canary-health { margin-top: 16px; padding: 10px 14px; border-radius: 4px; font-size: 0.8125rem; }
.canary-health.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.canary-health.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }

.btn {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 2px; padding: 7px 12px; cursor: pointer; font-size: 0.8125rem;
}
.btn:hover { border-color: var(--border-hover); }
.btn.primary, .btn.promote { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.rollback { color: var(--warn); }
.btn.primary:hover:not(:disabled), .btn.promote:hover:not(:disabled) { background: var(--accent-active); border-color: var(--accent-active); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:disabled:hover { border-color: var(--border); }

/* Whole-app text-size toggle (#1139) — A−/A/A+ group in the app-bar actions slot. */
.text-size-controls { display: inline-flex; align-items: center; gap: 4px; }
.btn.text-size { padding: 5px 8px; min-width: 30px; text-align: center; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 18, 32, 0.8);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 22px; width: min(440px, 92vw); }
.modal h3 { margin: 0 0 6px; text-transform: capitalize; }
.modal p { color: var(--muted); font-size: 0.8125rem; margin: 0 0 12px; }
.modal textarea {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 2px; padding: 9px; resize: vertical; font: inherit;
}
.modal textarea.invalid { border-color: var(--err); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Profile modal (#1138) — reuses .modal-overlay / .modal; adds a close control, an
   identity line, and an inline notice (My Account stub / local-dev logout). */
.modal { position: relative; }
.modal-close {
  position: absolute; top: 10px; right: 12px; background: none; border: none;
  color: var(--muted); font-size: 1.375rem; line-height: 1; cursor: pointer; padding: 2px 6px;
}
.modal-close:hover { color: var(--text); }
.modal-identity { color: var(--text); font-weight: 600; font-size: 0.9375rem; margin: 0 0 10px; }
.modal-notice {
  margin: 4px 0 0; padding: 8px 10px; border-radius: 4px; font-size: 0.8125rem;
  background: var(--surface-2); color: var(--muted);
}
.modal-actions .btn { min-width: 96px; }

/* Sidebar collapses to an off-canvas drawer on phones; the hamburger toggles it and no
   horizontal page scroll appears (design D3, ≤640px). */
@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  .subtitle { display: none; }
  .logo { width: 1.5rem; height: 1.04rem; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 260px; max-width: 80vw; z-index: 45;
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.5); }
  body { overflow-x: hidden; }
}

/* Engagement-detail overlay (#1140) */
.fleet-row { cursor: pointer; }
.fleet-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.detail-overlay { align-items: flex-start; padding: 4vh 16px; overflow-y: auto; }
.detail-modal { width: min(880px, 96vw); max-height: 92vh; overflow-y: auto; padding: 20px 24px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.detail-head h3 { margin: 0; text-transform: none; }
.detail-close { padding: 4px 10px; line-height: 1; }
.detail-section { margin-top: 16px; }
.detail-section-title {
  margin: 0 0 8px; color: var(--muted); font-size: 0.75rem;
}
.detail-grid { margin: 0; display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 6px 16px; }
.detail-row { display: contents; }
.detail-label { color: var(--muted); font-size: 0.8125rem; }
.detail-value { color: var(--text); font-size: 0.8125rem; word-break: break-word; }
.chip.behind-yes { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.chip.behind-no { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }

/* Installs of an engagement (#1206) — a compact table inside the detail overlay. An install is
   shown by a short form of its random id, set in monospace so the hex is easy to compare; the
   legacy row has no id, so its label is styled as a note instead. On a narrow screen the table
   scrolls sideways inside its wrapper rather than widening the dialog. */
.installs-scroll { overflow-x: auto; }
table.grid.installs { background: var(--surface-2); font-size: 0.8125rem; }
table.grid.installs th, table.grid.installs td { padding: 6px 12px; white-space: nowrap; }
table.grid.installs tbody tr:last-child td { border-bottom: none; }
.install-id { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.install-legacy { color: var(--muted); font-style: italic; }
.detail-section .note { margin: 8px 0 0; font-size: 0.75rem; }

/* Definitions (#1141, story 5396) — the ⓘ beside every header and headline number on every
   tab, the engagement detail included (term-tip.mjs). The button is a real focusable control;
   the definition bubble is position:fixed so it escapes a table's overflow clip and a dialog's
   scroll box. */
.term-tip { display: inline-flex; align-items: center; gap: 4px; }
.term-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; padding: 0; flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 0.625rem; font-weight: 700; font-style: normal; line-height: 1;
  text-transform: none; cursor: pointer;
}
.term-info:hover { color: var(--text); border-color: var(--border-hover); }
.term-info:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.term-desc {
  position: fixed; z-index: 70; width: max-content; max-width: 280px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px;
  font-size: 0.75rem; font-weight: 400; line-height: 1.45;
  white-space: normal; text-align: start; overflow-wrap: anywhere; font-variant-numeric: normal;
  text-transform: none; letter-spacing: normal;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}
.term-desc[hidden] { display: none; }

.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { padding: 10px 16px; border-radius: 4px; font-size: 0.8125rem; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.toast.ok { background: var(--ok); color: var(--on-accent); }
.toast.warn { background: var(--warn); color: var(--on-accent); }
.toast.err { background: var(--err); color: var(--on-accent); }

/* The Delivery report's tables (story 5398; story 1718's delivery view first), and the other tables drawn with
   tables.mjs's parts: numbers right-aligned in tabular figures. Each table scrolls sideways in its own box on a narrow
   screen, so the page itself never does. Plain text throughout: no new chip, so no new colour pair for
   tests/smoke/dashboard-state-chip-contrast.spec.mjs to hold. */
.delivery-section { margin-top: 20px; }
.delivery-title {
  margin: 0 0 8px; color: var(--muted); font-size: 0.75rem;
}
.delivery-meta { color: var(--muted); font-size: 0.8125rem; margin: 0 0 8px; }
.table-scroll { overflow-x: auto; }
table.grid th.num, table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid tfoot td { font-weight: 600; border-bottom: none; }
/* A Delivery table's row headers (the first column) read as the body cells beside them, not as column headings. */
table.delivery-grid tbody th, table.delivery-grid tfoot th {
  color: inherit; font-size: inherit; font-weight: normal; text-transform: none; letter-spacing: normal;
}
table.delivery-grid tfoot th { font-weight: 600; border-bottom: none; }

/* Prices (story 5400): the prices in use, their stale flag and the marks, on the Delivery tab and the Model prices page;
   the Model prices table; and an Admin's fixes. The stale chip takes stale's colour pair, which the state chips are held
   to at 4.5:1 (tests/smoke/dashboard-state-chip-contrast.spec.mjs); it is not named state-*, which would have that spec
   look for it in the Fleet view. A mark is its word and its ⓘ, plain text, as the rest of a Delivery table is, and two
   are parted by a comma. The Model prices table has ten columns, so where it is short of room a match and a version wrap
   at their spaces, and the table scrolls in its box; a model id, its row's name, is never broken at its hyphens. A
   version's cell contains its screen-reader-only full id (position), so that scrolls with the table on a phone instead
   of widening the page. */
.prices-in-use { font-size: 0.8125rem; margin: 0 0 8px; }
.price-flag { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.chip.price-stale { background: color-mix(in srgb, var(--stale) 22%, transparent); color: var(--stale); }
td.price-marks .term-tip { white-space: nowrap; }
td.price-version { position: relative; }
table.prices-grid th, table.prices-grid td { padding-left: 10px; padding-right: 10px; }
table.prices-grid tbody th {
  color: inherit; font-size: inherit; font-weight: normal; text-transform: none; letter-spacing: normal; white-space: nowrap;
}
.prices-admin { margin-top: 28px; }
.prices-admin h3 { margin: 0 0 4px; font-size: 1rem; }
.prices-admin > .note { margin: 0 0 4px; max-width: 72ch; }
/* A fix's form: its fields in as many columns as fit, one on a phone. A refusal is said in invalid's colour, which keeps
   4.5:1 on the form's surface, as a dialog's problem does; the field the page refused is edged as a dialog's blank
   reason is. */
.fix-form {
  margin-top: 16px; padding: 14px 16px; max-width: 760px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
}
.fix-form h4, .fix-form h5 { margin: 0 0 4px; font-size: 0.875rem; }
.fix-form .note { margin: 0 0 10px; }
.fix-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; }
.fix-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fix-field label { color: var(--muted); font-size: 0.8125rem; }
.fix-field input {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 2px; padding: 7px 9px; font: inherit;
}
.fix-field input.invalid { border-color: var(--err); }
.fix-actions { margin-top: 12px; }
.fix-status { margin: 8px 0 0; font-size: 0.8125rem; }
.fix-status:empty { display: none; }
.fix-problem { margin: 8px 0 0; font-size: 0.8125rem; color: var(--invalid); }

/* Roles view (story 2055): what each role can do, read-only. The caption sits above the table, and a permission's
   row header is its label with the id the API checks under it. The role columns centre their Yes. */
table.roles-grid caption { caption-side: top; text-align: left; color: var(--muted); padding: 0 0 8px; }
table.roles-grid th.role, table.roles-grid td.role { text-align: center; }
table.roles-grid tbody th { color: inherit; font-size: inherit; font-weight: normal; text-transform: none; letter-spacing: normal; }
table.roles-grid code { display: block; color: var(--muted); font-size: 0.75rem; }
.btn.link { background: none; border: none; padding: 0; color: var(--accent-secondary); text-decoration: underline; }

/* Users view (story 2056): everyone who has signed in, for an Admin. A row's first cell is the person's name, a row
   header that reads as the cells beside it. The role cell contains its screen-reader-only text (position), so that scrolls
   with the table instead of widening the page on a phone. The chips take colour pairs the state chips are held to at
   4.5:1 on both surfaces, a row's and a row's under the pointer (tests/smoke/dashboard-state-chip-contrast.spec.mjs):
   Enabled current's, Disabled invalid's, fallback dark's. They are not named state-*, which would have that spec look for
   them in the Fleet view. A user's audit record takes the pair of its outcome. */
table.users-grid tbody th { color: inherit; font-size: inherit; font-weight: normal; text-transform: none; letter-spacing: normal; }
table.users-grid td.user-role { position: relative; white-space: nowrap; }
.chip.user-enabled, .action-user-enable { background: color-mix(in srgb, var(--current) 22%, transparent); color: color-mix(in srgb, var(--current), white 7%); }
.chip.user-disabled, .action-user-disable { background: color-mix(in srgb, var(--invalid) 22%, transparent); color: var(--invalid); }
.chip.fallback { background: color-mix(in srgb, var(--dark) 25%, transparent); color: color-mix(in srgb, var(--dark), white 27%); }
/* The Disable or Re-enable dialog. Its title names a person, as written; its reason has a label; and a blank reason is
   said in invalid's colour, which keeps 4.5:1 on both surfaces; --err reads 4.6:1 on the dialog and 4.0:1 on
   --surface-2. */
.user-access-modal h3 { text-transform: none; }
.modal-label { display: block; color: var(--muted); font-size: 0.8125rem; margin: 0 0 4px; }
.modal p.modal-problem { color: var(--invalid); margin: 6px 0 0; }

/* The Change role dialog (story 2057): the roles as a group of radio buttons, then what the chosen one can and cannot do.
   A row's two buttons sit side by side. The marks on a gained or lost permission are text, so they do not rest on colour. */
td.user-actions { white-space: nowrap; }
td.user-actions .btn + .btn { margin-left: 6px; }
.user-role-modal h3, .user-role-modal h4 { text-transform: none; }
.user-role-modal fieldset { border: 0; margin: 0 0 8px; padding: 0; }
.user-role-modal legend { color: var(--muted); font-size: 0.8125rem; padding: 0; margin-bottom: 4px; }
.role-choice { display: block; padding: 4px 0; cursor: pointer; }
.role-preview h4 { margin: 10px 0 4px; font-size: 0.875rem; }
.role-preview ul { margin: 0; padding-left: 20px; }
.role-preview .role-mark { font-weight: 600; }

/* The Internal list under the Fleet table (story 8282), built as the Deleted list is. Its heading is its name alone: its
   definition's ⓘ follows it, and its count, with the count's ⓘ, goes to the end of the line, as the Fleet table's count
   goes to the end of the filters. */
.internal-section { margin-top: 28px; }
.internal-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 0 0 4px; }
.internal-head h3 { margin: 0; font-size: 1rem; }
.internal-head h3:focus { outline: none; }
.internal-section .note { margin: 0 0 10px; }

/* Deleting (story 2053): the Deleted list under the Fleet table, and the Delete and Clear dialogs. The status chips take
   colour pairs held to 4.5:1 already: deleted is dark's, incomplete is invalid's. A reason can be long, so it wraps. */
.deleted-section { margin-top: 28px; }
.deleted-section h3 { margin: 0 0 4px; font-size: 1rem; }
.deleted-section h3:focus { outline: none; }
.deleted-section .note { margin: 0 0 10px; }
.chip.deletion-deleted { background: color-mix(in srgb, var(--dark) 25%, transparent); color: color-mix(in srgb, var(--dark), white 27%); }
.chip.deletion-incomplete { background: color-mix(in srgb, var(--invalid) 22%, transparent); color: var(--invalid); }
td.deleted-reason { word-break: break-word; min-width: 140px; }
td.deleted-actions { white-space: nowrap; }
.delete-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.delete-modal { width: min(560px, 92vw); max-height: 92vh; overflow-y: auto; }
.delete-modal h3 { text-transform: none; }
.modal input[type="text"] {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 2px; padding: 9px; font: inherit;
}
/* A field a dialog refused (the promotion PR id, Bug 8283) is edged as a blank attestation is. */
.modal input[type="text"].invalid { border-color: var(--err); }
.delete-reason-label { margin-top: 12px; }
.delete-list { margin: 0 0 10px; padding-left: 20px; font-size: 0.8125rem; }
.delete-left { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--invalid); border-radius: 4px; }
.delete-left p { margin: 0 0 6px; }
.delete-status:empty { display: none; }

/* The Rollout page's release lines, notes and pull requests (design 2026-11-05). */
.ring-release { display: flex; flex-direction: column; gap: 4px; }
.ring-released { font-size: 0.75rem; color: var(--muted); }
/* A ring's pull request: the secondary accent only when it is a link. One at an address that is not https is drawn as
   text, and must not look like a link. */
.ring-pr { font-size: 0.8125rem; overflow-wrap: anywhere; }
a.ring-pr { color: var(--accent-secondary); }
.ring-pr.none, .ring-notes.none { color: var(--muted); font-size: 0.75rem; }
.ring-notes summary { cursor: pointer; font-size: 0.8125rem; }
.release-notes { font-size: 0.8125rem; line-height: 1.45; max-width: 60ch; }
.release-notes h4 { margin: 10px 0 4px; font-size: 0.8125rem; }
/* A bold run in a notes heading keeps the heading's weight: bold would ask Manrope for 700, which is not shipped. */
.release-notes h4 strong { font-weight: inherit; }
.release-notes p { margin: 6px 0; }
.release-notes ul { margin: 4px 0; padding-left: 18px; }
/* A second-level bullet is a list inside the bullet before it, which indents it; one with no bullet before it stays at
   the top level, indented and marked (a circle, not a disc) as though it were. */
.release-notes li ul { margin: 2px 0; }
.release-notes > ul > li.sub { margin-left: 16px; list-style-type: circle; }
.release-notes code { font-size: 0.75rem; background: var(--surface-2); padding: 0 4px; border-radius: 4px; }
.canary-prs { margin-top: 24px; }
.canary-prs h3 { font-size: 1rem; margin: 0 0 8px; }
.canary-prs h4 { font-size: 0.875rem; margin: 16px 0 6px; color: var(--muted); }
/* A link in the tables of pull requests into canary. With no colour of its own it would be the browser's link blue,
   which cannot be read on the dark surface (under 2:1): it takes the secondary accent, as a ring card's link does,
   and keeps "PR <id>" on one line. */
.canary-prs a { color: var(--accent-secondary); white-space: nowrap; }
.chip.pr-status { background: var(--surface-2); color: var(--text); white-space: nowrap; }
.no-state { color: var(--muted); }

/* Chart legend and caption (story 5396). Used by the Delivery report and any other chart
   page. The swatch is a small coloured tile whose pattern doubles as a second, non-colour
   cue (hatch, dash or marker) so charts remain legible in greyscale and for colour-blind
   viewers. forced-color-adjust:none preserves the patterns in Windows forced-colour mode.
   Colours are expressed through var(--series-color) so the caller sets each series' colour
   as a CSS custom property; no new colour tokens are added here. */
.chart-figure { margin: 0; }
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  list-style: none; margin: 0 0 8px; padding: 0;
  font-size: 0.75rem; color: var(--muted);
}
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch {
  display: inline-block; width: 18px; height: 12px; flex: 0 0 auto;
  border-radius: 2px; forced-color-adjust: none;
}

/* Hatch variants — 18 × 12 px swatches with a 20% tinted background (10% for dots), on the
   same 45° lattice as the chart's canvas pattern (hatchPattern and HATCH in legend.mjs), so
   the legend shows the chart's stripes. The canvas repeats an 8 px tile whose stripes are the
   lines x + y = 8k and x - y = 8k; across the stripes that is a period of 8 / sqrt(2) =
   5.657 px, the period of the gradients here, with the same 2 px stripe:
   diagonal: "/" stripes rising to the right (-45°).
   reverse-diagonal: "\" stripes falling to the right (45°).
   cross: both diagonal directions together.
   dots: 2 px radius circles on a 6 px grid, not rotated, as on the canvas.
   solid: a plain filled square. */
.chart-swatch.hatch-solid             { background: var(--series-color); }
.chart-swatch.hatch-diagonal          { background: repeating-linear-gradient(-45deg, var(--series-color) 0, var(--series-color) 2px, transparent 2px, transparent 5.657px); background-color: color-mix(in srgb, var(--series-color) 20%, transparent); }
.chart-swatch.hatch-reverse-diagonal  { background: repeating-linear-gradient(45deg, var(--series-color) 0, var(--series-color) 2px, transparent 2px, transparent 5.657px); background-color: color-mix(in srgb, var(--series-color) 20%, transparent); }
.chart-swatch.hatch-cross             { background: repeating-linear-gradient(45deg, var(--series-color) 0, var(--series-color) 2px, transparent 2px, transparent 5.657px), repeating-linear-gradient(-45deg, var(--series-color) 0, var(--series-color) 2px, transparent 2px, transparent 5.657px); background-color: color-mix(in srgb, var(--series-color) 20%, transparent); }
.chart-swatch.hatch-dots              { background: radial-gradient(circle, var(--series-color) 2px, transparent 2px) 0 0 / 6px 6px; background-color: color-mix(in srgb, var(--series-color) 10%, transparent); }

/* Dash variants — a 32 × 3 px horizontal line whose on/off rhythm matches Chart.js
   borderDash arrays. Each variant uses one full period as the background tile
   (background-size), so an exact number of periods always fits with background-repeat:round.
   transparent sections represent the gap; periods: solid=n/a, dashed=10 px, dotted=5 px,
   dash-dot=16 px, long-dash=16 px. */
.chart-swatch.cue-dash { width: 32px; align-self: center; height: 3px; border-radius: 999px; }
.chart-swatch.dash-solid     { background: var(--series-color); }
.chart-swatch.dash-dashed    { background: linear-gradient(90deg, var(--series-color) 0 6px, transparent 6px 10px); background-size: 10px 100%; background-repeat: round; }
.chart-swatch.dash-dotted    { background: linear-gradient(90deg, var(--series-color) 0 2px, transparent 2px 5px); background-size: 5px 100%; background-repeat: round; }
.chart-swatch.dash-dash-dot  { background: linear-gradient(90deg, var(--series-color) 0 8px, transparent 8px 11px, var(--series-color) 11px 13px, transparent 13px 16px); background-size: 16px 100%; background-repeat: round; }
.chart-swatch.dash-long-dash { background: linear-gradient(90deg, var(--series-color) 0 12px, transparent 12px 16px); background-size: 16px 100%; background-repeat: round; }

/* Marker variants — ~10 px shapes centred in the swatch. circle: border-radius. square:
   plain. triangle / diamond / cross: clip-path polygons. */
.chart-swatch.cue-marker { width: 10px; height: 10px; border-radius: 0; background: var(--series-color); align-self: center; }
.chart-swatch.marker-circle   { border-radius: 50%; }
.chart-swatch.marker-square   { border-radius: 0; }
.chart-swatch.marker-triangle { clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.chart-swatch.marker-diamond  { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.chart-swatch.marker-cross    { clip-path: polygon(30% 0%, 70% 0%, 70% 30%, 100% 30%, 100% 70%, 70% 70%, 70% 100%, 30% 100%, 30% 70%, 0% 70%, 0% 30%, 30% 30%); }

.chart-caption { display: block; margin-top: 8px; font-size: 0.75rem; color: var(--muted); }

/* Delivery report (story 5398): headline numbers, chart cards and the numbers behind them, the breadcrumb, a story's
   name and the engagements table's trend. Chart colours are tokens a chart reads (report-charts.mjs chartColor), each
   one of the palette's above: a custom property's computed value has its var() resolved, so a chart reads the concrete
   colour legend.mjs needs (report-charts.mjs FALLBACK_COLORS holds the same values, for node --test, and
   report-charts.test.mjs holds the two together). Plain text throughout: no new chip, so no new colour pair to hold. */
:root {
  --chart-landed: var(--ok); --chart-carried: var(--warn); --chart-dropped: var(--err); --chart-pending: var(--muted);
  --chart-interval: var(--accent-secondary); --chart-claim: var(--muted); --chart-rate: var(--text);
  --chart-committed: var(--ok); --chart-target: var(--accent-secondary); --chart-stretch: var(--warn); --chart-band: var(--walled); --chart-exact: var(--muted);
  --chart-agent: var(--accent-secondary); --chart-waiting: var(--warn); --chart-text: var(--muted); --chart-grid: var(--border);
}
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 4px 0 0; padding: 0; color: var(--muted); }
/* The separator is drawn, never read: its alternative text is empty where the syntax is known; the plain content before
   it is for a browser that does not know it. */
.breadcrumb li + li::before { content: "›"; content: "›" / ""; margin-right: 6px; }
.breadcrumb [aria-current="page"] { color: var(--text); }
.report-level-head { display: flex; align-items: baseline; gap: 8px; }
.report-level-title { margin: 16px 0 8px; font-size: 1rem; }
/* The ring shows when the focus came from the keyboard (a drill or a breadcrumb started from it), not after a click. */
.report-level-title:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.report-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 12px; }
.report-number { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 12px; min-width: 0; }
.report-number-label { color: var(--muted); font-size: 0.8125rem; }
.report-number-value { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.report-number-change, .report-number-sub { color: var(--muted); font-size: 0.75rem; }
.report-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 16px; margin-top: 16px; }
.report-card { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 12px; margin-top: 16px; min-width: 0; }
.report-charts .report-card { margin-top: 0; }
/* A card's heading is its name alone; its definition's ⓘ sits beside it. */
.report-card-head { display: flex; align-items: baseline; gap: 4px; margin: 0 0 8px; }
.report-card-title { margin: 0; font-size: 0.875rem; }
.chart-box { position: relative; height: 16rem; }
/* No chart drawn: the box holds one line, which says so, not a chart's height. */
.chart-box.chart-box-missing { height: auto; }
.chart-missing { color: var(--muted); }
.card-error { color: var(--invalid); }
.chart-data { margin-top: 8px; }
.chart-data summary { cursor: pointer; color: var(--accent-secondary); }
.report-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 8px; margin: 0 0 12px; }
.report-split dt { color: var(--muted); font-size: 0.8125rem; }
.report-split dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 1.25rem; vertical-align: middle; }
.spark-bar { width: 6px; min-height: 1px; background: var(--chart-landed); }
.spark-bar.spark-none { background: var(--border); }
.story-name .work-item { margin-left: 4px; color: var(--accent-secondary); text-decoration: none; }
.report-level-head .work-item { color: var(--accent-secondary); }
td.no-telemetry { color: var(--muted); }
/* A story's sessions: its start, its model and every number on one line; its steps in a column wide enough for two or
   three lines; and its id, a Claude Code session id (a UUID, <uuid>.a<n> after a resume: contract.mjs sessionIds),
   in full, wrapping where it must. The essentials come first, so the token counts, last, are what scrolls in the box. */
table.story-sessions th, table.story-sessions td { white-space: nowrap; }
table.story-sessions td.session-steps { white-space: normal; min-width: 11rem; }
table.story-sessions tbody th { white-space: normal; overflow-wrap: anywhere; min-width: 9rem; }
/* A level that could not be loaded: its message takes the keyboard focus after a drill or a breadcrumb, as a level's
   heading does once loaded. */
.delivery-error:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* The header's data-profile badge (story 5399): said in words, "Internal data" or "Demo data", with its (i), on a tint of
   its colour. The words, not the colour, say which. (Not the profile card's: that one is the signed-in person's.) */
.data-profile-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
/* The display above would draw the empty badge of a live deployment, which app.mjs hides: an author's display wins over the
   browser's own [hidden] rule, as for .term-desc. */
.data-profile-badge[hidden] { display: none; }
/* The words keep 4.5:1 on the tint, as a state chip's do (tests/smoke/dashboard-state-chip-contrast.spec.mjs): the
   secondary accent itself reads at 4.0:1 there, so internal's is lightened, as current's chip text is; warn reads at
   6.5:1 as it is. */
.data-profile-badge.data-profile-internal { background: color-mix(in srgb, var(--accent-secondary) 22%, transparent); color: color-mix(in srgb, var(--accent-secondary), white 25%); }
.data-profile-badge.data-profile-demo { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
/* On a phone (design D3, at most 640px wide) the bar has no room for a badge beside the name and role and the text-size
   toggle: with a badge shown, the actions take a line of their own under the brand, so that the name and role still show,
   cut short as before, and nothing is pushed off the screen. With none (a live deployment) the bar is as it was. */
@media (max-width: 640px) {
  .app-bar:has(.data-profile-badge:not([hidden])) { flex-wrap: wrap; }
}
/* The engagement settings form's checkbox, with its label beside it; not the full-width text box of .fix-field input. */
.fix-field.fix-check { flex-direction: row; align-items: center; gap: 8px; }
.fix-field.fix-check input { width: auto; padding: 0; }
/* Its project URL takes a row of its own: in one 150 px column of the fields' grid it showed about 20 characters. */
#engagement-settings-form .fix-field:not(.fix-check) { grid-column: 1 / -1; }
/* The engagement's Azure DevOps project, in its detail: a link in the secondary accent, as every link the dashboard
   draws, which reads at 4.5:1 or better on the dialog (the browser's own link blue reads at 1.9:1). */
.settings-project a { color: var(--accent-secondary); }
/* The settings form is the one fix form drawn in a dialog: its outcome lines keep their own spacing, and a refusal its
   colour, which the dialog's paragraph rule (.modal p) would otherwise take. */
.modal .fix-form p.fix-status, .modal .fix-form p.fix-problem { margin: 8px 0 0; }
.modal .fix-form p.fix-problem { color: var(--invalid); }
