/* Hosait design system — shared foundations and components.
 *
 * Tokens (colours, type scale, spacing) are defined twice on purpose: as
 * Tailwind theme values in hosait-theme.js, for utility classes in markup, and
 * as custom properties here, for the components below and for JS-built UI.
 * Keep the two in step.
 *
 * Components use the `hx-` prefix. Tailwind utilities load after this file,
 * so a utility on an element always wins over the component default.
 */

:root {
  color-scheme: dark;

  /* Surfaces */
  --hx-bg: #0d0d11;
  --hx-bg-deep: #08080b;
  --hx-surface-1: #131318;
  --hx-surface-2: #18181e;
  --hx-surface-3: #202027;
  --hx-surface-4: #2a2a32;
  --hx-line: rgba(255, 255, 255, 0.08);
  --hx-line-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --hx-text: #f5f5f7;
  --hx-text-2: #a9a9b6;
  --hx-text-3: #8a8a97;

  /* Accent + status */
  --hx-accent: #b8b9ff;
  --hx-accent-hover: #d4d5ff;
  --hx-on-accent: #15135c;
  --hx-accent-soft: rgba(184, 185, 255, 0.12);
  --hx-live: #5fd38d;
  --hx-live-soft: rgba(95, 211, 141, 0.12);
  --hx-warn: #ffb783;
  --hx-error: #ffb4ab;
  --hx-error-soft: rgba(255, 180, 171, 0.1);

  /* Type */
  --hx-font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --hx-font-heading: "IBM Plex Serif", Georgia, serif;
  --hx-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --hx-fs-display: clamp(40px, 3.6vw + 26px, 80px);
  --hx-fs-title: clamp(30px, 2.2vw + 21px, 52px);
  --hx-fs-subtitle: clamp(21px, 0.5vw + 19px, 26px);
  --hx-fs-lead: clamp(19px, 0.45vw + 16.5px, 23px);
  --hx-fs-body: clamp(17px, 0.2vw + 16px, 18px);
  --hx-fs-small: 15px;
  --hx-fs-caption: 14px;

  /* Space (4 · 8 · 12 · 16 · 24 · 32 · 48 · 64 · 96 · 128) */
  --hx-s1: 4px;  --hx-s2: 8px;  --hx-s3: 12px; --hx-s4: 16px; --hx-s5: 24px;
  --hx-s6: 32px; --hx-s7: 48px; --hx-s8: 64px; --hx-s9: 96px; --hx-s10: 128px;
  --hx-gutter: 20px;
  --hx-max: 1200px;
  --hx-max-wide: 1320px;
  --hx-section-y: clamp(64px, 7vw + 30px, 136px);
  --hx-header-h: 56px;

  /* Shape + motion */
  --hx-r-sm: 10px;
  --hx-r-md: 14px;
  --hx-r-lg: 22px;
  --hx-r-xl: 28px;
  --hx-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --hx-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --hx-fast: 180ms;
  --hx-med: 400ms;
  /* Tailwind colour tokens (hosait-theme.js reads these). r g b, so /opacity works. */
  --c-surface-container-lowest: 8 8 11;
  --c-background: 13 13 17;
  --c-surface: 13 13 17;
  --c-surface-dim: 13 13 17;
  --c-surface-container-low: 19 19 24;
  --c-surface-container: 24 24 30;
  --c-surface-container-high: 32 32 39;
  --c-surface-container-highest: 42 42 50;
  --c-surface-bright: 52 52 61;
  --c-surface-variant: 42 42 50;
  --c-inverse-surface: 245 245 247;
  --c-inverse-on-surface: 29 29 34;
  --c-on-background: 245 245 247;
  --c-on-surface: 245 245 247;
  --c-on-surface-variant: 169 169 182;
  --c-outline: 124 124 138;
  --c-outline-variant: 58 58 68;
  --c-primary: 184 185 255;
  --c-primary-fixed: 212 213 255;
  --c-primary-fixed-dim: 184 185 255;
  --c-surface-tint: 184 185 255;
  --c-on-primary: 21 19 92;
  --c-primary-container: 127 130 245;
  --c-on-primary-container: 13 11 82;
  --c-on-primary-fixed: 7 0 108;
  --c-on-primary-fixed-variant: 47 46 190;
  --c-inverse-primary: 84 87 220;
  --c-secondary: 198 198 207;
  --c-secondary-fixed: 226 225 235;
  --c-secondary-fixed-dim: 198 198 207;
  --c-secondary-container: 69 70 78;
  --c-on-secondary: 47 48 55;
  --c-on-secondary-container: 180 180 189;
  --c-on-secondary-fixed: 26 27 34;
  --c-on-secondary-fixed-variant: 69 70 78;
  --c-tertiary: 255 183 131;
  --c-tertiary-fixed: 255 220 197;
  --c-tertiary-fixed-dim: 255 183 131;
  --c-tertiary-container: 217 119 33;
  --c-on-tertiary: 79 37 0;
  --c-on-tertiary-container: 69 32 0;
  --c-on-tertiary-fixed: 48 20 0;
  --c-on-tertiary-fixed-variant: 112 55 0;
  --c-success: 95 211 141;
  --c-on-success: 6 51 26;
  --c-success-container: 18 53 36;
  --c-error: 255 180 171;
  --c-on-error: 105 0 5;
  --c-error-container: 147 0 10;
  --c-on-error-container: 255 218 214;
  --c-white: 255 255 255;
}
@media (min-width: 640px)  { :root { --hx-gutter: 32px; } }
@media (min-width: 1024px) { :root { --hx-gutter: 40px; --hx-header-h: 60px; } }

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--hx-header-h) + 16px); }
body {
  background: var(--hx-bg);
  color: var(--hx-text);
  font-family: var(--hx-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
::selection { background: rgba(184, 185, 255, 0.3); }
/* Google's sign-in button is an iframe with a light colour scheme. Inside a
   dark page Chrome paints an opaque white box behind any iframe whose scheme
   differs from its embedder — giving the iframe element itself "light" makes
   them match, and the button's own dark pill shows on a transparent ground. */
iframe[src*="accounts.google.com/gsi"] { color-scheme: light; }
:focus-visible { outline: 2px solid var(--hx-accent) !important; outline-offset: 3px !important; border-radius: 6px; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--hx-error) !important; }
img, video { max-width: 100%; }
/* Fonts served from our own domain (licences: font-licenses.txt). Inter is the
   fallback for systems without San Francisco / Segoe UI; IBM Plex Serif (one
   weight, 500) is for the main headings. The subsets cover the characters of
   all 16 languages. Material Symbols is the icon font, limited to
   the icons and axes the site uses (scripts/update-fonts.js, scripts/check-icons.js).
   The icons use block: a ligature name never shows as text while it loads. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(hosait-font-inter-cyrillic-v20.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(hosait-font-inter-latin-ext-v20.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(hosait-font-inter-latin-v20.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Serif'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(hosait-font-plex-serif-cyrillic-v20.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Serif'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(hosait-font-plex-serif-latin-ext-v20.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Serif'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(hosait-font-plex-serif-latin-v20.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Material Symbols Outlined'; font-style: normal; font-weight: 300 500; font-display: block;
  src: url(hosait-font-symbols-v377.woff2) format('woff2'); }
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: 24px;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr;
  -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; line-height: 1;
}

@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;
  }
}

.hx-skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--hx-accent); color: var(--hx-on-accent); font-weight: 600;
}
.hx-skip:focus { top: 12px; }

/* ---------- Layout ---------- */
.hx-container { width: 100%; max-width: calc(var(--hx-max) + 2 * var(--hx-gutter)); margin-inline: auto; padding-inline: var(--hx-gutter); }
.hx-container--wide { max-width: calc(var(--hx-max-wide) + 2 * var(--hx-gutter)); }
.hx-container--narrow { max-width: calc(760px + 2 * var(--hx-gutter)); }
.hx-section { padding-block: var(--hx-section-y); }
.hx-section--tight { padding-block: calc(var(--hx-section-y) * 0.62); }
.hx-section--alt { background: var(--hx-surface-1); }
.hx-section--deep { background: var(--hx-bg-deep); }
.hx-page { padding-top: var(--hx-header-h); min-height: 100vh; }
.hx-center { text-align: center; margin-inline: auto; }
.hx-center .hx-lead, .hx-center .hx-body { margin-inline: auto; }
.hx-grid { display: grid; gap: var(--hx-s5); }
@media (min-width: 768px) {
  .hx-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) { .hx-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Type ---------- */
.hx-eyebrow { font-size: var(--hx-fs-body); font-weight: 600; color: var(--hx-accent); letter-spacing: -0.005em; margin: 0 0 var(--hx-s3); }
.hx-display { font-family: var(--hx-font-heading); font-size: var(--hx-fs-display); line-height: 1.08; letter-spacing: -0.015em; font-weight: 500; margin: 0; text-wrap: balance; }
.hx-title { font-family: var(--hx-font-heading); font-size: var(--hx-fs-title); line-height: 1.12; letter-spacing: -0.01em; font-weight: 500; margin: 0; text-wrap: balance; }
.hx-subtitle { font-size: var(--hx-fs-subtitle); line-height: 1.25; letter-spacing: -0.014em; font-weight: 600; margin: 0; text-wrap: balance; }
.hx-lead { font-size: var(--hx-fs-lead); line-height: 1.45; letter-spacing: -0.008em; color: var(--hx-text-2); max-width: 36em; margin: var(--hx-s5) 0 0; text-wrap: pretty; }
.hx-body { font-size: var(--hx-fs-body); line-height: 1.6; color: var(--hx-text-2); max-width: 64ch; margin: 0; text-wrap: pretty; }
.hx-small { font-size: var(--hx-fs-small); line-height: 1.5; color: var(--hx-text-2); }
.hx-caption { font-size: var(--hx-fs-caption); line-height: 1.45; color: var(--hx-text-3); }
.hx-muted { color: var(--hx-text-2); }
.hx-strong { color: var(--hx-text); font-weight: 600; }
.hx-accent-text { color: var(--hx-accent); }
.hx-display + .hx-lead, .hx-title + .hx-lead { margin-top: var(--hx-s5); }
.hx-subtitle + .hx-body, .hx-subtitle + .hx-small { margin-top: var(--hx-s3); }
.hx-intro { margin-bottom: clamp(40px, 4vw + 16px, 64px); }
.hx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--hx-s4) var(--hx-s5); margin-top: var(--hx-s6); }
.hx-center .hx-actions, .hx-actions--center { justify-content: center; }
.hx-prose { font-size: var(--hx-fs-body); line-height: 1.65; color: var(--hx-text-2); max-width: 68ch; }
.hx-prose h2 { color: var(--hx-text); font-size: var(--hx-fs-subtitle); line-height: 1.25; font-weight: 600; letter-spacing: -0.014em; margin: 2.2em 0 0.6em; }
.hx-prose h3 { color: var(--hx-text); font-size: 19px; font-weight: 600; margin: 1.8em 0 0.5em; }
.hx-prose p, .hx-prose ul, .hx-prose ol { margin: 0 0 1em; }
.hx-prose ul { list-style: disc; padding-left: 1.3em; }
.hx-prose ol { list-style: decimal; padding-left: 1.3em; }
.hx-prose li { margin: 0.35em 0; }
.hx-prose a { color: var(--hx-accent); text-decoration: underline; text-underline-offset: 3px; }
.hx-prose strong { color: var(--hx-text); font-weight: 600; }
.hx-prose code, .hx-code { font-family: var(--hx-mono); font-size: 0.88em; background: var(--hx-surface-3); border-radius: 6px; padding: 0.12em 0.4em; color: var(--hx-text); }

