/* approvald stylesheet: OUR layout on top of the portal's design tokens.
 *
 * portal-tokens.css is vendored from the portal by
 * scripts/vendor-portal-design.py (never edited by hand; PORTAL-DESIGN.md).
 * Every colour, radius, shadow, font stack and spacing step below is one of
 * its variables; nothing here names a colour of its own (look_test.go
 * checks that). What the portal has as a component is rebuilt here from the
 * tokens, and the comment above each block names the portal component and
 * the Tailwind classes it mirrors. Font sizes that the portal writes as
 * arbitrary values in a component (13px, 13.5px, 15px, 28px) are repeated
 * as such; the type scale itself comes from the tokens.
 *
 * No script, no inline style, no request beyond /static and /favicon.ico
 * (CSP default-src 'none'; style-src 'self'; img-src 'self').
 */
@import "portal-tokens.css";

/* ---------------------------------------------------------------------------
   base (portal app/globals.css @layer base) */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--background); color: var(--foreground);
  font-family: var(--font-sans); font-size: var(--text-base); line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, blockquote, figure, ul, fieldset { margin: 0; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--primary-soft); }
table { font-variant-numeric: tabular-nums; border-collapse: collapse; }
.tabular { font-variant-numeric: tabular-nums; }
summary { cursor: pointer; }
a { color: var(--primary); font-weight: var(--font-weight-medium); text-underline-offset: 4px; }
strong { font-weight: var(--font-weight-semibold); }

/* identifiers (portal features/approvals/segments.tsx: rounded-sm bg-muted
   px-1 py-px font-mono text-[0.9em] break-all text-foreground) */
code, pre, .mono { font-family: var(--font-mono); font-variant-ligatures: none; overflow-wrap: anywhere; }
code { font-size: 0.9em; padding: 1px var(--spacing); border-radius: var(--radius-sm); background: var(--muted); color: var(--foreground); }
.mono { font-size: 0.9em; }
q.val { font-weight: var(--font-weight-medium); }
q.val, .reason q, #outcome { unicode-bidi: isolate; }
.muted { color: var(--muted-foreground); font-size: var(--text-sm); line-height: var(--leading-relaxed); }

/* skip link (portal-shell.tsx: sr-only, focus:fixed rounded-md bg-surface px-3 py-2 text-sm) */
.skip { position: absolute; left: -9999px; }
.skip:focus { position: fixed; left: calc(var(--spacing) * 4); top: calc(var(--spacing) * 2); z-index: 50;
  padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3); border-radius: var(--radius-md);
  background: var(--surface); color: var(--foreground); font-size: var(--text-sm); }

/* ---------------------------------------------------------------------------
   header (portal components/shell/app-header.tsx: bg-ink text-ink-foreground;
   mx-auto flex h-14 max-w-[1400px] items-center gap-3 px-4 md:px-8) */
.app-header { background: var(--ink); color: var(--ink-foreground); }
.app-header :focus-visible { outline-color: var(--ink-foreground); }
.app-header-inner {
  max-width: var(--page-max); margin: 0 auto; min-height: var(--header-height);
  display: flex; align-items: center; gap: calc(var(--spacing) * 3); padding: 0 var(--page-gutter);
}
/* wordmark (portal components/shell/wordmark.tsx: the line
   text-[13.5px] font-semibold tracking-tight and the descriptor
   text-[11px] tracking-wide text-ink-muted). The portal's mark is still a
   letter square; approvald shows the logo kit's wordmark in its place
   (PORTAL-DESIGN.md, the differences). The logo kit's
   rules (assets/brand/keylee/README.md): one dimension set, the other
   auto (the SVG's own ratio); the white artwork on the ink header, the
   colour one in print (below). */
