/* IT GO page styles. Every colour, type size, radius, and shadow is a token
   from tokens.css (design spec, MVP plan step 3c); this file only arranges.

   Console layout (rework plan Q10): a side menu, a top bar, and a dense
   content area. Wide screens use the extra width for the menu, not for
   longer lines of text (Q11). */

:root {
  --sidebar-width: 15rem;
  --content-width: 96rem;
  --reading-width: 80ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--ob-bg);
  color: var(--ob-ink);
}

body {
  align-content: flex-start;
  align-items: stretch;
  background: var(--ob-bg);
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  min-height: 100vh;
}

/* Beside the content the sidebar reaches the foot of the window even on a
   short page; stacked above it, it takes only its own height. */
@media (min-width: 50rem) {
  body {
    align-content: stretch;
  }
}

a {
  color: var(--ob-ink);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--ob-olive);
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.skip-link {
  background: var(--ob-surface);
  border: 2px solid var(--ob-primary);
  border-radius: var(--ob-radius-sm);
  color: var(--ob-ink);
  font-weight: 700;
  left: 1rem;
  padding: 0.7rem 1rem;
  position: absolute;
  top: 0;
  transform: translateY(-140%);
  z-index: 1000;
}

.skip-link:focus {
  transform: translateY(0.75rem);
}

:focus-visible {
  outline: var(--ob-focus);
  outline-offset: 2px;
}

/* The app shell (design spec §4): the sidebar and the main column wrap,
   so the sidebar keeps about 220px beside the content and stacks above it
   on a narrow screen. The sidebar is never sticky and never 100vh; it
   stretches with the page. */

.site-sidebar {
  background: var(--ob-sunken);
  border-right: var(--ob-border);
  display: flex;
  flex: 1 1 220px;
  flex-direction: column;
  gap: var(--ob-space-6);
  padding: var(--ob-space-6) var(--ob-space-4);
}

.brand {
  align-items: center;
  color: var(--ob-ink);
  display: flex;
  gap: 10px;
  padding: 0 var(--ob-space-2);
  text-decoration: none;
}

.brand:hover {
  color: var(--ob-ink);
}

/* The IT GO logo, black on transparent. The dark theme turns it light. */
.brand-logo {
  display: block;
  height: auto;
  max-width: 100%;
  width: 180px;
}

[data-theme="dark"] .brand-logo {
  filter: invert(1);
}

@media print {
  [data-theme="dark"] .brand-logo {
    filter: none;
  }
}

/* The Organization being worked in (design spec §5.2). */
.workspace-switcher {
  align-items: center;
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-lg);
  color: var(--ob-ink);
  display: flex;
  gap: var(--ob-space-3);
  min-height: 48px;
  padding: var(--ob-space-2) var(--ob-space-3);
  text-decoration: none;
  transition: border-color var(--ob-dur-fast) var(--ob-ease);
}

.workspace-switcher:hover {
  border-color: var(--ob-muted);
  color: var(--ob-ink);
}

.workspace-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.workspace-name {
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.workspace-context {
  color: var(--ob-muted);
  font-size: var(--ob-fs-caption);
}

/* Initials in a circle (design spec §5.14). */
.avatar {
  align-items: center;
  background: var(--ob-status-track-bg);
  border-radius: 50%;
  color: var(--ob-status-track-ink);
  display: inline-flex;
  flex: none;
  font-size: var(--ob-fs-caption);
  font-weight: 600;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.avatar-large {
  height: 44px;
  width: 44px;
}

.icon {
  fill: none;
  flex: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.navigation-groups {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--ob-space-6);
}

/* Administration and Help sit at the foot of the sidebar (MVP plan Q97). */
.navigation-foot {
  border-top: var(--ob-border);
  padding-top: var(--ob-space-4);
}

.navigation-group:not(.navigation-foot) + .navigation-foot {
  margin-top: auto;
}

.navigation-foot + .navigation-foot {
  border-top: 0;
  padding-top: 0;
}

.navigation-group-label {
  color: var(--ob-muted);
  display: block;
  font-family: var(--ob-font-mono);
  font-size: var(--ob-fs-mono-label);
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0 var(--ob-space-3) var(--ob-space-2);
  text-transform: uppercase;
}

.primary-navigation {
  display: flex;
  flex-direction: column;
  gap: var(--ob-space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* A sidebar link (design spec §5.3). */
.primary-navigation a {
  align-items: center;
  border-radius: var(--ob-radius-md);
  color: var(--ob-ink);
  display: flex;
  gap: var(--ob-space-3);
  min-height: 44px;
  padding: 0 var(--ob-space-3);
  text-decoration: none;
  transition: background-color var(--ob-dur-fast) var(--ob-ease);
}

.primary-navigation a:hover {
  background: var(--ob-nav-active);
  color: var(--ob-ink);
}

.primary-navigation a[aria-current="page"] {
  background: var(--ob-nav-active);
  font-weight: 500;
}

.nav-label {
  flex: 1;
}

/* The main column: the top bar, then the page. */

.app-body {
  display: flex;
  flex: 999 1 560px;
  flex-direction: column;
  min-width: 0;
}

/* The top bar (design spec §4.2): the search grows, then the controls. */
.app-topbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-3);
  padding: var(--ob-space-6) var(--ob-space-8) 0;
}

.app-topbar .topbar-search {
  background: none;
  border: 0;
  border-radius: 0;
  display: flex;
  flex: 1 1 360px;
  margin: 0;
  max-width: none;
  padding: 0;
}

/* The command search (design spec §5.8). */
.command-search {
  align-items: center;
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-lg);
  color: var(--ob-muted);
  cursor: text;
  display: flex;
  flex: 1;
  gap: var(--ob-space-3);
  min-height: 44px;
  padding: 0 var(--ob-space-2) 0 14px;
  transition: border-color var(--ob-dur-fast) var(--ob-ease);
}

.command-search:hover,
.command-search:focus-within {
  border-color: var(--ob-muted);
}

.command-search:focus-within {
  outline: var(--ob-focus);
  outline-offset: 2px;
}

.command-search input {
  background: transparent;
  border: 0;
  color: var(--ob-ink);
  flex: 1;
  font-size: var(--ob-fs-body);
  margin: 0;
  min-height: 42px;
  min-width: 0;
  padding: 0;
}

.command-search input:focus-visible {
  outline: none;
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-3);
}

/* Controls in the top bar are 44px tall (design spec §4.2). */
.topbar-actions > .action-link,
.topbar-actions > button {
  margin: 0;
  min-height: 44px;
}

/* The theme toggle (design spec §7.5): a secondary button naming the theme
   it switches to, with a moon or a sun. */
.theme-toggle span {
  align-items: center;
  display: inline-flex;
  gap: var(--ob-space-2);
}

.theme-toggle svg {
  fill: none;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 16px;
}

[data-theme="dark"] .theme-to-dark,
:root:not([data-theme="dark"]) .theme-to-light {
  display: none;
}

/* The account menu (MVP plan Q103): the avatar opens a small menu. */
.account-menu {
  margin: 0;
  position: relative;
}

.account-menu > summary {
  cursor: pointer;
  list-style: none;
  padding: 0;
}

.account-menu > summary::-webkit-details-marker {
  display: none;
}

.account-menu > summary:hover,
.account-menu[open] > summary {
  outline: 2px solid var(--ob-line);
  outline-offset: 2px;
}

.account-menu > summary:focus-visible {
  outline: var(--ob-focus);
}

.menu-popover {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-xl);
  box-shadow: var(--ob-shadow-pop);
  display: grid;
  gap: var(--ob-space-3);
  grid-template-columns: minmax(0, 1fr);
  padding: var(--ob-space-4);
  position: absolute;
  width: min(18rem, calc(100vw - 2rem));
  right: 0;
  top: calc(100% + var(--ob-space-2));
  z-index: 50;
}