/* ---------- Buttons + links ---------- */
.hx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--hx-s2);
  min-height: 44px; padding: 10px 22px; border-radius: 999px;
  font: 500 17px/1.2 var(--hx-font); letter-spacing: -0.005em; text-align: center; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color var(--hx-fast) var(--hx-ease), color var(--hx-fast) var(--hx-ease),
              border-color var(--hx-fast) var(--hx-ease), transform var(--hx-fast) var(--hx-ease);
}
.hx-btn:active:not([disabled]):not([aria-disabled="true"]) { transform: scale(0.98); }
.hx-btn .material-symbols-outlined { font-size: 20px; }
.hx-btn.hx-btn--primary { background: var(--hx-accent); color: var(--hx-on-accent); }
.hx-btn.hx-btn--primary:hover { background: var(--hx-accent-hover); }
.hx-btn.hx-btn--secondary { background: transparent; color: var(--hx-text); border-color: var(--hx-line-strong); }
.hx-btn.hx-btn--secondary:hover { background: var(--hx-surface-3); border-color: rgba(255, 255, 255, 0.22); }
.hx-btn.hx-btn--quiet { background: var(--hx-surface-3); color: var(--hx-text); }
.hx-btn.hx-btn--quiet:hover { background: var(--hx-surface-4); }
.hx-btn.hx-btn--danger { background: transparent; color: var(--hx-error); border-color: rgba(255, 180, 171, 0.35); }
.hx-btn.hx-btn--danger:hover { background: var(--hx-error-soft); }
.hx-btn--sm { min-height: 36px; padding: 6px 16px; font-size: 15px; }
.hx-btn--lg { min-height: 52px; padding: 14px 30px; font-size: 18px; }
.hx-btn--block { width: 100%; }
.hx-btn[disabled], .hx-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.hx-btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.hx-btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--hx-on-accent) var(--hx-on-accent) transparent transparent;
  animation: hx-spin 0.8s linear infinite;
}
.hx-btn--secondary[aria-busy="true"]::after, .hx-btn--quiet[aria-busy="true"]::after { border-color: var(--hx-text) var(--hx-text) transparent transparent; }
/* Small header CTA keeps a 44px hit area around a 36px pill. */
.hx-btn--sm { position: relative; }
.hx-btn--sm::before { content: ""; position: absolute; inset: -4px 0; }

