/* cp-face design system, base layer. Spec and Component API: docs/design/portal-2026-11.md.
   Dark, one theme; print stays light. Every style lives in /static (CSP style-src 'self': no style attributes, no
   <style> blocks). Page layers come through {% block extra_css %}: auth.css (sign-in) now, hub.css, hr.css and
   training.css later. Fonts: the ITernative kit, self-hosted (SIL OFL 1.1, each license.txt next to its file).
   References to files under /static get their content version when this file is served (app/assets.py). */

/* ---- fonts ----------------------------------------------------------------------------------------------------- */
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/geist/geist-variable-latin.woff2?v=d510ce1539f6") format("woff2");
}
@font-face {
  font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/geistmono/geist-mono-variable-latin.woff2?v=4bff54910336") format("woff2");
}
@font-face {
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/static/fonts/instrumentserif/instrument-serif-italic-latin.woff2?v=e28a443d155d") format("woff2");
}
/* Arial sized to Geist's metrics while Geist loads, so nothing reflows when it swaps in */
@font-face {
  font-family: "Geist Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica");
  size-adjust: 104.9%; ascent-override: 95.8%; descent-override: 28.1%; line-gap-override: 0%;
}

/* ---- tokens ---------------------------------------------------------------------------------------------------- */
:root {
  color-scheme: dark;
  /* canvas and surfaces */
  --canvas: #101b22;
  --halo: rgba(61, 96, 100, .22);
  --glass: rgba(23, 37, 46, .88);
  --glass-solid: #16242d;
  --raised: rgba(255, 255, 255, .04);
  --raised-hover: rgba(255, 255, 255, .07);
  --sunken: rgba(4, 10, 14, .42);
  --line: rgba(197, 218, 226, .13);
  --line-strong: rgba(197, 218, 226, .22);
  --line-field: rgba(197, 218, 226, .40);
  --line-hover: rgba(197, 218, 226, .58);
  /* text */
  --text: #eef3f5;
  --body: #d4d8dd;
  --muted: #acbdc5;
  --faint: #7f939c;
  /* actions */
  --primary: #086bad;
  --primary-hover: #075e99;
  --primary-line: rgba(255, 255, 255, .15);
  --link: #5cb3f0;
  --link-hover: #8fcdf7;
  --link-line: rgba(92, 179, 240, .4);
  --focus: #52a8e4;
  /* quiet accents, used sparingly (mostly through the art) */
  --blue: #0089ed;
  --sky: #a9d4e6;
  --teal: #3fa7b8;
  --sand: #d9b26a;
  --rose: #c98a90;
  --sage: #9eab92;
  --taupe: #b8aa99;
  --graphite: #40464f;
  /* states: ink on a tint, with a line */
  --ok-ink: #c4e4c2;    --ok-bg: rgba(158, 171, 146, .16);   --ok-line: rgba(158, 171, 146, .42);
  --warn-ink: #f0d9a6;  --warn-bg: rgba(217, 178, 106, .14);  --warn-line: rgba(217, 178, 106, .42);
  --err-ink: #f4c3c6;   --err-bg: rgba(201, 138, 144, .15);   --err-line: rgba(201, 138, 144, .5);
  --info-ink: #cfe6fb;  --info-bg: rgba(0, 137, 237, .13);    --info-line: rgba(0, 137, 237, .45);
  --draft-ink: #e6dccf; --draft-bg: rgba(184, 170, 153, .14); --draft-line: rgba(184, 170, 153, .42);
  /* type */
  --font-sans: "Geist", "Geist Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  /* shape */
  --r-card: 20px;
  --r-auth: 24px;
  --r-control: 12px;
  --r-small: 8px;
  --r-pill: 999px;
  --shadow: 0 24px 80px -32px rgba(0, 0, 0, .45);
  --shadow-pop: 0 18px 50px -16px rgba(0, 0, 0, .62);
  /* rhythm: 4/8 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --gutter: 16px;
  --container: 1240px;
  --measure: 64ch;
  --touch: 44px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1100px) { :root { --gutter: 32px; } }

/* ---- reset ----------------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  background: var(--canvas); color: var(--body);
  font: 400 .9375rem/1.6 var(--font-sans);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, picture, video, canvas, iframe { display: block; max-width: 100%; }
img { height: auto; }
svg { flex-shrink: 0; }
input, button, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
p { margin: 0 0 var(--s4); }
ul, ol { margin: 0 0 var(--s4); padding-left: 1.4em; }
li + li { margin-top: var(--s1); }
dl, figure, blockquote { margin: 0 0 var(--s4); }
dd { margin: 0; }
table { border-collapse: separate; border-spacing: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(0, 137, 237, .38); color: #ffffff; }

/* ---- type ------------------------------------------------------------------------------------------------------ */
h1, h2, h3, h4 { color: var(--text); font-weight: 600; text-wrap: balance; }
h1 {
  margin: 0 0 var(--s4);
  font-size: clamp(1.875rem, 1.45rem + 1.5vw, 2.5rem); line-height: 1.1; font-weight: 500; letter-spacing: -.03em;
}
h2 { margin: var(--s7) 0 var(--s3); font-size: 1.375rem; line-height: 1.27; letter-spacing: -.015em; }
h3 { margin: var(--s5) 0 var(--s2); font-size: 1.0625rem; line-height: 1.41; letter-spacing: -.005em; }
h4 { margin: var(--s4) 0 var(--s2); font-size: .9375rem; }
h1 + h2, h1 + .lead { margin-top: 0; }
strong, b { font-weight: 600; color: var(--text); }
small, .small { font-size: .8125rem; line-height: 1.54; }
.small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.lead { max-width: var(--measure); font-size: 1.0625rem; line-height: 1.65; color: var(--body); }
.measure { max-width: var(--measure); }
.eyebrow {
  margin: 0 0 var(--s2);
  font: 500 .75rem/1.34 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.t-display {
  margin: 0; font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.25rem); line-height: 1.077; font-weight: 500;
  letter-spacing: -.035em; color: var(--text);
}
.t-title { margin: 0; font-size: 1.625rem; line-height: 1.154; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.mono, code, kbd, samp, pre { font-family: var(--font-mono); }
.tnum { font-variant-numeric: tabular-nums; }
code {
  padding: .1em .4em; border: 1px solid var(--line); border-radius: 6px; background: var(--raised);
  font-size: .8125em; color: var(--text); overflow-wrap: anywhere;
}
hr, .divider { height: 0; margin: var(--s6) 0; border: 0; border-top: 1px solid var(--line); }
.nowrap { white-space: nowrap; }
.wrap-anywhere { overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; }
.center { text-align: center; }

/* ---- links and focus ------------------------------------------------------------------------------------------- */
a {
  color: var(--link);
  text-decoration: underline; text-decoration-color: var(--link-line); text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
.link-quiet { color: var(--muted); text-decoration-color: transparent; }
.link-quiet:hover { color: var(--text); text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--s4); top: -100px; z-index: 100;
  padding: 10px 16px; border-radius: var(--r-small); background: var(--text); color: var(--canvas);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: var(--s3); color: var(--canvas); }

/* ---- icons (templates/_icons.html.j2) -------------------------------------------------------------------------- */
.icon { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.25em; }
.icon-sm { width: 1em; height: 1em; vertical-align: -.14em; }

/* ---- layout: the signed-in shell (templates/base.html.j2) ------------------------------------------------------ */
body.app {
  display: flex; flex-direction: column;
  background: radial-gradient(ellipse 80% 640px at 50% 0%, var(--halo), transparent 62%) no-repeat, var(--canvas);
}
.container {
  width: 100%; max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto; padding-inline: var(--gutter);
}
.page { flex: 1 0 auto; width: 100%; padding-block: var(--s6) var(--s8); }
.page > p:not(.toolbar), .page > .muted { max-width: 76ch; }
@media (min-width: 640px) { .page { padding-block: var(--s7) var(--s9); } }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.stack > * { margin: 0; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.cluster > * { margin: 0; }

.topbar { border-bottom: 1px solid var(--line); }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 72px; }
.brand {
  display: flex; align-items: center; min-width: 0; padding: var(--s1) 0;
  color: var(--text); text-decoration: none; border-radius: var(--r-small);
}
.brand:hover { color: var(--text); }
.brand-mark { width: 112px; flex: none; }
.brand-company {
  min-width: 0; margin-left: var(--s5); padding-left: var(--s4); border-left: 1px solid var(--line-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .9375rem; line-height: 24px; font-weight: 500; letter-spacing: -.005em; color: var(--text);
}
@media (max-width: 479px) {
  .brand-mark { width: 96px; }
  .brand-company { margin-left: var(--s4); padding-left: var(--s3); font-size: .875rem; }
}

/* the person menu: <details class="menu">, closed by Esc and outside clicks in face.js */
.menu { position: relative; flex: none; }
.menu > summary {
  display: flex; align-items: center; gap: var(--s2); min-height: var(--touch); padding: 3px 10px 3px 3px;
  border: 1px solid transparent; border-radius: var(--r-pill); color: var(--text); font-weight: 500;
  list-style: none; cursor: pointer; user-select: none; transition: background-color .15s ease, border-color .15s ease;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--raised); border-color: var(--line); }
.menu-chevron { width: 16px; height: 16px; color: var(--muted); transition: transform .2s var(--ease); }
.menu[open] .menu-chevron { transform: rotate(180deg); }
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: linear-gradient(145deg, #1e3c4f, #13252f); color: var(--sky);
  font: 600 .8125rem/1 var(--font-sans); letter-spacing: .02em;
}
.menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  width: max-content; min-width: 240px; max-width: min(340px, calc(100vw - 2 * var(--gutter)));
  padding: var(--s2); border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--glass-solid); box-shadow: var(--shadow-pop);
}
.menu-head { margin: 0 0 var(--s2); padding: var(--s2) var(--s3) var(--s3); border-bottom: 1px solid var(--line); }
.menu-head strong { display: block; color: var(--text); font-weight: 600; }
.menu-head span { display: block; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.menu form { margin: 0; }
.menu-item {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: var(--touch); padding: 0 var(--s3);
  border: 0; border-radius: 10px; background: none; color: var(--text);
  font: 500 .9375rem/1.3 var(--font-sans); text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: var(--raised-hover); color: var(--text); }
.menu-item .icon { color: var(--muted); }
@media (max-width: 639px) {
  .menu-name {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap;
  }
  .menu > summary { padding-right: 6px; gap: var(--s1); }
}

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }
.site-footer-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4) var(--s5);
  padding-block: var(--s5) var(--s6);
}
.endorsement { width: 176px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5); margin: 0; }
.footer-links a, .footer-links button.link { color: var(--muted); text-decoration-color: transparent; }
.footer-links a:hover, .footer-links button.link:hover { color: var(--text); text-decoration-color: currentColor; }
.footer-links form { margin: 0; }