.account-who {
  display: grid;
  gap: 2px;
  margin: 0;
}

.account-who .actor-label,
.account-detail {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
}

.menu-items {
  border-top: var(--ob-border);
  display: grid;
  gap: var(--ob-space-1);
  list-style: none;
  margin: 0;
  padding: var(--ob-space-3) 0 0;
}

.menu-items li {
  margin: 0;
  max-width: none;
}

.menu-items a {
  border-radius: var(--ob-radius-md);
  display: block;
  padding: var(--ob-space-2);
  text-decoration: none;
}

.menu-items a:hover {
  background: var(--ob-nav-active);
  color: var(--ob-ink);
}

.menu-popover form {
  background: none;
  border: 0;
  display: block;
  margin: 0;
  padding: 0;
}

.menu-popover form button {
  margin: 0;
  width: 100%;
}

main {
  flex: 1;
  margin: 0 auto;
  max-width: var(--content-width);
  padding: var(--ob-space-6) var(--ob-space-8) var(--ob-space-10);
  width: 100%;
}

h1,
h2,
h3 {
  color: var(--ob-ink);
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  font-family: var(--ob-font-serif);
  font-size: var(--ob-fs-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 0 0 0.75rem;
}

h2 {
  border-top: var(--ob-border);
  font-size: var(--ob-fs-h2);
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
  padding-top: 1.25rem;
}

h3 {
  font-size: var(--ob-fs-lead);
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

p {
  margin: 0.5rem 0;
}

p,
li,
dd,
dt {
  max-width: var(--reading-width);
}

hr {
  border: 0;
  border-top: var(--ob-border);
  margin: 1.5rem 0;
}

dl {
  margin: 0.5rem 0;
}

dt {
  font-weight: 600;
}

dd {
  margin: 0 0 0.5rem;
}

/* Forms */

form {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-xl);
  margin: var(--ob-space-3) 0 var(--ob-space-4);
  max-width: 64rem;
  padding: var(--ob-space-5);
}

/* Filter forms sit in one row so the results start higher on the page. */
form[method="get"] {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  max-width: none;
  padding-block: 0.5rem;
}

form[method="get"] > p {
  display: flex;
  flex-direction: column;
  margin: 0.25rem 0;
}

form[method="get"] input,
form[method="get"] select,
form[method="get"] button {
  margin: 0.25rem 0;
}

/* Forms that save: short fields (a label with one box or pick list) sit
   side by side; text boxes, help text, checkboxes, and buttons keep their
   own row (rework plan Q11). The same holds inside a form's sections and
   fieldsets. A .choice-grid fieldset of short checkbox choices fills the
   row instead. Browsers without :has() stack every field. Fields line up
   along their top edge, so help text under one field sits beneath it
   without pushing its neighbour down (F-071). */
form[method="post"],
form[method="post"] :is(fieldset, section) {
  align-items: start;
  column-gap: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

:is(form[method="post"], form[method="post"] :is(fieldset, section)) > * {
  grid-column: 1 / -1;
}

:is(form[method="post"], form[method="post"] :is(fieldset, section))
  > p:is(:has(> label + input:not([type="checkbox"], [type="radio"])), :has(> label + select)) {
  display: flex;
  flex-direction: column;
  grid-column: auto;
  margin: 0.25rem 0;
}

:is(form[method="post"], form[method="post"] :is(fieldset, section))
  > p:is(:has(> label + input), :has(> label + select)) > :is(input, select) {
  margin-bottom: 0.25rem;
  width: 100%;
}

:is(form[method="post"], form[method="post"] :is(fieldset, section))
  > p:has(> input[type="checkbox"]) {
  align-items: baseline;
  display: flex;
  gap: 0.5rem;
  margin: 0.15rem 0;
}

form[method="post"] .choice-grid > p:has(> input[type="checkbox"]) {
  grid-column: auto;
}

:is(form[method="post"], form[method="post"] :is(fieldset, section)) > p:has(> textarea) {
  display: flex;
  flex-direction: column;
  margin: 0.25rem 0;
}

:is(form[method="post"], form[method="post"] :is(fieldset, section))
  > p:has(> textarea) > textarea {
  margin-bottom: 0.25rem;
}

:is(form[method="post"], form[method="post"] :is(fieldset, section)) > button {
  grid-column: auto / span 1;
  justify-self: start;
  margin-top: 0.5rem;
}

:is(form[method="post"], form[method="post"] :is(fieldset, section)) > :not(button) + button {
  grid-column-start: 1;
}

/* A choice that decides what the rest of the page shows, such as which
   Requirement applies to which subject: two pick lists side by side with
   their helper links beneath, and the button beside them. */
form[method="get"].choose-pair {
  align-items: start;
  display: grid;
  gap: 0.25rem 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  max-width: 64rem;
  padding: 0.875rem 1rem;
}

.choose-pair > p {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.choose-pair select {
  width: 100%;
}

.choose-pair > button {
  margin-top: 1.55rem;
}

.choose-pair .choose-note {
  grid-column: 1 / -1;
}

.field-help {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
}

@media (max-width: 48rem) {
  form[method="get"].choose-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .choose-pair > button {
    justify-self: start;
    margin-top: 0.25rem;
  }
}

fieldset {
  border: var(--ob-border);
  border-radius: var(--ob-radius-lg);
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
}

legend {
  color: var(--ob-ink);
  font-weight: 600;
  padding: 0 0.35rem;
}

label {
  color: var(--ob-muted);
  font-size: var(--ob-fs-body);
  font-weight: 500;
}

input,
select,
textarea,
button {
  font: inherit;
  max-width: 100%;
}

input,
select,
textarea {
  background: var(--ob-surface);
  border: 1px solid var(--ob-field-line);
  border-radius: var(--ob-radius-lg);
  color: var(--ob-ink);
  margin: var(--ob-space-1) 0 var(--ob-space-2);
  min-height: 2.5rem;
  padding: var(--ob-space-2) var(--ob-space-3);
  transition: border-color var(--ob-dur-fast) var(--ob-ease);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--ob-muted);
}

::placeholder {
  color: var(--ob-muted);
  opacity: 1;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--ob-olive);
  min-height: 0;
}

textarea {
  min-height: 5rem;
  resize: vertical;
  width: min(100%, 48rem);
}

/* Buttons (design spec §5.5): a pill, primary unless the place it sits
   makes it secondary. A form that saves has one button, its primary action.
   design-spec: buttons stay 36px, as §5.5 gives them; that is above WCAG 2.2
   AA's 24px target size (§9 asks 44px, which is AAA). */
button,
.action-link {
  align-items: center;
  background: var(--ob-primary);
  border: 1px solid var(--ob-primary);
  border-radius: var(--ob-radius-pill);
  color: var(--ob-on-primary);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--ob-font-sans);
  font-size: var(--ob-fs-small);
  font-weight: 500;
  gap: var(--ob-space-2);
  justify-content: center;
  line-height: 1.25;
  margin: var(--ob-space-1) 0;
  min-height: 36px;
  padding: var(--ob-space-2) 14px;
  text-align: center;
  text-decoration: none;
  transition:
    opacity var(--ob-dur-fast) var(--ob-ease),
    border-color var(--ob-dur-fast) var(--ob-ease);
}

/* A link that looks like a button keeps space from the text after it. */
.action-link {
  margin-inline-end: var(--ob-space-3);
}

button:hover,
.action-link:hover {
  color: var(--ob-on-primary);
  opacity: 0.9;
}

button:active:not(:disabled) {
  transform: translateY(1px);
  transition-duration: 80ms;
}