.hx-link {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px;
  color: var(--hx-accent); font-size: 17px; font-weight: 500; text-decoration: none;
  transition: color var(--hx-fast) var(--hx-ease);
}
.hx-link::after { content: "›"; font-size: 1.25em; line-height: 1; margin-left: 3px; transform: translateY(-1px); transition: transform var(--hx-fast) var(--hx-ease); }
.hx-link:hover { color: var(--hx-accent-hover); text-decoration: underline; text-underline-offset: 4px; }
.hx-link:hover::after { transform: translate(2px, -1px); }
.hx-link--plain::after { content: none; }

@keyframes hx-spin { to { transform: rotate(360deg); } }

/* ---------- Surfaces ---------- */
.hx-card { background: var(--hx-surface-1); border: 1px solid var(--hx-line); border-radius: var(--hx-r-lg); padding: clamp(22px, 2vw + 14px, 32px); }
.hx-card--flat { background: transparent; }
.hx-card--raised { background: var(--hx-surface-2); }
.hx-card--accent { border-color: rgba(184, 185, 255, 0.4); }

/* Pricing: a small illustration per plan, a topic icon per capacity row. */
.hx-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--hx-s4); }
.hx-plan-art { width: 64px; height: 64px; flex: none; }
.hx-art-fill { fill: var(--hx-accent-soft); stroke: var(--hx-accent); stroke-width: 1.6; }
.hx-art-back { opacity: 0.55; }
.hx-art-solid { fill: var(--hx-accent); opacity: 0.85; }
.hx-art-dot { fill: var(--hx-accent); }
.hx-art-line { stroke: var(--hx-accent); stroke-width: 1.6; stroke-linecap: round; fill: none; }
.hx-feat-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; margin-top: -3px; border-radius: 8px; background: var(--hx-accent-soft); color: var(--hx-accent); }
.hx-feat-icon .material-symbols-outlined { font-size: 18px; }
.hx-card--lift { transition: transform var(--hx-med) var(--hx-ease-out), border-color var(--hx-fast) var(--hx-ease); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .hx-card--lift:hover { transform: translateY(-4px); } .hx-card--lift:not(.hx-card--accent):hover { border-color: var(--hx-line-strong); } }
.hx-tile { background: var(--hx-surface-1); border-radius: var(--hx-r-xl); overflow: hidden; }
.hx-divider { height: 1px; background: var(--hx-line); border: 0; margin: 0; }
.hx-icon-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; background: var(--hx-accent-soft); color: var(--hx-accent);
}
.hx-icon-badge .material-symbols-outlined { font-size: 24px; }

/* Status: a dot + a word, never colour alone. */
.hx-status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--hx-text-2); }
.hx-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.hx-status--live { color: var(--hx-live); }
.hx-status--busy { color: var(--hx-warn); }
.hx-status--error { color: var(--hx-error); }
.hx-status--idle { color: var(--hx-text-3); }
.hx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--hx-surface-3); color: var(--hx-text-2); }
.hx-chip--accent { background: var(--hx-accent-soft); color: var(--hx-accent); }
.hx-chip--live { background: var(--hx-live-soft); color: var(--hx-live); }

/* Numbered steps */
.hx-steps { display: grid; gap: var(--hx-s6); counter-reset: hx-step; list-style: none; margin: 0; padding: 0; }
@media (min-width: 900px) { .hx-steps--row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hx-s7); } }
.hx-step { counter-increment: hx-step; }
.hx-step::before {
  content: counter(hx-step); display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; margin-bottom: var(--hx-s4);
  background: var(--hx-accent-soft); color: var(--hx-accent); font-weight: 600; font-size: 16px;
}
.hx-step h3 { font-size: var(--hx-fs-subtitle); line-height: 1.25; font-weight: 600; letter-spacing: -0.014em; margin: 0 0 var(--hx-s2); }
.hx-step p { font-size: var(--hx-fs-body); line-height: 1.6; color: var(--hx-text-2); margin: 0; }

