/* =========================================================================
   Hospital OS — own visual identity. Bootstrap 5 base, but the chrome
   (topbar, nav, container, footer) is bespoke so it never feels like a
   bolt-on of School OS.

   Palette: medical blue + warm white, clear typography, dense data layout.
   ========================================================================= */

:root {
  /* Magenta & Violet — bold premium hospital theme */
  --hos-primary:        #c026d3;   /* Fuchsia 600 */
  --hos-primary-dark:   #6b21a8;   /* Purple 800 */
  --hos-primary-deep:   #4a044e;   /* Purple 950 */
  --hos-accent:         #f43f5e;   /* Rose 500 */
  --hos-accent-soft:    #f9a8d4;   /* Pink 300 — for highlights / chips */
  --hos-bg:             #fdf4ff;   /* Very pale violet */
  --hos-surface:        #ffffff;
  --hos-text:           #1e1b4b;   /* Indigo 950 — darker than slate for warmth */
  --hos-text-muted:     #6b7280;
  --hos-border:         #f5d0fe;   /* Fuchsia 200 — soft violet border */
  --hos-border-strong:  #e9d5ff;   /* Purple 200 */
  --hos-danger:         #dc2626;
  --hos-warning:        #f59e0b;
}

* { box-sizing: border-box; }

html, body { background: var(--hos-bg); color: var(--hos-text); }
body.hos-body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

.hos-container {
  max-width: 1320px;
  margin: 0 auto;
  padding-left: clamp(16px, 3vw, 32px);
  padding-right: clamp(16px, 3vw, 32px);
}

/* ---------- Topbar ---------- */
.hos-topbar {
  background: linear-gradient(135deg, #4a044e 0%, #86198f 60%, #c026d3 100%);
  color: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 18px rgba(74, 4, 78, 0.28);
}
.hos-topbar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.hos-platform-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.hos-platform-link:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.hos-platform-sep {
  color: rgba(255, 255, 255, 0.40);
  font-weight: 600;
  margin: 0 2px;
}

.hos-footer__brand {
  color: #f9a8d4;
  text-decoration: none;
  font-weight: 700;
}
.hos-footer__brand:hover { color: #fbcfe8; text-decoration: underline; }

.hos-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.hos-brand__mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.hos-brand__mark svg { width: 22px; height: 22px; }
.hos-brand__text strong { font-weight: 800; color: #f9a8d4; margin-left: 2px; }

.hos-topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  flex-grow: 1;
  flex-wrap: wrap;
}
.hos-topnav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.hos-topnav__link i { font-size: 1.05rem; }
.hos-topnav__link:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}
.hos-topnav__link.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.hos-topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hos-user {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 600;
}

.hos-burger {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  font-size: 1.4rem;
}

@media (max-width: 767.98px) {
  .hos-topnav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    background: rgba(2, 6, 23, 0.92);
    padding: 8px;
    border-radius: 10px;
    margin: 8px 0 0 0;
  }
  .hos-topnav.is-open { display: flex; }
  .hos-topnav__link { padding: 10px 14px; }
  .hos-topbar__inner { flex-wrap: wrap; }
}

/* ---------- Main + footer ---------- */
.hos-main {
  padding-block: clamp(20px, 3vw, 32px);
  min-height: calc(100vh - 64px - 90px);
}
.hos-messages { margin-bottom: 12px; }