/* Secondary: filters, the top bar, signing out, and printing. */
.button-secondary,
form[method="get"] button,
.app-topbar button,
.period-summary button {
  background: var(--ob-surface);
  border-color: var(--ob-line);
  color: var(--ob-ink);
}

.button-secondary:hover,
form[method="get"] button:hover,
.app-topbar button:hover,
.period-summary button:hover {
  border-color: var(--ob-muted);
  color: var(--ob-ink);
  opacity: 1;
}

button:disabled,
button:disabled:hover {
  cursor: not-allowed;
  opacity: 0.45;
}

/* A keyboard shortcut (design spec §5.4). */
kbd {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-sm);
  color: var(--ob-muted);
  font-family: var(--ob-font-mono);
  font-size: var(--ob-fs-mono-label);
  padding: 2px 6px;
}

/* The field a refused form is about (2c-4, F-051; design spec §7). */
[aria-invalid="true"],
fieldset.field-error {
  border-color: var(--ob-status-overdue-ink);
  outline: 2px solid var(--ob-status-overdue-ink);
  outline-offset: 2px;
  scroll-margin-top: 1.5rem;
}

/* A choice that is shown but cannot be made, with the reason beside it (2c-4). */
.choice-unavailable label {
  color: var(--ob-muted);
  text-decoration: line-through;
}

.choice-unavailable .field-help {
  display: block;
  margin-left: 1.5rem;
}

/* A refusal or failure, in plain words (design spec §7.3). */
main [role="alert"] {
  background: var(--ob-status-overdue-bg);
  border: 0;
  border-radius: var(--ob-radius-lg);
  color: var(--ob-status-overdue-ink);
  margin: var(--ob-space-3) 0;
  max-width: 64rem;
  padding: var(--ob-space-3) var(--ob-space-4);
}

main [role="alert"] a {
  color: inherit;
}

/* Billing notices under the top bar, for those who can act (MVP plan Q125). */
.billing-notice {
  background: var(--ob-status-soon-bg);
  border-radius: var(--ob-radius-lg);
  color: var(--ob-status-soon-ink);
  margin: 0 0 var(--ob-space-3);
  padding: var(--ob-space-3) var(--ob-space-4);
}

.billing-notice-overdue {
  background: var(--ob-status-overdue-bg);
  color: var(--ob-status-overdue-ink);
}

.billing-notice a {
  color: inherit;
  font-weight: 600;
}

details {
  margin: 0.5rem 0;
}

summary {
  color: var(--ob-ink);
  cursor: pointer;
  font-weight: 500;
  padding: 0.25rem 0;
}

details > form {
  margin-top: 0.5rem;
}

/* A long name, even one with no spaces, wraps instead of widening the
   page (MVP plan 2c-6, F-055). */
main {
  overflow-wrap: break-word;
}

/* In a table only a linked name may break mid-word, so dates and short
   labels keep whole words. */
td a {
  overflow-wrap: anywhere;
}

/* Tables */

table {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-collapse: separate;
  border-radius: var(--ob-radius-xl);
  border-spacing: 0;
  font-size: var(--ob-fs-body);
  margin: 0.5rem 0 1.5rem;
  overflow: hidden;
  width: 100%;
}

th,
td {
  border-bottom: var(--ob-border);
  padding: var(--ob-space-3) var(--ob-space-5);
  text-align: left;
  vertical-align: top;
}

/* Column headings are machine labels: mono, upper case (design spec §3.4). */
th {
  background: var(--ob-surface);
  color: var(--ob-muted);
  font-family: var(--ob-font-mono);
  font-size: var(--ob-fs-mono-label);
  font-weight: 500;
  letter-spacing: 0.05em;
  padding-block: 10px;
  text-transform: uppercase;
}

td {
  font-variant-numeric: tabular-nums;
}

tbody tr:hover {
  background: var(--ob-sunken);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td small {
  color: var(--ob-muted);
}

main > ul,
main > ol {
  padding-left: 1.5rem;
}

main > ul > li,
main > ol > li {
  margin-bottom: 0.35rem;
}

code {
  background: var(--ob-status-track-bg);
  border-radius: var(--ob-radius-sm);
  font-family: var(--ob-font-mono);
  font-size: var(--ob-fs-caption);
  padding: 0.1rem 0.3rem;
}

.page-introduction {
  color: var(--ob-muted);
  margin: 0 0 1.25rem;
}

/* What a person does on a list page (F-040), under its introduction. */
.page-introduction:has(+ .page-guide) {
  margin-bottom: 0.5rem;
}

/* The Audit view (MVP plan Q53): one Cycle after another. */
.audit-cycle {
  border-top: var(--ob-border);
  margin-top: 1rem;
  padding-top: 0.5rem;
}

.page-guide {
  border-left: 3px solid var(--ob-sage);
  color: var(--ob-muted);
  font-size: var(--ob-fs-body);
  margin: 0 0 1.25rem;
  max-width: 56rem;
  padding-left: 0.75rem;
}

/* Status */

.status-badge {
  align-items: center;
  background: var(--ob-status-track-bg);
  border-radius: var(--ob-radius-pill);
  color: var(--ob-status-track-ink);
  display: inline-flex;
  font-size: var(--ob-fs-caption);
  font-weight: 500;
  gap: 6px;
  line-height: 1.35;
  padding: var(--ob-space-1) 10px;
  white-space: nowrap;
}

/* A record the sample loader made, not the customer's own. */
.status-sample {
  background: transparent;
  border: 1px dashed currentColor;
  margin-left: 0.4rem;
  vertical-align: middle;
}


/* Statuses on the spec's four colour pairs (MVP plan Q98). A status
   without its own rule (Planned, Submitted, Under review, an Issue that is
   New, a Fix not started, ...) keeps the badge's own colours, the neutral
   pair. An open Cycle reads "In progress" and is green like a Fix in
   progress. */
.status-active,
.status-satisfied,
.status-met,
.status-accepted,
.status-completed,
.status-closed,
.status-in-progress,
.status-cycle-open {
  background: var(--ob-status-progress-bg);
  color: var(--ob-status-progress-ink);
}

.status-critical,
.status-not-satisfied,
.status-not-met,
.status-overdue,
.status-blocked {
  background: var(--ob-status-overdue-bg);
  color: var(--ob-status-overdue-ink);
}

.status-high,
.status-satisfied-by-exception,
.status-partially-satisfied,
.status-due-soon,
.status-due-today,
.status-ready-for-verification {
  background: var(--ob-status-soon-bg);
  color: var(--ob-status-soon-ink);
}

.status-on-track,
.status-inactive,
.status-cancelled,
.status-future,
.status-superseded {
  background: var(--ob-status-track-bg);
  color: var(--ob-status-track-ink);
}

/* Guidance and history */

.workflow-guidance {
  background: var(--ob-sunken);
  border: var(--ob-border);
  border-radius: var(--ob-radius-lg);
  margin: 1rem 0;
  padding: 0.875rem 1rem;
}

.workflow-guidance h2 {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.workflow-guidance p:first-child {
  margin-top: 0;
}

.workflow-guidance p:last-child {
  margin-bottom: 0;
}

/* The guided tour's strip above a stop's page (MVP plan Q178). */
.tour-strip {
  background: var(--ob-sunken);
  border: var(--ob-border);
  border-left: 4px solid var(--ob-primary);
  border-radius: var(--ob-radius-lg);
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
}

.tour-strip p {
  margin: 0 0 0.5rem;
}

.tour-strip .tour-strip-step {
  font-weight: 600;
}

.tour-strip-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* A one-button form in the strip, not a card of fields. */
.tour-strip .tour-strip-actions form[method="post"] {
  background: none;
  border: 0;
  border-radius: 0;
  display: block;
  margin: 0;
  max-width: none;
  padding: 0;
  width: auto;
}

.tour-strip .tour-strip-actions form[method="post"] > button {
  margin: 0;
}

@media print {
  .tour-strip {
    display: none;
  }
}

.guidance-steps {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0 1.5rem;
  padding-left: 1.75rem;
}

.guidance-steps li {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-lg);
  padding: 0.65rem 0.875rem;
}

.guidance-steps li::marker {
  color: var(--ob-olive);
  font-weight: 700;
}

.term-list {
  margin: 1rem 0 2rem;
  max-width: var(--reading-width);
}

.term-list dt {
  background: var(--ob-sunken);
  border: var(--ob-border);
  border-bottom: 0;
  border-radius:
    var(--ob-radius-lg)
    var(--ob-radius-lg)
    0
    0;
  color: var(--ob-ink);
  font-weight: 600;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
}

.term-list dd {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius:
    0
    0
    var(--ob-radius-lg)
    var(--ob-radius-lg);
  margin: 0;
  padding: 0.6rem 0.75rem;
}

.history-list {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
}

.history-list > li {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-lg);
  padding: 0.75rem 1rem;
}