/* ---------- Forms ---------- */
.hx-field { display: flex; flex-direction: column; gap: 6px; }
.hx-label { font-size: 15px; font-weight: 500; color: var(--hx-text); }
.hx-help { font-size: 14px; color: var(--hx-text-2); }
.hx-error-text { font-size: 14px; color: var(--hx-error); }
.hx-input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px;
  background: var(--hx-surface-2); border: 1px solid var(--hx-line-strong); color: var(--hx-text);
  font: 400 16px/1.4 var(--hx-font);
  transition: border-color var(--hx-fast) var(--hx-ease), box-shadow var(--hx-fast) var(--hx-ease);
}
.hx-input::placeholder { color: var(--hx-text-3); }
.hx-input:hover { border-color: rgba(255, 255, 255, 0.24); }
.hx-input:focus { outline: none; border-color: var(--hx-accent); box-shadow: 0 0 0 3px rgba(184, 185, 255, 0.22); }
.hx-alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.45; }
.hx-alert--error { background: var(--hx-error-soft); color: var(--hx-error); }
.hx-alert--info { background: var(--hx-accent-soft); color: var(--hx-text); }
.hx-spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--hx-line-strong); border-top-color: var(--hx-accent); animation: hx-spin 0.8s linear infinite; }

/* ---------- Site header (marketing pages) ---------- */
.hx-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--hx-header-h);
  background: rgb(var(--c-background) / 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--hx-fast) var(--hx-ease), background-color var(--hx-fast) var(--hx-ease);
}
.hx-header.is-scrolled { border-bottom-color: var(--hx-line); background: rgb(var(--c-background) / 0.86); }
.hx-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--hx-s5); }
.hx-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--hx-text); text-decoration: none; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.hx-brand img { width: 26px; height: 30px; object-fit: contain; }
.hx-nav { display: flex; align-items: center; gap: clamp(18px, 2vw, 32px); }
.hx-nav a {
  display: inline-flex; align-items: center; min-height: 44px; position: relative;
  font-size: 14px; font-weight: 400; color: var(--hx-text-2); text-decoration: none; white-space: nowrap;
  transition: color var(--hx-fast) var(--hx-ease);
}
.hx-nav a:hover { color: var(--hx-text); }
.hx-nav a[aria-current="page"] { color: var(--hx-text); font-weight: 500; }
.hx-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 2px; border-radius: 2px; background: var(--hx-accent); }
.hx-header__actions { display: flex; align-items: center; gap: var(--hx-s4); }
/* Signed in (html.hx-authed, set by the header's first script and by
   logged-in-shell.js): room for the sidebar from the first paint. Until the
   sidebar and profile menu are in, an empty bar holds the sidebar's place and
   the guest buttons stay invisible. Phones have no sidebar. */
@media (min-width: 768px) {
  html.hx-authed body { padding-left: var(--sb-w, 80px); }
  html.hx-authed body > header { left: var(--sb-w, 80px) !important; right: 0 !important; width: auto !important; }
  html.hx-authed #mobile-menu { left: var(--sb-w, 80px) !important; }
  html.hx-authed body > header .hx-brand img { display: none; }
  html.hx-authed body::before { content: ""; position: fixed; z-index: 49; left: 0; top: 0; bottom: 0; width: var(--sb-w, 80px); background: var(--hx-surface-1); border-right: 1px solid rgb(var(--c-white) / .07); }
}
html.hx-authed body:not(.hosait-authed) > header [data-hosait-login],
html.hx-authed body:not(.hosait-authed) > header [data-hosait-cta] { visibility: hidden; }
/* Phones: "Get started" next to the menu button; a signed-in visitor has the menu (logged-in-shell.js). */
.hx-header__mcta { margin-left: auto; margin-right: calc(-1 * var(--hx-s5) + 8px); }
.hosait-authed .hx-header__mcta, html.hx-authed .hx-header__mcta { display: none; }
.hx-menu-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -10px;
  border-radius: 999px; color: var(--hx-text); background: transparent; border: 0; cursor: pointer;
}
.hx-menu-btn:hover { background: var(--hx-surface-3); }
.hx-mobile-menu {
  position: fixed; inset: var(--hx-header-h) 0 0 0; z-index: 45;
  background: var(--hx-bg); overflow-y: auto; overscroll-behavior: contain;
}
.hx-mobile-menu a.mobile-nav-link {
  display: flex; align-items: center; justify-content: space-between; min-height: 60px;
  font-size: 22px; font-weight: 600; letter-spacing: -0.015em; color: var(--hx-text); text-decoration: none;
  border-bottom: 1px solid var(--hx-line);
}
.hx-mobile-menu a.mobile-nav-link[aria-current="page"] { color: var(--hx-accent); }
.hx-mobile-menu:not(.hidden) { animation: hx-fade-down var(--hx-med) var(--hx-ease-out); }
@keyframes hx-fade-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Language switcher (built by i18n.js) */
[id^="lang-switcher-"] > button {
  min-height: 44px; min-width: 44px; justify-content: center; gap: 4px;
  font-size: 14px !important; letter-spacing: 0 !important; color: var(--hx-text-2);
}
[id^="lang-menu-"] { background: var(--hx-surface-2) !important; border: 1px solid var(--hx-line) !important; border-radius: 14px !important; padding: 6px; max-height: min(560px, 82vh); overflow-y: auto !important; }
[id^="lang-menu-"] .js-lang-option { border-radius: 8px; min-height: 40px; font-size: 15px !important; }
#mobile-menu [id^="lang-menu-"] { position: static; width: 100%; margin-top: 8px; }