.wordmark { display: flex; align-items: center; gap: calc(var(--spacing) * 3); flex-shrink: 0;
  color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
.wordmark-logo { display: block; flex-shrink: 0; height: calc(var(--spacing) * 8); width: auto; }
.wordmark-logo-print { display: none; }
.wordmark-text { display: flex; flex-direction: column; line-height: var(--leading-tight); }
.wordmark-line { font-size: 13.5px; font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-tight); }
.wordmark-descriptor { font-size: 11px; font-weight: var(--font-weight-normal); letter-spacing: var(--tracking-wide); color: var(--ink-muted); }
/* identity and log out, right (app-header.tsx account summary: text-[13px] font-medium) */
.who { margin-left: auto; min-width: 0; display: flex; align-items: center; gap: calc(var(--spacing) * 3); font-size: 13px; }
.who-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--font-weight-medium); }
.who-display { color: var(--ink-muted); font-weight: var(--font-weight-normal); }
form.inline { display: inline; margin: 0; }

/* primary navigation (portal components/shell/primary-nav.tsx: border-b
   bg-surface; items h-11 px-3 text-[13.5px] font-medium, active underline
   h-0.5 bg-primary) */
.primary-nav { border-bottom: 1px solid var(--border); background: var(--surface); }
.primary-nav ul { list-style: none; margin: 0 auto; max-width: var(--page-max);
  display: flex; gap: var(--spacing); overflow-x: auto; padding: 0 var(--page-gutter); }
.primary-nav a { position: relative; display: flex; align-items: center; height: calc(var(--spacing) * 11);
  padding: 0 calc(var(--spacing) * 3); font-size: 13.5px; white-space: nowrap;
  color: var(--muted-foreground); text-decoration: none; }
.primary-nav a:hover, .primary-nav a[aria-current] { color: var(--foreground); }
.primary-nav a[aria-current]::after { content: ""; position: absolute; bottom: 0; height: 2px; border-radius: 2px;
  left: calc(var(--spacing) * 3); right: calc(var(--spacing) * 3); background: var(--primary); }

/* page container and footer (portal-shell.tsx: main mx-auto w-full
   max-w-[1400px] flex-1 px-4 py-8 md:px-8; footer border-t, text-xs
   text-muted-foreground, py-5) */
main { width: 100%; max-width: var(--page-max); margin: 0 auto; flex: 1;
  padding: var(--page-pad-y) var(--page-gutter); }
main > * + * { margin-top: calc(var(--spacing) * 6); }
.app-footer { border-top: 1px solid var(--border); }
.app-footer-inner { max-width: var(--page-max); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: calc(var(--spacing) * 3); padding: calc(var(--spacing) * 5) var(--page-gutter);
  font-size: var(--text-xs); color: var(--muted-foreground); }

/* ---------------------------------------------------------------------------
   button (portal components/ui/button.tsx: inline-flex rounded-md border
   text-sm font-medium; size default h-10 px-4, sm h-8 px-3 text-[13px],
   lg h-11 px-5 text-[15px]). A plain button is the "outline" variant. */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--spacing) * 2);
  height: calc(var(--spacing) * 10); padding: 0 calc(var(--spacing) * 4);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface); color: var(--foreground);
  font-family: inherit; font-size: var(--text-sm); font-weight: var(--font-weight-medium); line-height: 1;
  white-space: nowrap; text-decoration: none; cursor: pointer; user-select: none;
  transition: color, background-color, border-color, box-shadow; transition-duration: var(--default-transition-duration);
  transition-timing-function: var(--default-transition-timing-function);
}
button:hover, .btn:hover { background: var(--muted); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
/* variant default: border-transparent bg-primary text-primary-foreground shadow-xs */
button.primary, .btn-primary { border-color: transparent; background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-xs); }
/* ours: mixed towards the foreground, not faded (bg-primary/90), so the label keeps 4.5:1 while hovered */
button.primary:hover, .btn-primary:hover { background: color-mix(in oklch, var(--primary) 90%, var(--foreground)); }
/* variant destructive-outline: border-danger/40 bg-surface text-danger hover:bg-danger-soft (the deny button) */
.actions form[action$="/deny"] button, .btn-danger-outline { border-color: color-mix(in oklch, var(--danger) 40%, transparent); background: var(--surface); color: var(--danger); }
.actions form[action$="/deny"] button:hover, .btn-danger-outline:hover { background: var(--danger-soft); }
/* header control (app-header.tsx items: h-9 rounded-md px-2.5 text-[13px] hover:bg-ink-line) */
.btn-on-ink { border-color: var(--ink-line); background: transparent; color: var(--ink-foreground); }
.btn-on-ink:hover { background: var(--ink-line); }
.btn-sm { height: calc(var(--spacing) * 8); padding: 0 calc(var(--spacing) * 3); font-size: 13px; }
.btn-lg, .actions button.primary { height: calc(var(--spacing) * 11); padding: 0 calc(var(--spacing) * 5); font-size: 15px; }
.btn-block { width: 100%; }