.history-entry h3 {
  font-size: var(--ob-fs-body);
  margin: 0;
}

.history-entry > p {
  margin: 0.35rem 0 0;
}

.history-timestamp {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
}

/* A record's folded History heading reads as a heading (rework plan Q20). */
.record-history > summary h2 {
  display: inline;
  font-size: var(--ob-fs-h2);
}

/* A replaced record beside its replacement (rework plan Q20). */
.version-pair {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin-top: 0.35rem;
}

.version {
  border: var(--ob-border);
  border-radius: var(--ob-radius-lg);
  padding: 0.5rem 0.75rem;
}

.version h4 {
  color: var(--ob-muted);
  font-size: var(--ob-fs-caption);
  letter-spacing: 0.04em;
  margin: 0;
  text-transform: uppercase;
}

.version p {
  margin: 0.2rem 0 0;
}

/* What changed (rework plan Q20): the old value struck through. */
.history-changes {
  display: grid;
  gap: 0.2rem;
  margin: 0.45rem 0 0;
}

.history-changes > div {
  display: grid;
  gap: 0 0.75rem;
  grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr);
}

.history-changes dt {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
}

.history-changes dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.history-before {
  color: var(--ob-muted);
  text-decoration: line-through;
}

.history-after {
  font-weight: 600;
}

.history-facts summary {
  font-size: var(--ob-fs-body);
}

.history-facts dl {
  display: grid;
  gap: 0.2rem 0.8rem;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0.4rem 0 0;
}

.history-facts dt {
  color: var(--ob-muted);
}

.history-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.audit-details {
  border-top: var(--ob-border);
  margin-top: 0.65rem;
  padding-top: 0.5rem;
}

.audit-details summary {
  font-size: var(--ob-fs-body);
}

.audit-details dl {
  display: grid;
  gap: 0.3rem 0.8rem;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0.6rem 0 0;
}

.audit-details dt {
  font-weight: 600;
}

.audit-details dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Home's charts (MVP plan Q112 to Q115). Colours are named by role: a hue
   names an outcome, the same on every chart, and work under way is a
   neutral shade. Each mark also states its count in words. */

.chart-problem { background: var(--ob-chart-problem); }
.chart-warning { background: var(--ob-chart-warning); }
.chart-good { background: var(--ob-chart-good); }
.chart-good-qualified { background: var(--ob-chart-good-qualified); }
.chart-neutral-1 { background: var(--ob-chart-neutral-1); }
.chart-neutral-2 { background: var(--ob-chart-neutral-2); }
.chart-neutral-3 { background: var(--ob-chart-neutral-3); }

/* Inconclusive settles nothing: neutral dots in an outline. No Result yet
   is the absence of one: neutral hatching. Neither takes a hue, and the two
   patterns stay apart from each other and from the solid colours. */
.chart-inconclusive {
  background: radial-gradient(circle, var(--ob-chart-neutral-2) 1.1px, transparent 1.4px) 0 0 / 4px 4px;
  box-shadow: inset 0 0 0 1px var(--ob-chart-neutral-2);
}

.chart-none {
  background: repeating-linear-gradient(135deg, var(--ob-chart-neutral-2) 0 1.5px, transparent 1.5px 5px);
  box-shadow: inset 0 0 0 1px var(--ob-line);
}