/* ---------- Footer ---------- */
.hx-footer { background: var(--hx-bg-deep); border-top: 1px solid var(--hx-line); padding-block: var(--hx-s8) var(--hx-s6); font-size: 14px; color: var(--hx-text-2); }
.hx-footer h2 { font-size: 13px; font-weight: 600; color: var(--hx-text); margin: 0 0 var(--hx-s3); }
.hx-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hx-footer a { color: var(--hx-text-2); text-decoration: none; display: inline-flex; min-height: 32px; align-items: center; }
.hx-footer a:hover { color: var(--hx-text); text-decoration: underline; text-underline-offset: 3px; }
.hx-footer__grid { display: grid; gap: var(--hx-s6) var(--hx-s5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hx-footer__brand { grid-column: 1 / -1; }
.hx-footer .hx-footer__social { display: flex; gap: var(--hx-s2); margin-top: var(--hx-s4); }
.hx-footer .hx-footer__social a { width: 40px; height: 40px; min-height: 40px; justify-content: center; border: 1px solid var(--hx-line-strong); border-radius: 50%; color: var(--hx-text-2); }
.hx-footer .hx-footer__social a:hover { color: var(--hx-text); border-color: var(--hx-text-2); text-decoration: none; }
@media (min-width: 900px) {
  .hx-footer__grid { grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); }
  .hx-footer__brand { grid-column: auto; }
}
.hx-footer__base { margin-top: var(--hx-s7); padding-top: var(--hx-s5); border-top: 1px solid var(--hx-line); color: var(--hx-text-3); }

/* ---------- FAQ / disclosure ---------- */
.hx-faq { border-top: 1px solid var(--hx-line); }
.hx-faq details { border-bottom: 1px solid var(--hx-line); }
.hx-faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--hx-s4);
  min-height: 64px; padding-block: var(--hx-s4); font-size: 19px; font-weight: 500; letter-spacing: -0.01em; color: var(--hx-text);
}
.hx-faq summary::-webkit-details-marker { display: none; }
.hx-faq summary::after { content: "+"; font-size: 26px; font-weight: 300; color: var(--hx-text-2); transition: transform var(--hx-fast) var(--hx-ease); flex: none; }
.hx-faq details[open] summary::after { transform: rotate(45deg); }
.hx-faq summary:hover { color: var(--hx-accent); }
.hx-faq details > div { padding: 0 0 var(--hx-s5); font-size: var(--hx-fs-body); line-height: 1.6; color: var(--hx-text-2); max-width: 64ch; }

/* ---------- Media ---------- */
.hx-media { position: relative; border-radius: var(--hx-r-xl); overflow: hidden; background: var(--hx-bg-deep); border: 1px solid var(--hx-line); }
.hx-media video, .hx-media img { display: block; width: 100%; height: auto; }

/* Hero entrance: once, short, and skipped with reduced motion. */
.hx-rise { animation: hx-rise 700ms var(--hx-ease-out) both; }
.hx-rise--2 { animation-delay: 80ms; }
.hx-rise--3 { animation-delay: 160ms; }
.hx-rise--4 { animation-delay: 260ms; }
@keyframes hx-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hx-float { animation: hx-float 6s ease-in-out infinite; }
@keyframes hx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .hx-float { animation: none; } }

/* Hosa chat on phones: stay out of the way of forms and bottom CTAs. */
@media (max-width: 639px) {
  #hosa-widget { right: 12px !important; bottom: 12px !important; }
  #hosa-fab { width: 52px !important; height: 52px !important; }
}
body.hx-hosa-lift #hosa-widget { transform: translateY(-72px); transition: transform var(--hx-fast) var(--hx-ease); }

/* Screen-reader only (for pages without Tailwind's sr-only) */
.hx-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
main[tabindex="-1"]:focus, main[tabindex="-1"]:focus-visible { outline: none !important; }

/* ---------- Docs reference ---------- */
.hx-docs-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hx-docs-toc a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--hx-line-strong); color: var(--hx-text-2); font-size: 15px; text-decoration: none; }
.hx-docs-toc a:hover, .hx-docs-toc a[aria-current="true"] { color: var(--hx-text); background: var(--hx-surface-3); }
@media (min-width: 1024px) {
  .hx-docs-toc { position: sticky; top: calc(var(--hx-header-h) + 24px); align-self: start; }
  .hx-docs-toc ul { flex-direction: column; flex-wrap: nowrap; gap: 2px; border-left: 1px solid var(--hx-line); }
  .hx-docs-toc a { border: 0; border-radius: 0; min-height: 36px; padding: 0 16px; margin-left: -1px; border-left: 2px solid transparent; }
  .hx-docs-toc a[aria-current="true"] { background: transparent; border-left-color: var(--hx-accent); color: var(--hx-text); }
}
.hx-docs-sec { padding-bottom: var(--hx-s8); margin-bottom: var(--hx-s8); border-bottom: 1px solid var(--hx-line); }
.hx-docs-sec:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.hx-docs p, .hx-docs li, .hx-docs dd { line-height: 1.6; }
.hx-docs code { font-family: var(--hx-mono); font-size: 0.9em; }
.hx-docs :not(pre) > code { background: var(--hx-surface-3); border-radius: 6px; padding: 0.1em 0.4em; color: var(--hx-text); }
.hx-docs pre { font-size: 14px; line-height: 1.6; }
.hx-docs table td, .hx-docs table th { vertical-align: top; }
.hx-docs a:not(.hx-btn) { color: var(--hx-accent); text-decoration: underline; text-underline-offset: 3px; }

/* Long words (Norwegian, German, Finnish compounds) must break, not overflow. */
.hx-display, .hx-title, .hx-subtitle { overflow-wrap: break-word; }
@media (max-width: 480px) { .hx-display, .hx-title { -webkit-hyphens: auto; hyphens: auto; } }

/* A help "?" inside a heading follows the last word instead of floating at
   the far edge of a wrapped, flex-centred heading. */
.hx-heading-help { vertical-align: middle; position: relative; top: -0.06em; margin-left: 0.2em; }

/* ---------- Hosa chat panel ----------
   The panel used the same surface and hairline as the cards behind it, so
   it sank into the page. It is a floating sheet: a lighter, slightly
   translucent surface with the page blurred behind it, a clear edge and a
   deep shadow — the way macOS panels sit above a window. */
#hosa-panel, #app-hosa-panel, #proj-hosa-panel {
  background: rgba(40, 40, 49, 0.9) !important;
  -webkit-backdrop-filter: saturate(170%) blur(28px);
  backdrop-filter: saturate(170%) blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 22px !important;
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.85), 0 10px 24px -6px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
#hosa-panel > :first-child, #app-hosa-panel > :first-child, #proj-hosa-panel > :first-child {
  background: rgba(255, 255, 255, 0.035) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