/* development mode only (DEV_LOGIN_EMAIL; never in production) */
.devbar {
  border-bottom: 1px solid var(--warn-line); color: var(--warn-ink); font-size: .8125rem;
  background: repeating-linear-gradient(135deg, rgba(217, 178, 106, .15) 0 14px, rgba(217, 178, 106, .09) 14px 28px);
}
.devbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-height: 40px; padding-block: 6px; }
.devbar strong { color: var(--warn-ink); }
.devbar form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0; }
.devbar select, .devbar button {
  min-height: 30px; width: auto; padding: 2px 10px; border: 1px solid var(--warn-line); border-radius: var(--r-small);
  background-color: rgba(16, 27, 34, .7); color: var(--text); font-size: .8125rem; box-shadow: none;
}
.devbar select { padding-right: 30px; background-position: right 8px center; }

/* ITernative staff (Pavel 11-08): the client switcher on ITernative's own portal, and the bar over a client's portal
   when staff are in it (app/web.py, templates/base.html.j2) */
.topbar-tools { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.switcher > summary { padding: 3px 12px; }
.switcher > summary > .icon:first-child { color: var(--muted); }
.menu-item.is-current { color: var(--muted); cursor: default; }
.menu-item.is-current:hover { background: none; color: var(--muted); }
.staffbar {
  border-bottom: 1px solid var(--info-line); color: var(--info-ink); font-size: .875rem;
  background: linear-gradient(90deg, var(--info-bg), rgba(0, 137, 237, .05));
}
.staffbar-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4);
  min-height: 48px; padding-block: 6px;
}
.staffbar-what { display: flex; align-items: center; gap: var(--s2); margin: 0; }
.staffbar-what strong { color: var(--text); font-weight: 600; }
.staffbar-go { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.staffbar-go .menu > summary { min-height: 36px; }
.staffbar-home { color: var(--text); font-weight: 500; }
@media print { .staffbar { display: none !important; } }

/* ---- surfaces -------------------------------------------------------------------------------------------------- */
.surface {
  padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--glass); box-shadow: var(--shadow);
}
@media (min-width: 640px) { .surface { padding: var(--s6); } }
.surface > :last-child { margin-bottom: 0; }
/* a message for a signed-in person (templates/message.html.j2): not found, not for this account */
.message { max-width: 640px; padding-block: var(--s5) var(--s7); }
.message .lead { margin-bottom: var(--s5); }
.message .cluster { margin-top: var(--s5); }

