/*
 * ACI Product Catalog stylesheet.
 *
 * Visual language borrowed from Strategy Room v2 (aci-advisory-v2-clean-slate, src/styles/tokens.css and base.css): a cool paper canvas, white surfaces with soft navy shadows, navy ink, a dark navy navigation rail, link blue for actions, and Inter throughout (JetBrains Mono for codes). Strategy Room is light-only; the dark palette here is derived from it (deep navy canvas, raised navy surfaces, the same rail). Light and dark follow prefers-color-scheme; data-theme="light" on the root forces light. No JavaScript is required.
 *
 * Token names are the catalog's own (--ground, --surface, --ink, --accent, ...), because the annotations engine reads them; each one maps to a Strategy Room token as noted.
 */

:root {
  /* Surfaces: --canvas, --surface, --surface-muted, --line, --line-strong */
  --ground: #F5F7FA; --surface: #FFFFFF; --surface-2: #EEF1F5; --rule: #DCE1E9; --rule-strong: #C7CED9;
  /* Ink: --ink-strong (headings), --ink (body), --ink-muted (split into a secondary and a quiet step, darkened slightly for AA on --surface-2) */
  --ink-strong: #102044; --ink: #283853; --ink-2: #4A5770; --ink-3: #5F6B83;
  /* Actions and status: --link (accent), --focus, and the section accents for amber (entry), green (workshops), rose (quarterly) */
  --accent: #0B5CAD; --accent-soft: #E5EEF8; --focus: #2C6EE8;
  --amber: #8A5A00; --amber-soft: #FBF1DE; --good: #246F32; --good-soft: #E6F2E8; --bad: #A12D45; --bad-soft: #FBEBEE;
  --muted-chip: #EEF1F5; --neutral: #59677E;
  /* Primary buttons are navy ink, as in Strategy Room's composer. */
  --button: #102044; --button-ink: #FFFFFF;
  /* The rail stays dark navy in both themes: --rail, --rail-surface, --rail-text, --rail-muted */
  --rail: #121827; --rail-surface: #1A2233; --rail-text: #F7F9FC; --rail-muted: #9BA6B9; --rail-line: rgb(255 255 255 / 10%); --rail-accent: #5E9DF0;
  --f-display: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-body: var(--f-display);
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Radii: --radius-small, --radius-medium, --radius-large */
  --radius: .65rem; --radius-md: 1rem; --radius-lg: 1.5rem;
  /* Shadows: --shadow-soft for raised panels, a lighter one for resting cards, a stronger one for floating controls */
  --shadow-soft: 0 1.5rem 4rem rgb(16 32 68 / 8%);
  --shadow-card: 0 .7rem 2rem rgb(16 32 68 / 4%);
  --shadow-float: 0 .8rem 2.5rem rgb(16 32 68 / 14%);
  --shadow-overlay: 0 1.5rem 4rem rgb(16 24 39 / 28%);
  --scrim: rgb(16 24 39 / 48%);
  --glass: rgb(255 255 255 / 96%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0E1422; --surface: #151D2E; --surface-2: #1C2538; --rule: #28334A; --rule-strong: #36425C;
    --ink-strong: #F3F6FB; --ink: #D6DDE9; --ink-2: #AEB8CA; --ink-3: #8F9BB1;
    --accent: #82B6F2; --accent-soft: #172B4A; --focus: #6FA2FF;
    --amber: #E9B356; --amber-soft: #33280F; --good: #7FCF8D; --good-soft: #15301E; --bad: #F28E9F; --bad-soft: #3B1B24;
    --muted-chip: #222C41; --neutral: #9BA6B9;
    --button: #DCE6F5; --button-ink: #0E1422;
    --rail: #090D17; --rail-surface: #141B2A; --rail-line: rgb(255 255 255 / 8%);
    --shadow-soft: 0 1.5rem 4rem rgb(0 0 0 / 35%);
    --shadow-card: 0 .7rem 2rem rgb(0 0 0 / 22%);
    --shadow-float: 0 .8rem 2.5rem rgb(0 0 0 / 45%);
    --shadow-overlay: 0 1.5rem 4rem rgb(0 0 0 / 55%);
    --scrim: rgb(3 6 12 / 62%);
    --glass: rgb(21 29 46 / 94%);
  }
}

/* Dark, chosen explicitly in Settings (CatalogTheme); Auto uses the media query above. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --ground: #0E1422; --surface: #151D2E; --surface-2: #1C2538; --rule: #28334A; --rule-strong: #36425C;
    --ink-strong: #F3F6FB; --ink: #D6DDE9; --ink-2: #AEB8CA; --ink-3: #8F9BB1;
    --accent: #82B6F2; --accent-soft: #172B4A; --focus: #6FA2FF;
    --amber: #E9B356; --amber-soft: #33280F; --good: #7FCF8D; --good-soft: #15301E; --bad: #F28E9F; --bad-soft: #3B1B24;
    --muted-chip: #222C41; --neutral: #9BA6B9;
    --button: #DCE6F5; --button-ink: #0E1422;
    --rail: #090D17; --rail-surface: #141B2A; --rail-line: rgb(255 255 255 / 8%);
    --shadow-soft: 0 1.5rem 4rem rgb(0 0 0 / 35%);
    --shadow-card: 0 .7rem 2rem rgb(0 0 0 / 22%);
    --shadow-float: 0 .8rem 2.5rem rgb(0 0 0 / 45%);
    --shadow-overlay: 0 1.5rem 4rem rgb(0 0 0 / 55%);
    --scrim: rgb(3 6 12 / 62%);
    --glass: rgb(21 29 46 / 94%);
  }


* { box-sizing: border-box; }

html { background: var(--ground); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

a { color: var(--accent); text-underline-offset: .17em; }
a:visited { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

code, .mono { font-family: var(--f-mono); font-size: .84em; }

/* Code autolinks (docs/code_autolinks_contract.md; Catalog::CodeLinker): a catalog code mentioned in text reads as a quiet reference, monospace with a subtle underline that firms up on hover. */
a.code-link { font-family: var(--f-mono); font-size: .86em; font-weight: 500; white-space: nowrap; color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a.code-link:hover, a.code-link:focus-visible { text-decoration-color: currentColor; }
code a.code-link, pre a.code-link { font-size: inherit; }

h1, h2, h3, h4 { font-family: var(--f-display); color: var(--ink-strong); text-wrap: balance; margin: 0 0 .3em; }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
h2 { font-size: 1.35rem; font-weight: 760; letter-spacing: -.025em; }
h3 { font-size: 1.05rem; font-weight: 720; letter-spacing: -.01em; }

p { margin: 0 0 .8em; }

.eyebrow {
  font-family: var(--f-display); font-size: .72rem; font-weight: 760; letter-spacing: .11em;
  text-transform: uppercase; color: var(--accent);
}

/* Layout shell: navigation rail, sticky top bar, stage (docs/navigation_and_schema_contract.md). Wide screens (1280px and up) get a persistent left rail; narrower screens hide it off-canvas and the top bar's menu button slides it in (site_chrome.js). Without JavaScript the menu button is a link to the footer's navigation list. */
:root { --rail-width: 272px; --bar-height: 56px; }
html { scroll-padding-top: calc(var(--bar-height) + 16px); }
html.nav-open { overflow: hidden; }

.skip-link {
  position: absolute; left: 12px; top: 8px; z-index: 1100; padding: 10px 16px; border-radius: var(--radius);
  background: var(--surface); color: var(--ink-strong); font-family: var(--f-display); font-weight: 700;
  box-shadow: var(--shadow-soft); transform: translateY(-180%); transition: transform .15s ease;
}
.skip-link:visited { color: var(--ink-strong); }
.skip-link:focus { transform: none; }
.site-main:focus { outline: none; }

.site-header {
  position: sticky; top: 0; z-index: 700;
  border-bottom: 1px solid var(--rule);
  background: var(--glass);
  -webkit-backdrop-filter: blur(.8rem); backdrop-filter: blur(.8rem);
}
.site-header .bar {
  min-height: var(--bar-height); padding: 8px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand {
  font-family: var(--f-display); font-weight: 800; font-size: 1rem; letter-spacing: -.01em; color: var(--ink-strong);
  text-decoration: none; line-height: 1.25;
}
.brand:visited { color: var(--ink-strong); }
.brand .sub { display: block; font-weight: 500; font-size: .72rem; color: var(--ink-3); letter-spacing: .01em; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 12px 0 10px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink-strong);
  font-family: var(--f-display); font-size: .85rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.nav-toggle:visited { color: var(--ink-strong); }
.nav-toggle:hover, .nav-toggle[aria-expanded="true"] { background: var(--surface-2); border-color: var(--neutral); }
.nav-toggle:focus-visible, .nav-tree__link:focus-visible, .nav-tree__label:focus-visible, .breadcrumbs a:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
@media (max-width: 420px) { .nav-toggle__label { display: none; } .brand--bar .sub { display: none; } }

.breadcrumbs { display: none; min-width: 0; font-family: var(--f-display); font-size: .84rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { color: var(--ink-3); white-space: nowrap; }
.breadcrumbs li + li::before { content: "›"; margin: 0 8px; color: var(--ink-3); }
.breadcrumbs a { color: var(--ink-2); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--ink-strong); font-weight: 700; white-space: normal; }

/* The rail: dark navy in both themes, off-canvas below 1280px, a persistent column at and above it. */
.site-rail {
  position: fixed; inset: 0 auto 0 0; z-index: 950; width: min(var(--rail-width), 86vw);
  display: flex; flex-direction: column; overflow-y: auto; padding: 24px 16px 16px;
  color: var(--rail-text); background: var(--rail); border-right: 1px solid var(--rail-line);
  scrollbar-color: #3B465A transparent;
  transform: translateX(-100%); visibility: hidden;
  transition: transform .2s ease, visibility 0s linear .2s;
}
.site-rail.is-open {
  transform: none; visibility: visible; transition: transform .2s ease;
  box-shadow: 24px 0 64px rgb(16 24 39 / 30%);
}
.site-rail__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0 4px 26px; }
.site-rail .brand, .site-rail .brand:visited { color: var(--rail-text); font-size: .96rem; }
.site-rail .brand .sub { color: var(--rail-muted); }
.site-rail__close {
  flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 50%; background: rgb(255 255 255 / 7%);
  color: var(--rail-text); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.site-rail__close:hover { background: rgb(255 255 255 / 12%); }
.site-rail__close[hidden] { display: none; }
.site-rail :focus-visible { outline: 2px solid var(--rail-accent); outline-offset: 2px; }
.nav-backdrop { position: fixed; inset: 0; z-index: 940; background: var(--scrim); -webkit-backdrop-filter: blur(.12rem); backdrop-filter: blur(.12rem); }
.nav-backdrop[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .site-rail, .site-rail.is-open, .skip-link { transition: none; } }

/* The tree (rail and footer share the markup). These base rules are the light footer copy; the rail overrides them below. Each group carries a marker color, after Strategy Room's section markers. */
.nav-tree { font-family: var(--f-display); --nav-marker: var(--accent); }
.site-rail .nav-tree { --nav-marker: var(--rail-accent); }
.nav-tree [data-nav-group="catalog"] { --nav-marker: #2AC4D4; }
.nav-tree [data-nav-group="workbench"] { --nav-marker: #F2AA24; }
.nav-tree--footer [data-nav-group] { --nav-marker: var(--accent); }
.nav-tree__group { margin: 0 0 14px; }
.nav-tree__label {
  display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 4px 6px;
  font-size: .64rem; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  border-radius: 4px; list-style: none;
}
summary.nav-tree__label { cursor: pointer; }
summary.nav-tree__label::-webkit-details-marker { display: none; }
summary.nav-tree__label::after { content: "▾"; font-size: .9em; letter-spacing: 0; }
details.nav-tree__group:not([open]) > summary.nav-tree__label::after { content: "▸"; }
.nav-tree__group.is-current > .nav-tree__label { color: var(--ink-2); }
.nav-tree__items {
  display: grid; gap: 2px; margin: 4px 0 0 6px; padding: 0 0 0 10px; list-style: none;
  border-left: 1px solid var(--rule);
}
.nav-tree__link {
  display: grid; grid-template-columns: 3px minmax(0, 1fr); align-items: center; gap: 10px;
  min-height: 38px; padding: 7px 10px 7px 6px; border-radius: var(--radius);
  color: var(--ink-2); font-size: .88rem; font-weight: 560; line-height: 1.25; text-decoration: none;
}
.nav-tree__link:visited { color: var(--ink-2); }
.nav-tree__link:hover { background: var(--surface-2); color: var(--ink-strong); }
.nav-tree__link[aria-current] { color: var(--ink-strong); font-weight: 650; }
.nav-tree__link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 720; }
.nav-tree__marker { width: 3px; height: 20px; border-radius: 1rem; background: transparent; }
.nav-tree__link[aria-current] .nav-tree__marker { background: var(--nav-marker); }
.nav-tree__note { font-size: .76rem; font-weight: 450; color: var(--ink-3); white-space: nowrap; }
/* The Workbench (docs/marketing_voice_contract.md): the catalog team's pages, set apart and subdued so readers' eyes stay on the catalog. */
.nav-tree__group--quiet .nav-tree__link { min-height: 32px; padding-top: 5px; padding-bottom: 5px; font-size: .82rem; }

/* Rail copy of the tree, on dark navy. */
.site-rail .nav-tree__label { color: color-mix(in srgb, var(--rail-muted) 78%, transparent); padding-left: 10px; }
.site-rail .nav-tree__group.is-current > .nav-tree__label { color: var(--rail-muted); }
.site-rail summary.nav-tree__label:hover { color: var(--rail-text); }
.site-rail .nav-tree__items { border-left-color: rgb(255 255 255 / 14%); }
.site-rail .nav-tree__home { border-left: 0; padding-bottom: 14px; border-bottom: 1px solid var(--rail-line); margin-bottom: 16px; }
.site-rail .nav-tree__group + .nav-tree__group { padding-top: 12px; border-top: 1px solid var(--rail-line); }
.site-rail .nav-tree__link, .site-rail .nav-tree__link:visited { color: var(--rail-muted); }
.site-rail .nav-tree__link:hover { color: var(--rail-text); background: rgb(255 255 255 / 6%); }
.site-rail .nav-tree__link[aria-current] { color: var(--rail-text); }
.site-rail .nav-tree__link[aria-current="page"] {
  color: var(--rail-text); background: color-mix(in srgb, var(--nav-marker) 15%, var(--rail-surface));
}
.site-rail .nav-tree__link[aria-current] .nav-tree__marker {
  box-shadow: 0 0 .7rem color-mix(in srgb, var(--nav-marker) 70%, transparent);
}
.site-rail .nav-tree__note { color: color-mix(in srgb, var(--rail-muted) 80%, transparent); }
.site-rail .nav-tree__link[aria-current] .nav-tree__note { color: var(--rail-muted); }
.site-rail .nav-tree__group--quiet { margin-top: 18px; }
.site-rail .nav-tree__group--quiet .nav-tree__link, .site-rail .nav-tree__group--quiet .nav-tree__link:visited { color: color-mix(in srgb, var(--rail-muted) 86%, transparent); }
.site-rail .nav-tree__group--quiet .nav-tree__link:hover, .site-rail .nav-tree__group--quiet .nav-tree__link[aria-current] { color: var(--rail-text); }
.site-rail .nav-tree__home .nav-tree__marker { background: var(--nav-marker); box-shadow: 0 0 .55rem color-mix(in srgb, var(--nav-marker) 58%, transparent); }

/* Footer copy of the tree: the no-JavaScript (and static export) navigation on narrow screens. */
.nav-tree--footer {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 4px 24px;
  margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); scroll-margin-top: calc(var(--bar-height) + 16px);
}
.nav-tree--footer .nav-tree__group { margin: 0; }
.nav-tree--footer .nav-tree__link { min-height: 32px; font-size: .86rem; }
html.js-nav .nav-tree--footer { display: none; }

@media (min-width: 1280px) {
  body.has-nav .site-stage { margin-left: var(--rail-width); }
  .site-rail {
    z-index: 20; width: var(--rail-width); transform: none; visibility: visible; transition: none; box-shadow: none;
  }
  .nav-toggle, .site-rail__close, .nav-backdrop { display: none !important; }
  body.has-nav .brand--bar { display: none; }
  .breadcrumbs { display: block; }
  .nav-tree--footer { display: none; }
  :root { --bar-height: 52px; }
  .site-header .bar { padding: 6px 32px; }
}

main.page { max-width: 1040px; margin: 0 auto; padding: clamp(28px, 4vw, 48px) 24px 72px; }
main.page.narrow { max-width: 780px; }

.page-head { display: grid; gap: 6px; margin-bottom: 28px; }
.page-head .lede { font-size: 1.05rem; line-height: 1.55; color: var(--ink-2); }
/* Reader page heroes (docs/marketing_voice_contract.md): a big, friendly heading with room to breathe. */
.page-hero { gap: 10px; margin-bottom: 40px; }
.page-hero h1 { margin: 0; font-size: clamp(2.1rem, 4.4vw, 2.9rem); line-height: 1.05; letter-spacing: -.045em; }
.page-hero .lede { margin: 4px 0 0; font-size: 1.12rem; line-height: 1.6; }

section + section, .block + .block { margin-top: 36px; }

footer.site-footer {
  max-width: 1040px; margin: 40px auto 0; padding: 20px 24px 40px; font-family: var(--f-display);
  font-size: .76rem; line-height: 1.5; color: var(--ink-3); border-top: 1px solid var(--rule);
}

/* Cards and tables: white surfaces with a hairline border, generous radius, and a soft navy shadow. */
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md); padding: 20px 22px;
  box-shadow: var(--shadow-card);
}
.card--flush > :first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.card--flush > :last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-family: var(--f-display); font-size: .86rem; }
th {
  text-align: left; font-size: .66rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3);
  font-weight: 760; padding: 10px 12px; border-bottom: 1px solid var(--rule-strong); white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--ink-3); font-size: .8rem; margin-top: 2px; }