#hosa-panel form, #app-hosa-panel form, #proj-hosa-panel form { border-top-color: rgba(255, 255, 255, 0.1) !important; }
/* Hosa's bubbles: a step lighter than the sheet so they read as bubbles. */
#hosa-messages .bg-surface-container-highest, #app-hosa-messages .bg-surface-container-highest, #proj-hosa-messages .bg-surface-container-highest {
  background: rgba(255, 255, 255, 0.09) !important;
}
/* One focus ring on the message field, not the global outline on top of it. */
#hosa-input:focus-visible, #app-hosa-input:focus-visible, #proj-hosa-input:focus-visible {
  outline: none !important;
  border-color: var(--hx-accent) !important;
  box-shadow: 0 0 0 3px rgba(184, 185, 255, 0.25);
}
#hosa-input, #app-hosa-input, #proj-hosa-input { background: rgba(0, 0, 0, 0.25) !important; }
@media (prefers-reduced-transparency: reduce) {
  #hosa-panel, #app-hosa-panel, #proj-hosa-panel { background: #282831 !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Video player controls, after apple.com: a frosted pill of chapter dots —
   the current one stretches and fills as it plays — and a round play/pause
   button beside it. Used by hosait-live.js. */
.hx-player { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 28px; }
.hx-player-dots { display: flex; align-items: center; gap: 2px; height: 56px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.hx-player-dot { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 5px; background: none; border: 0; cursor: pointer; }
.hx-player-pip { position: relative; display: block; width: 8px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.38); overflow: hidden; transition: width 0.45s var(--hx-ease), background-color 0.2s; }
.hx-player-dot:hover .hx-player-pip { background: rgba(255, 255, 255, 0.62); }
.hx-player-dot[aria-current="true"] .hx-player-pip { width: 48px; background: rgba(255, 255, 255, 0.24); }
.hx-player-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: var(--hx-text); }
.hx-player-btn { width: 56px; height: 56px; flex: none; border-radius: 999px; border: 0; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.08); color: var(--hx-text); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); cursor: pointer; transition: background-color 0.2s; }
.hx-player-btn.hidden { display: none; }
.hx-player-btn:hover { background: rgba(255, 255, 255, 0.15); }
.hx-player-btn .material-symbols-outlined { font-size: 28px; font-variation-settings: "FILL" 1, "wght" 500; }
@media (max-width: 420px) { .hx-player-dots { padding: 0 10px; } .hx-player-dot[aria-current="true"] .hx-player-pip { width: 36px; } }
@media (prefers-reduced-motion: reduce) { .hx-player-pip { transition: none; } }