.chart-key {
  color: var(--ob-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--ob-fs-caption);
  gap: var(--ob-space-1) var(--ob-space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.chart-key li {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  margin: 0;
}

.swatch {
  border-radius: 2px;
  display: inline-block;
  flex: none;
  height: 10px;
  width: 10px;
}

/* The cards in a row of Home (Q113) share a height, so they are chosen to
   hold about the same amount. */
.home-row {
  display: grid;
  gap: var(--ob-space-5);
  margin: 0 0 var(--ob-space-5);
}

.home-charts {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
}

.home-lists {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 75rem) {
  .home-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-charts > :first-child {
    grid-column: 1 / -1;
  }

  .home-lists {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 44rem) {
  .home-charts {
    grid-template-columns: minmax(0, 1fr);
  }
}

.home-row > .card {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.home-row .card-foot {
  margin-top: auto;
}

.card-count {
  color: var(--ob-muted);
  font-family: var(--ob-font-mono);
  font-size: var(--ob-fs-caption);
}

.card-foot {
  border-top: var(--ob-border);
  color: var(--ob-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--ob-fs-small);
  gap: var(--ob-space-2);
  justify-content: space-between;
  padding: 14px var(--ob-space-5);
}

.card-foot a {
  color: var(--ob-ink);
  font-weight: 500;
}

/* When Cycles are due: an overdue column, twelve weeks, then later, with
   each count printed above its bar. */
.due-weeks {
  align-items: end;
  display: grid;
  gap: 4px;
  grid-template-columns: 3.5rem repeat(12, minmax(0, 1fr)) 2.75rem;
  height: 8.25rem;
  list-style: none;
  margin: var(--ob-space-2) 0 0;
  padding: 0;
}

.due-weeks li {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-end;
  margin: 0;
  max-width: none;
  position: relative;
}

.due-weeks .week-count {
  font-family: var(--ob-font-mono);
  font-size: var(--ob-fs-caption);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.due-weeks .week-bar {
  border-radius: 4px 4px 0 0;
  display: block;
  max-width: 22px;
  min-height: 2px;
  width: 100%;
}

.due-weeks .week-overdue .week-bar,
.due-weeks .week-later .week-bar {
  max-width: 40px;
}

.due-weeks .week-empty .week-bar {
  background: var(--ob-line);
  border-radius: 1px;
  height: 2px;
}

/* Today falls in the first week: a dashed line marks where it begins. */
.due-weeks .week-first::before {
  border-left: 1.5px dashed var(--ob-field-line);
  bottom: 0;
  content: "";
  left: -3px;
  position: absolute;
  top: 0;
}

.due-axis {
  border-top: var(--ob-border);
  display: grid;
  gap: 4px;
  grid-template-columns: 3.5rem repeat(12, minmax(0, 1fr)) 2.75rem;
  margin: 6px 0 var(--ob-space-3);
  padding-top: 6px;
}

.due-axis span {
  color: var(--ob-muted);
  font-family: var(--ob-font-mono);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

.due-axis .axis-week {
  text-align: left;
}

.chart-table {
  margin-top: var(--ob-space-3);
}

.chart-table summary {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
  font-weight: 400;
}

.chart-table table {
  margin-bottom: 0;
}

/* Open Cycles by stage: one bar, then a stage to a line with its count. */
.stage-bar {
  border-radius: 6px;
  display: flex;
  gap: 3px;
  height: 12px;
  overflow: hidden;
}

.stage-bar span {
  display: block;
  min-width: 6px;
}

.stage-list,
.severity-bars {
  display: grid;
  gap: var(--ob-space-2);
  list-style: none;
  margin: var(--ob-space-4) 0 0;
  padding: 0;
}

.severity-bars {
  margin: 0;
}

.stage-list li,
.severity-bars li {
  margin: 0;
  max-width: none;
}

.stage-list li > a,
.stage-list li > span {
  align-items: center;
  color: var(--ob-ink);
  display: grid;
  font-size: var(--ob-fs-small);
  gap: var(--ob-space-3);
  grid-template-columns: 10px minmax(0, 1fr) auto;
  text-decoration: none;
}

.stage-list a:hover .stage-name {
  text-decoration: underline;
}

.stage-flag {
  color: var(--ob-status-overdue-ink);
}

.chart-value {
  font-family: var(--ob-font-mono);
  font-size: var(--ob-fs-caption);
  font-variant-numeric: tabular-nums;
}

.severity-bars a {
  align-items: center;
  color: var(--ob-ink);
  display: grid;
  font-size: var(--ob-fs-small);
  gap: var(--ob-space-3);
  grid-template-columns: 4rem minmax(0, 1fr) 1.5rem;
  text-decoration: none;
}

.severity-bars a:hover .bar-label {
  text-decoration: underline;
}

.bar-track {
  background: var(--ob-track);
  border-radius: 4px;
  display: block;
  height: 8px;
  overflow: hidden;
}

.bar {
  border-radius: 4px;
  display: block;
  height: 100%;
}

.bar-value {
  text-align: right;
}

/* Latest Result, by area: an Area to a line, in two columns (Q113). */
.area-lines {
  display: grid;
  gap: var(--ob-space-2) var(--ob-space-10);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 56rem) {
  .area-lines {
    grid-template-columns: minmax(0, 1fr);
  }
}

.area-lines li {
  align-items: center;
  display: grid;
  font-size: var(--ob-fs-small);
  gap: var(--ob-space-3);
  grid-template-columns: minmax(7.5rem, 10.5rem) minmax(5rem, 1fr) minmax(0, 12rem);
  margin: 0;
  max-width: none;
  min-height: 28px;
}

@media (max-width: 32rem) {
  .area-lines li {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .area-lines .area-summary {
    grid-column: 1 / -1;
  }
}

.area-name {
  font-weight: 500;
}

.area-summary {
  color: var(--ob-muted);
  font-size: var(--ob-fs-caption);
}

.share-bar {
  border-radius: 5px;
  display: flex;
  gap: 2px;
  height: 10px;
  overflow: hidden;
}

.share-bar span {
  display: block;
  min-width: 6px;
}

/* Home's short lists: a Cycle or Obligation to a row, its next fact at the
   right (Q113). */
.row-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.row-list li {
  align-items: center;
  border-top: var(--ob-border);
  display: flex;
  gap: var(--ob-space-2) var(--ob-space-3);
  margin: 0;
  max-width: none;
  padding: 10px var(--ob-space-5);
}

.row-text {
  flex: 1 1 auto;
  min-width: 0;
}

.row-text a {
  font-weight: 500;
}

.row-sub {
  color: var(--ob-muted);
  display: block;
  font-size: var(--ob-fs-caption);
}

.row-end {
  flex: none;
  white-space: nowrap;
  font-size: var(--ob-fs-small);
  text-align: right;
}

.row-list .action-link {
  flex: none;
  font-size: var(--ob-fs-caption);
  margin: 0;
  white-space: nowrap;
  min-height: 32px;
  padding-inline: var(--ob-space-3);
}

.home-row .card-table,
.home-row .card-list,
.card-list {
  padding: var(--ob-space-5) 0 0;
}

.card-list > .card-head {
  padding: 0 var(--ob-space-5);
}

.card-list > .card-empty {
  color: var(--ob-muted);
  margin: 0;
  padding: 0 var(--ob-space-5) var(--ob-space-5);
}

/* Needs attention: a Cycle to a line, its Obligation beside its name. */
.card-attention td {
  vertical-align: middle;
}

.card-attention .due {
  white-space: nowrap;
}

.card-attention .row-sub {
  display: inline;
  margin-left: var(--ob-space-2);
}

.card-attention .is-late .due-relative {
  color: var(--ob-status-overdue-ink);
  font-weight: 500;
}

@media (max-width: 56rem) {
  .card-attention .row-sub {
    display: block;
    margin: 2px 0 0;
  }
}

/* Home's count tiles (Q113): each a link to what it counts. A tile is
   tinted only when it counts a problem above zero; a zero is muted. */
.count-tiles {
  border-top: var(--ob-border);
  display: grid;
  flex: 1 1 100%;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 18px 0 0;
}

.count-tiles li {
  margin: 0;
  max-width: none;
}

.count-tiles a {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-lg);
  color: var(--ob-ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 12px 14px;
  text-decoration: none;
  transition: border-color var(--ob-dur-fast) var(--ob-ease);
}

.count-tiles a:hover {
  border-color: var(--ob-field-line);
}

.tile-value {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1;
}

.tile-name {
  color: var(--ob-muted);
  font-size: var(--ob-fs-caption);
  line-height: 1.3;
}

.tile-name strong {
  color: var(--ob-status-overdue-ink);
  font-weight: 500;
}

.count-tiles a.tile-bad {
  background: var(--ob-status-overdue-bg);
  border-color: transparent;
}

.count-tiles a.tile-bad .tile-value,
.count-tiles a.tile-bad .tile-name {
  color: var(--ob-status-overdue-ink);
}

.count-tiles a.tile-zero .tile-value {
  color: var(--ob-muted);
}

/* The page hero (design spec §5.7): the headline sentence with its number,
   the lead naming what needs attention, the page's action, and the stat
   strip. */
.hero {
  align-items: flex-end;
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-xl);
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-7);
  margin: 0 0 var(--ob-space-6);
  padding: var(--ob-space-8) 36px;
}

.hero-main {
  display: flex;
  flex: 1 1 520px;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.hero-main > * {
  margin: 0;
}

.hero-eyebrow {
  color: var(--ob-muted);
}

.hero h1 {
  margin: 0;
}

.hero-lead {
  color: var(--ob-muted);
  font-size: var(--ob-fs-lead);
  line-height: 1.5;
}

.lead-urgent {
  color: var(--ob-status-overdue-ink);
  font-weight: 500;
}

/* The lead line's phrases are links to what they count (F-066): they keep
   the line's colour, with a quiet underline that firms up on hover. */
.hero-lead a {
  color: inherit;
  text-decoration-color: var(--ob-field-line);
  text-underline-offset: 3px;
}

.hero-lead a:hover {
  color: var(--ob-ink);
  text-decoration-color: currentColor;
}

.hero-lead a.lead-urgent,
.hero-lead a.lead-urgent:hover {
  color: var(--ob-status-overdue-ink);
}

.hero-help {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
}

.hero-action {
  display: flex;
  flex-direction: column;
  gap: var(--ob-space-3);
}

.hero-button {
  font-size: var(--ob-fs-body);
  margin: 0;
  min-height: 48px;
  padding-inline: var(--ob-space-5);
}

/* A list or record page's hero: the same card, its guide inside it. */
.hero-page .page-guide {
  margin: 0;
}

.hero-secondary {
  font-size: var(--ob-fs-small);
  text-align: center;
}

/* A due date in a list (MVP plan Q100): relative words, the exact date
   beneath. */
.due {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.due-relative {
  color: var(--ob-ink);
}

.due-exact {
  color: var(--ob-muted);
  font-size: var(--ob-fs-caption);
}

/* A card (design spec §5.9). */
.card {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-xl);
  margin: 0 0 var(--ob-space-5);
  min-width: 0;
  padding: var(--ob-space-5);
}

.card > h2,
.card-head h2 {
  border-top: 0;
  font-size: var(--ob-fs-h2);
  margin: 0 0 var(--ob-space-3);
  padding: 0;
}

.card-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-2) var(--ob-space-4);
  justify-content: space-between;
}

.card-head h2 {
  flex: 1;
}

.card-caption {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
  margin: 0;
}

/* A card holding a table: the rows run edge to edge (design spec §5.9). */
.card-table {
  padding: var(--ob-space-5) 0 0;
}

.card-table > .card-head,
.card-table > p {
  padding: 0 var(--ob-space-5);
}

.card-table table {
  border: 0;
  border-radius: 0;
  border-top: var(--ob-border);
  margin: 0;
}

.card-table > p:last-child {
  padding-bottom: var(--ob-space-5);
}

@media (max-width: 30rem) {
  .hero {
    padding: var(--ob-space-6) var(--ob-space-5);
  }
}

/* Review period page (rework plan Q13): a rail with the period's summary
   and its step menu, beside one step at a time. Without script every
   pane shows; print always shows them all. */

.period-layout {
  align-items: start;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 17rem minmax(0, 1fr);
}

.period-rail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  position: sticky;
  top: 1rem;
}

.rail-heading {
  border-top: 0;
  font-size: var(--ob-fs-small);
  margin: 0 0 0.5rem;
  padding-top: 0;
}

.period-summary,
.step-menu {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-xl);
  padding: var(--ob-space-5);
}

.summary-list {
  display: grid;
  gap: 0.15rem 0.75rem;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  margin: 0;
}

.summary-list dt {
  max-width: 7.5rem;
  color: var(--ob-muted);
  font-size: var(--ob-fs-caption);
  font-weight: 500;
  padding-top: 0.2rem;
}

.summary-list dd {
  display: flex;
  flex-wrap: wrap;
  font-size: var(--ob-fs-small);
  gap: 0.25rem;
  margin: 0;
  min-width: 0;
}

/* The rail is narrow: a long badge wraps rather than being cut off. */
.summary-list .status-badge {
  max-width: 100%;
  white-space: normal;
}

.period-summary .no-print {
  margin: 0.6rem 0 0;
}

.period-summary button {
  width: 100%;
}

.step-menu ol {
  display: grid;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step-menu li {
  margin: 0;
  max-width: none;
}

.step-menu-more {
  border-top: var(--ob-border);
  margin-top: 0.5rem !important;
  padding-top: 0.5rem !important;
}

.step-menu a {
  align-items: center;
  border-radius: var(--ob-radius-sm);
  color: var(--ob-ink);
  display: grid;
  gap: 0.1rem 0.5rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.4rem 0.5rem;
  text-decoration: none;
}

.step-menu a:hover {
  background: var(--ob-sunken);
}

.step-menu a[aria-current="step"] {
  background: var(--ob-nav-active);
  font-weight: 500;
}

.step-title {
  font-size: var(--ob-fs-body);
  font-weight: 500;
}

.step-summary {
  color: var(--ob-muted);
  font-size: var(--ob-fs-caption);
  grid-column: 1 / -1;
}

.step-count {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
}

.step-menu form {
  background: none;
  border: 0;
  margin: 0.5rem 0 0;
  padding: 0;
}

.step-menu form button {
  width: 100%;
}

/* Record pages (rework plan Q15): facts in a compact grid, and the
   Obligation page's two columns. */
.record-facts {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-xl);
  display: grid;
  gap: 0.35rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  margin: 0 0 1rem;
  max-width: 64rem;
  padding: var(--ob-space-5);
}

.record-facts > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.record-facts dt {
  color: var(--ob-muted);
  font-size: var(--ob-fs-caption);
  font-weight: 500;
}

.record-facts dd {
  font-size: var(--ob-fs-body);
  margin: 0;
  max-width: none;
}

.record-summary {
  max-width: var(--reading-width);
}

.record-layout {
  align-items: start;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) 20rem;
}

.record-main > section > h2:first-child,
.record-main > section > .section-head h2 {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.record-main > section + section {
  border-top: var(--ob-border);
  margin-top: 1.5rem;
  padding-top: 0.25rem;
}

.record-side {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-xl);
  display: grid;
  font-size: var(--ob-fs-body);
  gap: 1rem;
  padding: var(--ob-space-5);
}

.record-side p {
  margin: 0.25rem 0;
}

.section-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
}

