/* Rail, airbenderARC's console design system, as every hub page shares it:
   the console (console.css builds on it) and the sign-in pages
   (internal/auth) link this one stylesheet, so Rail's tokens have one
   source. Calm by default, colour only where it carries meaning, ids,
   hashes, paths and times in IBM Plex Mono, a 4px grid, radii of 2, 4 and
   6px, flat cards with a 1px hairline and shadows only between layers.
   Every text pair meets WCAG AA in both themes.

   Tokens: light by default, dark under prefers-color-scheme, either pinned
   by :root[data-theme] (static/theme.js sets it before the page paints from
   the viewer's choice). */
:root {
  color-scheme: light;
  --bg: #eef0ed; --surface: #ffffff; --surface-2: #f7f8f6; --sunken: #e7eae6;
  --border: #d3d8d4; --border-strong: #a9b1ac; --divider: #e3e6e2;
  --text: #121920; --muted: #475259; --faint: #5f6a71;
  --accent: #1d5c8a; --accent-hover: #174b72; --accent-fg: #ffffff; --accent-subtle: #e2edf5; --accent-text: #1b5682;
  --focus: #1f6fd1; --row-hover: #f8faf8;
  --nav: #141c24;
  --info-fg: #24557a; --info-bg: #e3edf5; --info-border: #a9c6dd;
  --good-fg: #17633a; --good-bg: #e2f2e8; --good-border: #a6d3b6;
  --warning-fg: #6e4b00; --warning-bg: #faefd3; --warning-border: #e3c678;
  --risk-fg: #a1251b; --risk-bg: #fbe5e2; --risk-border: #ecaea6;
  --none-fg: #475259; --none-bg: #eceeeb; --none-border: #cdd2ce;
  /* Type marks: each type family's colour from the puck-core registry
     (puck-core/family.go, Light and Dark; puck-dn2.4), a 3px mark beside
     the type's name, never a filled card. family_css_test.go keeps the
     three blocks in step with the registry. */
  --family-plan: #255f9f; --family-doc: #1d6c7c; --family-design: #5544a8; --family-deck: #a8501c; --family-report: #5f6420;
  --family-decision: #a33a3a; --family-app: #7a5c00; --family-data: #3f5878; --family-site: #2f6f33; --family-explainer: #255f9f;
  --family-media: #6d5a4b; --family-design-system: #9a2b64; --family-other: #5f6b73;
  --type-untyped: var(--border-strong);
  --shadow-1: 0 1px 0 rgb(16 24 32 / .04), 0 1px 2px rgb(16 24 32 / .06);
  --shadow-2: 0 2px 4px rgb(16 24 32 / .06), 0 8px 24px rgb(16 24 32 / .1);
  --shadow-3: 0 12px 48px rgb(16 24 32 / .18);
  /* Circle's ink over a puck's frame (the viewer's circle tool). */
  --ring: #c2410c; --ring-soft: rgb(194 65 12 / .12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1015; --surface: #121a21; --surface-2: #18222b; --sunken: #0e141a;
    --border: #26323c; --border-strong: #3a4954; --divider: #1f2a33;
    --text: #e4e9ed; --muted: #a3afb8; --faint: #85929c;
    --accent: #6fb0e0; --accent-hover: #8cc2ea; --accent-fg: #071521; --accent-subtle: #13283a; --accent-text: #86bfe8;
    --focus: #7cc0ff; --row-hover: #151f27;
    --nav: #0e151b;
    --info-fg: #8fc0e6; --info-bg: #132636; --info-border: #284a66;
    --good-fg: #7ed29b; --good-bg: #0f2619; --good-border: #22553a;
    --warning-fg: #f0c35c; --warning-bg: #2a2210; --warning-border: #5a4718;
    --risk-fg: #ff9b8f; --risk-bg: #321410; --risk-border: #6b2b22;
    --none-fg: #a3afb8; --none-bg: #1b252e; --none-border: #2f3c46;
    --family-plan: #78aef0; --family-doc: #5ec4d6; --family-design: #a698f0; --family-deck: #f0935a; --family-report: #c4c66a;
    --family-decision: #f39a8f; --family-app: #e2bd4f; --family-data: #9fb6d6; --family-site: #84cf86; --family-explainer: #78aef0;
    --family-media: #c8b4a0; --family-design-system: #ef8fc0; --family-other: #85929c;
    --shadow-1: 0 1px 0 rgb(0 0 0 / .3), 0 1px 2px rgb(0 0 0 / .35);
    --shadow-2: 0 2px 4px rgb(0 0 0 / .35), 0 8px 24px rgb(0 0 0 / .5);
    --shadow-3: 0 12px 48px rgb(0 0 0 / .6);
    --ring: #fb923c; --ring-soft: rgb(251 146 60 / .16);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1015; --surface: #121a21; --surface-2: #18222b; --sunken: #0e141a;
  --border: #26323c; --border-strong: #3a4954; --divider: #1f2a33;
  --text: #e4e9ed; --muted: #a3afb8; --faint: #85929c;
  --accent: #6fb0e0; --accent-hover: #8cc2ea; --accent-fg: #071521; --accent-subtle: #13283a; --accent-text: #86bfe8;
  --focus: #7cc0ff; --row-hover: #151f27;
  --nav: #0e151b;
  --info-fg: #8fc0e6; --info-bg: #132636; --info-border: #284a66;
  --good-fg: #7ed29b; --good-bg: #0f2619; --good-border: #22553a;
  --warning-fg: #f0c35c; --warning-bg: #2a2210; --warning-border: #5a4718;
  --risk-fg: #ff9b8f; --risk-bg: #321410; --risk-border: #6b2b22;
  --none-fg: #a3afb8; --none-bg: #1b252e; --none-border: #2f3c46;
  --family-plan: #78aef0; --family-doc: #5ec4d6; --family-design: #a698f0; --family-deck: #f0935a; --family-report: #c4c66a;
  --family-decision: #f39a8f; --family-app: #e2bd4f; --family-data: #9fb6d6; --family-site: #84cf86; --family-explainer: #78aef0;
  --family-media: #c8b4a0; --family-design-system: #ef8fc0; --family-other: #85929c;
  --shadow-1: 0 1px 0 rgb(0 0 0 / .3), 0 1px 2px rgb(0 0 0 / .35);
  --shadow-2: 0 2px 4px rgb(0 0 0 / .35), 0 8px 24px rgb(0 0 0 / .5);
  --shadow-3: 0 12px 48px rgb(0 0 0 / .6);
  --ring: #fb923c; --ring-soft: rgb(251 146 60 / .16);
}
/* The same in both themes: the type families and the motion. brand.css
   (the footer) reads --line, --muted and --ink. */