.index-table tr:hover td { background: var(--surface-2); }

/* Chips and badges: Strategy Room's status pills, a hairline border over a light tint. */
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-display); font-size: .7rem;
  font-weight: 700; letter-spacing: .02em; line-height: 1.3; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--rule-strong); background: var(--muted-chip); color: var(--ink-2);
}
.chip.accent { border-color: color-mix(in srgb, var(--accent) 35%, var(--rule)); background: var(--accent-soft); color: var(--accent); }
.chip.good { border-color: color-mix(in srgb, var(--good) 35%, var(--rule)); background: var(--good-soft); color: var(--good); }
.chip.bad { border-color: color-mix(in srgb, var(--bad) 35%, var(--rule)); background: var(--bad-soft); color: var(--bad); }
.chip.amber, .badge-question {
  border-color: color-mix(in srgb, var(--amber) 38%, var(--rule)); background: var(--amber-soft); color: var(--amber);
}
.count-chip { font-family: var(--f-mono); font-size: .76rem; color: var(--ink-2); }

/* Index list rows (catalog, products, offerings). */
.list-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center;
  padding: 13px 18px; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row .name { font-family: var(--f-display); font-weight: 700; font-size: .96rem; color: var(--ink-strong); }
.list-row .code { display: block; font-family: var(--f-mono); font-size: .76rem; color: var(--ink-3); margin-top: 2px; }
.list-row .stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* Bars (coverage / legacy family counts). */
.bars { display: grid; gap: 7px; font-family: var(--f-display); font-size: .82rem; }
.bars .bar { display: grid; grid-template-columns: minmax(140px,260px) minmax(0,1fr) 3ch; gap: 10px; align-items: center; }
.bars .track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bars .track i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bars .val { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bars .name { color: inherit; text-decoration: none; }
a.bars .name:hover, .bars a.name:hover { text-decoration: underline; }
.bar-sub { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 4px; padding-left: 4px; }
.bar-sub a.chip { text-decoration: none; }
.bar-sub a.chip:hover { text-decoration: underline; }

/* Legacy filter state. */
.active-filter { color: var(--ink-2); font-size: .9rem; }
.active-filter a { color: var(--accent); }

/* Utility. */
p.sub, span.sub, div.sub { color: var(--ink-3); font-size: .85rem; }
ul.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
ul.plain-list li { padding: 2px 0; }
.stack { display: grid; gap: 10px; }
.hr { border: 0; border-top: 1px solid var(--rule); margin: 20px 0; }
.empty { color: var(--ink-3); font-style: italic; }
.team-group { margin-bottom: 30px; }
.team-group h2 { display: flex; align-items: baseline; gap: 10px; }
.team-group h2 .code { font-family: var(--f-mono); font-size: .8rem; color: var(--ink-3); font-weight: 500; }

@media (max-width: 640px) {
  .list-row { grid-template-columns: 1fr; }
  .list-row .stats { justify-content: flex-start; }
  main.page { padding: 24px 16px 56px; }
}

/* --- Annotations engine integration (docs/annotations_contract.md, "Host integration") --------- */

/* Profile menu (app/views/layouts/_profile_menu.html.erb; behavior in the header chrome script). */
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.link-button:hover, .link-button:focus-visible { text-decoration: underline; }
.profile-menu { position: relative; margin-left: auto; font-family: var(--f-display); }
.profile-menu form { margin: 0; }
.profile-menu__button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 3px 10px 3px 3px;
  border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--surface); color: var(--ink-strong);
  font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer;
}
.profile-menu__button:hover, .profile-menu__button[aria-expanded="true"] { background: var(--surface-2); border-color: var(--neutral); }
.profile-menu__button:focus-visible, .profile-menu__item:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.profile-menu__avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--rail); color: var(--rail-text); font-size: .68rem; font-weight: 800; letter-spacing: .05em;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 14%);
}
.profile-menu__name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu__caret { color: var(--ink-3); }
.profile-menu__button[aria-expanded="true"] .profile-menu__caret { transform: rotate(180deg); }
.profile-menu__list {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 800; min-width: 210px; padding: 6px;
  display: grid; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
}
.profile-menu__list[hidden] { display: none; }
.profile-menu__who {
  margin: 0; padding: 6px 10px 8px; font-size: .74rem; color: var(--ink-3); border-bottom: 1px solid var(--rule);
  margin-bottom: 4px; overflow-wrap: anywhere;
}
.profile-menu__item {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius); background: none;
  color: var(--ink); font: inherit; font-size: .88rem; text-align: left; cursor: pointer;
}
.profile-menu__item:hover, .profile-menu__item:focus { background: var(--surface-2); outline: none; }
.profile-menu__separator { height: 1px; margin: 4px 2px; background: var(--rule); }
@media (max-width: 1180px) { .profile-menu__name { display: none; } .profile-menu__button { padding-right: 8px; } }

/* Compact "N notes" summaries that expand into a full Annotations::Targets.panel / answer panel — used for obligations, products, legacy items, sales cards, and routine question answers. Plain <details>/<summary>, no JS. */
details.anno-inline { margin-top: 6px; font-family: var(--f-display); font-size: .82rem; }
details.anno-inline summary {
  cursor: pointer; color: var(--ink-2); list-style: none; display: inline-flex; align-items: center;
  gap: 4px; padding: 2px 0;
}
details.anno-inline summary::-webkit-details-marker { display: none; }
details.anno-inline summary::before { content: "▸"; font-size: .7em; color: var(--ink-3); }
details.anno-inline[open] summary::before { content: "▾"; }
details.anno-inline summary:hover { color: var(--accent); }
details.anno-inline[open] { padding-bottom: 4px; }
details.routine-answer summary { color: var(--amber); }

/* Per-page and per-target note panels, and their static-export fallback text. */
.page-annotations { max-width: 1040px; margin: 36px auto 0; padding: 0 20px; }
.page-annotations h2 { font-size: 1.1rem; }
.question-answer { margin-top: 8px; }
.anno-export-count { color: var(--ink-3); font-size: .85rem; font-style: italic; margin: 6px 0 0; }
.card-notes { padding: 0 20px 16px; }

/* Status messages (sign-in pending, errors, confirmations). */
.flash { max-width: var(--page-max, 1100px); margin: 16px auto 0; padding: 12px 16px; border-radius: var(--radius-md); font-family: var(--f-display); font-size: .9rem; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--shadow-card); }
.flash-alert { border-color: color-mix(in srgb, var(--amber) 45%, var(--rule)); background: var(--amber-soft); color: var(--ink-strong); }
/* Header notice for editors: Microsoft sign-ins waiting for approval (docs/ai_setup_contract.md). */
.approval-notice { max-width: var(--page-max, 1100px); margin: 10px auto 0; padding: 0 16px; font-family: var(--f-display); font-size: .85rem; }
.approval-notice__link { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px 12px; border-radius: 999px; background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--rule)); color: var(--ink-strong); font-weight: 600; text-decoration: none; }
.approval-notice__link:hover { border-color: var(--amber); }
.approval-notice__how { font-weight: 400; color: var(--ink-2); }
.sign-in { max-width: 640px; }
.sign-in .button { margin-top: 16px; }

/* Site modals: "Set up my AI" and Settings (app/views/layouts/_ai_setup_modal.html.erb, _settings_modal.html.erb). */
.site-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; }
.site-modal[hidden] { display: none; }
.site-modal__backdrop { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(.12rem); backdrop-filter: blur(.12rem); }
.site-modal__dialog {
  position: relative; width: min(560px, 100%); box-sizing: border-box; padding: 28px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
}
.site-modal__dialog:focus { outline: none; }
.site-modal__dialog h2 { margin: 0 44px 8px 0; font-family: var(--f-display); font-size: 1.2rem; }
.site-modal__dialog p { color: var(--ink-2); margin: 0 0 12px; }
.site-modal__close {
  position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--rule); border-radius: 50%; background: var(--surface);
  font-size: 1.4rem; line-height: 1; color: var(--ink-strong); cursor: pointer;
}
.site-modal__close:hover { background: var(--surface-2); }
.site-modal__prompt-wrap { display: grid; gap: 10px; margin: 4px 0 16px; }
.site-modal__prompt {
  width: 100%; box-sizing: border-box; padding: 10px 12px; resize: none;
  font: .82rem/1.55 var(--f-mono); color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--rule); border-radius: var(--radius);
}

