/* ==========================================================================
   Lab Shift Roster design system
   --------------------------------------------------------------------------
   One stylesheet, no framework. Everything below the tokens is built from the
   tokens; nothing hard-codes a brand colour, radius or shadow.

   CSP note: the Worker serves `default-src 'self'`, so there are no inline
   styles, no data: URIs and no external fonts anywhere in this system. Icons
   are inline SVG elements; progress is the native <progress> element.

   Contents
     1. Tokens
     2. Base and typography
     3. Layout primitives
     4. Components (buttons, forms, badges, alerts, cards, tables, ...)
     5. Public site (header, footer, home, pricing, contact)
     6. Auth pages
     7. Application shell
     8. Account pages
     9. Utilities, motion, print
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Brand */
  --brand-navy: #0B2D4F;
  --brand-steel: #3B82C4;
  --brand-emerald: #10B981;
  --brand-mist: #E5EEF5;

  /* Navy scale */
  --navy-950: #061A2E;
  --navy-900: #0B2D4F;
  --navy-800: #12395F;
  --navy-700: #1A4876;
  --navy-600: #245A8E;

  /* Steel blue scale. 600 is the accessible text/link blue (5.2:1 on white). */
  --steel-700: #245E9A;
  --steel-600: #2F6FB0;
  --steel-500: #3B82C4;
  --steel-400: #5FA0DB;
  --steel-300: #9CC3E8;
  --steel-200: #C6DCF1;
  --steel-100: #E0EDF9;
  --steel-50:  #F0F6FC;

  /* Emerald scale. 700 is the accessible text/solid green (5.5:1 on white). */
  --emerald-800: #065F46;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-500: #10B981;
  --emerald-200: #A7F3D0;
  --emerald-100: #D1FAE5;
  --emerald-50:  #ECFDF5;

  /* Mist and neutrals */
  --mist-50:  #F6F9FC;
  --mist-100: #E5EEF5;
  --mist-200: #D9E4EE;
  --mist-300: #BCCDDF;

  --text-strong: #0F1F33;
  --text: #24364D;
  --text-muted: #5B6B7F;
  --text-on-dark: #FFFFFF;
  --text-on-dark-muted: #B7CBE0;

  --bg: #F6F9FC;
  --surface: #FFFFFF;
  --surface-muted: #F6F9FC;
  --border: #D9E4EE;
  --border-strong: #BCCDDF;

  /* Semantic */
  --success-fg: #047857; --success-bg: #ECFDF5; --success-border: #A7F3D0;
  --warning-fg: #92400E; --warning-bg: #FFF7E0; --warning-border: #F2D58A;
  --danger-fg:  #B42318; --danger-bg:  #FEF3F2; --danger-border:  #FECDCA;
  --info-fg:    #245E9A; --info-bg:    #F0F6FC; --info-border:    #C6DCF1;

  /* Typography. System stack only: no font files are shipped or fetched. */
  --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.5rem;
  --text-display: clamp(2.25rem, 1.2rem + 3vw, 3.4rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem;

  /* Shape and elevation */
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px; --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(11, 45, 79, 0.05);
  --shadow-sm: 0 1px 3px rgba(11, 45, 79, 0.08), 0 1px 2px rgba(11, 45, 79, 0.04);
  --shadow-md: 0 8px 24px -8px rgba(11, 45, 79, 0.2), 0 2px 6px rgba(11, 45, 79, 0.06);
  --focus-ring: 0 0 0 3px rgba(59, 130, 196, 0.35);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --dur-fast: 120ms;
  --dur: 180ms;

  /* Layout */
  --container: 1180px;
  --container-narrow: 760px;
  --header-h: 68px;
  --sidebar-w: 264px;
  --topbar-h: 60px;

  --z-header: 40; --z-drawer: 60; --z-dialog: 80; --z-toast: 90;

  color-scheme: light;
}

