/* Shared vocabulary for server-rendered pages (Login, Onboard, Admin, Health).
   Tokens live in tokens.css; the shell in app-shell.css. Ruled sections, not boxed cards. */
.page { max-width: 1200px; }
.page h1, .page h2, .page h3 { font-family: var(--font-heading); font-weight: 600; line-height: 1.05; margin: 0; }
.page h1 { font-size: 44px; letter-spacing: -.01em; }
.page h2 { font-size: 26px; }
.page h3 { font-size: 20px; }
.page p { margin: 0; max-width: 76ch; }
.page a { color: var(--accent); text-underline-offset: 3px; }
.page :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Mono is for code and aligned figures only; times inside a sentence read as prose. */
.page code, .page pre, .page .num { font-family: var(--font-number); font-variant-numeric: tabular-nums; }
.page time { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted-foreground); }
.small { font-size: 13px; }

/* Heading block: title, one-line purpose, primary action on the right. */
.page-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.page-heading p { margin-top: 8px; color: var(--muted-foreground); font-size: 15px; }

/* Sections: separated by a rule; the first carries the accent rule. */
.page-section { padding: 24px 0; border-top: 1px solid var(--line); min-width: 0; }
.page-section:first-of-type { border-top: 2px solid var(--accent); }
.page-section > header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.page-section > header p { color: var(--muted-foreground); font-size: 14px; margin-top: 4px; }
.stack { display: grid; gap: 12px; }

/* Controls */
.button, .page button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); font: 500 14px/1.2 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover, .page button:hover { background: var(--accent-soft); }
.button.primary, .page button.primary { background: var(--accent); border-color: var(--accent); color: var(--primary-foreground); }
.button.primary:hover, .page button.primary:hover { background: var(--accent-hover); }
.button.danger, .page button.danger { border-color: var(--danger-border); color: var(--danger); }
.button.danger:hover, .page button.danger:hover { background: var(--danger-soft); }
.page button:disabled { opacity: .55; cursor: not-allowed; }
.page label { display: grid; gap: 6px; font-size: 14px; color: var(--muted-foreground); }
.page label.check { display: flex; align-items: flex-start; gap: 10px; color: var(--ink); }
.page input, .page select, .page textarea { min-height: 40px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 0; background: var(--input-bg); color: var(--ink); font: 400 15px/1.3 var(--font-body); }
.page input[type="checkbox"], .page input[type="radio"] { width: auto; min-height: auto; margin-top: 3px; accent-color: var(--accent); }
.page input.code { font-family: var(--font-number); letter-spacing: .12em; }
.form-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.form-row > label { flex: 1 1 220px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Copyable values. Inline: one value with a small copy action at its right edge.
   Panel: a header bar carries a label and the copy action, so the button never covers
   or squeezes a long command, and the value is never cut mid-line. */
.command { display: grid; grid-template-columns: minmax(0, 1fr) auto; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.command pre { margin: 0; padding: 10px 12px; overflow-x: auto; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.command button, .page .command button { min-height: 32px; padding: 0 12px; border: 0; border-left: 1px solid var(--line); background: transparent; font-size: 13px; }
.command-meta { grid-row: 1; grid-column: 1; align-self: center; min-width: 0; padding: 6px 12px; color: var(--muted-foreground); font: 500 12px/1.4 var(--font-body); }
.command-panel button, .page .command-panel button { grid-row: 1; grid-column: 2; }
.command-panel pre { grid-row: 2; grid-column: 1 / -1; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--paper); }
/* Long scripts show whole lines only and scroll inside their panel; copy always takes the full script. */
.command-script pre { max-height: calc(10 * 1.6em + 12px); padding-bottom: 0; overflow-y: auto; }
.command-script pre::after { content: ""; display: block; height: 12px; }

/* Notices: one sentence of state, one next step. */
/* Block, not grid: a sentence with an inline <time> or <strong> must flow as one line. */
.notice { display: block; padding: 14px 16px; border: 1px solid var(--line); border-left-width: 3px; background: var(--surface); font-size: 14px; }
.notice > * + * { margin-top: 6px; }
.notice.success { color: var(--success); background: var(--success-soft); border-color: var(--success-border); }
.notice.warning { color: var(--warning); background: var(--warning-soft); border-color: var(--warning-border); }
.notice.danger { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.page-notice { max-width: 64ch; padding: 20px; border-left: 3px solid var(--accent); background: var(--surface); display: grid; gap: 10px; }

/* Status chips: a word, not a color alone. */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; background: var(--table-header); color: var(--muted-foreground); font: 500 12px/1.6 var(--font-body); white-space: nowrap; }
.chip.ok { color: var(--success); background: var(--success-soft); }
.chip.warn { color: var(--warning); background: var(--warning-soft); }
.chip.bad { color: var(--danger); background: var(--danger-soft); }
.chip.info { color: var(--accent); background: var(--accent-soft); }

/* Facts: label over value. */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted-foreground); font-size: 13px; }
.facts dd { margin: 2px 0 0; font-size: 15px; overflow-wrap: anywhere; }

/* Tables: only for genuinely tabular records (roster, inventory, diagnostics). */
/* Relative: visually hidden text inside cells must stay inside the clipped scroller, never widen the page. */
.table-scroll { position: relative; overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
.page table { width: 100%; border-collapse: collapse; font-size: 14px; }
.page th, .page td { padding: 10px 12px; border-top: 1px solid var(--line-subtle); text-align: left; vertical-align: top; }
.page thead th { border-top: 0; background: var(--table-header); font-weight: 500; white-space: nowrap; }
.page td.num, .page th.num { text-align: right; white-space: nowrap; font-family: var(--font-number); font-variant-numeric: tabular-nums; }
.page tbody tr:hover { background: var(--table-row-hover); }

.page details > summary { cursor: pointer; width: fit-content; padding: 6px 0; font-size: 14px; }
.page dialog { border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--surface); color: var(--ink); padding: 24px; max-width: min(520px, 92vw); }
.page dialog::backdrop { background: rgb(0 0 0 / .35); }

@media (max-width: 600px) {
  .page h1 { font-size: 36px; }
  .page-heading { margin-bottom: 16px; }
}