.settings-form { display: grid; gap: 8px; }
.settings-form label { font-family: var(--f-display); font-weight: 700; font-size: .86rem; color: var(--ink-strong); }
.settings-form select {
  width: 100%; min-height: 42px; padding: 8px 10px; font: .9rem var(--f-display); color: var(--ink-strong); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
.settings-form select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.site-modal__dialog .settings-form__hint { font-size: .86rem; color: var(--ink-3); margin: 0 0 8px; }
.settings-form__actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Buttons: the modal's Copy, sign-in, and plain buttons on collaboration pages (setup, spaces). Primary is Strategy Room's navy ink button; secondary is a white button with a strong hairline. */
.btn, .button, .collab-page button:not(.link-button) {
  justify-self: start; min-height: 42px; padding: 8px 16px; border-radius: var(--radius); cursor: pointer;
  font-family: var(--f-display); font-weight: 720; font-size: .84rem; line-height: 1.2;
  border: 1px solid var(--button); background: var(--button); color: var(--button-ink);
}
.btn:hover, .button:hover, .collab-page button:not(.link-button):hover { background: color-mix(in srgb, var(--button) 84%, var(--accent)); }
.btn.btn-secondary, .collab-page button.anno-btn--ghost { border-color: var(--rule-strong); background: var(--surface); color: var(--ink-strong); }
.btn.btn-secondary:hover, .collab-page button.anno-btn--ghost:hover { border-color: var(--neutral); background: var(--surface-2); }
.btn:focus-visible, .button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.collab-page details { margin: 10px 0; }
.collab-page summary { cursor: pointer; font-family: var(--f-display); font-size: .9rem; color: var(--accent); }
.collab-page pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; font: .82rem/1.5 var(--f-mono); }

/* --- Model › Schema (/schema; app/views/schema/) --------------------------------------------------- */
main.page.schema-page { max-width: 1240px; }
.schema-toc { margin-bottom: 32px; }
.schema-toc ul {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 24px;
  margin: 6px 0 0; padding: 0; list-style: none; font-family: var(--f-display); font-size: .92rem;
}
.schema-toc li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.schema-toc ul + .eyebrow { margin-top: 16px; }
/* The two roles (docs/catalog_and_tool_tables_contract.md): "The catalog" and "Running the tool" each open with a heading band above their clusters. */
.schema-role { margin-top: 64px; padding-top: 18px; border-top: 2px solid var(--rule-strong); }
.schema-role__title { font-size: 1.6rem; }
.schema-role__lede { margin: 6px 0 0; color: var(--ink-2); }
.schema-role + .schema-cluster-section { margin-top: 28px; }
.schema-part-of { margin: 2px 0 8px; font-family: var(--f-display); font-size: .82rem; color: var(--ink-3); }
.records .schema-part-of { margin: 8px 12px 0; }
.schema-part-of__role { margin-left: 4px; font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); opacity: .8; }
.schema-fallback {
  padding: 12px 16px; border: 1px dashed var(--rule-strong); border-radius: var(--radius);
  font-family: var(--f-display); font-size: .9rem; color: var(--ink-2); background: var(--surface);
}
.schema-cluster-section { margin-top: 48px; }
.schema-cluster-section h2 .code, .schema-collapsed h2 .code {
  font-family: var(--f-mono); font-size: .8rem; color: var(--ink-3); font-weight: 500;
}
.schema-cluster-section > .lede, .schema-collapsed .lede { color: var(--ink-2); }
.schema-cluster-section--unclustered { padding-left: 14px; border-left: 3px solid var(--amber); }
.schema-collapsed > summary { cursor: pointer; list-style: none; }
.schema-collapsed > summary::-webkit-details-marker { display: none; }
.schema-collapsed > summary h2 { display: inline-flex; align-items: baseline; gap: 10px; }
.schema-collapsed > summary h2::before { content: "▸"; font-size: .8em; color: var(--ink-3); }
.schema-collapsed[open] > summary h2::before { content: "▾"; }

.schema-figure {
  margin: 16px 0 24px; padding: 16px; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md); box-shadow: var(--shadow-card);
}
.schema-figure figcaption { margin-top: 6px; font-family: var(--f-display); }
.schema-svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
@media (max-width: 720px) { .schema-figure .schema-svg { max-width: none; } }

/* Graphviz output: every element carries a class, and the catalog's tokens paint it (light and dark). */
.schema-svg .graph > polygon { fill: transparent; stroke: none; }
.schema-svg text { fill: var(--ink); }
.schema-svg text[font-style="italic"] { fill: var(--ink-3); }
.schema-svg .schema-cluster path, .schema-svg .schema-cluster polygon { fill: var(--surface-2); stroke: var(--rule-strong); }
.schema-svg .schema-cluster text { fill: var(--ink-strong); font-weight: 700; }
.schema-svg .schema-cluster--unclustered path, .schema-svg .schema-cluster--unclustered polygon {
  fill: var(--amber-soft); stroke: var(--amber);
}
.schema-svg .schema-node path { fill: var(--surface); stroke: var(--ink-3); }
.schema-svg .schema-node polygon { fill: none; stroke: var(--rule-strong); }
.schema-svg .schema-stub path { fill: transparent; stroke: var(--ink-3); }
.schema-svg .schema-stub text { fill: var(--ink-2); }
.schema-svg .schema-edge path { fill: none; stroke: var(--ink-3); }
.schema-svg .schema-edge polygon { fill: var(--ink-3); stroke: var(--ink-3); }
.schema-svg a:hover path, .schema-svg a:focus path { stroke: var(--accent); stroke-width: 2; }
.schema-svg a:hover text, .schema-svg a:focus text { fill: var(--accent); }
.schema-svg a:focus { outline: none; }

.schema-table { margin-top: 18px; scroll-margin-top: calc(var(--bar-height) + 16px); }
.schema-table:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-card); }
.schema-table__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.schema-table__head h3 { margin: 0; }
.schema-table__name { color: var(--ink-3); }
.schema-table__purpose { color: var(--ink-2); font-size: .98rem; margin-top: 6px; }
.schema-columns { margin-top: 8px; }
.schema-columns td:first-child { white-space: nowrap; }
.schema-columns__type { white-space: nowrap; color: var(--ink-2); }
.schema-columns td .sub { display: block; margin-top: 2px; }
.schema-columns__ref { display: block; color: var(--ink-2); }
.schema-columns__row--secondary td { color: var(--ink-3); }
.schema-columns__row--secondary code { color: var(--ink-3); }
.schema-columns__tag { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); font-size: .72rem; }
.schema-table__refs { margin: 10px 0 0; font-family: var(--f-display); }

/* The data dock, docked at the bottom of the viewport (app/views/shared/_records_dock.html.erb, app/views/schema/records.html.erb, app/assets/javascripts/schema_records.js). While it's open the body gets bottom padding equal to its height (--records-dock-h, set by the script), so no page content sits behind it, and the comments launcher lifts above it. */
.schema-table__records { margin-left: auto; min-height: 32px; padding: 5px 12px; font-size: .78rem; }
.schema-table.is-records-current { outline: 2px solid var(--focus); outline-offset: 2px; }
body.has-records-dock { padding-bottom: var(--records-dock-h, 40vh); }
body.has-records-dock .anno-launcher { bottom: calc(var(--records-dock-h, 40vh) + 16px); }
.records-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 800;
  height: var(--records-dock-h, 40vh); display: flex; flex-direction: column;
  background: var(--surface); border-top: 1px solid var(--rule-strong); box-shadow: 0 -.8rem 2.5rem rgb(16 32 68 / 12%);
  font-family: var(--f-display);
}
.records-dock[hidden] { display: none; }
@media (min-width: 1280px) { body.has-nav .records-dock { left: var(--rail-width); } }
.records-dock__handle {
  flex: 0 0 auto; height: 10px; margin-top: -5px; cursor: ns-resize; touch-action: none; position: relative;
}
.records-dock__handle::after {
  content: ""; position: absolute; left: 50%; top: 5px; width: 44px; height: 4px; margin-left: -22px;
  border-radius: 999px; background: var(--rule-strong);
}
.records-dock__handle:hover::after, .records-dock__handle:focus-visible::after, .records-dock.is-resizing .records-dock__handle::after {
  background: var(--accent);
}
.records-dock__handle:focus-visible { outline: none; }
.records-dock.is-resizing { user-select: none; }
.records-dock__head {
  flex: 0 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  padding: 2px 12px 8px; border-bottom: 1px solid var(--rule);
}
.records-dock__nav { display: flex; gap: 4px; }
.records-dock__btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0;
  border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink-strong);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.records-dock__btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--neutral); }
.records-dock__btn:disabled { color: var(--ink-3); opacity: .5; cursor: default; }
.records-dock__btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.records-dock__close { margin-left: auto; font-size: 1.4rem; }
.records-dock__title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.records-dock__title h2 { margin: 0; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.records-dock__name { font-size: .8rem; color: var(--ink-3); }
.records-dock__trail { min-width: 0; flex: 1 1 240px; overflow-x: auto; }
.records-dock__trail ol { display: flex; margin: 0; padding: 0; list-style: none; font-size: .8rem; white-space: nowrap; }
.records-dock__trail li { color: var(--ink-3); }
.records-dock__trail li + li::before { content: "›"; margin: 0 6px; color: var(--ink-3); }
.records-dock__trail button {
  padding: 2px 4px; border: 0; border-radius: 4px; background: none; color: var(--accent); font: inherit; cursor: pointer;
}
.records-dock__trail button:hover { background: var(--accent-soft); }
.records-dock__trail [aria-current="step"] { color: var(--ink); font-weight: 600; }
.records-dock__trail .is-forward button { color: var(--ink-3); }
.records-dock__refs {
  flex: 0 0 auto; padding: 6px 12px; border-bottom: 1px solid var(--rule); background: var(--surface-2);
  font-size: .8rem; max-height: 30%; overflow: auto;
}
.records-dock__refs[hidden] { display: none; }
.records-refs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.records-refs__label { color: var(--ink-2); font-weight: 600; }
.records-refs__none { color: var(--ink-3); }
.records-refs__list { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
.records-refs__item {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--rule);
  border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none;
}
a.records-refs__item:visited { color: var(--ink); }
a.records-refs__item:hover { border-color: var(--accent); }
.records-refs__item.is-empty { color: var(--ink-3); }
.records-refs__item .sub { font-size: .72rem; }
.records-dock__body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.records-dock__body:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.records-dock__body > .empty { margin: 12px; }
.records-dock__status {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.records__filter { margin: 8px 12px 0; }
.records__chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--ink); font-size: .8rem;
}
.records__chip-clear {
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--ink-2);
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.records__chip-clear:hover { background: var(--surface); color: var(--ink); }
.records__note { margin: 6px 12px 8px; font-size: .8rem; }
.records__table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: .82rem; }
.records__table th, .records__table td {
  padding: 6px 10px; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule);
  vertical-align: top; text-align: left; background: var(--surface);
}
.records__table th { text-transform: none; letter-spacing: normal; font-size: inherit; color: var(--ink); }
.records__table thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); white-space: nowrap;
  font-weight: 700; color: var(--ink-strong); border-top: 1px solid var(--rule);
}
.records__table tbody th { position: sticky; left: 0; z-index: 1; font-weight: 600; white-space: nowrap; }
.records__table thead th:first-child { left: 0; z-index: 3; }
.records__table th:first-child { box-shadow: 1px 0 0 var(--rule); }
.records__lead { cursor: pointer; }
.records__select {
  width: 20px; height: 20px; margin-right: 4px; padding: 0; border: 1px solid transparent; border-radius: 4px;
  background: none; color: var(--ink-3); font-size: .85rem; line-height: 1; cursor: pointer; vertical-align: 1px;
}
.records__lead:hover .records__select, .records__select:focus-visible { border-color: var(--rule); color: var(--accent); }
.records__table tr.is-selected > * { background: var(--surface-2); }
.records__table tr.is-selected > th:first-child { box-shadow: inset 3px 0 0 var(--ink-3), 1px 0 0 var(--rule); }
.records__table tr.is-highlighted > * { background: var(--accent-soft); }
.records__table tr.is-highlighted > th:first-child { box-shadow: inset 4px 0 0 var(--accent), 1px 0 0 var(--rule); }
.records__table tr.is-highlighted.is-flash > * { animation: records-flash 1.2s ease-out 1; }
@keyframes records-flash { from { background: var(--amber-soft); } to { background: var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .records__table tr.is-highlighted.is-flash > * { animation: none; } }
.records__fk-hint { display: block; font-weight: 400; font-size: .72rem; color: var(--ink-3); }
/* Column order and purpose (config/table_columns.yml): a header's tooltip says what the column holds; provenance and bookkeeping columns have a muted header and, unless an editor can change them, stay hidden until "Show all columns". */
.records__table thead th[title] { cursor: help; }
.records__table thead th.records__col--secondary { font-weight: 500; color: var(--ink-3); }
.records:not(.is-all-columns) .records__col--hideable { display: none; }
.records__columns-toggle { margin-left: 6px; }
.records__cell { display: block; max-width: 40ch; overflow-wrap: anywhere; }
.records__cell--long {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3;
  overflow: hidden; cursor: zoom-in;
}
.records__cell--long.is-expanded {
  display: block; -webkit-line-clamp: unset; line-clamp: none; max-width: 70ch; white-space: pre-wrap; cursor: zoom-out;
}
.records__null { color: var(--ink-3); font-style: italic; }
.records__table td { max-width: 40ch; overflow-wrap: anywhere; }
.records__table td:has(.records__cell--long.is-expanded) { max-width: none; }
.records__fk { white-space: nowrap; }
.records__fk-id { margin-left: 2px; padding: 0 5px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); font: 500 .7rem var(--f-mono); text-decoration: none; vertical-align: 1px; }
.records__fk:hover .records__fk-id { color: var(--ink-2); }
@media (max-width: 767px) {
  .records-dock__title h2 { max-width: 60vw; }
  .records-dock__trail { order: 5; flex-basis: 100%; }
}
.records-dock__body[aria-busy="true"] { opacity: .6; }