/* 2. Base and typography --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; color: var(--text-strong); font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.2; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
h1 { font-size: var(--text-3xl); font-weight: 700; }
h2 { font-size: var(--text-2xl); font-weight: 700; }
h3 { font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: var(--text-md); font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }
a { color: var(--steel-600); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--navy-900); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-6) 0; }
code, kbd { font-family: var(--font-mono); font-size: 0.9em; }
code { background: var(--mist-100); padding: 0.1em 0.4em; border-radius: var(--radius-sm); color: var(--text-strong); overflow-wrap: anywhere; }
small { font-size: var(--text-sm); }
strong { font-weight: 600; color: var(--text-strong); }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--steel-600); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--steel-200); color: var(--navy-950); }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  background: var(--navy-900); color: #fff; padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: var(--space-4); }

.eyebrow { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel-600); margin: 0 0 var(--space-3); }
.lede { font-size: var(--text-lg); color: var(--text); line-height: 1.6; max-width: 62ch; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-strong { color: var(--text-strong); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

/* 3. Layout primitives ----------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-6); }
.container-narrow { max-width: var(--container-narrow); }
.stack > * + * { margin-top: var(--stack-gap, var(--space-4)); }
.stack-2 { --stack-gap: var(--space-2); } .stack-3 { --stack-gap: var(--space-3); }
.stack-6 { --stack-gap: var(--space-6); } .stack-8 { --stack-gap: var(--space-8); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.cluster-between { justify-content: space-between; }
.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* 4. Components ------------------------------------------------------------ */
.icon { flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons: primary navy, secondary outlined, ghost, success (emerald, true positives only), danger. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 40px; padding: 0 var(--space-4);
  font: inherit; font-size: var(--text-base); font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-md);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn-primary { background: var(--navy-900); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-secondary, .btn-primary-outline { background: var(--surface); color: var(--navy-900); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover, .btn-primary-outline:hover { background: var(--mist-50); border-color: var(--steel-500); color: var(--navy-900); }
.btn-primary-outline { border-color: var(--navy-900); }
.btn-ghost { background: transparent; color: var(--steel-600); }
.btn-ghost:hover { background: var(--steel-50); color: var(--navy-900); }
.btn-success { background: var(--emerald-700); color: #fff; }
.btn-success:hover { background: var(--emerald-800); color: #fff; }
.btn-danger { background: var(--surface); color: var(--danger-fg); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-fg); }
.btn-on-dark { background: #fff; color: var(--navy-900); }
.btn-on-dark:hover { background: var(--mist-100); color: var(--navy-900); }
.btn-outline-on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.btn-outline-on-dark:hover { background: rgba(255, 255, 255, 0.08); border-color: #fff; color: #fff; }
.btn-sm { min-height: 34px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn-lg { min-height: 48px; padding: 0 var(--space-6); font-size: var(--text-md); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; animation: spin 0.7s linear infinite;
}
.btn-secondary[aria-busy="true"]::after, .btn-primary-outline[aria-busy="true"]::after, .btn-ghost[aria-busy="true"]::after, .btn-danger[aria-busy="true"]::after {
  border-color: var(--mist-300); border-top-color: var(--navy-900);
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-text { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--danger-fg); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-text:hover { color: #7A1A12; }
@media (pointer: coarse) { .btn { min-height: 44px; } .btn-sm { min-height: 40px; } }

/* Forms */
.field { display: block; }
.field + .field { margin-top: var(--space-5); }
.label { display: block; margin-bottom: var(--space-2); font-size: var(--text-base); font-weight: 600; color: var(--text-strong); }
.label .optional { font-weight: 400; color: var(--text-muted); }
.help { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--text-muted); }
.input, .select, .textarea {
  display: block; width: 100%; min-height: 42px; padding: 0 var(--space-3);
  font: inherit; font-size: var(--text-md); color: var(--text-strong);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.textarea { padding: var(--space-3); min-height: 120px; line-height: 1.5; resize: vertical; }
.select { appearance: none; padding-right: var(--space-8); cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.input::placeholder, .textarea::placeholder { color: #7A8A9C; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--steel-500); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--steel-600); box-shadow: var(--focus-ring); }
.input[readonly], .textarea[readonly] { background: var(--mist-50); color: var(--text); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger-fg); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--navy-900); width: 1.05rem; height: 1.05rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.form-row > .field + .field { margin-top: 0; }
.form-row + .field { margin-top: var(--space-5); }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } .form-row > .field + .field { margin-top: var(--space-5); } }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }

/* Inline form feedback. The empty elements are rendered by the server and
   filled by page scripts, so they collapse until they have text. */
.form-error, .form-success {
  margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md); border: 1px solid; border-left-width: 4px;
  font-size: var(--text-base); line-height: 1.5; overflow-wrap: anywhere;
}
.form-error { color: var(--danger-fg); background: var(--danger-bg); border-color: var(--danger-border); border-left-color: var(--danger-fg); }
.form-success { color: var(--success-fg); background: var(--success-bg); border-color: var(--success-border); border-left-color: var(--success-fg); }
.form-error:empty, .form-success:empty { display: none; }
.form-success .copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.form-success .copy-row code { background: rgba(255, 255, 255, 0.7); flex: 1 1 260px; padding: var(--space-2) var(--space-3); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.6rem;
  font-size: var(--text-xs); font-weight: 600; line-height: 1.5; white-space: nowrap;
  border-radius: var(--radius-pill); border: 1px solid transparent;
  background: var(--mist-100); color: var(--text);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge-plain::before { display: none; }
.badge-info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-border); }
.badge-success { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning-fg); border-color: var(--warning-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-border); }
.badge-navy { background: var(--navy-900); color: #fff; }
.badge-neutral { background: var(--mist-100); color: var(--text); }
.tier-badge { display: inline-flex; align-items: center; padding: 0.15rem 0.6rem; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-radius: var(--radius-pill); background: var(--mist-100); color: var(--text); border: 1px solid var(--mist-200); }
.tier-badge.tier-pro { background: var(--steel-100); color: var(--steel-700); border-color: var(--steel-200); }
.tier-badge.tier-enterprise { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }

/* Alerts */
.alert { display: flex; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--info-border); border-left-width: 4px; border-radius: var(--radius-md); background: var(--info-bg); color: var(--text); }
.alert .icon { margin-top: 2px; color: var(--info-fg); }
.alert-title { margin: 0 0 var(--space-1); font-weight: 600; color: var(--text-strong); }
.alert-body { margin: 0; font-size: var(--text-base); }
.alert-success { background: var(--success-bg); border-color: var(--success-border); border-left-color: var(--success-fg); } .alert-success .icon { color: var(--success-fg); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); border-left-color: #D97706; } .alert-warning .icon { color: var(--warning-fg); }
.alert-danger { background: var(--danger-bg); border-color: var(--danger-border); border-left-color: var(--danger-fg); } .alert-danger .icon { color: var(--danger-fg); }
.alert-info { border-left-color: var(--steel-500); }

/* Cards and metrics */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card-body { padding: var(--space-6); }
.card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--border); }
.card-title { font-size: var(--text-lg); font-weight: 600; margin: 0; }
.card-sub { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--text-muted); }
.card-footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border); background: var(--surface-muted); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-flush { overflow: hidden; }
.card-flush .table-wrap { border: 0; border-radius: 0; }
.card + .card, .card + .alert, .alert + .card { margin-top: var(--space-6); }