/* Profile menu: quiet identity panel, generous hit areas and restrained chrome. */
header .hx-profile-trigger {
  gap: 10px;
  padding: 5px 10px 5px 14px;
  border: 1px solid var(--hx-line);
  background: var(--hx-surface-1);
  border-radius: 16px;
  min-height: 48px;
  transition: background .18s ease, border-color .18s ease;
}
header .hx-profile-trigger:hover,
header .hx-profile-trigger[aria-expanded="true"] {
  background: var(--hx-surface-3);
  border-color: var(--hx-line-strong);
}
header .hx-profile-trigger > .material-symbols-outlined {
  font-size: 18px;
  transition: transform .18s ease;
}
header .hx-profile-trigger[aria-expanded="true"] > .material-symbols-outlined {
  transform: rotate(180deg);
}
header .hx-profile-menu {
  box-sizing: border-box;
  width: 304px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  margin-top: 12px;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid var(--hx-line-strong);
  background: linear-gradient(150deg, var(--hx-surface-3), var(--hx-surface-2) 65%);
  box-shadow: 0 24px 64px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.18), inset 0 1px 0 var(--hx-line);
  font-family: var(--hx-font);
}
.hx-profile-menu .hx-profile-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 12px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--hx-line);
}
.hx-profile-menu .hx-profile-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--hx-accent-soft);
  color: var(--hx-accent-hover);
  border: 1px solid rgba(184,185,255,.16);
  font-size: 17px;
  font-weight: 500;
}
.hx-profile-menu .hx-profile-details { min-width: 0; }
.hx-profile-menu .hx-profile-name {
  margin: 0 0 4px;
  color: var(--hx-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  letter-spacing: -.2px;
}
.hx-profile-menu .hx-profile-email {
  margin: 0;
  color: var(--hx-text-2);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
header .hx-profile-menu > [role="menuitem"] {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--hx-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  transition: background .15s ease;
}
header .hx-profile-menu > [role="menuitem"]:hover {
  background: rgba(255,255,255,.055);
}
header .hx-profile-menu > [role="menuitem"] > .material-symbols-outlined {
  font-size: 20px;
  flex-shrink: 0;
  color: var(--hx-text-2);
  font-variation-settings: 'wght' 300;
}
header .hx-profile-menu > .hx-profile-logout {
  margin-top: 8px;
  border-top: 1px solid var(--hx-line);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding-top: 15px;
  color: var(--hx-text-2);
}
header .hx-profile-trigger:focus-visible,
header .hx-profile-menu > [role="menuitem"]:focus-visible {
  outline: 2px solid var(--hx-accent);
  outline-offset: -2px;
}
@media (prefers-reduced-motion: reduce) {
  header .hx-profile-trigger,
  header .hx-profile-trigger > .material-symbols-outlined,
  header .hx-profile-menu > [role="menuitem"] { transition: none; }
}

/* ---------- Admin portal: light purple throughout ----------
   noway.html is <html data-portal="admin">. Only the values change; every
   token name stays, so no markup needs to know it is in the portal. Surfaces
   lean violet and the accent is a lighter lilac than the product's lavender,
   so the portal is recognisable at a glance. Contrast: lilac on the darkest
   surface is above 10:1, secondary text above 7:1. */
[data-portal="admin"] {
  --c-surface-container-lowest: 14 8 26;
  --c-background: 21 13 38;
  --c-surface: 21 13 38;
  --c-surface-dim: 21 13 38;
  --c-surface-container-low: 30 20 50;
  --c-surface-container: 38 26 62;
  --c-surface-container-high: 48 34 77;
  --c-surface-container-highest: 60 44 94;
  --c-surface-bright: 74 56 112;
  --c-surface-variant: 60 44 94;
  --c-on-surface-variant: 187 178 204;
  --c-outline: 156 142 188;
  --c-outline-variant: 82 66 120;
  --c-primary: 208 184 255;
  --c-primary-fixed: 230 216 255;
  --c-primary-fixed-dim: 208 184 255;
  --c-surface-tint: 208 184 255;
  --c-on-primary: 43 17 96;
  --c-primary-container: 140 109 240;
  --c-on-primary-container: 28 11 77;
  --c-inverse-primary: 106 67 217;
  --hx-bg: #150d26;
  --hx-bg-deep: #0e081a;
  --hx-surface-1: #1e1432;
  --hx-surface-2: #261a3e;
  --hx-surface-3: #30224d;
  --hx-surface-4: #3c2c5e;
  --hx-accent: #d0b8ff;
  --hx-accent-hover: #e6d8ff;
  --hx-on-accent: #2b1160;
  --hx-accent-soft: rgba(208, 184, 255, 0.14);
}
[data-portal="admin"] body { background-image: radial-gradient(64rem 30rem at 14% -6rem, rgba(208, 184, 255, 0.16), transparent 70%); background-attachment: fixed; }
[data-portal="admin"] aside { background-image: linear-gradient(180deg, rgba(208, 184, 255, 0.10), rgba(208, 184, 255, 0) 38%); }

/* ---------- Light theme ----------
   Same token names as the dark theme (see hosait-theme.js), different values.
   The page is Apple-grey with white cards; the lavender accent becomes a
   deeper indigo so links and buttons keep 4.5:1 on white; status colours are
   the darker siblings of the dark theme's. "white" (bg-white/10 …) turns into
   black overlays. Set by hosait-theme.js from the device or the visitor's choice. */
[data-theme="light"] {
  color-scheme: light;
  --c-white: 0 0 0;
  --c-surface-container-lowest: 255 255 255;
  --c-background: 245 245 247;
  --c-surface: 245 245 247;
  --c-surface-dim: 236 236 241;
  --c-surface-container-low: 251 251 253;
  --c-surface-container: 255 255 255;
  --c-surface-container-high: 240 240 245;
  --c-surface-container-highest: 232 232 239;
  --c-surface-bright: 255 255 255;
  --c-surface-variant: 232 232 239;
  --c-inverse-surface: 29 29 31;
  --c-inverse-on-surface: 245 245 247;
  --c-on-background: 29 29 31;
  --c-on-surface: 29 29 31;
  --c-on-surface-variant: 72 72 84;
  --c-outline: 133 133 148;
  --c-outline-variant: 214 214 224;
  --c-primary: 84 87 220;
  --c-primary-fixed: 63 66 190;
  --c-primary-fixed-dim: 84 87 220;
  --c-surface-tint: 84 87 220;
  --c-on-primary: 255 255 255;
  --c-primary-container: 224 224 255;
  --c-on-primary-container: 29 27 110;
  --c-on-primary-fixed: 20 17 100;
  --c-on-primary-fixed-variant: 47 46 190;
  --c-inverse-primary: 184 185 255;
  --c-secondary: 80 80 92;
  --c-secondary-fixed: 60 60 72;
  --c-secondary-fixed-dim: 80 80 92;
  --c-secondary-container: 228 228 236;
  --c-on-secondary: 255 255 255;
  --c-on-secondary-container: 60 60 72;
  --c-on-secondary-fixed: 26 27 34;
  --c-on-secondary-fixed-variant: 69 70 78;
  --c-tertiary: 168 82 0;
  --c-tertiary-fixed: 140 66 0;
  --c-tertiary-fixed-dim: 168 82 0;
  --c-tertiary-container: 255 228 205;
  --c-on-tertiary: 255 255 255;
  --c-on-tertiary-container: 80 36 0;
  --c-on-tertiary-fixed: 48 20 0;
  --c-on-tertiary-fixed-variant: 112 55 0;
  --c-success: 20 120 66;
  --c-on-success: 255 255 255;
  --c-success-container: 214 245 226;
  --c-error: 186 26 26;
  --c-on-error: 255 255 255;
  --c-error-container: 255 224 220;
  --c-on-error-container: 105 0 5;
  --hx-bg: #f5f5f7;
  --hx-bg-deep: #ffffff;
  --hx-surface-1: #fbfbfd;
  --hx-surface-2: #ffffff;
  --hx-surface-3: #f0f0f5;
  --hx-surface-4: #e8e8ef;
  --hx-line: rgba(0, 0, 0, 0.08);
  --hx-line-strong: rgba(0, 0, 0, 0.14);
  --hx-text: #1d1d1f;
  --hx-text-2: #484854;
  --hx-text-3: #6e6e7b;
  --hx-accent: #5457dc;
  --hx-accent-hover: #3f42be;
  --hx-on-accent: #ffffff;
  --hx-accent-soft: rgba(84, 87, 220, 0.1);
  --hx-live: #147842;
  --hx-live-soft: rgba(20, 120, 66, 0.1);
  --hx-warn: #a85200;
  --hx-error: #ba1a1a;
}
/* Pieces that had their colours written out in the dark theme. */
[data-theme="light"] .hx-btn.hx-btn--secondary:hover { border-color: rgba(0, 0, 0, 0.24); }
[data-theme="light"] .hx-input:hover { border-color: rgba(0, 0, 0, 0.26); }
[data-theme="light"] #hosa-panel, [data-theme="light"] #app-hosa-panel, [data-theme="light"] #proj-hosa-panel {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 30px 80px -14px rgba(20, 20, 40, 0.28), 0 10px 24px -8px rgba(20, 20, 40, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}
[data-theme="light"] #hosa-panel > :first-child, [data-theme="light"] #app-hosa-panel > :first-child, [data-theme="light"] #proj-hosa-panel > :first-child {
  background: rgba(0, 0, 0, 0.03) !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] #hosa-panel form, [data-theme="light"] #app-hosa-panel form, [data-theme="light"] #proj-hosa-panel form { border-top-color: rgba(0, 0, 0, 0.08) !important; }
[data-theme="light"] #hosa-messages .bg-surface-container-highest, [data-theme="light"] #app-hosa-messages .bg-surface-container-highest, [data-theme="light"] #proj-hosa-messages .bg-surface-container-highest { background: rgba(0, 0, 0, 0.06) !important; }
[data-theme="light"] #hosa-input, [data-theme="light"] #app-hosa-input, [data-theme="light"] #proj-hosa-input { background: rgba(0, 0, 0, 0.04) !important; }
[data-theme="light"] #hosa-input:focus-visible, [data-theme="light"] #app-hosa-input:focus-visible, [data-theme="light"] #proj-hosa-input:focus-visible { box-shadow: 0 0 0 3px rgba(84, 87, 220, 0.22); }
[data-theme="light"] header .hx-profile-menu > [role="menuitem"]:hover { background: rgba(0, 0, 0, 0.05); }
[data-theme="light"] .hx-profile-menu { box-shadow: 0 24px 64px rgba(20, 20, 40, 0.22), 0 4px 12px rgba(20, 20, 40, 0.1), inset 0 1px 0 var(--hx-line); }

/* ---------- Theme switch (Auto / Light / Dark) ---------- */
.hx-theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgb(var(--c-white) / 0.07); }
.hx-theme-switch button { width: 32px; height: 32px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--hx-text-2); cursor: pointer; transition: background .15s, color .15s; }
.hx-theme-switch button .material-symbols-outlined { font-size: 18px; }
.hx-theme-switch button:hover { color: var(--hx-text); }
.hx-theme-switch button[aria-pressed="true"] { background: var(--hx-accent); color: var(--hx-on-accent); }
.hx-theme-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; font-size: 14px; color: var(--hx-text-2); border-top: 1px solid var(--hx-line); }
.hx-profile-menu .hx-theme-row { padding: 10px 12px; }
[data-theme-switch] { display: inline-flex; }