/* The data dock on every catalog page, for editors, and editing in it (docs/data_dock_editing_contract.md; app/views/shared/_records_dock.html.erb, app/helpers/schema_records_helper.rb). The dock slides up over the page's bottom. In Edit mode, registry-editable cells get a quiet underline and the page editor's hover; read-only cells (ids, codes, timestamps, source references, columns the registry doesn't know) get no affordance at all. A cell being edited opens its control in a small popover anchored to the cell, so the grid doesn't reflow. */
.records-dock:not([hidden]) { animation: records-dock-in .18s ease-out; }
@keyframes records-dock-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .records-dock:not([hidden]) { animation: none; } }
html:not(.cms-editing) .records__edit[data-cms-blank]:empty { display: inline; }
html:not(.cms-editing) .records__edit[data-cms-blank]:empty::before { content: "null"; color: var(--ink-3); font-style: italic; }
.cms-editing .records-dock .records__edit { border-bottom: 1px solid var(--rule-strong); border-radius: 2px; }
/* A reassignable reference (Catalog::FieldRegistry::REASSIGNABLE): its link still follows the reference in Edit mode, and a small "Change" button beside it opens the searchable select. A reference the data view can't change gets only a hover hint (its title) and a help cursor in Edit mode. */
.records__fk-change {
  margin-left: 6px; padding: 0 7px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface);
  font: 600 .68rem var(--f-display); color: var(--accent); cursor: pointer; vertical-align: 1px;
}
.records__fk-change:hover { border-color: var(--accent); background: var(--accent-soft); }
.cms-editing .records-dock .records__edit:has(.records__fk-change):hover { background: transparent; box-shadow: none; }
.cms-editing .records-dock .records__fk--fixed:hover { cursor: help; }
.cms-editing .records-dock .records__edit:not(.is-open) { z-index: auto; }
.cms-editing .records-dock .records__edit::after { content: none; }
.cms-editing .records-dock .records__edit[data-cms-blank]::before { font-size: .74rem; }
.cms-editing .records-dock .records__edit.is-open { display: block; min-height: 1.5em; border-bottom-color: transparent; }
.records-dock .records__edit .cms-editor {
  position: absolute; left: -6px; top: -6px; z-index: 40; display: block; min-width: calc(100% + 12px); width: max-content; max-width: min(560px, 82vw);
  padding: 6px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-float);
}
.records-dock .records__edit .cms-editor--prose, .records-dock .records__edit .cms-editor--long { width: min(560px, 82vw); }
.records-dock .records__edit .cms-editor--fk { width: min(380px, 82vw); }
.records-dock .records__edit .cms-editor--text .cms-input, .records-dock .records__edit .cms-editor--number .cms-input { width: 100%; }
.records-dock .records__edit .cms-combo { display: block; min-width: 0; }
.records-dock .records__edit .cms-textarea { white-space: pre-wrap; }
.records-dock .cms-flash { margin-left: 6px; font-size: .72rem; }
.records-dock td:has(> .records__edit.is-open) { overflow: visible; }
/* In the dock the popover is fixed to the viewport (catalog_editing.js, floatInDock), so rows near the dock's bottom edge don't open it inside the scrolling body: the script sets its top or bottom, left, and minimum width from the cell. Flipped, it grows upward from the cell, and a searchable select's list opens above its input. */
.records-dock .records__edit .cms-editor--floating { position: fixed; z-index: 60; min-width: 0; max-height: calc(100vh - 16px); overflow-y: auto; }
.records-dock .records__edit .cms-editor--floating:has(.cms-combo__list:not([hidden])) { overflow: visible; }
.records-dock .records__edit .cms-editor.is-flipped .cms-combo__list { top: auto; bottom: calc(100% + 6px); }

/* "Data" controls: a page header's (the record the page represents) and each editable section's (that record's rows). Edit mode only (cms-when-editing). */
.data-dock-links { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.data-dock-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 1px 9px; border: 1px solid var(--rule-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); font: 700 .7rem var(--f-display); letter-spacing: .02em; text-transform: none; cursor: pointer;
}
.data-dock-btn::before { content: "▦"; font-size: .8rem; line-height: 1; color: var(--ink-3); }
.data-dock-btn:hover, .data-dock-btn:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.data-dock-btn:hover::before, .data-dock-btn:focus-visible::before { color: var(--accent); }
.data-dock-btn:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.data-dock-btn--section { float: right; margin: 4px 0 0 12px; }