.metric-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.metric { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); text-decoration: none; color: var(--text); }
a.metric { transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
a.metric:hover { border-color: var(--steel-500); box-shadow: var(--shadow-sm); color: var(--text); }
.metric-label { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); }
.metric-label .icon { color: var(--steel-500); }
.metric-value { font-size: var(--text-3xl); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.metric-value small { font-size: var(--text-md); font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.metric-caption { font-size: var(--text-sm); color: var(--text-muted); }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.table th { padding: var(--space-3) var(--space-4); text-align: left; font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); background: var(--mist-50); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--mist-100); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--steel-50); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-actions { text-align: right; width: 1%; white-space: nowrap; }
.table-dense th, .table-dense td { padding: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.table .when { white-space: nowrap; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.table a { font-weight: 600; }
.person { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.avatar { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--steel-100); color: var(--steel-700); font-size: var(--text-sm); font-weight: 700; }
.person-email { overflow-wrap: anywhere; color: var(--text-strong); font-weight: 500; }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: var(--space-12) var(--space-6); }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: var(--space-2); border-radius: 50%; background: var(--steel-50); color: var(--steel-600); border: 1px solid var(--steel-100); }
.empty-title { font-size: var(--text-lg); font-weight: 600; color: var(--text-strong); margin: 0; }
.empty-text { max-width: 44ch; margin: 0 0 var(--space-3); color: var(--text-muted); }
.empty-compact { padding: var(--space-8) var(--space-6); }

/* Progress, meters and loading */
.meter { width: 100%; height: 8px; border: 0; border-radius: var(--radius-pill); background: var(--mist-100); overflow: hidden; appearance: none; }
.meter::-webkit-progress-bar { background: var(--mist-100); }
.meter::-webkit-progress-value { background: var(--steel-500); border-radius: var(--radius-pill); }
.meter::-moz-progress-bar { background: var(--steel-500); border-radius: var(--radius-pill); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--mist-200); border-top-color: var(--steel-600); animation: spin 0.8s linear infinite; }
.inline-status { display: none; align-items: center; gap: var(--space-3); margin-top: var(--space-4); color: var(--text-muted); font-size: var(--text-base); }
.inline-status.is-visible { display: flex; }