.hos-footer {
  background: #2e1065;            /* Violet 950 — keeps brand mood in dark UI chrome */
  color: rgba(255, 255, 255, 0.72);
  padding-block: 18px;
  font-size: 0.86rem;
}
.hos-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hos-footer__rail { color: rgba(255, 255, 255, 0.65); }
.hos-footer__rail i { color: #f9a8d4; margin-right: 4px; }

/* ---------- Page header ---------- */
.hos-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.hos-page-head h1 {
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.hos-page-head .hos-subtitle {
  color: var(--hos-text-muted);
  margin: 0;
  font-size: 0.95rem;
}

/* ---------- Cards & tables (Bootstrap-friendly) ---------- */
.card {
  border-radius: 12px;
  border-color: var(--hos-border);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.card-header {
  background: #f8fafc;
  border-bottom-color: var(--hos-border);
}

.table > thead {
  background: #f8fafc;
}
.table > :not(caption) > * > * {
  border-color: var(--hos-border);
}

/* ---------- Priority pill tints (triage) ---------- */
.hos-pri {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.hos-pri--emergent     { background: #fee2e2; color: #991b1b; }
.hos-pri--urgent_high  { background: #ffedd5; color: #9a3412; }
.hos-pri--urgent       { background: #fef3c7; color: #854d0e; }
.hos-pri--standard     { background: #dcfce7; color: #166534; }
.hos-pri--non_urgent   { background: #cffafe; color: #155e75; }
.hos-pri--unset        { background: #e2e8f0; color: #475569; }

/* ---------- Stat tiles on the dashboard ---------- */
.hos-stat {
  background: var(--hos-surface);
  border: 1px solid var(--hos-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.hos-stat__label {
  color: var(--hos-text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.hos-stat__value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--hos-text);
}
.hos-stat--warning .hos-stat__value { color: var(--hos-warning); }
.hos-stat--info    .hos-stat__value { color: var(--hos-primary); }
.hos-stat--danger  .hos-stat__value { color: var(--hos-danger); }

/* ---------- Module cards ---------- */
.hos-module-card {
  background: var(--hos-surface);
  border: 1px solid var(--hos-border);
  border-radius: 12px;
  padding: 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.hos-module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.08);
}

/* ---------- Marketing page hero (used on /) ---------- */
.hos-hero {
  background: linear-gradient(135deg, #4a044e 0%, #86198f 60%, #c026d3 100%);
  color: #f8fafc;
  padding-block: clamp(40px, 6vw, 96px);
  position: relative;
  overflow: hidden;
}
.hos-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 70% at 80% 0%, rgba(244, 63, 94, 0.35), transparent 60%),
    radial-gradient(50% 70% at 0% 100%, rgba(217, 70, 239, 0.30), transparent 60%);
  pointer-events: none;
}
.hos-hero__inner { position: relative; z-index: 1; text-align: center; max-width: 820px; margin: 0 auto; }
.hos-hero h1 {
  font-size: clamp(1.7rem, 4.5vw, 3.4rem);
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  line-height: 1.12;
}
.hos-hero h1 .hos-accent {
  background: linear-gradient(135deg, #fbcfe8, #fda4af);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hos-hero p { color: rgba(255, 255, 255, 0.85); max-width: 640px; margin: 0 auto 20px; font-size: clamp(0.92rem, 1.4vw, 1.05rem); line-height: 1.55; }

/* Hero / CTA action button — replaces .btn-lg so we can size for mobile. */
.hos-hero-btn {
  padding: 11px 20px !important;
  font-size: 0.95rem !important;
  border-radius: 10px !important;
  font-weight: 700;
  letter-spacing: -0.005em;
  min-height: 44px;       /* touch target */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Small helpers ---------- */
.hos-mt-1 { margin-top: 4px; }
.hos-mt-3 { margin-top: 12px; }
.hos-text-muted { color: var(--hos-text-muted); }
.hos-tight { letter-spacing: -0.01em; }

a { color: var(--hos-primary-dark); }
a:hover { color: var(--hos-primary); }

/* Bootstrap component overrides so primary/info/success/danger inherit our brand. */
.btn-primary {
  --bs-btn-bg:            var(--hos-primary);
  --bs-btn-border-color:  var(--hos-primary);
  --bs-btn-hover-bg:      var(--hos-primary-dark);
  --bs-btn-hover-border-color: var(--hos-primary-dark);
  --bs-btn-active-bg:     var(--hos-primary-dark);
  --bs-btn-active-border-color: var(--hos-primary-dark);
}
.btn-outline-primary {
  --bs-btn-color:         var(--hos-primary-dark);
  --bs-btn-border-color:  var(--hos-primary);
  --bs-btn-hover-bg:      var(--hos-primary);
  --bs-btn-hover-border-color: var(--hos-primary);
}
.text-primary { color: var(--hos-primary) !important; }
.bg-primary   { background-color: var(--hos-primary) !important; }
.badge.bg-info  { background-color: var(--hos-primary) !important; }

/* Focus ring + form-control highlight in brand colour. */
.form-control:focus, .form-select:focus {
  border-color: var(--hos-primary);
  box-shadow: 0 0 0 0.2rem rgba(192, 38, 211, 0.18);
}

/* =========================================================================
   Marketing home — hero, sections, tiers, pillars, flow, modules, CTA
   ========================================================================= */

/* ---------- Hero polish (extends .hos-hero base) ---------- */
.hos-hero { isolation: isolate; }
.hos-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(2px 2px at 18% 28%, rgba(255,255,255,.55), transparent 50%),
    radial-gradient(2px 2px at 82% 38%, rgba(255,255,255,.45), transparent 50%),
    radial-gradient(2px 2px at 42% 78%, rgba(255,255,255,.40), transparent 50%),
    radial-gradient(2px 2px at 68% 88%, rgba(255,255,255,.50), transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.hos-hero__inner { z-index: 2; }

.hos-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hos-pill__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #f9a8d4;
  box-shadow: 0 0 12px rgba(249, 168, 212, 0.95);
  animation: hos-pulse 1.8s ease-in-out infinite;
}
@keyframes hos-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 168, 212, 0.7); }
  50%      { box-shadow: 0 0 0 8px rgba(249, 168, 212, 0); }
}

.hos-hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hos-hero__preview {
  position: relative;
  height: 200px;
  margin-top: 48px;
  pointer-events: none;
}
.hos-preview-card {
  position: absolute;
  left: 50%;
  top: 0;
  background: rgba(255, 255, 255, 0.97);
  color: #0f172a;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.30);
  text-align: left;
  width: 220px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hos-preview-card strong { font-size: 1rem; letter-spacing: -0.01em; }
.hos-preview-card small { color: #64748b; font-size: 0.82rem; }
.hos-preview-tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: #fae8ff;       /* Fuchsia 100 */
  color: #86198f;            /* Fuchsia 800 */
  padding: 3px 8px;
  border-radius: 999px;
}
.hos-preview-tag--urgent  { background: #fef3c7; color: #854d0e; }
.hos-preview-tag--success { background: #fce7f3; color: #9d174d; }

.hos-preview-card--patient { transform: translate(calc(-50% - 200px), 8px)  rotate(-4deg); animation: hos-float 6s ease-in-out infinite alternate; }
.hos-preview-card--triage  { transform: translate(-50%, 60px)                rotate(2deg);  animation: hos-float 7s ease-in-out infinite alternate -2s; }
.hos-preview-card--bill    { transform: translate(calc(-50% + 200px), 16px)  rotate(5deg);  animation: hos-float 6.5s ease-in-out infinite alternate -1s; }
@keyframes hos-float {
  from { translate: 0 0; }
  to   { translate: 0 -10px; }
}

/* Tablet — narrow the float spacing so cards don't overlap the edges. */
@media (max-width: 900px) {
  .hos-preview-card { width: 200px; padding: 12px 14px; }
  .hos-preview-card--patient { transform: translate(calc(-50% - 150px), 8px)  rotate(-4deg); }
  .hos-preview-card--bill    { transform: translate(calc(-50% + 150px), 16px) rotate(5deg); }
}

/* Mobile — switch from floating layout to a clean vertical stack.
   Small but readable: ~13–14px body, dense but breathable. */
@media (max-width: 640px) {
  .hos-hero__preview {
    position: static;
    height: auto;
    margin-top: 28px;
    display: grid;
    gap: 10px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
  .hos-preview-card {
    position: static;
    width: 100%;
    min-height: 0;
    padding: 10px 14px;
    border-radius: 12px;
    transform: none !important;
    animation: none;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.22);
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .hos-preview-card strong { font-size: 0.92rem; }
  .hos-preview-card small  { font-size: 0.75rem; flex-basis: 100%; }
  .hos-preview-tag         { font-size: 0.6rem; padding: 2px 7px; letter-spacing: 0.10em; }
}

/* ---------- Trust ticker (scrolling marquee below hero) ---------- */
.hos-trust {
  background: #2e1065;            /* Violet 950 — matches footer for continuity */
  color: rgba(255, 255, 255, 0.85);
  padding-block: 14px;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  overflow: hidden;
  position: relative;
}
.hos-trust__viewport {
  overflow: hidden;
  /* Fade the edges so chips don't pop in/out abruptly. */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.hos-trust__track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  width: max-content;
  gap: clamp(20px, 3vw, 36px);
  animation: hos-trust-scroll 32s linear infinite;
  will-change: transform;
}
.hos-trust__track > li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.hos-trust__track i {
  color: #f9a8d4;
  font-size: 1.05rem;
  vertical-align: -2px;
}
/* Brand-tinted separator dot between items — sits inside the flex gap. */
.hos-trust__track > li + li {
  position: relative;
}
.hos-trust__track > li + li::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(20px, 3vw, 36px) / 2);
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(249, 168, 212, 0.55);
  transform: translate(-50%, -50%);
}
@keyframes hos-trust-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
.hos-trust__viewport:hover .hos-trust__track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .hos-trust__track { animation: none; }
}

/* ---------- Generic section ---------- */
.hos-section {
  padding-block: clamp(48px, 6vw, 88px);
}
.hos-section--alt {
  background: #faf5ff;                 /* Purple 50 — very pale violet */
  border-block-start: 1px solid var(--hos-border);
  border-block-end: 1px solid var(--hos-border);
}
.hos-section__head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto clamp(28px, 4vw, 48px);
}
.hos-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hos-primary-dark);
  background: rgba(192, 38, 211, 0.12);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hos-section__head h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin: 0 0 10px;
  color: var(--hos-text);
}
.hos-accent {
  background: linear-gradient(135deg, #6b21a8, #c026d3, #f43f5e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hos-section__head p {
  margin: 0;
  color: var(--hos-text-muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

/* ---------- Grids ---------- */
.hos-grid {
  display: grid;
  gap: 20px;
}
.hos-grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.hos-grid--4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---------- Tier cards (who it's for) ---------- */
.hos-tier {
  background: var(--hos-surface);
  border: 1px solid var(--hos-border);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.hos-tier:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 36px rgba(2, 6, 23, 0.08);
  border-color: color-mix(in srgb, var(--tint, #c026d3) 35%, transparent);
}
.hos-tier::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tint, #c026d3) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.hos-tier__icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tint, #c026d3) 14%, white);
  color: var(--tint, #c026d3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
}
.hos-tier h3 { font-size: 1.2rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.hos-tier p { color: var(--hos-text-muted); margin: 0 0 14px; line-height: 1.55; }
.hos-tier__kinds {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.hos-tier__kinds li {
  font-size: 0.92rem;
  color: var(--hos-text);
  display: flex; align-items: center; gap: 6px;
}
.hos-tier__kinds i {
  color: var(--tint, #c026d3);
  font-size: 1.05rem;
}

/* ---------- Pillar cards ---------- */
.hos-pillar {
  background: var(--hos-surface);
  border: 1px solid var(--hos-border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.hos-pillar:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.08);
}
.hos-pillar__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tint, #c026d3) 14%, white);
  color: var(--tint, #c026d3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.hos-pillar h3 { font-size: 1.1rem; margin: 0; letter-spacing: -0.01em; }
.hos-pillar p  { color: var(--hos-text-muted); margin: 0; line-height: 1.55; font-size: 0.95rem; }

/* ---------- Flow steps ---------- */
.hos-flow {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  counter-reset: hos-step;
}
.hos-flow__step {
  position: relative;
  background: var(--hos-surface);
  border: 1px solid var(--hos-border);
  border-radius: 14px;
  padding: 24px 18px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hos-flow__step i {
  font-size: 1.8rem;
  color: var(--hos-primary);
}
.hos-flow__num {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6b21a8, #c026d3, #f43f5e);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 6px 14px rgba(74, 4, 78, 0.30);
}
.hos-flow__step strong { font-size: 1rem; margin-top: 2px; }
.hos-flow__step small  { color: var(--hos-text-muted); font-size: 0.83rem; line-height: 1.4; }

/* ---------- Module catalog grid (refined) ---------- */
.hos-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.hos-module-card {
  background: var(--hos-surface);
  border: 1px solid var(--hos-border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hos-module-card__code {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: #86198f;
  background: #fae8ff;
  padding: 3px 8px;
  border-radius: 6px;
  align-self: flex-start;
}
.hos-module-card h4 { font-size: 1.02rem; margin: 0; letter-spacing: -0.01em; }
.hos-module-card p { color: var(--hos-text-muted); font-size: 0.9rem; margin: 0; line-height: 1.5; }
.hos-module-card__fit {
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--hos-text-muted);
  font-style: italic;
}

/* ---------- CTA section ---------- */
.hos-cta {
  background: linear-gradient(135deg, #4a044e 0%, #86198f 60%, #c026d3 100%);
  color: #f8fafc;
  padding-block: clamp(40px, 5vw, 64px);
}
.hos-cta__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.hos-cta h2 {
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hos-cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}
.hos-cta__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-self: end;
}
.hos-cta__actions .btn i { vertical-align: -2px; margin-right: 4px; }
@media (max-width: 820px) {
  .hos-cta__inner { grid-template-columns: 1fr; }
  .hos-cta__actions { justify-self: stretch; }
}

/* =========================================================================
   Mobile revamp — small but readable. Tightens everything below 640px
   without sacrificing legibility. Touch targets stay >= 44px.
   ========================================================================= */

/* Tablet: 2-col grids for tiers/pillars/modules, slightly tighter sections. */
@media (max-width: 900px) {
  .hos-section { padding-block: clamp(40px, 6vw, 64px); }
  .hos-grid--3,
  .hos-grid--4,
  .hos-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hos-flow        { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
  .hos-tier  { padding: 20px; }
  .hos-pillar { padding: 18px; }
  .hos-tier__icon  { width: 46px; height: 46px; font-size: 1.4rem; }
  .hos-pillar__icon { width: 40px; height: 40px; font-size: 1.25rem; }
}

/* Phone — small but readable */
@media (max-width: 640px) {
  /* Topbar — tighter, brand still readable */
  .hos-topbar__inner { min-height: 56px; gap: 8px; flex-wrap: nowrap; }
  .hos-platform-link { padding: 4px 8px 4px 6px; font-size: 0.72rem; }
  .hos-platform-sep  { margin: 0; }
  .hos-brand         { font-size: 0.98rem; gap: 8px; }
  .hos-brand__mark   { width: 30px; height: 30px; }
  .hos-brand__mark svg { width: 18px; height: 18px; }
  .hos-burger        { width: 36px; height: 36px; font-size: 1.25rem; }
  .hos-main          { padding-block: clamp(14px, 3vw, 22px); }

  /* Hero — compact but readable */
  .hos-hero          { padding-block: 36px; }
  .hos-hero__inner   { padding-inline: 4px; }
  .hos-pill          { font-size: 0.7rem; padding: 5px 10px; margin-bottom: 14px; letter-spacing: 0.08em; }
  .hos-hero h1       { font-size: clamp(1.55rem, 7.5vw, 1.95rem); margin-bottom: 10px; }
  .hos-hero p        { font-size: 0.92rem; line-height: 1.5; margin-bottom: 16px; }
  .hos-hero__actions { gap: 8px; }
  .hos-hero__actions .hos-hero-btn { flex: 1 1 calc(50% - 4px); padding: 10px 14px !important; font-size: 0.88rem !important; }

  /* Trust ticker — slightly tighter, slightly faster on small screens */
  .hos-trust          { padding-block: 11px; font-size: 0.78rem; }
  .hos-trust__track   { gap: 18px; animation-duration: 26s; }
  .hos-trust__track i { font-size: 0.95rem; vertical-align: -1px; }
  .hos-trust__track > li + li::before { left: -9px; width: 3px; height: 3px; }

  /* Sections — tighten padding + heading */
  .hos-section          { padding-block: 36px; }
  .hos-section__head    { margin-bottom: 24px; }
  .hos-section__head h2 { font-size: clamp(1.35rem, 5.5vw, 1.65rem); line-height: 1.22; }
  .hos-section__head p  { font-size: 0.92rem; line-height: 1.5; }
  .hos-eyebrow          { font-size: 0.66rem; letter-spacing: 0.16em; padding: 4px 10px; margin-bottom: 8px; }

  /* Grids back to single-column for clarity */
  .hos-grid           { gap: 12px; }
  .hos-grid--3,
  .hos-grid--4        { grid-template-columns: 1fr; }
  .hos-flow           { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .hos-module-grid    { grid-template-columns: 1fr; gap: 12px; }

  /* Tier cards — compact */
  .hos-tier           { padding: 16px; border-radius: 14px; }
  .hos-tier__icon     { width: 40px; height: 40px; font-size: 1.2rem; margin-bottom: 10px; border-radius: 10px; }
  .hos-tier h3        { font-size: 1.05rem; margin-bottom: 6px; }
  .hos-tier p         { font-size: 0.88rem; line-height: 1.5; margin-bottom: 10px; }
  .hos-tier__kinds li { font-size: 0.85rem; }
  .hos-tier__kinds i  { font-size: 0.95rem; }
  .hos-tier::after    { width: 110px; height: 110px; inset: auto -28px -28px auto; }

  /* Pillar cards — compact */
  .hos-pillar         { padding: 14px; gap: 8px; border-radius: 12px; }
  .hos-pillar__icon   { width: 36px; height: 36px; font-size: 1.1rem; border-radius: 10px; }
  .hos-pillar h3      { font-size: 0.98rem; }
  .hos-pillar p       { font-size: 0.85rem; line-height: 1.45; }

  /* Flow steps — 2-col grid, compact pucks */
  .hos-flow__step       { padding: 18px 10px 12px; border-radius: 12px; gap: 2px; }
  .hos-flow__step i     { font-size: 1.4rem; }
  .hos-flow__num        { width: 22px; height: 22px; font-size: 0.72rem; top: -10px; }
  .hos-flow__step strong { font-size: 0.86rem; }
  .hos-flow__step small  { font-size: 0.74rem; line-height: 1.35; }

  /* Module cards — tighter padding, compact code chip */
  .hos-module-card        { padding: 14px; gap: 6px; border-radius: 10px; }
  .hos-module-card__code  { font-size: 0.62rem; padding: 2px 7px; letter-spacing: 0.12em; }
  .hos-module-card h4     { font-size: 0.95rem; }
  .hos-module-card p      { font-size: 0.83rem; line-height: 1.45; }
  .hos-module-card__fit   { font-size: 0.72rem; }

  /* CTA — compact, full-width buttons */
  .hos-cta            { padding-block: 36px; }
  .hos-cta h2         { font-size: 1.2rem; margin-bottom: 6px; line-height: 1.25; }
  .hos-cta p          { font-size: 0.9rem; line-height: 1.5; }
  .hos-cta__actions   { gap: 8px; flex-direction: column; }
  .hos-cta__actions .hos-hero-btn { width: 100%; padding: 11px 16px !important; font-size: 0.9rem !important; }

  /* Footer — wrap & shrink */
  .hos-footer         { padding-block: 14px; font-size: 0.78rem; }
  .hos-footer__inner  { justify-content: center; text-align: center; gap: 6px; }
  .hos-footer__rail   { font-size: 0.74rem; }
}

/* Very small phones (<= 380px) — keep everything readable, never tiny */
@media (max-width: 380px) {
  .hos-platform-link span { display: none; }   /* keep only the back-arrow */
  .hos-brand__text        { font-size: 0.92rem; }
  .hos-hero h1            { font-size: 1.5rem; }
  .hos-hero p             { font-size: 0.88rem; }
  .hos-section__head h2   { font-size: 1.25rem; }
  .hos-hero__actions      { flex-direction: column; }
  .hos-hero__actions .hos-hero-btn { width: 100%; flex: 1 1 100%; }
}