/* "Updated in data view · Refresh": an edit in the dock the page can't show live. Sits just above the dock. */
.data-dock-stale {
  position: fixed; left: 50%; bottom: calc(var(--records-dock-h, 0px) + 14px); z-index: 850; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 6px 8px 6px 14px; border: 1px solid var(--rule-strong); border-radius: 999px;
  background: var(--glass); color: var(--ink-2); box-shadow: var(--shadow-float); font: 600 .8rem var(--f-display);
}
.data-dock-stale[hidden] { display: none; }
.data-dock-stale__refresh { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.data-dock-stale__dismiss { font: inherit; font-size: 1rem; line-height: 1; color: var(--ink-3); background: none; border: 0; padding: 2px 6px; cursor: pointer; border-radius: 999px; }
.data-dock-stale__refresh:focus-visible, .data-dock-stale__dismiss:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media print { .data-dock-btn, .data-dock-links, .data-dock-stale, .records-dock { display: none !important; } }

.settings-form--drafts { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.settings-form__check { display: flex; align-items: center; gap: 8px; }

/* --- Reading layout (docs/reading_layout_contract.md) ------------------------------------------------
   Catalog pages read as a finished document: blanks don't render, pending proposals are opt-in and subtle, open questions sit collapsed at the end, short facts live in a fact strip, and prose runs full width. */

.card--flush { padding: 0; }
.section-gap { margin-top: 16px; }
.quiet-counts { font-family: var(--f-display); font-size: .78rem; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip--status { font-size: .64rem; font-weight: 780; letter-spacing: .045em; text-transform: uppercase; padding: 2px 8px; }
.chip--status.good { border-color: color-mix(in srgb, var(--good) 35%, var(--rule)); color: var(--good); background: var(--good-soft); }

/* Prose fields keep the line breaks their author wrote. */
.field--prose { white-space: pre-line; }

/* Products list rows (the whole row links through the name's overlay). */
.list-row .desc { display: block; color: var(--ink-2); font-size: .9rem; margin-top: 4px; }
.list-row--linked { position: relative; }
.list-row--linked .list-row__link { text-decoration: none; }
.list-row--linked .list-row__link::after { content: ""; position: absolute; inset: 0; }
.list-row--linked .list-row__link:focus-visible { outline: none; }
.list-row--linked:has(.list-row__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.list-row--linked .is-pending a, .list-row--linked .anno-item-chip { position: relative; z-index: 1; }

/* Index lists: Offerings and Service entries. One thin row per record: code, name over tagline, quiet meta. */
.team-index { margin: -8px 0 32px; }
.team-index ol {
  display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0; padding: 0; list-style: none;
  font-family: var(--f-display); font-size: .84rem;
}
.team-index a {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 13px; border: 1px solid var(--rule-strong);
  border-radius: 999px; background: var(--surface); color: var(--ink-strong); font-weight: 600; text-decoration: none;
}
.team-index a:hover { border-color: var(--neutral); background: var(--surface-2); }
.team-index a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.team-index__count { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: .78rem; }

.index-group { margin-top: 36px; scroll-margin-top: calc(var(--bar-height) + 16px); }
.index-group__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  padding-bottom: 6px; border-bottom: 2px solid var(--ink-strong);
}
.index-group__head h2 { margin: 0; font-size: 1.15rem; }
.index-group__count { font-family: var(--f-display); font-size: .78rem; color: var(--ink-3); letter-spacing: .02em; }
.index-group__desc { margin: 8px 0 4px; color: var(--ink-3); font-size: .88rem; line-height: 1.5; }

.index-list { margin: 0; padding: 0; list-style: none; }
.index-list--flat { border-top: 2px solid var(--ink-strong); }
.index-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline;
  gap: 2px 18px; padding: 9px 8px; border-bottom: 1px solid var(--rule); scroll-margin-top: calc(var(--bar-height) + 16px);
}
.index-row:hover { background: var(--surface); box-shadow: var(--shadow-card); }
.index-row:has(.index-row__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.index-row__code { font-size: .74rem; color: var(--ink-3); letter-spacing: .01em; white-space: nowrap; }
.cms-editing .index-row { grid-template-columns: 7.2rem minmax(0, 1fr) auto; }
.index-row__main { min-width: 0; }
.index-row__name { margin: 0; font-size: .96rem; font-weight: 700; line-height: 1.35; text-wrap: pretty; }
.index-row__link { color: var(--ink-strong); text-decoration: none; }
.index-row__link:visited { color: var(--ink-strong); }
.index-row__link::after { content: ""; position: absolute; inset: 0; }
.index-row__link:focus-visible { outline: none; }
.index-row:hover .index-row__link { color: var(--accent); }
.index-row__tagline { display: block; margin-top: 1px; color: var(--ink-2); font-size: .92rem; line-height: 1.45; }
.index-row__meta { display: flex; align-items: baseline; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.index-row__team { font-family: var(--f-display); font-size: .8rem; color: var(--ink-3); }
.index-row .is-pending a, .index-row .anno-item-chip { position: relative; z-index: 1; }
@media (max-width: 640px) {
  .index-row, .cms-editing .index-row { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 4px; }
  .index-row__code { grid-column: 1 / -1; order: -1; }
  .index-row__meta { align-self: start; }
  .index-row .quiet-counts { display: none; }
}

/* Detail pages (offering, service entry, product): a document header, a fact strip, full-width sections. */
.doc-head { display: grid; gap: 8px; margin-bottom: 24px; }
.doc-head h1 { margin: 0; font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.05; letter-spacing: -.045em; }
.doc-hero { gap: 10px; margin-bottom: 32px; }
.doc-hero h1 { font-size: clamp(2.2rem, 4.6vw, 3rem); }
.doc-hero .lede { font-size: 1.12rem; line-height: 1.65; }
.doc-head__tagline { margin: 0; font-family: var(--f-display); font-size: 1.15rem; font-weight: 500; color: var(--ink-2); line-height: 1.4; }
.doc-head__intro { margin: 2px 0 0; font-family: var(--f-display); font-size: .84rem; color: var(--ink-3); }
.doc-head .lede { margin: 10px 0 0; font-size: 1.06rem; line-height: 1.6; color: var(--ink); }
.doc-head__summary { margin: 0; color: var(--ink-2); }

/* The fact strip reads as an "at a glance" row (docs/marketing_voice_contract.md): a soft panel, small sentence-case labels over plain values. */
.facts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px 32px;
  margin: 0 0 12px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.fact { min-width: 0; }
.fact--wide { grid-column: 1 / -1; }
.fact dt { font-family: var(--f-display); font-size: .8rem; font-weight: 600; color: var(--ink-3); margin-bottom: 3px; }
.fact dd { margin: 0; font-family: var(--f-display); font-size: 1rem; font-weight: 600; line-height: 1.45; color: var(--ink-strong); }
.fact--wide dd { font-family: var(--f-body); font-weight: 400; font-size: 1rem; color: var(--ink); }
.facts--inline {
  grid-template-columns: none; display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 8px 0 0; padding: 0; border: 0;
  background: none; border-radius: 0; box-shadow: none;
}
.facts--inline .fact { display: flex; align-items: baseline; gap: 8px; }
.facts--inline .fact dt { margin: 0; font-size: .76rem; }
.facts--inline .fact dd { font-weight: 400; }
.facts--inline .fact dd { font-size: .86rem; color: var(--ink-2); }

/* Sections: a softer rhythm, generous space above each heading and no rule beneath it. */
.doc-section { margin-top: 52px; }
.doc-section > h2 { font-size: 1.45rem; letter-spacing: -.028em; margin-bottom: 14px; }
/* Subheadings inside a section ("Security", "What's not included"): clear space above when they follow a list or paragraph, a smaller gap below. */
.doc-section > h3, .doc-subhead { margin: 0 0 .6rem; font-size: 1.05rem; font-weight: 720; letter-spacing: -.012em; color: var(--ink-strong); }
.doc-section > * + h3, .doc-section * + .doc-subhead { margin-top: 1.9rem; }
.doc-section > h2 + h3, .doc-section > h2 + .doc-subhead, .doc-section .section-note + .doc-subhead { margin-top: .9rem; }
.doc-section > .field--prose { margin: 0; }
.section-note { margin: -4px 0 14px; font-family: var(--f-display); font-size: .88rem; color: var(--ink-3); }
* + .section-note:last-child { margin: 14px 0 0; }

.doc-list { margin: 0; padding: 0 0 0 1.1em; display: grid; gap: 6px; }
.doc-list li::marker { color: var(--ink-3); }
.doc-list--tight { gap: 2px; font-size: .9rem; }
.doc-list__note { display: block; color: var(--ink-2); font-size: .92rem; }
.compact-list {
  margin: 0; padding: 0; list-style: none; columns: 300px; column-gap: 28px;
  font-family: var(--f-display); font-size: .86rem;
}
.compact-list li { break-inside: avoid; padding: 3px 0; }
.doc-disclosure { margin-top: 8px; }
.doc-disclosure > summary { cursor: pointer; font-family: var(--f-display); font-size: .84rem; color: var(--accent); margin-bottom: 6px; }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--rule); }
.doc-table { font-size: .9rem; }
.doc-table th { padding-left: 0; }
.doc-table td { padding-left: 0; }
.doc-table td + td, .doc-table th + th { padding-left: 16px; }

/* Deliverables: one block per obligation, separated by rules; prose full width, short facts inline beneath. */
.deliverables { display: grid; }
.deliverable { padding: 14px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: calc(var(--bar-height) + 16px); }
.deliverable:first-child { padding-top: 4px; }
.deliverable:last-child { border-bottom: 0; }
.deliverable__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.deliverable__head h3 { margin: 0; font-size: 1rem; }
.deliverable__code { font-size: .74rem; color: var(--ink-3); }
.deliverable__cadence {
  font-family: var(--f-display); font-size: .66rem; font-weight: 760; letter-spacing: .045em; text-transform: uppercase; color: var(--ink-2);
  padding: 2px 8px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--surface-2);
}
.deliverable__outcome { margin: 4px 0 0; }
.deliverable__activity { margin: 6px 0 0; color: var(--ink-2); font-size: .95rem; }
.deliverable__evidence { margin: 8px 0 0; font-size: .9rem; color: var(--ink-2); }
.deliverable .facts--inline + .deliverable__evidence::before, .deliverables--plain .deliverable__evidence::before {
  content: "Evidence: "; font-family: var(--f-display); font-size: .78rem; font-weight: 600; color: var(--ink-3);
}
.deliverables--plain .deliverable__evidence::before { content: "You receive: "; }

/* Readiness and open questions (docs/answering_questions_contract.md): one calm, bounded panel at the end of a page, the working space where questions are answered in place. Open on offering pages until the offering is approved; closed elsewhere. */
.open-questions {
  margin-top: 44px; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius-md); padding: 4px 20px;
}
.open-questions > summary {
  cursor: pointer; list-style: none; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 14px 0;
  font-family: var(--f-display); font-size: 1rem; font-weight: 700; color: var(--ink-strong);
}
.open-questions > summary::-webkit-details-marker { display: none; }
.open-questions > summary::before { content: "▸"; font-size: .8em; color: var(--ink-3); }
.open-questions[open] > summary::before { content: "▾"; }
.open-questions > summary:hover .open-questions__title { color: var(--accent); }
.open-questions__count { margin-left: auto; font-size: .8rem; font-weight: 550; color: var(--ink-3); }
.open-questions__body { padding: 0 0 20px; }
.open-questions__readiness { padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.open-questions__readiness > p:last-child { margin-bottom: 0; }
.open-questions__label, .qcard__label { margin: 0 0 4px; font-family: var(--f-display); font-size: .76rem; font-weight: 700; color: var(--ink-2); }
.open-questions__progress { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; font-family: var(--f-display); font-size: .8rem; color: var(--ink-3); }
.open-questions__progress progress, .qcard-progress {
  appearance: none; -webkit-appearance: none; width: 120px; height: 6px; border: 0; border-radius: 999px; background: var(--rule); overflow: hidden;
}
.open-questions__progress progress::-webkit-progress-bar { background: var(--rule); border-radius: 999px; }
.open-questions__progress progress::-webkit-progress-value { background: var(--good); border-radius: 999px; }
.open-questions__progress progress::-moz-progress-bar { background: var(--good); border-radius: 999px; }
.open-questions__list { display: grid; gap: 12px; margin-top: 12px; }

/* The question card: code, subject, owner, and category; the question; then either the answer, or the recommendation with "Use recommendation" as the one obvious action. */
.qcard-stack { display: grid; gap: 12px; }
.qcard {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-card);
  font-size: .94rem; line-height: 1.55;
}
.open-questions .qcard { box-shadow: none; }
.qcard p { margin: 0; }
.qcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; font-family: var(--f-display); font-size: .76rem; color: var(--ink-3); }
.qcard__meta > * + *::before { content: "·"; margin: 0 7px; color: var(--ink-3); }
.qcard__meta > .chip { margin-left: 10px; }
.qcard__meta > .chip::before { content: none; }
.qcard__code { font-size: .74rem; font-weight: 500; color: var(--ink-2); }
a.qcard__code { color: var(--accent); }
.qcard__question { margin-top: 4px !important; color: var(--ink-strong); font-weight: 560; }
.qcard__source { margin-top: 4px !important; font-family: var(--f-display); font-size: .78rem; color: var(--ink-3); }
.qcard__rec { margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius); }
.qcard__rec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 4px !important; }
.qcard__rec-head .qcard__label { margin: 0; }
.qcard__rec-text, .qcard__answer-text, .qcard__proposal-text { color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.qcard__confidence { font-size: .7rem; padding: 1px 8px; }
.cms-editing .qcard__rec-head > .qcard__confidence { display: none; }
.qcard__why { margin-top: 6px; }
.qcard__why > summary { cursor: pointer; width: fit-content; font-family: var(--f-display); font-size: .8rem; font-weight: 600; color: var(--accent); }
.qcard__why-text { margin-top: 4px !important; font-size: .88rem; color: var(--ink-2); white-space: pre-line; }
.qcard__proposals { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.qcard__proposal { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); }
.qcard__proposal-by { font-family: var(--f-display); font-size: .76rem; color: var(--ink-3); }
.qcard__proposal-by b { font-weight: 650; color: var(--ink-2); }
.qcard__proposal .qcard__form { margin-top: 4px; }
.qcard__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.qcard__actions--quiet { justify-content: space-between; margin-top: 8px; }
.qcard__form { margin: 0; }
.qcard__compose > summary { list-style: none; display: inline-flex; align-items: center; }
.qcard__compose > summary::-webkit-details-marker { display: none; }
.qcard__compose-form { display: grid; gap: 8px; margin-top: 10px; }
.js-questions .qcard__compose[open] { flex-basis: 100%; }
.js-questions .qcard__compose[open] > summary { display: none; }
.js-questions .qcard__actions:has(.qcard__compose[open]) .qcard__use { display: none; }
.js-questions .qcard__compose[open] .qcard__compose-form { margin-top: 0; }
.qcard__compose-label { font-family: var(--f-display); font-size: .78rem; font-weight: 650; color: var(--ink-2); }
.qcard__compose-note { font-family: var(--f-display); font-size: .78rem; color: var(--ink-3); }
.qcard__textarea {
  width: 100%; min-height: 5.5em; padding: 10px 12px; resize: vertical; font: inherit; line-height: 1.5; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
.qcard__textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.qcard__compose-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.btn-small { min-height: 34px; padding: 5px 12px; font-size: .8rem; }
.btn:disabled { opacity: .6; cursor: progress; }
.qcard__quiet-button {
  padding: 0; border: 0; background: none; cursor: pointer; font-family: var(--f-display); font-size: .8rem; font-weight: 600; color: var(--accent);
}
.qcard__quiet-button:hover { text-decoration: underline; }
.qcard__quiet-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.qcard__answer { margin-top: 10px; }
.qcard__byline { margin-top: 4px !important; font-family: var(--f-display); font-size: .78rem; color: var(--ink-3); }
.qcard__hint { font-family: var(--f-display); font-size: .8rem; color: var(--ink-2); }
.qcard__link { font-family: var(--f-display); font-size: .82rem; font-weight: 600; }
.qcard__error { display: block; margin-top: 8px; font-family: var(--f-display); font-size: .8rem; font-weight: 500; color: var(--bad); }
.qcard .cms-flash { margin: 10px 0 0; display: flex; }
.qcard--compact { padding: 10px 12px; font-size: .88rem; box-shadow: none; }
.qcard--compact .qcard__rec { margin-top: 8px; padding: 8px 10px; }
.qcard--compact .qcard__actions { margin-top: 8px; }
.qcard--compact .btn { min-height: 34px; padding: 5px 12px; font-size: .8rem; }

/* Filters on /questions. */
.question-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0 0 28px; }
.question-filters__field { display: grid; gap: 4px; font-family: var(--f-display); font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.question-filters select {
  min-height: 38px; padding: 6px 10px; font: inherit; font-weight: 500; font-size: .88rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
.question-filters__check { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; font-family: var(--f-display); font-size: .86rem; color: var(--ink); }
.question-filters .btn { min-height: 38px; }
.question-filters__clear { font-family: var(--f-display); font-size: .84rem; align-self: center; }
.empty-note { color: var(--ink-3); }

/* Weighing open questions (docs/answering_questions_contract.md, amendment of September 24, 2026): a box with open questions in it is highlighted with an accent edge; blocking and high-priority cards carry a colored edge of their own; each card says what it applies to and how far it reaches. */
.open-questions--waiting { border-color: color-mix(in srgb, var(--accent) 38%, var(--rule)); border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface-2)); }
.qcard--priority-blocking.qcard--open { border-left: 4px solid var(--bad); }
.qcard--priority-high.qcard--open { border-left: 4px solid var(--amber); }
.qcard__priority { font-size: .7rem; padding: 1px 8px; }
.qcard__priority-field { display: inline-flex; align-items: center; gap: 4px; }
.cms-editing .qcard__meta > .qcard__priority { display: none; }
.qcard__label-inline { font-family: var(--f-display); font-size: .76rem; font-weight: 700; color: var(--ink-3); margin-right: 4px; }
.qcard__applies { margin-top: 6px !important; font-family: var(--f-display); font-size: .82rem; color: var(--ink-2); }
.qcard__applies .qcard__subject { font-weight: 600; }
.qcard__reach { color: var(--ink-3); white-space: nowrap; }
.qcard__reach::before { content: "·"; margin: 0 7px; }
.qcard__priority-why { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 4px; margin-top: 6px; font-size: .84rem; color: var(--ink-2); }
.qcard__priority-why-text { margin: 0; white-space: pre-line; }
.start-here { margin: 0 0 36px; padding: 16px 20px 20px; background: var(--surface-2); border: 1px solid var(--rule); border-left: 4px solid var(--bad); border-radius: var(--radius-md); }
.start-here h2 { margin-top: 0; }
.start-here__note { margin: 0 0 14px; font-family: var(--f-display); font-size: .86rem; color: var(--ink-3); }
.off-group .open-questions { margin-top: 20px; }

@media print {
  .qcard { box-shadow: none; break-inside: avoid; }
  .qcard__actions, .qcard__proposals, .question-filters { display: none !important; }
  .qcard__why { display: block; }
}

/* Pending proposals (Settings › Show pending proposals; off by default): a thin accent rule and a small label. */
.is-pending { border-left: 2px solid var(--accent); padding-left: 10px; }
span.is-pending { display: inline-block; }
li.is-pending { list-style: none; margin-left: -1.1em; }
.pending-label {
  display: inline-block; margin-right: 4px; font-family: var(--f-display); font-size: .66rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent); text-decoration: none; vertical-align: 1px;
}
.pending-label:visited { color: var(--accent); }
.pending-label:hover { text-decoration: underline; }
.pending-text { color: var(--ink-2); }