/* Dialog and toast, both built by /assets/ui.js */
.dialog { width: min(92vw, 440px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); color: var(--text); background: var(--surface); }
.dialog::backdrop { background: rgba(6, 26, 46, 0.55); }
.dialog-body { padding: var(--space-6); }
.dialog-title { font-size: var(--text-xl); margin: 0 0 var(--space-2); }
.dialog-text { margin: 0; color: var(--text); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-6); background: var(--surface-muted); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.toast-region { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-2); max-width: min(92vw, 380px); }
.toast { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--navy-900); color: #fff; box-shadow: var(--shadow-md); font-size: var(--text-base); animation: toast-in var(--dur) var(--ease); }
.toast-danger { background: var(--danger-fg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Brand lockup */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--navy-900); }
.brand:hover { color: var(--navy-900); }
.brand-mark { flex: none; width: 34px; height: 34px; }
.brand-word { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; color: var(--navy-900); }
.brand-accent { color: var(--steel-600); }
.brand-on-dark .brand-word { color: #fff; }
.brand-on-dark .brand-accent { color: #6CB1F0; }

/* 5. Public site ----------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: var(--z-header); background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header-inner { display: flex; align-items: center; gap: var(--space-8); min-height: var(--header-h); }
.site-nav { display: flex; align-items: center; gap: var(--space-1); }
.site-nav a { padding: 0.5rem 0.8rem; border-radius: var(--radius-md); font-size: var(--text-base); font-weight: 500; color: var(--text); text-decoration: none; }
.site-nav a:hover { background: var(--mist-100); color: var(--navy-900); }
.site-nav a[aria-current="page"] { color: var(--navy-900); font-weight: 600; background: var(--mist-100); }
.site-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.nav-mobile { display: none; position: relative; margin-left: var(--space-2); }
.nav-mobile summary { list-style: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); cursor: pointer; color: var(--navy-900); }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile-panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(88vw, 320px); padding: var(--space-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); display: grid; gap: 2px; }
.nav-mobile-panel a { padding: 0.7rem 0.8rem; border-radius: var(--radius-md); text-decoration: none; color: var(--text-strong); font-weight: 500; }
.nav-mobile-panel a:hover { background: var(--mist-100); }
.nav-mobile-panel hr { margin: var(--space-2) 0; }
@media (max-width: 920px) {
  .site-nav, .site-actions .hide-sm { display: none; }
  .nav-mobile { display: block; }
  .site-header-inner { gap: var(--space-4); }
}

.site-footer { background: var(--navy-950); color: var(--text-on-dark-muted); padding: var(--space-16) 0 var(--space-8); font-size: var(--text-base); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--space-10); }
.footer-blurb { margin-top: var(--space-4); max-width: 34ch; color: var(--text-on-dark-muted); }
.footer-col h2 { font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; margin-bottom: var(--space-4); font-family: var(--font-sans); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.site-footer a { color: var(--text-on-dark-muted); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: var(--text-sm); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.section { padding: var(--space-16) 0; }
.section-tint { background: var(--mist-50); border-block: 1px solid var(--border); }
.section-head { max-width: 62ch; margin-bottom: var(--space-10); }
.section-head h2 { font-size: var(--text-4xl); font-weight: 700; letter-spacing: -0.03em; }
.section-head p { margin-top: var(--space-4); font-size: var(--text-lg); }
@media (max-width: 640px) { .section { padding: var(--space-12) 0; } .section-head h2 { font-size: var(--text-3xl); } }

/* Hero */
.hero { padding: var(--space-20) 0 var(--space-16); background: linear-gradient(180deg, var(--mist-50), var(--surface)); border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: var(--space-12); align-items: center; }
.hero h1 { font-size: var(--text-display); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.hero-lede { margin-top: var(--space-5); max-width: 52ch; font-size: var(--text-lg); color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.hero-points { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: var(--space-8) 0 0; padding: 0; list-style: none; font-size: var(--text-base); color: var(--text-muted); }
.hero-points li { display: inline-flex; align-items: center; gap: var(--space-2); }
.hero-points .icon { color: var(--emerald-700); }
.pill-eyebrow { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0.3rem 0.8rem; margin-bottom: var(--space-5); font-size: var(--text-sm); font-weight: 600; color: var(--navy-800); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); }
.pill-eyebrow .icon { color: var(--emerald-700); }
@media (max-width: 960px) { .hero { padding: var(--space-12) 0; } .hero-grid { grid-template-columns: 1fr; gap: var(--space-10); } }

/* Illustrative product preview (HTML, not an image: crisp at any size) */
.preview { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); overflow: hidden; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--navy-900); color: #fff; font-size: var(--text-sm); }
.preview-bar strong { color: #fff; font-weight: 600; }
.preview-bar .badge { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: transparent; }
.preview-body { padding: var(--space-4); }
.preview-title { margin: 0 0 var(--space-3); font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); }
.roster { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: var(--text-sm); }
.roster th { font-weight: 600; font-size: var(--text-xs); color: var(--text-muted); text-align: center; padding-bottom: 2px; }
.roster th:first-child { text-align: left; }
.roster td { text-align: center; height: 30px; border-radius: 5px; font-weight: 700; font-size: var(--text-xs); }
.roster td:first-child { text-align: left; width: 74px; font-weight: 600; font-size: var(--text-sm); color: var(--text-strong); }
.roster td.off { color: #8FA0B3; font-weight: 400; background: var(--mist-50); }
.shift-E { background: #FFF2CC; color: #000; } .shift-C { background: #D9E1F2; color: #000; }
.shift-L { background: #00B0F0; color: #000; } .shift-N { background: #7030A0; color: #fff; }
.shift-W { background: #00B050; color: #fff; }
.preview-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); font-size: var(--text-xs); color: var(--text-muted); }
.preview-legend span { display: inline-flex; align-items: center; gap: var(--space-1); }
.preview-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.12); }
.preview-issues { display: grid; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.issue-line { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); font-size: var(--text-sm); border: 1px solid; border-left-width: 4px; }
.issue-line b { font-weight: 700; }
.issue-critical { background: var(--danger-bg); border-color: var(--danger-border); border-left-color: var(--danger-fg); color: #7A1A12; }
.issue-review { background: var(--warning-bg); border-color: var(--warning-border); border-left-color: #D97706; color: #6B3008; }
.issue-passed { background: var(--success-bg); border-color: var(--success-border); border-left-color: var(--success-fg); color: #04503B; }
.preview-note { margin: var(--space-3) 0 0; font-size: var(--text-xs); color: var(--text-muted); text-align: center; }

/* Feature grid */
.feature { padding: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.feature-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: var(--space-4); border-radius: var(--radius-md); background: var(--steel-50); color: var(--steel-600); border: 1px solid var(--steel-100); }
.feature h3 { margin-bottom: var(--space-2); }
.feature p { color: var(--text); font-size: var(--text-base); }

.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--space-12); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: var(--space-8); } }
.constraint-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.constraint-list li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); font-weight: 500; color: var(--text-strong); font-size: var(--text-base); }
.constraint-list .icon { color: var(--steel-500); }
@media (max-width: 520px) { .constraint-list { grid-template-columns: 1fr; } }