.hx-footer__base--row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.hx-footer__base--row > p { margin: 0; }
[data-theme="light"] #hosa-panel, [data-theme="light"] #app-hosa-panel, [data-theme="light"] #proj-hosa-panel { /* reduced-transparency */ }
@media (prefers-reduced-transparency: reduce) { [data-theme="light"] #hosa-panel, [data-theme="light"] #app-hosa-panel, [data-theme="light"] #proj-hosa-panel { background: #ffffff !important; } }

/* Tailwind's own green/amber text and tints were picked for dark pages; on the
   light theme they use the theme's status colours (4.5:1 on white). */
[data-theme="light"] .text-green-300, [data-theme="light"] .text-green-400 { color: rgb(var(--c-success)); }
[data-theme="light"] .text-amber-400 { color: rgb(var(--c-tertiary)); }
[data-theme="light"] .bg-green-400 { background-color: rgb(var(--c-success)); }
[data-theme="light"] .bg-green-500\/10, [data-theme="light"] .bg-green-500\/15 { background-color: rgb(var(--c-success) / 0.12); }
[data-theme="light"] .border-green-500\/30, [data-theme="light"] .border-green-500\/40 { border-color: rgb(var(--c-success) / 0.4); }
/* The wizard's status colours are fixed light tints (text-[#4ade80] …): fine on
   the dark page, 1.7–2.8:1 on white. In the light theme they take the darker
   success/error tokens (AA on white). The green badge keeps its black text. */
[data-theme="light"] .text-\[\#34C759\], [data-theme="light"] .text-\[\#4ade80\] { color: rgb(var(--c-success)); }
[data-theme="light"] .text-\[\#f87171\] { color: rgb(var(--c-error)); }
[data-theme="light"] .bg-\[\#4ade80\]\/10 { background-color: rgb(var(--c-success) / 0.1); }
[data-theme="light"] .bg-\[\#f87171\]\/10 { background-color: rgb(var(--c-error) / 0.08); }
[data-theme="light"] .border-\[\#4ade80\]\/30, [data-theme="light"] .border-\[\#4ade80\]\/70 { border-color: rgb(var(--c-success) / 0.55); }
[data-theme="light"] .border-\[\#f87171\]\/30, [data-theme="light"] .border-\[\#f87171\]\/70 { border-color: rgb(var(--c-error) / 0.55); }
/* The video player's dots are white on the dark page: dark on the light one. */
[data-theme="light"] .hx-player-pip { background: rgba(0, 0, 0, 0.28); }
[data-theme="light"] .hx-player-dot:hover .hx-player-pip { background: rgba(0, 0, 0, 0.5); }
[data-theme="light"] .hx-player-dot[aria-current="true"] .hx-player-pip { background: rgba(0, 0, 0, 0.18); }

/* Wizard step 1: two equal cards, each with its own button. Quiet purple on
   hover and keyboard focus; the chosen one (on coming back) has a purple border. */
.source-card { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 18px rgba(0, 0, 0, 0.05); transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease; }
.source-card:hover, .source-card:focus-within { border-color: var(--hx-accent); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 10px 26px rgba(0, 0, 0, 0.08); }
.source-card[data-selected="true"] { background: var(--hx-accent-soft); border-color: var(--hx-accent); box-shadow: 0 0 0 1px var(--hx-accent); }
.source-cta { transition: background-color 0.2s ease, transform 0.2s ease; }
.source-cta:hover { background: var(--hx-accent-hover); }
.source-cta:focus-visible { outline: 2px solid var(--hx-accent) !important; outline-offset: 3px !important; border-radius: 9999px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .source-card:hover .source-cta { transform: translateX(2px); } }

/* ---------- Project page: cards and the top of the Overview (H91) ---------- */
#proj-page-title:focus-visible { outline: none !important; }
.proj-card {
  background: var(--hx-surface-1);
  border: 1px solid var(--hx-line);
  border-radius: 24px;
  padding: clamp(20px, 3vw, 30px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 14px 34px -24px rgba(0, 0, 0, 0.4);
}
.proj-home-title {
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.08;
  font-weight: 680;
  letter-spacing: -0.028em;
  text-wrap: balance;
  color: var(--hx-text);
}
.proj-stats {
  background: var(--hx-surface-1);
  border: 1px solid var(--hx-line);
  border-radius: 24px;
  overflow: hidden;
}
.proj-stat + .proj-stat { border-top: 1px solid var(--hx-line); }
@media (min-width: 640px) {
  .proj-stat + .proj-stat { border-top: 0; border-left: 1px solid var(--hx-line); }
}