/* Home (/): the catalog's front page. Reader half first (figures, team cards, ways in); the catalog team's workbench below, quieter and set apart. */
.nav-tree__home { margin: 0 0 14px; padding-left: 0; border-left: 0; }
.nav-tree--footer .nav-tree__home { margin: 0; }

.dash-head { display: grid; gap: 8px; margin-bottom: 28px; }
.dash-head h1 { margin: 0; font-size: clamp(2.2rem, 4.5vw, 3rem); line-height: 1; letter-spacing: -.045em; }
.dash-head .lede { margin: 6px 0 0; font-size: 1.1rem; line-height: 1.6; color: var(--ink-2); }

.dash-figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; margin: 0 0 8px;
  border-top: 2px solid var(--ink-strong); border-bottom: 1px solid var(--rule);
}
.dash-figure { display: grid; align-content: start; gap: 2px; padding: 16px 18px 16px 0; }
.dash-figure + .dash-figure { padding-left: 18px; border-left: 1px solid var(--rule); }
.dash-figure dd { margin: 0; }
.dash-figure__count { display: block; font-family: var(--f-display); font-size: 2.1rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.dash-figure__label { font-family: var(--f-display); font-size: .72rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.dash-figure__label a { color: inherit; text-decoration: none; }
.dash-figure__label a:hover { color: var(--accent); text-decoration: underline; }
.dash-figure__note { display: block; font-family: var(--f-display); font-size: .8rem; line-height: 1.4; color: var(--ink-3); }
@media (max-width: 640px) {
  .dash-figures { grid-template-columns: 1fr 1fr; }
  .dash-figure, .dash-figure + .dash-figure { padding: 12px 12px 12px 0; border-left: 0; }
  .dash-figure:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--rule); }
  .dash-figure:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

.dash-section { margin-top: 44px; }
.dash-section__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  margin-bottom: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--rule);
}
.dash-section__head h2 { margin: 0; font-size: 1.25rem; }
.dash-more { font-family: var(--f-display); font-size: .82rem; font-weight: 600; text-decoration: none; }
.dash-more::after { content: " →"; }
.dash-more:hover { text-decoration: underline; }

.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.team-card {
  display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 18px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 74%, transparent), transparent 32%), var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--rule)); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
  scroll-margin-top: calc(var(--bar-height) + 16px);
}
.team-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.team-card__name { margin: 0; font-size: 1.1rem; }
.team-card__name a { color: var(--ink-strong); text-decoration: none; }
.team-card__name a:hover { color: var(--accent); text-decoration: underline; }
.team-card__count { font-family: var(--f-display); font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.team-card__desc { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--ink-2); }
.team-card__offerings { display: grid; gap: 8px; margin: 4px 0 0; padding: 10px 0 0; list-style: none; border-top: 1px solid var(--rule); }
.team-card__offering { font-family: var(--f-display); font-size: .9rem; font-weight: 700; color: var(--ink-strong); text-decoration: none; }
.team-card__offering:visited { color: var(--ink-strong); }
.team-card__offering:hover { color: var(--accent); text-decoration: underline; }
.team-card__tagline { display: block; font-size: .86rem; line-height: 1.45; color: var(--ink-2); }
.team-card__more { margin-top: auto; padding-top: 4px; font-family: var(--f-display); font-size: .8rem; font-weight: 600; text-decoration: none; }
.team-card__more::after { content: " →"; }
.team-card__more:hover { text-decoration: underline; }

.ways-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 28px; margin: 0; padding: 0; list-style: none; }
.ways-in li { display: grid; gap: 2px; }
.ways-in a { font-family: var(--f-display); font-weight: 650; font-size: .98rem; text-decoration: none; }
.ways-in a:hover { text-decoration: underline; }
.ways-in span { font-size: .9rem; line-height: 1.5; color: var(--ink-2); }

.workbench {
  margin-top: 64px; padding: 24px 24px 28px; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  font-family: var(--f-display); font-size: .88rem; color: var(--ink-2);
}
.workbench__head { display: grid; gap: 2px; }
.workbench__head h2 { margin: 0; font-size: 1.1rem; color: var(--ink-strong); }
/* The workbench is a closed disclosure at the bottom of Home (docs/marketing_voice_contract.md): one quiet line until a team member opens it. */
details.workbench { padding-block: 18px 20px; }
details.workbench > summary { position: relative; cursor: pointer; list-style: none; padding-right: 28px; }
details.workbench > summary::-webkit-details-marker { display: none; }
details.workbench > summary::after { content: "▸"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
details.workbench[open] > summary::after { content: "▾"; }
details.workbench > summary:hover h2 { color: var(--accent); }
details.workbench[open] > summary { margin-bottom: 18px; }
.workbench .dash-figures { margin-bottom: 16px; }
.team-card__team { margin: -4px 0 0; font-family: var(--f-display); font-size: .8rem; color: var(--ink-3); }
.workbench__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.wb-panel { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.wb-panel + .wb-panel { margin-top: 0; }
.wb-panel--wide { grid-column: 1 / -1; }
.wb-panel h3 { margin: 0; font-size: .68rem; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.wb-panel h4 { margin: 6px 0 0; font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.wb-panel .dash-more { margin-top: auto; padding-top: 4px; font-size: .8rem; }
.wb-figure { margin: 0; color: var(--ink-2); }
.wb-figure b { font-size: 1.35rem; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 2px; }
.wb-note { margin: 0; font-size: .82rem; line-height: 1.5; color: var(--ink-3); }

.status-bar { display: flex; gap: 2px; height: 10px; border-radius: 3px; overflow: hidden; background: var(--rule); }
.status-bar__seg { display: block; min-width: 4px; }
.status-bar__seg--draft, .wb-swatch--draft { background: var(--ink-3); }
.status-bar__seg--proposed, .wb-swatch--proposed { background: var(--accent); }
.status-bar__seg--approved, .wb-swatch--approved { background: var(--good); }
.status-bar__seg--retired, .wb-swatch--retired { background: var(--rule); }
.wb-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.wb-legend li { display: inline-flex; align-items: center; gap: 6px; }
.wb-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.wb-swatch { width: 9px; height: 9px; border-radius: 2px; }

.wb-owners { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.wb-owners li { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); }
.wb-owners a { color: var(--ink); text-decoration: none; font-weight: 600; }
.wb-owners a:hover { color: var(--accent); text-decoration: underline; }
.wb-owners span { color: var(--ink-3); font-variant-numeric: tabular-nums; }

.wb-questions, .wb-changes, .wb-comments { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wb-figure__note { margin-left: 6px; font-size: .8rem; color: var(--ink-3); }
.wb-questions__meta, .wb-comments__meta { font-size: .76rem; color: var(--ink-3); }
.wb-changes li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 10px; line-height: 1.4; }
.wb-changes a { color: var(--ink); text-decoration: none; }
.wb-changes a:hover { color: var(--accent); text-decoration: underline; }
.wb-changes span { font-size: .76rem; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wb-comments li { position: relative; display: grid; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.wb-comments li:last-child { padding-bottom: 0; border-bottom: 0; }
.wb-comments__who { font-size: .76rem; font-weight: 650; color: var(--ink-2); }
.wb-comments__body { margin: 0; font-family: var(--f-body); font-size: .9rem; line-height: 1.45; color: var(--ink); }
.wb-comments li:hover .wb-comments__body { color: var(--accent); }
.wb-comments__body a.code-link { position: relative; z-index: 1; }
.wb-comments__open { color: var(--ink-3); }
.wb-comments__open::after { content: ""; position: absolute; inset: 0; }
.wb-comments__open:hover, .wb-comments__open:focus-visible { color: var(--accent); }

.meters { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; align-items: baseline; }
.meter__label a { color: var(--ink); text-decoration: none; }
.meter__label a:hover { color: var(--accent); text-decoration: underline; }
.meter__value { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter__track { grid-column: 1 / -1; display: block; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.meter__track i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 640px) { .workbench { margin-left: -8px; margin-right: -8px; padding: 18px 14px 20px; } }

/* --- Print: an offering, a service entry, or a list prints as a clean document (docs/reading_layout_contract.md). --- */
@media print {
  :root, :root:not([data-theme="light"]) {
    color-scheme: light;
    --ground: #fff; --surface: #fff; --surface-2: #f3f5f8; --ink-strong: #0b1733; --ink: #1c2638; --ink-2: #333d50; --ink-3: #555f72;
    --rule: #c9d0db; --rule-strong: #aab3c2; --accent: #0B5CAD; --accent-soft: #fff; --amber: #6e4800; --amber-soft: #fff;
    --good: #1d5a29; --good-soft: #fff; --bad: #8a2438; --bad-soft: #fff; --muted-chip: #fff;
    --shadow-soft: none; --shadow-card: none; --shadow-float: none; --glass: #fff;
  }
  @page { margin: 16mm 14mm; }
  html, body { background: #fff; font-size: 11pt; }
  .site-rail, .site-header, .nav-backdrop, .skip-link, .site-modal, .flash, .approval-notice, .nav-tree--footer, .records-dock,
  .anno-launcher, .anno-launcher-spacer, .anno-drawer, .anno-item-chip, [class^="anno-"], .page-annotations,
  .team-index, .open-questions, .workbench, .dash-more, .team-card__more, .doc-disclosure > summary, button, .btn, .is-pending { display: none !important; }
  .doc-disclosure { display: block; }
  .doc-disclosure::details-content { content-visibility: visible; display: block; }
  body.has-nav .site-stage { margin-left: 0; }
  main.page, main.page.narrow, main.page.schema-page { max-width: none; padding: 0; margin: 0; }
  footer.site-footer { max-width: none; margin: 24px 0 0; padding: 8px 0 0; }
  a, a:visited { color: inherit; text-decoration: none; }
  .index-row:hover, .list-row:hover { background: none; }
  .index-row, .list-row, .deliverable, .fact, .qcard, tr, .change-entry, .team-card { break-inside: avoid; }
  .team-card { background: #fff; border-color: var(--rule); border-radius: var(--radius); }
  .card, .schema-figure, .wb-panel, .index-row:hover { box-shadow: none; }
  h1, h2, h3, .index-group__head, .doc-section > h2 { break-after: avoid; }
  .index-group { break-inside: auto; }
  .table-wrap, .scroll { overflow: visible; }
  .card { border-color: var(--rule); }
  .chip { border: 1px solid var(--rule); }
}

/* Packages (docs/packages_contract.md): the showcase at /packages (plans as a row of comparable cards, add-ons below), the package page, and the dashboard's compact cards. Marketing material in the catalog's palette: no prices, no "most popular". */
.dash-section--packages { margin-top: 8px; margin-bottom: 36px; }
.dashboard .dash-section { margin-top: 56px; }
.dashboard .dash-section--packages { margin-top: 8px; }
.dashboard .dash-section__head { border-bottom: 0; padding-bottom: 0; }
.dashboard .dash-section__head h2 { font-size: 1.45rem; letter-spacing: -.028em; }
.pkg-hero h1 { margin: 0; font-size: clamp(2.1rem, 4.4vw, 2.9rem); line-height: 1.05; letter-spacing: -.045em; }
.pkg-row { margin-top: 36px; }
.pkg-row__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 14px; }
.pkg-row__head h2 { margin: 0; font-size: 1.25rem; }
.pkg-row__head .section-note { margin: 0; }
.pkg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; align-items: stretch; }
.pkg-cards--compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pkg-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 22px 22px 20px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent-soft) 80%, transparent), transparent 38%), var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--rule)); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
  scroll-margin-top: calc(var(--bar-height) + 16px);
}
.pkg-card--add-on {
  background: color-mix(in srgb, var(--accent) 4%, var(--surface)); border-style: solid; border-color: color-mix(in srgb, var(--accent) 30%, var(--rule)); box-shadow: var(--shadow-card);
}
.pkg-card--compact { padding: 16px 18px; gap: 6px; border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.pkg-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.pkg-card__kind { font-family: var(--f-display); font-size: .7rem; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.pkg-card__name { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.pkg-card--compact .pkg-card__name { font-size: 1.05rem; }
.pkg-card__name a, .pkg-card__name a:visited { color: var(--ink-strong); text-decoration: none; }
.pkg-card__name a:hover { color: var(--accent); text-decoration: underline; }
.pkg-card__audience { margin: 0; font-family: var(--f-display); font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.pkg-card__tagline { margin: 0; font-size: .95rem; line-height: 1.5; color: var(--ink); }
.pkg-card--compact .pkg-card__tagline { font-size: .86rem; color: var(--ink-2); }
.pkg-card__band {
  align-self: flex-start; margin: 2px 0 0; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--f-display); font-size: .8rem; font-weight: 720;
}
.pkg-card__plus { margin: 6px 0 0; font-family: var(--f-display); font-size: .84rem; font-weight: 700; color: var(--ink-strong); }
.pkg-card__items { display: grid; gap: 7px; margin: 6px 0 0; padding: 12px 0 0; list-style: none; border-top: 1px solid var(--rule); font-size: .9rem; line-height: 1.45; }
.pkg-card__items li { position: relative; padding-left: 22px; }
.pkg-card__items li::before {
  content: ""; position: absolute; left: 2px; top: .38em; width: 11px; height: 6px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg);
}
.pkg-card__more { margin: 0; font-family: var(--f-display); font-size: .8rem; color: var(--ink-3); }
.pkg-card__cta { margin-top: auto; padding-top: 8px; font-family: var(--f-display); font-size: .86rem; font-weight: 700; text-decoration: none; }
.pkg-card__cta::after { content: " →"; }
.pkg-card__cta:hover { text-decoration: underline; }
.pkg-doc__builds-on { margin: 0; font-family: var(--f-display); font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.pkg-items { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pkg-item { display: grid; gap: 2px; padding-left: 22px; position: relative; }
.pkg-item::before {
  content: ""; position: absolute; left: 2px; top: .45em; width: 11px; height: 6px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg);
}
.pkg-items--optional .pkg-item::before { width: 8px; height: 8px; top: .5em; border: 2px solid var(--ink-3); border-radius: 50%; transform: none; }
.pkg-item__text { color: var(--ink); }
.pkg-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-family: var(--f-display); font-size: .78rem; }
.pkg-item__link { color: var(--ink-3); }
.pkg-item__link:visited { color: var(--ink-3); }
.pkg-item__link:hover { color: var(--accent); }
.pkg-item--inherited .pkg-item__text { color: var(--ink-2); }
.allowance-list__text { font-weight: 650; color: var(--ink-strong); }
@media (max-width: 640px) {
  .pkg-cards, .pkg-cards--compact { grid-template-columns: minmax(0, 1fr); }
  .pkg-card { padding: 18px 16px; }
}
@media print {
  .pkg-card, .pkg-card--add-on { background: #fff; box-shadow: none; border-color: var(--rule); break-inside: avoid; }
  .pkg-card__cta, .pkg-companions, .cms-new-record { display: none !important; }
  .pkg-card__band { background: #fff; border: 1px solid var(--rule); }
  .pkg-cards { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
  .pkg-item, .pkg-row__head { break-inside: avoid; }
}

/* Marketing voice and feel (docs/marketing_voice_contract.md): reader pages read like the packages pages. Internal codes are for editors only; lists use the packages' checkmarks; services read as cards and tiles. */
.record-code { font-family: var(--f-mono); font-size: .72rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
html:not(.cms-editing) .record-code { display: none; }
.eyebrow .record-code { margin-left: 4px; }

.check-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.check-list > li { position: relative; padding-left: 26px; line-height: 1.55; }
.check-list > li::before {
  content: ""; position: absolute; left: 3px; top: .45em; width: 11px; height: 6px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg);
}
.check-list--not > li::before { top: .75em; width: 10px; height: 0; border-left: 0; border-bottom: 2px solid var(--ink-3); transform: none; }
.check-list--ask > li::before { content: "→"; top: 0; width: auto; height: auto; border: 0; transform: none; color: var(--accent); font-family: var(--f-display); font-weight: 700; }
.check-list--note > li::before { top: .62em; left: 4px; width: 6px; height: 6px; border: 0; border-radius: 50%; background: var(--ink-3); transform: none; }
.check-list > li.is-pending { margin-left: 0; }
.check-list__note { display: block; margin-top: 2px; color: var(--ink-2); font-size: .94rem; }

.doc-foot { margin: 52px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); font-family: var(--f-display); font-size: .9rem; color: var(--ink-3); }
.doc-fold { margin-top: 36px; font-family: var(--f-display); font-size: .9rem; }
.doc-fold > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.doc-fold > summary:hover { color: var(--accent); }
.doc-fold[open] > summary { margin-bottom: 10px; }
.doc-fold__count { color: var(--ink-3); font-weight: 500; }
/* Terms (docs/catalog_and_tool_tables_contract.md): each term's header row carries its own small Delete control; the calendars and priority levels tables carry a caption saying they're tables of their own. */
.term-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.term-table { margin-top: 22px; }
.term-table__caption h3 { margin: 0 0 4px; }
.term-table__provenance { margin: 0 0 10px; font-family: var(--f-display); font-size: .84rem; color: var(--ink-3); }
.term-table__actions { width: 1%; text-align: right; white-space: nowrap; }
.term-table__actions .cms-danger--inline { flex-direction: column; align-items: flex-end; gap: 6px; }
.term-table__actions .cms-confirm, .term-table__actions .cms-error { width: 15rem; margin: 0; white-space: normal; text-align: left; }
.term-head .cms-danger--inline { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

/* A service's "What you get": one card per deliverable, its plain outcome, a "how often" tag, and the evidence folded away. */
.svc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.svc-card {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 18px 20px 16px;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--rule)); border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--bar-height) + 16px);
}
.svc-card__head { display: grid; gap: 6px; }
.svc-card__head h3 { position: relative; margin: 0; padding-left: 24px; font-size: 1.05rem; line-height: 1.3; }
.svc-card__head h3::before {
  content: ""; position: absolute; left: 3px; top: .38em; width: 11px; height: 6px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg);
}
.svc-card__often {
  justify-self: start; margin-left: 24px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--f-display); font-size: .76rem; font-weight: 650;
}
.svc-card__outcome { margin: 0; color: var(--ink); line-height: 1.55; }
.svc-card__more { margin-top: auto; padding-top: 4px; font-family: var(--f-display); font-size: .84rem; }
.svc-card__more > summary { cursor: pointer; color: var(--ink-3); font-weight: 600; }
.svc-card__more > summary:hover { color: var(--accent); }
.svc-card__evidence { margin: 6px 0 0; font-family: var(--f-body); font-size: .92rem; color: var(--ink-2); }
.cms-editing .svc-card__more::details-content { content-visibility: visible; display: block; }
.svc-card__code { align-self: flex-start; }