/* Privacy panel (navy, strategic use) */
.panel-dark { background: var(--navy-900); color: var(--text-on-dark-muted); border-radius: var(--radius-xl); padding: var(--space-12); }
.panel-dark h2, .panel-dark h3 { color: #fff; }
.panel-dark .eyebrow { color: #6CB1F0; }
.panel-dark p { color: var(--text-on-dark-muted); }
.panel-dark strong { color: #fff; }
.assurance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); margin-top: var(--space-10); padding-top: var(--space-8); border-top: 1px solid rgba(255, 255, 255, 0.14); }
.assurance .icon { color: var(--emerald-500); margin-bottom: var(--space-3); }
.assurance h3 { font-size: var(--text-md); margin-bottom: var(--space-2); }
.assurance p { font-size: var(--text-base); }
.panel-dark .fine-print { margin-top: var(--space-8); font-size: var(--text-sm); color: #8FAAC6; max-width: 80ch; }
@media (max-width: 860px) { .panel-dark { padding: var(--space-8) var(--space-6); } .assurance { grid-template-columns: 1fr; gap: var(--space-6); } }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); }
.chip { padding: 0.35rem 0.85rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); font-size: var(--text-base); font-weight: 500; color: var(--text-strong); }

.cta-band { background: var(--navy-900); color: #fff; border-radius: var(--radius-xl); padding: var(--space-12); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-6); }
.cta-band h2 { color: #fff; font-size: var(--text-3xl); max-width: 22ch; }
.cta-band p { color: var(--text-on-dark-muted); margin-top: var(--space-2); }
@media (max-width: 640px) { .cta-band { padding: var(--space-8) var(--space-6); } }

/* Pricing */
.page-hero { padding: var(--space-16) 0 var(--space-8); text-align: center; }
.page-hero h1 { font-size: var(--text-4xl); letter-spacing: -0.03em; }
.page-hero .lede { margin: var(--space-4) auto 0; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); align-items: stretch; }
@media (max-width: 960px) { .plan-grid { grid-template-columns: minmax(0, 520px); justify-content: center; } }
.plan-card { display: flex; flex-direction: column; padding: var(--space-8); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-xs); }
.plan-card-featured { border: 2px solid var(--navy-900); box-shadow: var(--shadow-md); position: relative; }
.plan-flag { position: absolute; top: -13px; left: var(--space-8); padding: 0.2rem 0.8rem; background: var(--navy-900); color: #fff; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border-radius: var(--radius-pill); }
.plan-name { font-size: var(--text-xl); }
.plan-tagline { margin: var(--space-2) 0 var(--space-5); color: var(--text-muted); font-size: var(--text-base); min-height: 3em; }
.plan-price { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text-strong); line-height: 1.05; font-variant-numeric: tabular-nums; }
.plan-price span { font-size: var(--text-base); font-weight: 500; letter-spacing: 0; color: var(--text-muted); margin-left: 0.25rem; }
.plan-price-alt { margin: var(--space-2) 0 0; font-size: var(--text-base); color: var(--text-muted); }
.plan-price-alt strong { color: var(--emerald-700); }
.plan-features { list-style: none; margin: var(--space-6) 0; padding: var(--space-6) 0 0; border-top: 1px solid var(--border); display: grid; align-content: start; gap: var(--space-3); flex: 1; }
.plan-features li { display: flex; gap: var(--space-3); font-size: var(--text-base); color: var(--text); }
.plan-features .icon { margin-top: 3px; color: var(--emerald-700); }
.plan-cta { display: grid; gap: var(--space-2); }
.compare { margin-top: var(--space-16); }
.compare .table td:not(:first-child), .compare .table th:not(:first-child) { text-align: center; }
.compare .yes { color: var(--emerald-700); display: inline-block; vertical-align: middle; }
.compare .no { color: var(--text-muted); }
.compare .table td:first-child { color: var(--text-strong); font-weight: 500; }
.compare .col-featured { background: var(--steel-50); }
.faq { max-width: 760px; margin: var(--space-12) auto 0; }
.faq details { border-bottom: 1px solid var(--border); padding: var(--space-4) 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; gap: var(--space-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.25rem; line-height: 1; color: var(--steel-600); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin-top: var(--space-3); color: var(--text); }

/* Contact */
.contact-layout { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--space-12); align-items: start; padding: var(--space-16) 0 var(--space-20); }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; gap: var(--space-8); padding: var(--space-10) 0 var(--space-16); } }
.contact-aside h1 { font-size: var(--text-4xl); letter-spacing: -0.03em; }
.contact-aside .lede { margin-top: var(--space-4); }
.contact-list { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: grid; gap: var(--space-5); }
.contact-list li { display: flex; gap: var(--space-4); }
.contact-list .icon-badge { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--steel-50); border: 1px solid var(--steel-100); color: var(--steel-600); }
.contact-list h2 { font-size: var(--text-md); font-family: var(--font-sans); margin-bottom: 2px; }
.contact-list p { font-size: var(--text-base); color: var(--text-muted); }
.honeypot-field { position: absolute; left: -9999px; top: -9999px; }