:root {
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fast: 90ms; --slow: 160ms; --ease: cubic-bezier(.2, 0, 0, 1);
  --line: var(--divider); --ink: var(--text);
}
@media (prefers-reduced-motion: reduce) { :root { --fast: 0s; --slow: 0s; } }

/* IBM Plex, vendored (static/fonts, SIL OFL 1.1 in fonts/OFL.txt). */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSans-Italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexSansCondensed-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/IBMPlexSansCondensed-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2"); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font-sans); font-feature-settings: "tnum" 1, "zero" 1; overflow-wrap: anywhere;
}
a { color: var(--accent-text); }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus);
}
h1, h2, h3 { font-family: var(--font-cond); font-weight: 600; line-height: 1.15; }
h1 { margin: 0 0 12px; font-size: 26px; }
h2 { margin: 28px 0 12px; font-size: 20px; }
h3 { margin: 20px 0 8px; font-size: 16px; }
code, kbd, samp, time, .mono { font-family: var(--font-mono); }
code { font-size: 12px; line-height: 1.4; }
.muted { color: var(--muted); font-weight: normal; }
.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Components (Rail's names). */
/* An uppercase label: Condensed 600 11px, tracked, muted. */
.eyebrow { font: 600 11px/1.5 var(--font-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* Buttons: 32px, a strong hairline, 4px corners; primary is the one accent
   on a page, ghost has no edge until hovered, sm is 26px. */
.btn, a.button, button.secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  font: 500 13px/1 var(--font-sans); color: var(--text); text-decoration: none; white-space: nowrap; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.btn:hover, a.button.secondary:hover, button.secondary:hover { color: var(--text); background: var(--surface-2); }
.btn-primary, a.button:not(.secondary) { color: var(--accent-fg); background: var(--accent); border-color: var(--accent); }
.btn-primary:hover, a.button:not(.secondary):hover { color: var(--accent-fg); background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { color: var(--muted); background: transparent; border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--sunken); }
.btn-sm { height: 26px; padding: 0 8px; font-size: 12px; }
/* A segmented control: a sunken track, the pressed option raised. */
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--sunken); border: 1px solid var(--border); border-radius: 4px; }
.seg-opt {
  height: 24px; padding: 0 10px; font: 500 12px/1 var(--font-sans); color: var(--muted); cursor: pointer;
  background: transparent; border: 0; border-radius: 2px;
}
.seg-opt:hover { color: var(--text); background: transparent; }
.seg-opt[aria-pressed="true"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-1); }
/* A chip: a value (a type with its 3x12px mark, a tag); mono for an id. */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 7px; max-width: 100%;
  font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; text-decoration: none;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 2px;
}
.chip-mono { font: 400 11px/1 var(--font-mono); }
.chip-mark { flex: none; width: 3px; height: 12px; border-radius: 1px; background: var(--type-untyped); }
.chip-mark[data-family="plan"] { background: var(--family-plan); }
.chip-mark[data-family="doc"] { background: var(--family-doc); }
.chip-mark[data-family="design"] { background: var(--family-design); }
.chip-mark[data-family="deck"] { background: var(--family-deck); }
.chip-mark[data-family="report"] { background: var(--family-report); }
.chip-mark[data-family="decision"] { background: var(--family-decision); }
.chip-mark[data-family="app"] { background: var(--family-app); }
.chip-mark[data-family="data"] { background: var(--family-data); }
.chip-mark[data-family="site"] { background: var(--family-site); }
.chip-mark[data-family="explainer"] { background: var(--family-explainer); }
.chip-mark[data-family="media"] { background: var(--family-media); }
.chip-mark[data-family="design-system"] { background: var(--family-design-system); }
.chip-mark[data-family="other"] { background: var(--family-other); }
/* A badge: a status, square and uppercase, optionally with a dot. */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; white-space: nowrap;
  font: 600 11px/1 var(--font-cond); letter-spacing: .04em; text-transform: uppercase;
  color: var(--none-fg); background: var(--none-bg); border: 1px solid var(--none-border); border-radius: 2px;
}
.badge.info { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-border); }
.badge.good { color: var(--good-fg); background: var(--good-bg); border-color: var(--good-border); }
.badge.warning { color: var(--warning-fg); background: var(--warning-bg); border-color: var(--warning-border); }
.badge.risk { color: var(--risk-fg); background: var(--risk-bg); border-color: var(--risk-border); }
/* A version's lifecycle state (data-state, puck-dn2.4): colour where the
   state asks something of the reader; approved, done and superseded stay
   quiet. */