.compact-records {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.25rem;
}

.compact-records > li {
  margin: 0;
}

td.row-action details {
  margin: 0;
}

@media (max-width: 63.99rem) {
  .record-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Oversight (MVP plan Q106). The status board: one row per question, a bar
   showing the mix, then each category's badge and count as a link. A bar
   segment takes its category's chart colour by role (Q112), as Home's
   charts do: a hue for an outcome, a neutral shade for anything else. */
.status-board {
  padding: var(--ob-space-5) 0 0;
}

.status-board > .card-head {
  padding: 0 var(--ob-space-5);
}

.board-row {
  align-items: start;
  border-top: var(--ob-border);
  display: grid;
  gap: var(--ob-space-3) var(--ob-space-6);
  grid-template-columns: minmax(0, 1fr);
  padding: var(--ob-space-4) var(--ob-space-5);
}

@media (min-width: 45rem) {
  .board-row {
    grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr);
  }
}

.board-question {
  border-top: 0;
  font-size: var(--ob-fs-body);
  font-weight: 600;
  margin: 0;
  padding: 0;
}

.board-total {
  color: var(--ob-muted);
  display: block;
  font-size: var(--ob-fs-caption);
  font-weight: 400;
  margin-top: 2px;
}

.board-data {
  display: flex;
  flex-direction: column;
  gap: var(--ob-space-3);
  min-width: 0;
}

.board-bar {
  background: var(--ob-track);
  border-radius: 5px;
  display: flex;
  gap: 2px;
  height: 10px;
  overflow: hidden;
}

.board-bar .board-segment {
  flex-basis: 0;
  min-width: 6px;
}

.board-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-2) var(--ob-space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.board-counts a {
  align-items: center;
  display: inline-flex;
  gap: var(--ob-space-2);
  min-height: 28px;
  text-decoration: none;
}

.board-count {
  color: var(--ob-ink);
  font-family: var(--ob-font-mono);
  font-size: var(--ob-fs-small);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.board-counts a:hover .board-count {
  text-decoration: underline;
}

.board-empty {
  color: var(--ob-muted);
  margin: 0;
}

/* The row of links to the lists, each with its count. */
.list-jump {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-2);
  margin: 0 0 var(--ob-space-6);
}

.list-jump-label {
  color: var(--ob-muted);
  font-family: var(--ob-font-mono);
  font-size: var(--ob-fs-mono-label);
  letter-spacing: 0.06em;
  margin-right: var(--ob-space-1);
  text-transform: uppercase;
}

.list-jump a {
  align-items: center;
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-pill);
  color: var(--ob-ink);
  display: inline-flex;
  font-size: var(--ob-fs-small);
  font-weight: 500;
  gap: var(--ob-space-2);
  min-height: 36px;
  padding: 0 14px;
  text-decoration: none;
  transition: border-color var(--ob-dur-fast) var(--ob-ease);
}

.list-jump a:hover {
  border-color: var(--ob-muted);
}

.list-jump-count {
  color: var(--ob-muted);
  font-family: var(--ob-font-mono);
  font-size: var(--ob-fs-caption);
}

.list-jump a.list-jump-empty {
  border-style: dashed;
  color: var(--ob-muted);
}