/* input (portal components/form.tsx controlClass: h-10 w-full rounded-md
   border border-input bg-surface px-3 text-sm; textareaClass h-auto
   min-h-24 py-2 leading-relaxed; Field label text-sm font-medium).
   Ours: the border is mixed darker than --input so that the field boundary
   has 3:1 against the surface (WCAG 1.4.11). */
input[type=text], textarea {
  width: 100%; height: calc(var(--spacing) * 10); padding: 0 calc(var(--spacing) * 3);
  border: 1px solid color-mix(in oklch, var(--muted-foreground) 85%, var(--surface)); border-radius: var(--radius-md);
  background: var(--surface); color: var(--foreground); font-family: inherit; font-size: var(--text-sm);
}
input[type=text]:hover, textarea:hover { border-color: var(--muted-foreground); }
input[type=text]:focus-visible, textarea:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
textarea { height: auto; min-height: calc(var(--spacing) * 40); padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
  font-family: var(--font-mono); font-size: 13px; line-height: var(--leading-relaxed); resize: vertical; }
textarea::placeholder, input::placeholder { color: var(--muted-foreground); }
label, .field { display: flex; flex-direction: column; gap: calc(var(--spacing) * 1.5); font-size: var(--text-sm); font-weight: var(--font-weight-medium); }
form.stack { display: flex; flex-direction: column; gap: calc(var(--spacing) * 4); align-items: flex-start; }
form.stack > label, form.stack > textarea { width: 100%; }

/* status pill (portal components/status.tsx Pill: inline-flex h-6 rounded-sm
   border px-2 text-xs font-medium; lib/domain/display.ts DECISION: pending
   info, approved success, denied danger, expired neutral) */
.badge { display: inline-flex; align-items: center; height: calc(var(--spacing) * 6); padding: 0 calc(var(--spacing) * 2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--muted); color: var(--muted-foreground);
  font-family: var(--font-sans); font-size: var(--text-xs); font-weight: var(--font-weight-medium); letter-spacing: 0; text-transform: none; white-space: nowrap; }
.badge.state-pending { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in oklch, var(--primary) 20%, transparent); }
.badge.state-approved { background: var(--success-soft); color: var(--success); border-color: color-mix(in oklch, var(--success) 25%, transparent); }
.badge.state-denied, .badge.state-refused { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in oklch, var(--danger) 25%, transparent); }

/* notice (portal components/page.tsx Notice: rounded-lg border px-4 py-3
   text-sm leading-relaxed text-foreground; warning border-warning/40
   bg-warning-soft, danger border-danger/40 bg-danger-soft, success
   border-success/30 bg-success-soft; title font-semibold in the tone) */
.notice, .warn {
  padding: calc(var(--spacing) * 3) calc(var(--spacing) * 4); border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--muted); color: var(--foreground); font-size: var(--text-sm); line-height: var(--leading-relaxed);
}
.notice > * + * { margin-top: var(--spacing); }
.warn { border-color: color-mix(in oklch, var(--warning) 40%, transparent); background: var(--warning-soft); }
.notice-danger { border-color: color-mix(in oklch, var(--danger) 40%, transparent); background: var(--danger-soft); }
.notice-success { border-color: color-mix(in oklch, var(--success) 30%, transparent); background: var(--success-soft); }
.notice-title { font-size: var(--text-sm); font-weight: var(--font-weight-semibold); }
.notice-danger .notice-title { color: var(--danger); }
.notice-success .notice-title { color: var(--success); }
.notice code, .warn code { background: color-mix(in oklch, var(--foreground) 8%, transparent); color: inherit; }