/* 6. Auth pages ------------------------------------------------------------ */
.auth-layout { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); min-height: 100vh; }
.auth-aside { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-10); padding: var(--space-12); background: var(--navy-900); color: var(--text-on-dark-muted); }
.auth-aside h2 { color: #fff; font-size: var(--text-3xl); letter-spacing: -0.03em; max-width: 18ch; }
.auth-aside p { margin-top: var(--space-4); max-width: 42ch; }
.auth-points { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: grid; gap: var(--space-4); }
.auth-points li { display: flex; gap: var(--space-3); color: var(--text-on-dark-muted); font-size: var(--text-base); }
.auth-points .icon { color: var(--emerald-500); margin-top: 3px; }
.auth-points strong { color: #fff; }
.auth-aside small { color: #8FAAC6; }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: var(--space-10) var(--space-6); background: var(--surface); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: var(--text-3xl); letter-spacing: -0.03em; }
.auth-card .lede { margin-top: var(--space-2); font-size: var(--text-md); color: var(--text-muted); }
.auth-card form { margin-top: var(--space-8); }
.auth-alt { margin-top: var(--space-6); text-align: center; font-size: var(--text-base); color: var(--text-muted); }
.auth-mobile-brand { display: none; margin-bottom: var(--space-8); }
.auth-foot { margin-top: var(--space-10); font-size: var(--text-sm); color: var(--text-muted); text-align: center; }
@media (max-width: 960px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-brand { display: block; }
  .auth-main { justify-content: flex-start; padding-top: var(--space-8); }
}

/* Legacy tiny status page used for checkout return screens */
.notice-page { max-width: 560px; margin: var(--space-20) auto; padding-inline: var(--space-6); text-align: center; }
.notice-page .empty-icon { width: 56px; height: 56px; margin-inline: auto; }
.notice-page h1 { margin-top: var(--space-4); font-size: var(--text-3xl); }
.notice-page p { margin-top: var(--space-3); color: var(--text); }
.notice-page .cluster { justify-content: center; margin-top: var(--space-8); }

/* 7. Application shell ----------------------------------------------------- */
.app-body { background: var(--bg); font-size: var(--text-base); }
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--navy-900); color: var(--text-on-dark-muted); overflow-y: auto; }
.sidebar-brand { padding: var(--space-5) var(--space-5) var(--space-4); }
.sidebar-org { display: flex; align-items: center; gap: var(--space-3); margin: 0 var(--space-3) var(--space-4); padding: var(--space-3); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius-md); }
.sidebar-org .avatar { background: var(--steel-500); color: #fff; border-radius: var(--radius-md); }
.sidebar-org-name { display: block; font-size: var(--text-sm); font-weight: 600; color: #fff; line-height: 1.3; overflow-wrap: anywhere; }
.sidebar-org .tier-badge { margin-top: 3px; padding: 0.05rem 0.5rem; font-size: 0.65rem; background: rgba(255, 255, 255, 0.12); color: #fff; border-color: transparent; }
.sidebar-org .tier-badge.tier-enterprise { background: var(--emerald-700); }
.sidebar-nav { flex: 1; padding: 0 var(--space-3) var(--space-4); }
.nav-group + .nav-group { margin-top: var(--space-5); }
.nav-label { margin: 0 0 var(--space-2); padding: 0 var(--space-3); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #7F9BB8; }
.nav-link { display: flex; align-items: center; gap: var(--space-3); min-height: 40px; padding: 0 var(--space-3); margin-bottom: 2px; border-radius: var(--radius-md); font-size: var(--text-base); font-weight: 500; color: var(--text-on-dark-muted); text-decoration: none; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-link[aria-current="page"] { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--emerald-500); }
.nav-link .icon { opacity: 0.9; }
.nav-link .nav-tag { margin-left: auto; padding: 0.05rem 0.45rem; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.1); color: var(--text-on-dark-muted); }
.nav-link-locked { color: #A9BFD6; }
.nav-link-locked .nav-tag { color: #C9D8E8; }
.sidebar-foot { padding: var(--space-3); border-top: 1px solid rgba(255, 255, 255, 0.1); }
.sidebar a:focus-visible, .sidebar button:focus-visible { outline-color: #fff; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: var(--z-header); display: flex; align-items: center; gap: var(--space-4); min-height: var(--topbar-h); padding: 0 var(--space-8); background: var(--surface); border-bottom: 1px solid var(--border); }
.menu-toggle { display: none; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--surface); color: var(--navy-900); cursor: pointer; }
.crumbs { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--text-base); color: var(--text-muted); }
.crumbs .icon { color: var(--mist-300); }
.crumbs span:last-child { color: var(--text-strong); font-weight: 600; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--navy-900); text-decoration: underline; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.topbar-user { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); min-width: 0; }
.topbar-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
.app-content { flex: 1; width: 100%; max-width: 1180px; margin-inline: auto; padding: var(--space-8); }
.app-content-narrow { max-width: 920px; }
.scrim { display: none; }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.page-title { font-size: var(--text-3xl); letter-spacing: -0.03em; }
.page-lede { margin: var(--space-2) 0 0; max-width: 68ch; color: var(--text-muted); font-size: var(--text-md); }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-8) 0 var(--space-3); }
.section-title h2 { font-size: var(--text-xl); }

@media (max-width: 1023px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; }
  .js .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: var(--z-drawer); width: min(86vw, 300px); height: 100%; transform: translateX(-100%); visibility: hidden; transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur); }
  .js .app-shell[data-drawer="open"] .sidebar { transform: none; visibility: visible; transition-delay: 0s; }
  .js .app-shell[data-drawer="open"] .scrim { display: block; position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: rgba(6, 26, 46, 0.55); }
  .js .menu-toggle { display: grid; }
  .topbar { padding: 0 var(--space-4); }
  .app-content { padding: var(--space-6) var(--space-4); }
  .topbar-user span { display: none; }
}