/* How quickly we respond: the situation, then the promise in plain words. */
.promise-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.promise { display: grid; gap: 3px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.promise__when { font-family: var(--f-display); font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.promise__what { color: var(--ink-strong); font-weight: 560; }

/* The services list: grouped by what the service is for, one tile per service. */
.svc-group { margin-top: 48px; scroll-margin-top: calc(var(--bar-height) + 16px); }
.svc-group__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 16px; }
.svc-group__head h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.028em; }
.svc-group__team { font-family: var(--f-display); font-size: .84rem; color: var(--ink-3); }
.svc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.svc-tile {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--bar-height) + 16px); transition: border-color .15s ease, box-shadow .15s ease;
}
.svc-tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); box-shadow: var(--shadow-soft); }
.svc-tile:has(.svc-tile__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.svc-tile__name { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.svc-tile__link, .svc-tile__link:visited { color: var(--ink-strong); text-decoration: none; }
.svc-tile__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.svc-tile__link:focus-visible { outline: none; }
.svc-tile:hover .svc-tile__link { color: var(--accent); }
.svc-tile__tagline { margin: 0; color: var(--ink-2); font-size: .94rem; line-height: 1.5; }
.svc-tile .is-pending a, .svc-tile .anno-item-chip, .cms-editing .svc-tile .cms-field { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .svc-tile { transition: none; } }
@media (max-width: 640px) {
  .svc-cards, .svc-tiles { grid-template-columns: minmax(0, 1fr); }
  .facts { padding: 16px; }
}

@media print {
  .record-code, .svc-card__more, .doc-foot, .doc-fold { display: none !important; }
  .facts, .svc-card, .svc-tile, .promise { background: #fff; box-shadow: none; border-color: var(--rule); }
  .svc-card, .svc-tile, .promise, .check-list > li { break-inside: avoid; }
  .svc-cards, .svc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .svc-card__often { background: #fff; border: 1px solid var(--rule); }
  .doc-section > * + h3, .doc-section * + .doc-subhead { margin-top: 1.4rem; }
  .doc-subhead, .svc-group__head { break-after: avoid; }
  .page-hero h1, .doc-hero h1 { font-size: 24pt; }
}

/* In-place editing (docs/cms_contract.md, "The editing experience"; app/assets/javascripts/catalog_editing.js). Editors' pages carry .cms-field hooks on every editable value, but nothing shows until Edit mode puts .cms-editing on the root element: then values get a soft highlight and a pencil in the margin on hover, blanks show a quiet "+ Add …" placeholder, and a click opens a control styled like the text it replaces. */
html:not(.cms-editing) .cms-field[data-cms-blank]:empty { display: none; }
.cms-editing .cms-field .cms-fallback:not(:has(.cms-field)) { display: none; }
.cms-editing .cms-field {
  position: relative; z-index: 2; cursor: pointer; border-radius: 4px;
  box-shadow: 0 0 0 3px transparent; transition: background-color .15s ease, box-shadow .15s ease;
}
.cms-editing .cms-field:hover, .cms-editing .cms-field:focus-visible {
  background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); outline: none;
}
.cms-editing .cms-field:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.cms-editing .cms-field::after {
  content: "✎"; position: absolute; left: -1.35em; top: 0; font-family: var(--f-display); font-size: .85rem; font-style: normal;
  color: var(--accent); opacity: 0; transition: opacity .15s ease; pointer-events: none;
}
.cms-editing .cms-field:hover::after, .cms-editing .cms-field:focus-visible::after { opacity: 1; }
.cms-editing .cms-field[data-cms-blank]::before {
  content: attr(data-cms-placeholder); font-family: var(--f-display); font-size: .82rem; font-weight: 500; font-style: normal;
  color: var(--ink-3); letter-spacing: 0; text-transform: none;
}
.cms-editing .cms-field[data-cms-blank]:has(.cms-fallback .cms-field)::before { margin-right: .6em; }
.cms-editing .cms-field[data-cms-blank]:hover::before { color: var(--accent); }
.cms-editing .cms-field.is-open { cursor: auto; background: transparent; box-shadow: none; z-index: 30; }
.cms-editing .cms-field.is-open::after, .cms-editing .cms-field.is-open::before { content: none; }
.cms-editing .cms-field.is-saving { opacity: .55; cursor: progress; }
.cms-editing .cms-field[role="switch"]::before {
  content: ""; display: inline-block; vertical-align: -2px; width: 26px; height: 15px; margin-right: 6px; border-radius: 999px;
  background: radial-gradient(circle at 7.5px 50%, var(--surface) 5px, transparent 5.5px), var(--ink-3);
}
.cms-editing .cms-field[role="switch"][aria-checked="true"]::before {
  background: radial-gradient(circle at 18.5px 50%, var(--surface) 5px, transparent 5.5px), var(--accent);
}
.cms-editing .cms-field[role="switch"][data-cms-blank]::before { content: ""; }
.cms-editing .cms-field[role="switch"][data-cms-blank]::after { content: attr(data-cms-placeholder); position: static; opacity: 1; color: var(--ink-3); font-size: .82rem; margin-left: 0; }

.cms-editor { display: inline; text-transform: none; letter-spacing: normal; }
.cms-editor .cms-input, .cms-editor .cms-select, .cms-combo__list, .cms-error { text-transform: none; letter-spacing: normal; }
.cms-editor--prose, .cms-editor--long, .cms-editor--fk { display: block; }
.cms-input, .cms-textarea, .cms-select {
  font: inherit; color: inherit; letter-spacing: inherit; background: var(--surface); border: 0; border-radius: 4px;
  box-shadow: 0 0 0 2px var(--accent); padding: 0 4px; margin: 0; max-width: 100%;
}
.cms-input:focus, .cms-textarea:focus, .cms-select:focus { outline: none; box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft); }
.cms-input[aria-invalid="true"], .cms-textarea[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--bad); }
.cms-textarea { display: block; width: 100%; resize: none; overflow: hidden; line-height: inherit; padding: 2px 6px; }
.cms-segmented { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 2px; padding: 3px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface-2); vertical-align: middle; }
.cms-segmented__option {
  font-family: var(--f-display); font-size: .78rem; font-weight: 600; border: 0; border-radius: 999px; padding: 3px 10px;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.cms-segmented__option[aria-checked="true"] { background: var(--surface); color: var(--ink-strong); box-shadow: 0 0 0 1px var(--rule-strong), var(--shadow-card); }
.cms-segmented__option:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.cms-combo { position: relative; display: inline-block; min-width: min(320px, 100%); }
.cms-combo__input { width: 100%; }
.cms-combo__list {
  position: absolute; z-index: 20; left: 0; top: calc(100% + 6px); min-width: max(100%, 340px); max-width: min(520px, 88vw);
  max-height: 260px; overflow-y: auto; margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md);
  box-shadow: var(--shadow-float); font-family: var(--f-display); font-size: .88rem;
}
.cms-combo__option { display: flex; justify-content: space-between; gap: 12px; padding: 6px 9px; border-radius: calc(var(--radius) - 4px); cursor: pointer; color: var(--ink); }
.cms-combo__option.is-active, .cms-combo__option:hover { background: var(--accent-soft); }
.cms-combo__option[aria-selected="true"] { font-weight: 650; }
.cms-combo__code { font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); white-space: nowrap; }
.cms-combo__empty { padding: 5px 8px; color: var(--ink-3); }
.cms-combo--multi .cms-combo__option { justify-content: flex-start; }
.cms-combo--multi .cms-combo__code { margin-left: auto; }
.cms-combo--multi .cms-combo__option { gap: 8px; }
.cms-check {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; border-radius: 3px;
  border: 1.5px solid var(--ink-3); font-size: .7rem; color: var(--accent);
}
.cms-combo__option[aria-selected="true"] .cms-check { border-color: var(--accent); }
.cms-error {
  display: block; margin-top: 4px; font-family: var(--f-display); font-size: .8rem; font-style: normal; font-weight: 500; color: var(--bad);
}
.cms-flash {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; font-family: var(--f-display); font-size: .76rem; font-style: normal;
  font-weight: 600; color: var(--good); vertical-align: middle; animation: cms-flash-in .2s ease;
}
.cms-flash__tick::before { content: "✓ "; }
.cms-flash__undo {
  font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline;
}
.cms-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes cms-flash-in { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cms-editing .cms-field, .cms-editing .cms-field::after { transition: none; }
  .cms-flash { animation: none; }
}
html:not(.cms-editing) .cms-when-editing { display: none; }
.profile-menu__item[role="menuitemcheckbox"] { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.profile-menu__item[role="menuitemcheckbox"]::after {
  content: ""; width: 26px; height: 15px; border-radius: 999px; flex: none;
  background: radial-gradient(circle at 7.5px 50%, var(--surface) 5px, transparent 5.5px), var(--ink-3);
}
.profile-menu__item[role="menuitemcheckbox"][aria-checked="true"]::after {
  background: radial-gradient(circle at 18.5px 50%, var(--surface) 5px, transparent 5.5px), var(--accent);
}

/* Adding, removing, and reordering parts of a page, and creating and deleting records (docs/cms_contract.md, passes 2 and 3). Edit mode only. */
.cms-editing .cms-reading-only { display: none; }
.cms-when-editing[hidden] { display: none; }
.cms-add[hidden], .cms-item-controls[hidden], .cms-danger__button[hidden] { display: none !important; }
.cms-add {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 5px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: transparent; color: var(--accent); font-family: var(--f-display); font-size: .82rem; font-weight: 600; cursor: pointer;
}
.cms-add:hover, .cms-add:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.cms-new-record { margin: 0 0 18px; }
.cms-item-controls { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.cms-icon-button {
  font-family: var(--f-display); font-size: .72rem; font-weight: 700; padding: 1px 8px; border: 1px solid var(--rule-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.cms-icon-button:hover, .cms-icon-button:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.cms-icon-button--remove:hover, .cms-icon-button--remove:focus-visible { border-color: var(--bad); color: var(--bad); }
.cms-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: 8px; font-family: var(--f-display); font-size: .82rem; }
.cms-button {
  font-family: var(--f-display); font-size: .8rem; font-weight: 720; min-height: 34px; padding: 5px 13px; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-strong); cursor: pointer;
}
.cms-button:hover:not(:disabled) { border-color: var(--neutral); }
.cms-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.cms-button--primary { background: var(--button); border-color: var(--button); color: var(--button-ink); }
.cms-button--primary:hover:not(:disabled) { background: color-mix(in srgb, var(--button) 84%, var(--accent)); border-color: var(--button); }
.cms-button--danger { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.cms-button--danger:hover:not(:disabled) { border-color: var(--bad); filter: brightness(1.06); }
.cms-button:disabled { opacity: .6; cursor: progress; }
.cms-form {
  display: grid; gap: 12px; margin: 12px 0; padding: 18px 20px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--rule)); border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow-soft); font-family: var(--f-display); font-size: .88rem;
}
.cms-form__row { display: grid; gap: 4px; }
.cms-form__row label { font-size: .68rem; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.cms-form__row--boolean { grid-template-columns: auto 1fr; align-items: center; }
.cms-form__control { font: inherit; color: var(--ink-strong); padding: 7px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); max-width: 100%; }
.cms-form__control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.cms-form__control { resize: vertical; line-height: 1.5; }
.cms-form__actions { display: flex; gap: 8px; }
.cms-form .cms-combo { display: block; min-width: 0; }
.cms-form .cms-combo__input { width: 100%; box-sizing: border-box; }
.cms-danger { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--rule); }
.cms-danger__button {
  font-family: var(--f-display); font-size: .82rem; font-weight: 720; min-height: 34px; padding: 5px 13px; border: 1px solid var(--bad); border-radius: var(--radius);
  background: transparent; color: var(--bad); cursor: pointer;
}
.cms-danger__button:hover, .cms-danger__button:focus-visible { background: var(--bad-soft); outline: none; }
/* The inline form (shared/record_delete, inline: true): a small secondary control in a record's header row or table row, not a block at the end of the page. */
.cms-danger--inline { display: inline-flex; margin: 0; padding: 0; border: 0; }
.cms-danger--inline .cms-danger__button { min-height: 28px; padding: 3px 10px; font-size: .76rem; font-weight: 650; border-color: var(--rule-strong); color: var(--ink-3); }
.cms-danger--inline .cms-danger__button:hover, .cms-danger--inline .cms-danger__button:focus-visible { border-color: var(--bad); color: var(--bad); }
.cms-more-fields { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }

/* A record's edit history (docs/cms_contract.md): a small disclosure at the end of a detail page. */
.history { margin-top: 36px; font-family: var(--f-display); font-size: .84rem; color: var(--ink-2); }
.history summary { cursor: pointer; color: var(--ink-3); font-weight: 600; }
.history ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.history li { border-left: 2px solid var(--rule); padding-left: 10px; }
.history .when { color: var(--ink-3); }
.history .change { display: block; overflow-wrap: anywhere; white-space: pre-line; }
.history del, .revision-change del { color: var(--ink-3); }
.history ins, .revision-change ins { text-decoration: none; }
.revision-change { overflow-wrap: anywhere; white-space: pre-line; }
@media print {
  .history, .cms-flash, .cms-error, .cms-when-editing, .cms-field[data-cms-blank] { display: none !important; }
}


/* Edit mode switch: a floating pill stacked just above the Comments launcher (editors only), styled like it (Strategy Room's comments trigger). */
.cms-mode-fab {
  position: fixed; right: 20px; bottom: 80px; z-index: 900;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 14px;
  border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--glass); color: var(--ink-strong);
  -webkit-backdrop-filter: blur(.6rem); backdrop-filter: blur(.6rem);
  font: 720 .8rem var(--f-display); cursor: pointer; box-shadow: var(--shadow-float);
}
.cms-mode-fab:hover { border-color: var(--neutral); }
.cms-mode-fab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cms-mode-fab__switch { position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--rule-strong); }
.cms-mode-fab__switch i { position: absolute; top: 1px; left: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); transition: transform .15s ease, background-color .15s ease; }
.cms-mode-fab[aria-checked="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
.cms-mode-fab[aria-checked="true"] .cms-mode-fab__switch { background: var(--accent-soft); border-color: var(--accent); }
.cms-mode-fab[aria-checked="true"] .cms-mode-fab__switch i { transform: translateX(12px); background: var(--accent); }
body.has-records-dock .cms-mode-fab { bottom: calc(var(--records-dock-h, 40vh) + 76px); }
@media (max-width: 640px) { .cms-mode-fab__label { display: none; } }
@media (prefers-reduced-motion: reduce) { .cms-mode-fab__switch i { transition: none; } }
@media print { .cms-mode-fab { display: none !important; } }

/* Legacy & sources (docs/page_help_contract.md, "Fold Coverage into Legacy"): each mapping's confidence, and the compact "Curtis's workbook" section. */
.chip--confidence { background: var(--muted-chip); color: var(--ink-3); }
.legacy-workbook__meters { margin: 14px 0 10px; }
.legacy-workbook__detail h3 { margin: 18px 0 8px; }

/* --- Page help (docs/page_help_contract.md): the Help button, the slide-in Help panel, and the plain help page. --- */
.help-button {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px 0 10px;
  border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--surface); color: var(--ink-strong);
  font-family: var(--f-display); font-size: .84rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.help-button:visited { color: var(--ink-strong); }
.help-button:hover { background: var(--surface-2); border-color: var(--neutral); }
.help-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.help-button + .profile-menu { margin-left: 0; }
@media (max-width: 640px) { .help-button__label { display: none; } .help-button { padding: 0 10px; } }

.help-panel {
  inset: 0 0 0 auto; width: min(40rem, 100vw); max-width: none; height: 100vh; height: 100dvh; max-height: none;
  margin: 0; padding: 0; overflow: hidden; border: 0; border-left: 1px solid var(--rule-strong);
  color: var(--ink); background: var(--surface); box-shadow: -1.5rem 0 4rem rgb(16 24 39 / 22%); font-family: var(--f-body);
}
.help-panel[open] { animation: help-panel-in .2s ease-out; }
.help-panel::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(.12rem); backdrop-filter: blur(.12rem); }
@keyframes help-panel-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .help-panel[open] { animation: none; } }
.help-panel__surface { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.help-panel__article { padding: 0 24px 32px; }
.help-panel__header {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin: 0 -24px 16px; padding: 20px 24px 14px; border-bottom: 1px solid var(--rule); background: var(--surface);
}
.help-panel__eyebrow { margin: 0 0 2px; font: 780 .68rem var(--f-display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.help-panel__title { margin: 0; font: 800 1.3rem/1.25 var(--f-display); color: var(--ink-strong); }
.help-panel__actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.help-panel__page-link { font: 600 .8rem var(--f-display); color: var(--accent); }
.help-panel__close {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--rule); border-radius: 50%; background: var(--surface);
  font-size: 1.4rem; line-height: 1; color: var(--ink-strong); cursor: pointer;
}
.help-panel__close:hover { background: var(--surface-2); }
.help-panel__close:focus-visible, .help-panel a:focus-visible, .help-content :is(h2, h3):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.help-panel__more { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: .88rem; color: var(--ink-2); }

.help-toc { margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface-2); font-family: var(--f-display); }
.help-toc__title { margin: 0 0 6px; font-size: .7rem; font-weight: 780; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.help-toc ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 3px; font-size: .86rem; }
.help-toc a { color: var(--accent); text-decoration: none; }
.help-toc a:hover { text-decoration: underline; }

.help-content { font-size: .94rem; line-height: 1.6; color: var(--ink); overflow-wrap: break-word; }
.help-content h2 { margin: 28px 0 10px; padding-top: 4px; font: 800 1.1rem/1.3 var(--f-display); color: var(--ink-strong); scroll-margin-top: 96px; }
.help-content h3 { margin: 20px 0 8px; font: 750 .98rem/1.35 var(--f-display); color: var(--ink-strong); scroll-margin-top: 96px; }
.help-content h4 { margin: 16px 0 6px; font: 700 .9rem var(--f-display); color: var(--ink-2); }
.help-content > :first-child { margin-top: 0; }
.help-content p, .help-content ul, .help-content ol { margin: 0 0 12px; }
.help-content ul, .help-content ol { padding-left: 1.3rem; }
.help-content li + li { margin-top: 4px; }
.help-content code { font: .85em var(--f-mono); padding: 1px 5px; border-radius: 4px; background: var(--surface-2); }
.help-content pre { max-width: 100%; overflow-x: auto; margin: 6px 0 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--rule); }
.help-content pre code { padding: 0; background: none; }
.help-content blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--rule-strong); color: var(--ink-2); }
.help-content table { display: block; overflow-x: auto; width: 100%; margin: 0 0 16px; border-collapse: collapse; font-size: .88rem; }
.help-content th, .help-content td { padding: 7px 10px; border: 1px solid var(--rule); text-align: left; vertical-align: top; }
.help-content th { background: var(--surface-2); font-family: var(--f-display); font-weight: 700; color: var(--ink-strong); }
.help-anchor { margin-left: 8px; font-weight: 500; color: var(--ink-3); text-decoration: none; opacity: 0; }
.help-content :is(h2, h3):hover .help-anchor, .help-anchor:focus-visible { opacity: 1; }

.help-page__layout { display: grid; gap: 24px; }
@media (min-width: 1100px) {
  .help-page__layout { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
  .help-page .help-toc { position: sticky; top: calc(var(--bar-height) + 16px); }
}

/* The Edit switch's Help link: a small pill above the switch, shown while Edit mode is on. */
.cms-mode-help {
  position: fixed; right: 20px; bottom: 132px; z-index: 900; display: none; align-items: center; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--glass); color: var(--accent);
  -webkit-backdrop-filter: blur(.6rem); backdrop-filter: blur(.6rem);
  font: 700 .76rem var(--f-display); text-decoration: none; box-shadow: var(--shadow-float);
}
.cms-editing .cms-mode-help { display: inline-flex; }
.cms-mode-help:hover { border-color: var(--neutral); }
.cms-mode-help:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
body.has-records-dock .cms-mode-help { bottom: calc(var(--records-dock-h, 40vh) + 128px); }

@media print { .help-button, .help-panel, .cms-mode-help, .help-anchor, .help-page .help-toc { display: none !important; } }