.badge[data-state="draft"], .badge[data-state="saved"] { color: var(--warning-fg); background: var(--warning-bg); border-color: var(--warning-border); }
.badge[data-state="in_review"] { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-border); }
.badge[data-state="deployed"] { color: var(--good-fg); background: var(--good-bg); border-color: var(--good-border); }
.badge[data-state="withdrawn"] { color: var(--risk-fg); background: var(--risk-bg); border-color: var(--risk-border); }
.badge .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* A key: 20px, mono, a heavier bottom edge. */
.kbd {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; font: 500 11px/1 var(--font-mono);
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px;
}
/* A panel: a quiet grouped area inside a page. */
.panel { padding: 12px 16px; background: var(--surface-2); border: 1px solid var(--divider); border-radius: 4px; }
/* An empty state: a dashed glyph, a Condensed title and a short body. */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 16px; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: 6px;
}
.empty-state-glyph {
  display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 36px; height: 36px; padding: 0 8px;
  border: 1px dashed var(--border-strong); border-radius: 4px;
}
.empty-state-glyph::before, .empty-state-glyph::after { content: ""; height: 2px; background: var(--border-strong); }
.empty-state-glyph::after { width: 60%; }
.empty-state-title { margin: 0; font: 600 16px/1.15 var(--font-cond); }
.empty-state-body { margin: 0; max-width: 52ch; font-size: 13px; color: var(--muted); }
/* A status callout: a quiet tinted box, its tone the status it carries
   (info, good, warning, risk), with its action if it has one: the viewer's
   newer version, the sign-in pages' and Account's messages. */