/* card (portal app/login/page.tsx sign-in section: rounded-xl border
   bg-surface p-6 shadow-sm md:p-8; components/page.tsx Panel) */
.narrow { width: 100%; max-width: var(--container-xl); margin-left: auto; margin-right: auto; padding-top: calc(var(--spacing) * 4); }
.narrow-wide { max-width: var(--container-3xl); }
.card { border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-pad { padding: calc(var(--spacing) * 6); }
.card > * + * { margin-top: calc(var(--spacing) * 4); }
.card > p { font-size: 15px; line-height: var(--leading-relaxed); }
.card-title { font-size: var(--text-2xl); line-height: var(--text-2xl--line-height); font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-tight); }
.lead-muted { color: var(--muted-foreground); }

/* page header and section (portal components/page.tsx PageHeader: border-b
   pb-6, h1 text-2xl font-semibold tracking-tight md:text-[28px]
   md:leading-9, description text-[15px] leading-relaxed
   text-muted-foreground; Section h2 text-base font-semibold tracking-tight) */
.page-header { display: flex; flex-direction: column; gap: calc(var(--spacing) * 1.5);
  padding-bottom: calc(var(--spacing) * 6); border-bottom: 1px solid var(--border); }
.page-title, .headline { font-size: var(--text-2xl); line-height: var(--text-2xl--line-height);
  font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-tight); text-wrap: balance; }
.page-description { max-width: var(--container-3xl); font-size: 15px; line-height: var(--leading-relaxed); color: var(--muted-foreground); }
.section { display: flex; flex-direction: column; gap: calc(var(--spacing) * 4); }
main > .section { margin-top: calc(var(--spacing) * 8); }
.section-title, .summary h2, .check h2 { font-size: var(--text-base); font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-tight); }
.note { max-width: var(--container-4xl); }

/* record table (portal components/table.tsx TableFrame: overflow-x-auto
   rounded-lg border bg-surface; THead border-b bg-surface-sunken/70 text-xs
   font-medium tracking-wide uppercase text-muted-foreground; Th px-4
   py-2.5; Td px-4 py-3 align-top; rows divide-y) */
.table-frame { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table.records { width: 100%; font-size: var(--text-sm); }
table.records th { padding: calc(var(--spacing) * 2.5) calc(var(--spacing) * 4); text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--surface-sunken) 70%, transparent);
  font-size: var(--text-xs); font-weight: var(--font-weight-medium); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--muted-foreground); }
table.records td { padding: calc(var(--spacing) * 3) calc(var(--spacing) * 4); vertical-align: top; text-align: left; overflow-wrap: break-word; }
table.records td:nth-child(-n+3), table.records td:last-child { white-space: nowrap; }
table.records tbody tr + tr td { border-top: 1px solid var(--border); }
table.records tbody tr:not(.empty):hover { background: color-mix(in oklch, var(--muted) 60%, transparent); }

/* ---------------------------------------------------------------------------
   approval page (portal features/approvals/approval-overview.tsx: headline,
   what this approves, where it fits, the check, the decision, the folded
   details; body column max-w-3xl, headline max-w-4xl) */
main:has(> .headline) > * { max-width: var(--container-3xl); }
main:has(> .headline) > .headline { max-width: var(--container-4xl); }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--spacing) * 2);
  font-size: var(--text-xs); font-weight: var(--font-weight-medium); letter-spacing: var(--tracking-wide); color: var(--muted-foreground); }
.eyebrow + .headline { margin-top: calc(var(--spacing) * 3); }
.headline code, .lead code { font-size: 0.85em; }
.lead { margin-top: calc(var(--spacing) * 3); font-size: var(--text-lg); line-height: var(--leading-relaxed); text-wrap: pretty; }
#expires { margin-top: calc(var(--spacing) * 3); }

/* what this approves (approval-overview.tsx: h2 text-base font-semibold;
   sentences text-[15px] leading-relaxed with a size-1.5 rounded-full
   bg-primary dot; the header above ends with border-b pb-6) */