.list-group-heading {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-1) var(--ob-space-3);
  margin: var(--ob-space-2) 0 var(--ob-space-4);
}

/* Sans, as design spec §2.4 keeps the serif for page headlines. */
.list-group-heading h2 {
  border-top: 0;
  font-size: var(--ob-fs-lead);
  font-weight: 600;
  margin: 0;
  padding: 0;
}

.list-group-heading p {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
  margin: 0;
}

.list-card .card-head h3,
.checked-list h3 {
  border-top: 0;
  font-size: var(--ob-fs-h2);
  font-weight: 600;
  margin: 0 0 var(--ob-space-3);
  padding: 0;
}

.list-card .card-head h3 {
  flex: 1;
}

.card-count {
  color: var(--ob-muted);
  font-family: var(--ob-font-mono);
  font-size: var(--ob-fs-caption);
  font-variant-numeric: tabular-nums;
}

.card-table > p.card-why {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
  margin: calc(-1 * var(--ob-space-1)) 0 var(--ob-space-4);
  max-width: 75ch;
}

/* Every empty list folded into one card, each still naming its check. */
.checked-list {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

.checked-list li {
  border-top: var(--ob-border);
  max-width: none;
  padding: var(--ob-space-3) 0;
  scroll-margin-top: var(--ob-space-6);
}

.checked-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.checked-list li:last-child {
  padding-bottom: 0;
}

.checked-list h3 {
  font-size: var(--ob-fs-body);
  margin: 0 0 var(--ob-space-1);
}

.checked-list p {
  color: var(--ob-muted);
  max-width: 75ch;
  font-size: var(--ob-fs-small);
  margin: 0;
}

.checked-list strong {
  color: var(--ob-ink);
  font-weight: 500;
}

/* Records that carry their own sequence number. */
.numbered-records {
  list-style: none;
  padding-left: 0;
}

.setup-readiness {
  border-top: var(--ob-border);
  font-size: var(--ob-fs-small);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.setup-readiness h2 {
  border-top: 0;
  font-size: var(--ob-fs-small);
  margin: 0 0 0.25rem;
  padding: 0;
}

.setup-readiness .action-link {
  display: block;
  text-align: center;
}

.period-panes {
  min-width: 0;
}

.panes-ready .period-pane {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-xl);
  padding: var(--ob-space-1) var(--ob-space-5) var(--ob-space-5);
}

.period-pane h2 {
  scroll-margin-top: 1rem;
}

.evidence-entry {
  border-bottom: var(--ob-border);
  padding: 0.5rem 0;
}

.evidence-entry:last-child {
  border-bottom: 0;
}

.evidence-entry > p {
  margin: 0.1rem 0;
}

.evidence-head {
  font-weight: 500;
}

.evidence-facts {
  color: var(--ob-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--ob-fs-small);
  gap: 0 0.5rem;
}

.evidence-facts span + span::before {
  color: var(--ob-field-line);
  content: "·";
  margin-right: 0.5rem;
}

.evidence-note,
.evidence-decision {
  font-size: var(--ob-fs-small);
}

.panes-ready .period-pane > h2:first-child {
  border-top: 0;
  margin-top: 0.75rem;
  padding-top: 0;
}

@media (max-width: 63.99rem) {
  .period-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .period-rail {
    max-height: none;
    overflow: visible;
    position: static;
  }
}

/* Narrow screens (design spec §4.5): the sidebar sits above the page, its
   links in wrapped rows, and the page and top bar take less padding. */
@media (max-width: 49.99rem) {
  .site-sidebar {
    border-bottom: var(--ob-border);
    border-right: 0;
    gap: var(--ob-space-4);
    padding: var(--ob-space-4);
  }

  .navigation-groups {
    gap: var(--ob-space-3);
  }

  .navigation-foot,
  .navigation-group:not(.navigation-foot) + .navigation-foot {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
  }

  .primary-navigation {
    flex-flow: row wrap;
  }

  .shortcut-hint {
    display: none;
  }

  .app-topbar {
    padding: var(--ob-space-4) var(--ob-space-4) 0;
  }

  main {
    padding: var(--ob-space-4) var(--ob-space-4) var(--ob-space-8);
  }
}

@media (max-width: 48rem) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  th,
  td {
    min-width: 8rem;
  }
}

@media print {
  @page {
    margin: 0.75in;
  }

  .site-sidebar,
  .app-topbar,
  .no-print,
  .skip-link {
    display: none !important;
  }

  .audit-cycle {
    break-inside: avoid-page;
  }

  body,
  html,
  main {
    background: var(--ob-surface);
    border: 0;
    color: var(--ob-ink);
    display: block;
    margin: 0;
    max-width: none;
    padding: 0;
    width: auto;
  }

  body {
    font-family: var(--ob-font-serif);
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  h1,
  h2,
  h3,
  li,
  tr {
    break-inside: avoid;
  }

  table {
    overflow: visible;
  }

  .period-layout {
    display: block;
  }

  .period-rail {
    max-height: none;
    overflow: visible;
    position: static;
  }

  .step-menu {
    display: none;
  }

  .period-pane[hidden] {
    display: block !important;
  }

  th {
    background: var(--ob-surface);
    color: var(--ob-ink);
  }
}

/* Reading pages, Why IT GO and How IT GO works (F-070): each section is a
   card at reading width, the contents a row of links, and bulleted lists
   carry small olive markers. The words are unchanged. */
.prose-page {
  display: flex;
  flex-direction: column;
  gap: var(--ob-space-5);
  max-width: 60rem;
}

.prose-page > section {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-xl);
  margin: 0;
  min-width: 0;
  padding: var(--ob-space-6) var(--ob-space-7);
}

@media (max-width: 30rem) {
  .prose-page > section {
    padding: var(--ob-space-5);
  }
}

.prose-page > section.workflow-guidance {
  background: var(--ob-sunken);
}

.prose-page > section > h2 {
  border-top: 0;
  font-size: var(--ob-fs-h2);
  margin: 0 0 var(--ob-space-3);
  padding: 0;
}

.prose-page h3 {
  border-top: var(--ob-border);
  font-size: var(--ob-fs-body);
  font-weight: 600;
  margin: var(--ob-space-5) 0 var(--ob-space-2);
  padding-top: var(--ob-space-4);
}

.prose-page > section > h2 + h3 {
  border-top: 0;
  margin-top: var(--ob-space-2);
  padding-top: 0;
}

.prose-page > section > p:last-child,
.prose-page > section > ul:last-child,
.prose-page > section > ol:last-child,
.prose-page > section > dl:last-child {
  margin-bottom: 0;
}

.prose-page > section ul:not([class]) {
  display: flex;
  flex-direction: column;
  gap: var(--ob-space-2);
  list-style: none;
  margin: var(--ob-space-3) 0 var(--ob-space-4);
  padding: 0;
}

.prose-page > section ul:not([class]) > li {
  padding-left: var(--ob-space-5);
  position: relative;
}

.prose-page > section ul:not([class]) > li::before {
  background: var(--ob-olive);
  border-radius: var(--ob-radius-pill);
  content: "";
  height: 6px;
  left: 4px;
  position: absolute;
  top: 0.6em;
  width: 6px;
}

.prose-page .guidance-steps li {
  background: var(--ob-sunken);
}

.prose-page .term-list {
  margin-bottom: 0;
}

.prose-page table {
  margin: var(--ob-space-3) 0 0;
}

/* Help's contents: a row of links, like Oversight's list links. */
.prose-page > nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.prose-page > nav li {
  max-width: none;
}

.prose-page > nav a {
  align-items: center;
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-pill);
  color: var(--ob-ink);
  display: inline-flex;
  font-size: var(--ob-fs-small);
  font-weight: 500;
  min-height: 36px;
  padding: 0 14px;
  text-decoration: none;
  transition: border-color var(--ob-dur-fast) var(--ob-ease);
}