/* ---- buttons --------------------------------------------------------------------------------------------------- */
.btn, .button, button.button, main button:not([class]) {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--touch); padding: 10px 18px;
  border: 1px solid var(--primary-line); border-radius: var(--r-control);
  background: var(--primary); color: #ffffff; box-shadow: 0 5px 14px -7px rgba(0, 71, 126, .4);
  font: 600 .9375rem/1.3 var(--font-sans); letter-spacing: 0; text-align: center; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.btn:hover, .button:hover, main button:not([class]):hover { background: var(--primary-hover); color: #ffffff; }
.btn:active, .button:active, main button:not([class]):active { transform: translateY(1px); }
.btn-secondary, .button.secondary, main button.secondary {
  border-color: var(--line-strong); background: var(--raised); color: var(--text); box-shadow: none;
}
.btn-secondary:hover, .button.secondary:hover, main button.secondary:hover {
  border-color: var(--line-hover); background: var(--raised-hover); color: var(--text);
}
.btn-quiet {
  border-color: transparent; background: transparent; color: var(--link); box-shadow: none; padding-inline: 10px;
}
.btn-quiet:hover { background: var(--raised); color: var(--link-hover); }
.btn-lg { min-height: 58px; padding: 14px 20px; font-size: 1rem; line-height: 1.4; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"], button[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
button.link, .btn-link {
  display: inline; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none;
  color: var(--link); font: inherit; text-align: inherit;
  text-decoration: underline; text-decoration-color: var(--link-line); text-underline-offset: .22em; cursor: pointer;
}
button.link:hover, .btn-link:hover { color: var(--link-hover); text-decoration-color: currentColor; }

/* ---- forms ----------------------------------------------------------------------------------------------------- */
label { color: var(--text); font-weight: 500; }
.label { display: block; margin: 0 0 6px; color: var(--text); font-size: .875rem; font-weight: 500; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.54; }
.field-error { margin: 6px 0 0; color: var(--err-ink); font-size: .8125rem; font-weight: 500; }
.req { color: var(--muted); font-size: .8125rem; font-weight: 400; }
.form-field { margin: 0 0 var(--s5); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s5); }

/* :where() keeps these at zero specificity, so a component (.auth-input, table.people input) only needs one class */
.input,
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"], [type="button"], [type="range"], [type="color"], [type="file"])),
:where(select, textarea) {
  width: 100%; max-width: 100%; min-height: 48px; margin: 0; padding: 11px 14px;
  border: 1px solid var(--line-field); border-radius: var(--r-control);
  background-color: var(--sunken); color: var(--text);
  font-size: 1rem; line-height: 1.5;
  transition: border-color .15s ease, background-color .15s ease;
}
:where(.input, input, select, textarea):hover { border-color: var(--line-hover); }
:where(.input, input, select, textarea):focus-visible {
  border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 2px;
}
::placeholder { color: var(--faint); opacity: 1; }
:where(textarea) { min-height: 112px; resize: vertical; }
:where(select) {
  appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23acbdc5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px 16px;
}
select option, select optgroup { background: var(--glass-solid); color: var(--text); }
input[type="checkbox"], input[type="radio"] {
  width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--blue); vertical-align: middle; cursor: pointer;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err-line); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