.summary { padding-top: calc(var(--spacing) * 6); border-top: 1px solid var(--border); }
.summary > * + * { margin-top: calc(var(--spacing) * 2); }
.summary > p { font-size: 15px; line-height: var(--leading-relaxed); text-wrap: pretty; }
.summary > p:not([id]) { position: relative; padding-left: calc(var(--spacing) * 4.5); }
.summary > p:not([id])::before { content: ""; position: absolute; left: 0; top: 0.6em;
  width: calc(var(--spacing) * 1.5); height: calc(var(--spacing) * 1.5); border-radius: 50%; background: var(--primary); }
/* the requester's note (figure rounded-md border bg-surface px-4 py-3;
   caption text-xs font-medium text-muted-foreground; quote text-sm) */
.summary > .reason { margin-top: calc(var(--spacing) * 3); padding: calc(var(--spacing) * 3) calc(var(--spacing) * 4);
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  font-size: var(--text-sm); line-height: var(--leading-relaxed); }
.reason .label { display: block; margin-bottom: var(--spacing); font-size: var(--text-xs); font-weight: var(--font-weight-medium); color: var(--muted-foreground); }
/* where this fits (text-[15px] leading-relaxed text-muted-foreground; the
   help link text-sm font-medium text-primary hover:underline with an arrow) */
.summary > .context { margin-top: calc(var(--spacing) * 4); color: var(--muted-foreground); }
.context strong { color: var(--foreground); }
#help { font-size: var(--text-sm); text-decoration: none; white-space: nowrap; }
#help:hover { text-decoration: underline; }
#help::after { content: " \2192"; }

/* the check (approval-overview.tsx: rounded-lg border-ink/20 bg-ink p-5
   md:p-6 text-ink-foreground, h2 with a warning triangle; instruction
   text-[15px] leading-relaxed, code bg-ink-line; comparison code rounded-md
   border (ours: ink-muted, not ink-line, so the frame is visible) px-4 py-2 font-mono text-3xl font-semibold
   tracking-[0.2em]; fingerprint text-2xl md:text-3xl tracking-[0.12em]) */
.check { padding: calc(var(--spacing) * 5); border: 1px solid var(--ink-line); border-radius: var(--radius-lg);
  background: var(--ink); color: var(--ink-foreground); }
.check > * + * { margin-top: calc(var(--spacing) * 4); }
.check h2::before { content: "\26A0\FE0E"; margin-right: calc(var(--spacing) * 2); }
.check p { max-width: 65ch; font-size: 15px; line-height: var(--leading-relaxed); text-wrap: pretty; }
.check code { background: var(--ink-line); color: var(--ink-foreground); }
.check .warn { max-width: none; color: var(--foreground); font-size: var(--text-sm); }
.check .warn code { background: color-mix(in oklch, var(--foreground) 8%, transparent); color: inherit; }
.code-line { overflow-wrap: anywhere; }
.code-line .big { display: inline-block; padding: calc(var(--spacing) * 2) calc(var(--spacing) * 4);
  border: 1px solid var(--ink-muted); border-radius: var(--radius-md); color: var(--ink-foreground);
  font-family: var(--font-mono); font-size: var(--text-2xl); line-height: var(--leading-tight);
  font-weight: var(--font-weight-semibold); letter-spacing: 0.2em; }