.prose-page > nav a:hover {
  border-color: var(--ob-muted);
}

/* Lists of records on Setup pages (MVP plan Q109, F-072): a card of rows,
   each the record's name as its link, a muted line beneath, and its status
   pill at the right. A stacked list keeps each row a block, for rows that
   hold forms or notes. */
.record-list {
  background: var(--ob-surface);
  border: var(--ob-border);
  border-radius: var(--ob-radius-xl);
  list-style: none;
  margin: var(--ob-space-3) 0 var(--ob-space-5);
  overflow: hidden;
  padding: 0;
}

.record-list > li {
  align-items: center;
  border-top: var(--ob-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-2) var(--ob-space-4);
  justify-content: space-between;
  max-width: none;
  padding: var(--ob-space-3) var(--ob-space-5);
  transition: background var(--ob-dur-fast) var(--ob-ease);
}

.record-list > li:first-child {
  border-top: 0;
}

.record-list > li:hover {
  background: var(--ob-sunken);
}

.record-list.record-list-stacked > li {
  display: block;
  padding-block: var(--ob-space-4);
}

.record-main {
  display: flex;
  flex: 1 1 16rem;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.record-main > a {
  font-weight: 500;
}

.record-main .status-sample {
  align-self: flex-start;
  margin: var(--ob-space-1) 0 0;
}

.record-meta {
  color: var(--ob-muted);
  font-size: var(--ob-fs-caption);
}

/* More ways to add a record, beside a page's main button. */
.hero-more-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-2);
}

.hero-more-actions .action-link {
  margin: 0;
}

/* The sign-in page (MVP plan Q116): no sidebar or top bar, one column
   centred under the logo. */
.sign-in-page {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: var(--ob-space-7);
  padding-top: var(--ob-space-4);
}

.sign-in-top {
  display: flex;
  justify-content: flex-end;
  max-width: 60rem;
  width: 100%;
}

.sign-in-logo {
  width: 200px;
}

.sign-in-card {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  max-width: 26.25rem;
  padding: 36px 32px 28px;
  text-align: center;
  width: 100%;
}

@media (max-width: 30rem) {
  .sign-in-card {
    padding: 28px var(--ob-space-5) 22px;
  }
}

.sign-in-card h1 {
  font-size: 40px;
  margin: 6px 0 0;
}

.sign-in-lead {
  color: var(--ob-muted);
  font-size: 15px;
  margin: 0;
  max-width: 68ch;
}

.sign-in-card .sign-in-lead {
  max-width: 34ch;
}

.sign-in-card p {
  margin: 0;
}

.sign-in-button {
  font-size: var(--ob-fs-body);
  justify-content: center;
  margin: 0;
  min-height: 48px;
  width: 100%;
}

.sign-in-fine,
.sign-in-signed {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
}

.sign-in-fine {
  border-top: var(--ob-border);
  padding-top: var(--ob-space-4);
  width: 100%;
}

.sign-in-help {
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
  margin: 0;
}

/* The hosted demonstration: a card per person to sign in as. */
.sign-in-demo {
  display: flex;
  flex-direction: column;
  gap: var(--ob-space-5);
  max-width: 60rem;
  width: 100%;
}

.sign-in-demo h1 {
  margin: 0;
}

.sign-in-demo > h2 {
  border-top: 0;
  font-size: var(--ob-fs-h2);
  margin: 0;
  padding-top: 0;
}

.sign-in-eyebrow {
  align-items: center;
  color: var(--ob-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--ob-fs-small);
  gap: var(--ob-space-2);
  margin: 0 0 var(--ob-space-2);
}

.sign-in-organization {
  border-top: 0;
  color: var(--ob-muted);
  font-size: var(--ob-fs-small);
  font-weight: 600;
  margin: var(--ob-space-2) 0 var(--ob-space-3);
}

.person-cards {
  display: grid;
  gap: var(--ob-space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 23.75rem), 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.person-cards > li {
  margin: 0;
  max-width: none;
}

.person-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  margin: 0;
  transition: border-color var(--ob-dur-fast) var(--ob-ease), box-shadow var(--ob-dur-fast) var(--ob-ease);
}

.person-card:hover {
  border-color: var(--ob-field-line);
  box-shadow: var(--ob-shadow-pop);
}

.person-current {
  border-color: var(--ob-olive);
}

.person-who {
  align-items: center;
  display: flex;
  gap: var(--ob-space-3);
}

.person-name {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.person-title {
  color: var(--ob-muted);
  display: block;
  font-size: var(--ob-fs-small);
}

.person-now {
  align-self: flex-start;
  margin-left: auto;
  white-space: nowrap;
}

.person-does {
  flex: 1;
  margin: 0;
}

.person-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.person-roles li {
  background: var(--ob-status-track-bg);
  border-radius: var(--ob-radius-pill);
  color: var(--ob-status-track-ink);
  font-size: var(--ob-fs-caption);
  margin: 0;
  padding: 2px 8px;
}

.person-card form {
  background: none;
  border: 0;
  border-radius: 0;
  margin: 0;
  max-width: none;
  padding: 0;
}

.person-card button {
  margin: 0;
  min-height: 44px;
  width: 100%;
}

/* The operator area (ADR-0016 Decision 14; MVP plan Q139): a focused page
   with its own bar naming the operator, and none of a customer's sidebar. */
.operator-page {
  display: flex;
  flex-direction: column;
  gap: var(--ob-space-4);
  margin: 0 auto;
  max-width: 80rem;
  width: 100%;
}

.operator-bar {
  align-items: center;
  border-bottom: var(--ob-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-3);
  justify-content: space-between;
  padding-bottom: var(--ob-space-3);
}

.operator-who {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-3);
}

.operator-who form {
  background: none;
  border: 0;
  margin: 0;
  max-width: none;
  padding: 0;
}

.operator-who button {
  margin: 0;
}

.operator-page table td .person-title {
  display: block;
}

.operator-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ob-space-4);
}

.operator-nav .sign-in-eyebrow {
  margin: 0;
}

.operator-nav a[aria-current="page"] {
  font-weight: 600;
}

.operator-facts {
  display: grid;
  gap: var(--ob-space-2) var(--ob-space-4);
  grid-template-columns: max-content 1fr;
  margin: 0;
}

.operator-facts dd {
  margin: 0;
}

.operator-action form {
  max-width: 36rem;
}

.field-hint {
  color: var(--ob-muted);
  font-weight: 400;
}

/* An action that ends something for good: the deletion (Q145). */
button.button-danger {
  background: var(--ob-clay);
  border-color: var(--ob-clay);
  color: var(--ob-on-primary);
}

/* The catalog of Areas (MVP plan Q169): each domain a row with its tick box,
   what it covers, and any starter content beneath. */
/* The form is already a card; the list inside it needs no second frame. */
.record-list.catalog-list {
  background: transparent;
  border: 0;
  margin: 0;
}

.record-list.catalog-list > li {
  padding-inline: 0;
}

.catalog-entry > p {
  margin: 0.15rem 0;
}

.catalog-choice {
  align-items: baseline;
  display: flex;
  gap: 0.5rem;
  font-weight: 600;
}

.catalog-choice .record-meta {
  font-weight: 400;
}

.catalog-pack {
  font-size: var(--ob-fs-small);
}

/* Get started (MVP plan Q176): each step a card headed by its name and
   whether it is done; the card is the frame, so the heading needs none. */
.get-started-steps > li > h2 {
  border-top: 0;
  font-size: var(--ob-fs-lead);
  margin: 0 0 0.5rem;
  padding-top: 0;
}

.get-started-steps > li > p {
  margin: 0.35rem 0;
}