fieldset {
  min-width: 0; margin: 0 0 var(--s5); padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--raised);
}
/* a legend reads as the panel's heading, inside it (floated, so it leaves the border alone) */
legend {
  float: left; width: 100%; margin: 0 0 var(--s4); padding: 0;
  color: var(--text); font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em;
}
legend + * { clear: both; }
.check { display: flex; align-items: flex-start; gap: var(--s3); min-height: var(--touch); padding: 10px 0; font-weight: 400; color: var(--body); cursor: pointer; }
.check input { margin-top: 2px; }

/* ---- alerts ---------------------------------------------------------------------------------------------------- */
.alert, .flash, .notice {
  display: block; margin: 0 0 var(--s5); padding: var(--s3) var(--s4);
  border: 1px solid var(--line-strong); border-radius: var(--r-control);
  background: var(--raised); color: var(--body); max-width: 860px;
}
.alert > :last-child, .flash > :last-child, .notice > :last-child { margin-bottom: 0; }
.alert p, .flash p { margin: 0 0 var(--s1); }
.alert ul, .flash ul { margin: var(--s1) 0 0; padding-left: 1.2em; }
.alert a, .flash a, .notice a { color: inherit; text-decoration-color: currentColor; }
.alert strong, .flash strong, .notice strong { color: inherit; }
.alert-info { border-color: var(--info-line); background: var(--info-bg); color: var(--info-ink); }
.alert-ok, .flash-ok, .notice-ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.alert-warn, .notice-warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.alert-error, .flash-error { border-color: var(--err-line); background: var(--err-bg); color: var(--err-ink); }
.notice-draft { border-color: var(--draft-line); background: var(--draft-bg); color: var(--draft-ink); }