/* 8. Account pages --------------------------------------------------------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-6); margin-top: var(--space-6); align-items: start; }
@media (max-width: 960px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.dash-grid .card + .card { margin-top: var(--space-6); }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: var(--space-4); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--mist-100); }
.activity li:last-child { border-bottom: 0; }
.activity-dot { flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--steel-500); box-shadow: 0 0 0 4px var(--steel-50); }
.activity-main { min-width: 0; }
.activity-title { margin: 0; color: var(--text-strong); font-weight: 500; }
.activity-meta { margin: 2px 0 0; font-size: var(--text-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: flex; gap: var(--space-4); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--mist-100); }
.steps li:last-child { border-bottom: 0; }
.steps li::before { content: counter(step); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--steel-50); border: 1px solid var(--steel-200); color: var(--steel-700); font-weight: 700; font-size: var(--text-sm); }
.steps h3 { font-size: var(--text-md); margin-bottom: 2px; }
.steps p { font-size: var(--text-sm); color: var(--text-muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-6); margin: 0; font-size: var(--text-base); }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; color: var(--text-strong); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.upsell { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-5) var(--space-6); background: var(--steel-50); border: 1px solid var(--steel-200); border-radius: var(--radius-lg); }
.upsell p { margin: 0; max-width: 62ch; color: var(--text); }
.upsell .icon { color: var(--steel-600); }
.locked-card { text-align: center; }

/* Billing */
.billing-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
@media (max-width: 720px) { .billing-plans { grid-template-columns: 1fr; } }
.billing-plan { position: relative; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); }
.billing-plan.is-selected { border-color: var(--navy-900); box-shadow: 0 0 0 1px var(--navy-900); }
.billing-plan .plan-price { font-size: 2.2rem; }
.billing-plan .badge { align-self: flex-start; }
.included { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.included li { display: flex; gap: var(--space-3); font-size: var(--text-base); }
.included .icon { margin-top: 3px; color: var(--emerald-700); }

/* Configuration editor */
.editor-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-bottom: var(--space-4); font-size: var(--text-sm); color: var(--text-muted); }
.code-area { font-family: var(--font-mono); font-size: var(--text-sm); line-height: 1.55; min-height: 340px; tab-size: 2; white-space: pre; overflow: auto; }
details.advanced { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
details.advanced > summary { cursor: pointer; padding: var(--space-4) var(--space-6); font-weight: 600; color: var(--text-strong); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: transform var(--dur) var(--ease); }
details.advanced[open] > summary::after { transform: rotate(-135deg); }
details.advanced > .advanced-body { padding: 0 var(--space-6) var(--space-6); }

/* Workflow stepper and timeline */
.stepper { display: flex; align-items: flex-start; margin: 0; padding: 0; list-style: none; }
.stepper li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; font-size: var(--text-sm); color: var(--text-muted); }
.stepper li::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--mist-200); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper .step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 2px solid var(--mist-300); color: var(--text-muted); font-weight: 700; font-size: var(--text-sm); }
.stepper li.is-done .step-dot { background: var(--emerald-700); border-color: var(--emerald-700); color: #fff; }
.stepper li.is-done::before, .stepper li.is-current::before { background: var(--emerald-700); }
.stepper li.is-current .step-dot { background: var(--navy-900); border-color: var(--navy-900); color: #fff; box-shadow: 0 0 0 4px var(--steel-100); }
.stepper li.is-current { color: var(--text-strong); font-weight: 600; }
.stepper li.is-warn .step-dot { background: var(--warning-bg); border-color: #D97706; color: var(--warning-fg); box-shadow: 0 0 0 4px var(--warning-bg); }
@media (max-width: 560px) { .stepper { flex-direction: column; gap: var(--space-4); } .stepper li { flex-direction: row; text-align: left; } .stepper li::before { display: none; } }
.timeline { list-style: none; margin: 0; padding: var(--space-6); }
.timeline li { position: relative; padding: 0 0 var(--space-6) var(--space-8); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: -2px; width: 2px; background: var(--mist-200); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--steel-500); }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.timeline-meta { font-size: var(--text-sm); color: var(--text-muted); }
.timeline-comment { margin: var(--space-2) 0 0; padding: var(--space-3) var(--space-4); background: var(--mist-50); border-left: 3px solid var(--steel-300); border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: var(--text-base); overflow-wrap: anywhere; }

/* 9. Utilities, motion, print ---------------------------------------------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.mt-2 { margin-top: var(--space-2); } .mt-4 { margin-top: var(--space-4); } .mt-6 { margin-top: var(--space-6); } .mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); } .mb-6 { margin-bottom: var(--space-6); }
.align-end { justify-content: flex-end; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .btn[aria-busy="true"]::after, .spinner { animation: none; border-top-color: var(--mist-300); }
}
@media (forced-colors: active) {
  .btn, .card, .metric, .table-wrap, .badge, .alert { border: 1px solid CanvasText; }
  .nav-link[aria-current="page"] { outline: 2px solid Highlight; }
}
@media print {
  .site-header, .site-footer, .sidebar, .topbar, .toast-region, .skip-link { display: none !important; }
  .app-shell { display: block; }
  .app-content { padding: 0; max-width: none; }
  body { background: #fff; }
}

/* Additional spacing utilities */
.pb-16 { padding-bottom: var(--space-16); }
.mt-3 { margin-top: var(--space-3); }
.mt-10 { margin-top: var(--space-10); }

/* How it works: numbered step cards */
.step-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.step-card { padding: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.step-num { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: var(--space-4); border-radius: 50%; background: var(--navy-900); color: #fff; font-weight: 700; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.step-card h3 { margin-bottom: var(--space-2); font-size: var(--text-md); }
.step-card p { margin: 0; font-size: var(--text-base); color: var(--text-muted); }
@media (max-width: 960px) { .step-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .step-cards { grid-template-columns: 1fr; } }

/* Small screens: keep the top bar to one line and the overview compact */
@media (max-width: 640px) {
  .crumbs { flex: 1; min-width: 0; }
  .crumbs > span:first-child, .crumbs > .icon { display: none; }
  .crumbs span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .metric { padding: var(--space-4); }
  .metric-value { font-size: var(--text-2xl); }
  .page-title { font-size: var(--text-2xl); }
  .page-header { margin-bottom: var(--space-5); }
  .card-body { padding: var(--space-5); }
  .card-header { padding: var(--space-4) var(--space-5); }
  .activity li, .steps li { padding-inline: var(--space-5); }
}

/* Very narrow screens (320px reflow): the header button moves into the menu, which already lists it */
@media (max-width: 430px) {
  .site-actions > .btn { display: none; }
  .container { padding-inline: var(--space-4); }
  .brand-word { font-size: 1.1rem; }
}