.callout {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 8px 8px 12px;
  font-size: 13px; border: 1px solid; border-radius: 4px;
}
.callout.info { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-border); }
.callout.good { color: var(--good-fg); background: var(--good-bg); border-color: var(--good-border); }
.callout.warning { color: var(--warning-fg); background: var(--warning-bg); border-color: var(--warning-border); }
.callout.risk { color: var(--risk-fg); background: var(--risk-bg); border-color: var(--risk-border); }
.callout-text { flex: 1 1 240px; margin: 0; }

/* Form controls. A bare button is the form's action (accent); secondary,
   danger and link buttons are the others. */
input, select, textarea, button { font: inherit; color: var(--text); }
input:not([type="checkbox"]):not([type="radio"]), textarea {
  min-width: 0; padding: 0 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px;
}
input:not([type="checkbox"]):not([type="radio"]) { height: 32px; }
textarea { padding: 6px 10px; }
/* A select: 28px with a caret drawn in CSS. */
select, .sel {
  min-width: 0; height: 28px; padding: 0 28px 0 8px; font: 500 12px/1 var(--font-sans); color: var(--text);
  appearance: none; -webkit-appearance: none; border: 1px solid var(--border-strong); border-radius: 4px;
  background-color: var(--surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 13px) 12px, calc(100% - 9px) 12px; background-size: 4px 4px; background-repeat: no-repeat;
}
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  font: 500 13px/1 var(--font-sans); white-space: nowrap; cursor: pointer;
  color: var(--accent-fg); background: var(--accent); border: 1px solid var(--accent); border-radius: 4px;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled { opacity: .6; cursor: progress; }
button.danger { color: #ffffff; background: var(--risk-fg); border-color: var(--risk-fg); }
:root[data-theme="dark"] button.danger { color: #1a0806; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button.danger { color: #1a0806; } }
button.link {
  height: auto; padding: 0; font-weight: 600; color: var(--accent-text); background: none; border: 0; border-radius: 0; text-decoration: underline;
}
/* A form field: its label over its 32px input, the field's errors under it
   in risk text; a read-only input reads as a value, sunken and muted. A
   form's submit sits at its foot (form-actions), sized to its text unless
   the page widens it. */
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 16px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text); }
.field input { width: 100%; }
.field input[readonly] { color: var(--muted); background: var(--sunken); }
.field input[aria-invalid="true"] { border-color: var(--risk-fg); }
.field-msg { font-size: 12px; color: var(--risk-fg); }
.field-check { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* The sign-in pages (internal/auth, signed out): a 400px surface card
   centred on the page, the mark with the name over a Condensed heading,
   the card's action a full-width primary button, its other links in accent
   text, and the brand footer under it, quiet. The mark's colours follow
   the theme, pinned or not, through brand.css's two tokens. */
body.signin { display: flex; flex-direction: column; align-items: center; padding: 48px 16px 0; }
.signin-card {
  width: 100%; max-width: 400px; padding: 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow-2);
}
.signin-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; }
.signin-brand .logo svg { width: 32px; height: 32px; }
.signin-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.signin-name { font: 600 16px/1.1 var(--font-cond); color: var(--text); }
.signin-card h1 { margin: 0 0 12px; font-size: 24px; }
.signin-card h2 { margin: 24px 0 12px; padding-top: 16px; border-top: 1px solid var(--divider); font-size: 16px; }
.signin-card > p, .signin-card form > p { margin: 0 0 16px; }
.signin-card .callout { margin: 0 0 16px; }
.signin-card .form-actions button { width: 100%; }
/* Sign in with Authentik (puck-7rz.16.8): its own button above the password
   form, an "or" rule between them. */
.signin-sso .form-actions { margin-top: 0; }
.signin-sso .form-actions button { font-weight: 600; }
.signin-card .signin-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.signin-card .signin-or::before, .signin-card .signin-or::after { content: ""; flex: 1; border-top: 1px solid var(--divider); }
.signin-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-top: 4px; font-size: 13px; }
.signin-links form { margin: 0; }
body.signin .hub-footer { width: 100%; max-width: 640px; }
@media (max-width: 479.98px) {
  body.signin { padding-top: 24px; }
  .signin-card { padding: 20px 16px; }
}