.check:has(#link-fp-warning) .code-line .big { letter-spacing: 0.12em; }
/* the identity to check (IdentityList: dt text-ink-muted, dd font-mono text-ink-foreground) */
table.identity { font-size: var(--text-sm); }
table.identity th { padding: calc(var(--spacing) * 0.5) calc(var(--spacing) * 6) calc(var(--spacing) * 0.5) 0;
  text-align: left; vertical-align: top; font-weight: var(--font-weight-normal); color: var(--ink-muted); white-space: nowrap; }
table.identity td { padding: calc(var(--spacing) * 0.5) 0; }
table.identity code { background: transparent; padding: 0; }

/* the decision (portal features/approvals/decision-panel.tsx: rounded-lg
   border bg-surface p-5 shadow-xs, max-w-xl; approve size lg w-full; the
   deny form border-t pt-5 with a labelled reason and a destructive-outline
   button w-full) */
.actions { max-width: var(--container-xl); padding: calc(var(--spacing) * 5);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
main:has(> .headline) > .actions { max-width: var(--container-xl); }
.actions form { display: flex; flex-direction: column; gap: calc(var(--spacing) * 3); margin: 0; }
.actions form + form, .actions form + p { margin-top: calc(var(--spacing) * 5); padding-top: calc(var(--spacing) * 5); border-top: 1px solid var(--border); }
.actions form p { font-size: var(--text-sm); line-height: var(--leading-relaxed); color: var(--muted-foreground); }
.actions button { width: 100%; }

/* the fold (approval-overview.tsx details: rounded-lg border bg-surface;
   summary flex justify-between px-4 py-3 text-sm font-medium
   hover:bg-muted/60, a hint that hides when open; content border-t px-4;
   review-body.tsx technical details: dt text-muted-foreground in a 12rem
   column, values font-mono text-[13px] break-all) */
details.details { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
details.details > summary { display: flex; align-items: center; justify-content: space-between; gap: calc(var(--spacing) * 3);
  padding: calc(var(--spacing) * 3) calc(var(--spacing) * 4); border-radius: var(--radius-lg); list-style: none;
  font-size: var(--text-sm); font-weight: var(--font-weight-medium); }
details.details > summary::-webkit-details-marker { display: none; }
details.details > summary:hover { background: color-mix(in oklch, var(--muted) 60%, transparent); }
details.details > summary::after { content: "Approval ID, document, digest, approvers, snapshots \25BE"; text-align: right;
  font-size: var(--text-xs); font-weight: var(--font-weight-normal); color: var(--muted-foreground); }
details.details[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
details.details[open] > summary::after { content: "\25B4"; font-size: var(--text-sm); }
details.details > :not(summary) { margin: calc(var(--spacing) * 4); }
details.details > table { width: calc(100% - var(--spacing) * 8); font-size: var(--text-sm); }
details.details > table > tbody > tr > th { width: 12rem; padding: calc(var(--spacing) * 1.5) calc(var(--spacing) * 6) calc(var(--spacing) * 1.5) 0;
  text-align: left; vertical-align: top; font-weight: var(--font-weight-normal); color: var(--muted-foreground); }
details.details > table > tbody > tr > td { padding: calc(var(--spacing) * 1.5) 0; vertical-align: top; overflow-wrap: anywhere; line-height: var(--leading-relaxed); }
td.mono, td .mono { font-size: 13px; }
/* tables inside a detail row (roles, mounts, array members, site roots):
   the record table in small; they scroll inside their own box */
details.details td table { display: block; width: fit-content; max-width: 100%; overflow-x: auto;
  margin: calc(var(--spacing) * 2) 0; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 13px; }
details.details td table th { padding: calc(var(--spacing) * 1.5) calc(var(--spacing) * 3); text-align: left; white-space: nowrap;
  background: color-mix(in oklch, var(--surface-sunken) 70%, transparent);
  font-size: var(--text-xs); font-weight: var(--font-weight-medium); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--muted-foreground); }
details.details td table td { padding: calc(var(--spacing) * 1.5) calc(var(--spacing) * 3); vertical-align: top; border-top: 1px solid var(--border); }
details.details td details > summary { font-size: var(--text-sm); color: var(--primary); font-weight: var(--font-weight-medium); }
pre { margin: calc(var(--spacing) * 2) 0 0; padding: calc(var(--spacing) * 3); border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface-sunken); font-size: 13px; line-height: var(--leading-relaxed); white-space: pre-wrap; }

/* ---------------------------------------------------------------------------
   widths (Tailwind md = 48rem: md:px-8, md:p-6/p-8, md:text-[28px] md:leading-9, md:text-3xl) */
@media (min-width: 48rem) {
  .app-header-inner, .primary-nav ul, .app-footer-inner { padding-left: var(--page-gutter-md); padding-right: var(--page-gutter-md); }
  main { padding-left: var(--page-gutter-md); padding-right: var(--page-gutter-md); }
  .page-title, .headline { font-size: 28px; line-height: calc(var(--spacing) * 9); }
  .card-pad { padding: calc(var(--spacing) * 8); }
  .check { padding: calc(var(--spacing) * 6); }
  .code-line .big { font-size: var(--text-3xl); }
}
/* phone: no horizontal scrolling of the page. The record table becomes one
   card per approval (labels from data-label), the detail rows stack, the
   header keeps the mark, the line and the user ID. */
@media (max-width: 40rem) {
  .who-display, .wordmark-descriptor { display: none; }
  .who { gap: calc(var(--spacing) * 2); }
  .check:has(#link-fp-warning) .code-line .big { padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3); font-size: var(--text-xl); letter-spacing: 0.08em; }
  table.records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.records, table.records tbody, table.records tr, table.records td { display: block; }
  table.records tr { padding: calc(var(--spacing) * 2) 0; }
  table.records tbody tr + tr { border-top: 1px solid var(--border); }
  table.records tbody tr + tr td { border-top: 0; }
  table.records td:nth-child(n) { white-space: normal; overflow-wrap: anywhere; }
  table.records td { position: relative; padding: calc(var(--spacing) * 1) calc(var(--spacing) * 4); }
  table.records td[data-label] { padding-left: calc(6rem + var(--spacing) * 7); }
  table.records td[data-label]::before { content: attr(data-label); position: absolute; left: calc(var(--spacing) * 4); width: 6rem;
    font-size: var(--text-xs); font-weight: var(--font-weight-medium); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--muted-foreground); padding-top: 2px; }
  table.records td:empty { display: none; }
  details.details > summary::after { content: "\25BE"; }
  details.details > table, details.details > table > tbody, details.details > table > tbody > tr,
  details.details > table > tbody > tr > th, details.details > table > tbody > tr > td { display: block; width: auto; }
  details.details > table > tbody > tr > th { padding: calc(var(--spacing) * 2) 0 0; font-size: var(--text-xs); }
  details.details > table > tbody > tr > td { padding: calc(var(--spacing) * 0.5) 0 calc(var(--spacing) * 1); }
  details.details > :not(summary) { margin: calc(var(--spacing) * 3); }
}

/* forced colours: the header background becomes the system canvas, so the
   white wordmark keeps the ink behind it. Screens only: print shows the
   colour wordmark on paper (the kit: colour artwork on light surfaces). */
@media screen and (forced-colors: active) {
  .wordmark-logo { forced-color-adjust: none; background: var(--ink); border-radius: var(--radius-sm); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* print (approvers may print): the light palette (portal-tokens.css applies
   the dark one to screens only), no navigation, no buttons, the check as a
   framed block, the details shown in full. */
@media print {
  body { background: var(--surface); font-size: 11pt; }
  .skip, .primary-nav, .who form, .actions, .card-actions { display: none; }
  .app-header { background: transparent; color: var(--foreground); border-bottom: 1px solid var(--border-strong); }
  .app-header-inner { padding: 0 0 calc(var(--spacing) * 2); min-height: 0; }
  .wordmark-logo { display: none; }
  .wordmark-logo-print { display: block; }
  .wordmark-descriptor, .who-display { color: var(--muted-foreground); }
  main { max-width: none; padding: calc(var(--spacing) * 4) 0; }
  main:has(> .headline) > * { max-width: none; }
  a { color: inherit; }
  .check { background: transparent; color: var(--foreground); border: 2px solid var(--foreground); break-inside: avoid; }
  .check code { background: transparent; color: inherit; }
  .code-line .big { color: var(--foreground); border-color: var(--foreground); }
  table.identity th { color: var(--muted-foreground); }
  .card, .actions { box-shadow: none; }
  .table-frame, details.details td table { overflow: visible; }
  details.details > summary::after { content: none; }
  details.details::details-content { content-visibility: visible; display: block; }
  tr, pre, .summary > p { break-inside: avoid; }
  .app-footer-inner { padding: calc(var(--spacing) * 2) 0; }
}