/* ---- chips ----------------------------------------------------------------------------------------------------- */
.chip, .badge, .status, .done {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; margin: 0; padding: 2px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--raised); color: var(--body);
  font-size: .75rem; font-weight: 500; line-height: 1.4; letter-spacing: .01em; white-space: nowrap; vertical-align: middle;
}
.chip-ok, .done, .status.status-sent, .status.status-closed { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.chip-warn, .badge-warn, .status.status-logged { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.chip-error, .status.status-failed { border-color: var(--err-line); background: var(--err-bg); color: var(--err-ink); }
.chip-info, .status.status-new { border-color: var(--info-line); background: var(--info-bg); color: var(--info-ink); }
.chip-draft, .badge-draft { border-color: var(--draft-line); background: var(--draft-bg); color: var(--draft-ink); }
a.chip {
  min-height: 36px; padding: 6px 14px; color: var(--text); font-size: .875rem; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
a.chip:hover { border-color: var(--line-hover); background: var(--raised-hover); color: var(--text); }
a.chip .icon { width: 1em; height: 1em; color: var(--muted); }

/* ---- tables ---------------------------------------------------------------------------------------------------- */
/* position: relative keeps absolutely placed children (a visually-hidden header) inside the scroll box */
.table-wrap, .table-scroll {
  position: relative; margin: 0 0 var(--s5); overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--glass); -webkit-overflow-scrolling: touch;
}
table, .table { width: 100%; font-size: .875rem; font-variant-numeric: tabular-nums; }
caption {
  padding: var(--s4) var(--s4) var(--s3); caption-side: top; text-align: left;
  color: var(--text); font-weight: 600; font-size: .9375rem;
}
th, td { padding: 11px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th {
  border-top: 0; background: rgba(255, 255, 255, .025); color: var(--muted); white-space: nowrap;
  font: 500 .6875rem/1.45 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
}
caption + thead th { border-top: 1px solid var(--line); }
tbody th { color: var(--text); font-weight: 500; }
tbody tr:hover > * { background: rgba(255, 255, 255, .02); }
td.num, th.num, .num { text-align: right; }
main > table.plain {
  margin: 0 0 var(--s5); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
  background: var(--glass);
}
main > table.plain thead th:first-child { border-top-left-radius: var(--r-card); }

/* ---- motion, forced colors, print ------------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .btn, .button, button, a.chip { border: 1px solid ButtonText; }
  .chip, .badge, .status, .done, .surface, .card, .panel, .facts, fieldset, .alert, .flash, .notice { border-color: CanvasText; }
  :focus-visible { outline-color: Highlight; }
  .brand-mark, .endorsement, .auth-logo { forced-color-adjust: none; background: #101b22; border-radius: 6px; }
  .art, .auth-art { display: none; }
}
@media print {
  :root { color-scheme: light; }
  body, body.app { background: #ffffff !important; color: #000000; font-size: 11pt; }
  .devbar, .topbar, .site-footer, .skip, .no-print, .crumbs, .menu { display: none !important; }
  .page { padding: 0; }
  h1, h2, h3, h4, strong, b, label, legend, caption, tbody th { color: #000000; }
  a { color: #000000; text-decoration: underline; }
  .muted, .small, .eyebrow, .hint, thead th { color: #444444; }
  .surface, .panel, .card, .facts, fieldset, .table-wrap, .table-scroll, main > table.plain {
    background: none; border-color: #bbbbbb; box-shadow: none;
  }
  .chip, .badge, .status, .done, .alert, .flash, .notice { background: none; border-color: #999999; color: #000000; }
  th, td { border-color: #cccccc; }
}

/* ==== earlier pages ================================================================================================
   The pages written before the 2026-11 redesign (hub, My items, HR, training) keep their markup; these rules make them
   read well on the new base until hub.css, hr.css and training.css take each page over (then delete what moved). */
main > h1:first-child, .crumbs + h1, .crumbs + .kicker + h1 { margin-top: 0; }
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 var(--s4);
  color: var(--faint); font-size: .8125rem;
}
.crumbs a { color: var(--muted); text-decoration-color: transparent; }
.crumbs a:hover { color: var(--text); text-decoration-color: currentColor; }
.toolbar { margin: 0 0 var(--s5); color: var(--muted); font-size: .875rem; }
.kicker, .record-kicker {
  margin: 0 0 var(--s2); color: var(--muted);
  font: 500 .75rem/1.34 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
}

/* hub (hub.html.j2) */
.cards {
  display: grid; gap: var(--s4); align-items: start; margin: 0 0 var(--s6); padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr));
}
.cards > li { margin: 0; }
.card {
  display: flex; flex-direction: column; gap: var(--s2); padding: var(--s5);
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--glass); box-shadow: var(--shadow);
  transition: border-color .2s ease;
}
.card:hover { border-color: var(--line-strong); }
.card h2, .card h3 { margin: 0 0 var(--s1); font-size: 1.25rem; line-height: 1.3; letter-spacing: -.015em; }
.card h2 a, .card h3 a { color: var(--text); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { color: var(--link-hover); text-decoration: underline; text-decoration-color: currentColor; }
.card p { margin: 0; }
.card > .badge, .card > .chip { align-self: flex-start; margin-top: var(--s1); }
.items { margin: var(--s1) 0 0; padding: 0; list-style: none; }
.items li { margin: 0; padding: var(--s3) 0; border-top: 1px solid var(--line); line-height: 1.5; }
.items li:first-child { border-top: 0; padding-top: var(--s1); }
.items a { color: var(--text); font-weight: 500; text-decoration-color: transparent; }
.items a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
.items .badge { margin-left: var(--s1); }
.hr-section { margin-top: var(--s7); padding-top: var(--s2); border-top: 1px solid var(--line); }

/* My items, HR and training pages */
.facts {
  display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; max-width: 760px; margin: 0 0 var(--s6);
  padding: var(--s2) var(--s5); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--glass);
}
.facts dt, .facts dd { margin: 0; padding: 12px 0; border-top: 1px solid var(--line); }
.facts dt { padding-right: var(--s5); color: var(--muted); font-weight: 500; }
.facts dd { color: var(--text); overflow-wrap: anywhere; }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }
@media (max-width: 559px) {
  .facts { grid-template-columns: 1fr; }
  .facts dd { padding-top: 0; border-top: 0; }
}
.stack { max-width: 680px; }
.stack label { font-weight: 500; }
.stack > button, .stack > .button, .stack > p > button { align-self: flex-start; }
.form-grid > p:last-child { margin-top: var(--s5); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 var(--s4); }
.field:last-child { margin-bottom: 0; }
.field label { color: var(--text); font-size: .875rem; font-weight: 500; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select { max-width: 480px; }
.field textarea { max-width: 680px; }
.field p { margin: 0; }
.field label.check { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: .9375rem; font-weight: 400; }
.radios { margin: 0 0 var(--s4); padding: 0; border: 0; background: none; }
.radios legend { margin-bottom: 6px; padding: 0; font-size: .875rem; font-weight: 500; }
.radios label { display: flex; align-items: center; gap: 10px; min-height: 40px; color: var(--body); font-weight: 400; }
.panel {
  margin: 0 0 var(--s5); padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--glass); box-shadow: var(--shadow);
}
.panel > :last-child { margin-bottom: 0; }
.panel h2 { margin-top: 0; }
.two-forms {
  display: grid; gap: var(--s4); margin-top: var(--s5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.two-forms .panel { max-width: none; margin: 0; }
.status-line { margin: var(--s1) 0 var(--s3); }
progress {
  appearance: none; -webkit-appearance: none; display: block; width: 100%; max-width: 420px; height: 8px;
  margin: 0 0 var(--s4); border: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, .08);
  overflow: hidden; color: var(--blue); accent-color: var(--blue);
}
progress::-webkit-progress-bar { background: rgba(255, 255, 255, .08); border-radius: var(--r-pill); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--blue), var(--sky)); border-radius: var(--r-pill); }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--blue), var(--sky)); border-radius: var(--r-pill); }
.lessons, .records { padding-left: 1.4em; }
.lessons li, .library li, .records li { margin: .55em 0; }
.library { padding-left: 0; list-style: none; }
.video-coming {
  display: flex; align-items: center; max-width: 760px; margin: var(--s5) 0; padding: var(--s5);
  aspect-ratio: 16 / 5; border: 1px dashed var(--line-strong); border-radius: var(--r-card); background: var(--raised);
}
.video-coming p { margin: 0; color: var(--muted); }
.script, .quiz { max-width: 760px; }
.question label { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 8px 0; color: var(--body); font-weight: 400; }
.question input { margin-top: 2px; }
.result { max-width: 760px; margin: var(--s5) 0; padding: var(--s4) var(--s5); border: 1px solid; border-radius: var(--r-card); }
.result h2 { margin-top: var(--s1); color: inherit; }
.result-pass { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.result-retry { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.feedback li { margin: .6em 0; }
.notice-draft .badge-draft { border-color: currentColor; }
.sig-frame {
  width: 100%; max-width: 760px; height: 220px; margin: 0 0 var(--s2); border: 1px solid var(--line-strong);
  border-radius: var(--r-control); background: #ffffff;
}
pre.json, .sig-text {
  margin: 0 0 var(--s4); padding: var(--s4); overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--sunken); color: var(--body); font-size: .8125rem; line-height: 1.6;
}
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: 0 0 var(--s4); }
.copy-status { color: var(--ok-ink); font-size: .875rem; }
.val { max-width: 28em; overflow-wrap: anywhere; font-size: .8125rem; }
.mdy { display: inline-flex; gap: 4px; }
.actions { white-space: nowrap; }
.actions form { display: inline; }
table.people td, table.people th { padding: 8px 10px; }
table.people input:not([type="checkbox"]), table.people select {
  width: 100%; min-width: 7em; min-height: 38px; padding: 6px 10px; border-radius: var(--r-small); font-size: .875rem;
}
table.people select { padding-right: 32px; background-position: right 10px center; }
table.people .mdy select { width: auto; min-width: 5.6em; }
table.people input[size="2"], table.people input[size="4"] { width: 4.4em; min-width: 3.2em; }
table.people tbody th { min-width: 12em; }
table.people tr.status-left > * { opacity: .62; }
table.people tr:target > * { background: rgba(0, 137, 237, .1); }
table.people .actions button { min-height: 36px; padding: 6px 14px; font-size: .8125rem; }
table.people .actions a { margin-left: var(--s2); }
table.training td, table.training th { font-size: .875rem; }
.record {
  max-width: 820px; margin: var(--s2) 0 var(--s4); padding: 40px 44px; border: 1px solid #d3dbe4; border-radius: 12px;
  background: #ffffff; color: #172029;
}
.record h1 { margin: .2em 0 .4em; color: #172029; font-size: 2rem; }
.record dt, .record strong { color: #172029; }
.record-name { margin: .6em 0 .1em; color: #172029; font-size: 1.6rem; font-weight: 700; }
.record-line { margin: 0 0 1.2em; font-size: 1.1rem; }
.record-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 1.2em; }
.record-facts dt { font-weight: 600; }
.record-facts dd { margin: 0; }
.record code { border-color: #d3dbe4; background: #f4f6f9; color: #172029; }
.record-scope { padding-top: 10px; border-top: 1px solid #d3dbe4; color: #52606e; font-size: .85rem; }
.record .record-kicker { color: #52606e; }
@media print {
  .record { margin: 0; padding: 0; border: none; max-width: none; }
}
