:root {
  /* SPARK GLOBAL official palette */
  --brand-navy: #102b5c;
  --brand-blue: #1d4ed8;
  --brand-gold: #d4af37;
  --bg-page: #f3f6fb;
  --bg-card: #ffffff;
  --text-primary: #172033;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --success: #198754;
  --warning: #f59e0b;
  --error: #dc2626;
  --navy-rgb: 16, 43, 92;
  --blue-rgb: 29, 78, 216;
  --gold-rgb: 212, 175, 55;

  /* Semantic aliases */
  --ink: var(--text-primary);
  --ink-soft: #1e2a45;
  --muted: var(--text-secondary);
  --line: var(--border);
  --line-strong: rgba(var(--navy-rgb), 0.22);
  --paper: var(--bg-page);
  --paper-deep: #e8edf5;
  --card: var(--bg-card);
  --card-solid: var(--bg-card);
  --forest: var(--brand-blue);
  --forest-mid: #2563eb;
  --forest-deep: var(--brand-navy);
  --brass: var(--brand-gold);
  --brass-light: #e4c96a;
  --brass-soft: rgba(var(--gold-rgb), 0.12);
  --gold-glow: rgba(var(--gold-rgb), 0.18);
  --danger: var(--error);
  --danger-soft: rgba(220, 38, 38, 0.08);
  --ok: var(--success);
  --ok-soft: rgba(25, 135, 84, 0.1);
  --warn: var(--warning);
  --warn-soft: rgba(245, 158, 11, 0.1);
  --focus-ring: rgba(var(--blue-rgb), 0.14);
  --shadow-sm: 0 1px 2px rgba(var(--navy-rgb), 0.05), 0 8px 24px rgba(var(--navy-rgb), 0.06);
  --shadow: 0 2px 4px rgba(var(--navy-rgb), 0.05), 0 20px 48px rgba(var(--navy-rgb), 0.08);
  --shadow-lg: 0 4px 8px rgba(var(--navy-rgb), 0.06), 0 32px 64px rgba(var(--navy-rgb), 0.12);
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --serif: "Inter", system-ui, -apple-system, sans-serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
  --page-max: 1280px;
  --page-gutter: clamp(16px, 4vw, 32px);
  --prose-max: 65ch;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --section-y: clamp(3rem, 7vw, 5rem);
  --nav-break: 1024px;
  --tap-min: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  letter-spacing: -0.01em;
  background: var(--bg-page);
}
body > * { position: relative; z-index: 1; }

a { color: var(--brand-blue); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.2s var(--ease); }
a:hover { color: var(--brand-navy); }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
strong { color: var(--ink-soft); font-weight: 650; }

.wrap {
  width: min(var(--page-max), calc(100% - var(--page-gutter) * 2));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--brand-navy);
  transition: box-shadow 0.25s var(--ease);
}
.site-header.is-scrolled {
  box-shadow: 0 4px 24px rgba(var(--navy-rgb), 0.35);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  white-space: nowrap;
  outline: none;
  border: 0;
  flex-shrink: 0;
}
.brand:hover { color: rgba(255, 255, 255, 0.92); }
.brand:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 4px;
  border-radius: 10px;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-blue);
  box-shadow: inset 0 0 0 2px rgba(var(--gold-rgb), 0.45);
  flex-shrink: 0;
}
.brand-text { display: grid; gap: 0; line-height: 1.15; }
.brand-name {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffffff;
}
.brand-text small {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.nav-toggle-bars {
  display: block;
  position: relative;
  width: 22px;
  height: 16px;
}

.nav-toggle-bar {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), top 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}

.nav-toggle-bar:nth-child(1) { top: 0; }
.nav-toggle-bar:nth-child(2) { top: 7px; }
.nav-toggle-bar:nth-child(3) { top: 14px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 104;
  background: rgba(10, 31, 66, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0s 0.28s;
}

.mobile-nav-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.28s ease, visibility 0s 0s;
}

.mobile-drawer-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}

.mobile-drawer-close:hover,
.mobile-drawer-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.mobile-drawer-close-icon {
  display: block;
  position: relative;
  width: 18px;
  height: 18px;
}

.mobile-drawer-close-icon::before,
.mobile-drawer-close-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  margin: -1px 0 0 -9px;
  background: currentColor;
  border-radius: 1px;
}

.mobile-drawer-close-icon::before { transform: rotate(45deg); }
.mobile-drawer-close-icon::after { transform: rotate(-45deg); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-primary {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.nav-primary a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 11px;
  border-radius: var(--radius-pill);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-primary a:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
.nav-primary a.active {
  background: var(--brand-blue);
  color: #ffffff;
  font-weight: 650;
}
.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.nav-actions a:not(.button) {
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  padding: 8px 10px;
  border-radius: var(--radius-pill);
}
.nav-actions a:not(.button):hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }
.nav-actions form { margin: 0; }

/* Page */
.page { padding: 36px 0 80px; }
.page-auth {
  padding: clamp(2rem, 5vw, 3rem) 0 clamp(2.5rem, 6vw, 4rem);
  max-width: none;
}

body.is-auth-page {
  background: linear-gradient(180deg, var(--bg-page) 0%, #eef2f8 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.is-auth-page main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

body.is-auth-page .auth-shell {
  flex: 1;
  min-height: auto;
  padding: 0 clamp(16px, 4vw, 24px);
}

.site-header-minimal {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-shell-minimal {
  grid-template-columns: minmax(140px, auto) auto;
  justify-content: space-between;
}

.header-actions-minimal {
  justify-self: end;
}

.site-footer-minimal {
  background: transparent;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 1.5rem;
}

.auth-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  font-size: 0.88rem;
}

.auth-footer-inner a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer-inner a:hover {
  color: var(--brand-blue);
}

.auth-footer-sep {
  color: var(--line);
}
.page-portal { padding-top: 28px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0 0 12px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--brand-gold), transparent);
}
.lede {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--muted);
  max-width: var(--prose-max);
  line-height: 1.65;
}
.page-head { margin-bottom: var(--space-5); }
.page-head p { color: var(--muted); max-width: var(--prose-max); }

:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* Hero */
.hero-band {
  position: relative;
  padding: clamp(40px, 5vw, 72px) 0;
  margin-bottom: 0;
}
.hero-band-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.hero-band::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0;
  background: var(--brand-navy);
  box-shadow: none;
  z-index: 0;
}
.hero-band:not(.hero-band-bleed)::after {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
  color: #ffffff;
}
.hero h1 {
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.12);
  font-size: clamp(1.75rem, 4vw + 0.25rem, 2.75rem);
  max-width: 20ch;
  line-height: 1.12;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.hero .lede {
  color: rgba(255, 255, 255, 0.88);
  max-width: var(--prose-max);
}
.hero .eyebrow { color: var(--brand-gold); }
.hero .eyebrow::before { background: linear-gradient(90deg, var(--brand-gold), transparent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero .panel {
  width: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255,255,255,0.5);
  color: var(--ink);
  backdrop-filter: blur(8px);
}
.hero .panel h2 { color: var(--brand-navy); font-size: 1.2rem; }
.hero-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.hero-stat:last-of-type { border-bottom: 0; }
.hero-stat span { color: var(--muted); font-size: 0.9rem; }
.hero-stat strong {
  font-family: var(--serif);
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  color: var(--brand-navy);
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

/* Surfaces */
.panel, .card, .table-wrap, .form, .notice, .empty-state {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}
.panel, .card, .form, .notice, .empty-state { padding: clamp(20px, 3vw, 28px); }
.card {
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.feature-card {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  min-width: 0;
}
.feature-card .card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-navy);
  background: var(--brass-soft);
  border: 1px solid rgba(var(--gold-rgb), 0.28);
}
.feature-card a.card-link {
  margin-top: auto;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.feature-card a.card-link::after { content: "\2192"; transition: transform 0.2s var(--ease); }
.feature-card a.card-link:hover::after { transform: translateX(4px); }

.notice {
  border-color: rgba(var(--navy-rgb), 0.14);
  background: var(--bg-card);
}
.notice h2 { color: var(--brand-navy); }

/* Compensation page */
.comp-hero .comp-hero-stats strong { font-size: 1.35rem; }
.comp-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  width: 100%;
}
.comp-step-card {
  position: relative;
  display: grid;
  gap: var(--space-3);
  padding: clamp(1rem, 3vw, 1.375rem);
  min-width: 0;
  border-radius: var(--radius-lg);
  background: var(--card-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.comp-step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.comp-step-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.comp-step-index {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand-navy);
  box-shadow: 0 6px 16px rgba(var(--navy-rgb), 0.24);
}
.comp-step-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-blue);
  font-weight: 700;
}
.comp-step-amount {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.5vw + 0.25rem, 2rem);
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.comp-step-caption {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}
.comp-step-legs { display: grid; gap: 12px; margin-top: 4px; }
.comp-leg { display: grid; gap: 4px; }
.comp-leg span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.comp-leg strong {
  font-size: clamp(0.9rem, 2vw, 0.95rem);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.comp-leg-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(var(--navy-rgb), 0.08);
  overflow: hidden;
}
.comp-leg-bar i {
  display: block;
  height: 100%;
  width: var(--fill);
  border-radius: inherit;
  background: var(--brand-navy);
}
.comp-leg-bar-alt i { background: var(--brand-blue); }
.comp-step-connector {
  display: none;
}
.info-strip { margin-bottom: 28px; }
.info-strip-card {
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--card-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.info-strip-card h3 {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-navy);
  font-weight: 700;
}
.info-strip-card p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.comp-process h2 { margin-bottom: 4px; }
.process-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
  counter-reset: proc;
}
.process-steps li {
  display: grid;
  gap: 4px;
  padding: 18px 0 18px 56px;
  border-bottom: 1px solid var(--line);
  position: relative;
  counter-increment: proc;
}
.process-steps li:last-child { border-bottom: 0; padding-bottom: 0; }
.process-steps li::before {
  content: counter(proc);
  position: absolute;
  left: 0;
  top: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-navy);
  background: var(--brass-soft);
  border: 1px solid rgba(var(--gold-rgb), 0.28);
}
.process-steps li strong {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
}
.process-steps li span { color: var(--muted); font-size: 0.94rem; }
.alert-panel {
  padding: clamp(22px, 3vw, 28px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.alert-panel-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.alert-panel-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid rgba(138, 90, 18, 0.14);
}
.alert-panel-head h2 { margin: 0 0 6px; color: var(--warn); font-size: 1.35rem; }
.alert-panel-head p { margin: 0; color: var(--muted); }
.alert-panel-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.alert-panel-list li {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(245, 158, 11, 0.18);
  color: var(--ink-soft);
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}
.rank-ladder {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
.rank-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.rank-card.ok { border-color: rgba(25, 135, 84, 0.22); background: var(--bg-card); }
.rank-card.pending { border-color: var(--border); }
.rank-medal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-navy);
  background: var(--brass-soft);
  border: 1px solid rgba(var(--gold-rgb), 0.32);
}
.rank-card.ok .rank-medal {
  background: var(--brand-gold);
  color: var(--brand-navy);
  border-color: rgba(var(--gold-rgb), 0.5);
}
.rank-body { min-width: 0; }
.rank-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}
.rank-title-row h4 { margin: 0; font-size: clamp(1rem, 2.5vw, 1.15rem); min-width: 0; }
.rank-note {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.legal-footnote {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 58ch;
  margin-inline: auto;
}

.empty-state,
.panel.empty {
  text-align: center;
  padding: clamp(1.75rem, 5vw, 2.75rem) clamp(1rem, 4vw, 1.5rem);
  max-width: 40rem;
  margin-inline: auto;
}
.empty-state h2,
.panel.empty h2,
.empty-state h3,
.panel.empty h3 { margin-bottom: var(--space-3); }
.empty-state p,
.panel.empty p {
  color: var(--muted);
  max-width: var(--prose-max);
  margin-inline: auto;
  overflow-wrap: anywhere;
}

.portal-main > h1:first-child {
  margin-bottom: 0.35em;
}
.portal-main > h1:first-child + p {
  color: var(--muted);
  margin-bottom: 1.25em;
}

/* Grid � mobile-first */
.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.25rem); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 40px 0 20px;
}
.section-title h2 { margin: 0; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--card-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 8px;
}
.stat-card .stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.stat-card strong {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--brand-navy);
  line-height: 1;
}
.stat-card.accent {
  background: var(--bg-card);
  border-color: rgba(var(--gold-rgb), 0.35);
  box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), 0.08);
}

.muted { color: var(--muted); }
.danger-text { color: var(--danger); }

[hidden] {
  display: none !important;
}

/* Buttons */
.button, button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  background: var(--brand-blue);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(var(--blue-rgb), 0.28);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}
.button:hover, button:hover:not(:disabled), .button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(var(--blue-rgb), 0.32);
  filter: brightness(1.04);
  color: #fff;
}
.button:active, button:active { transform: translateY(0); }
.button.secondary, button.secondary {
  background: transparent;
  color: var(--brand-navy);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.button.secondary:hover, button.secondary:hover {
  background: rgba(var(--navy-rgb), 0.04);
  color: var(--brand-navy);
  box-shadow: none;
}
.site-header .button.secondary {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}
.site-header .button.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.hero .button.secondary {
  border-color: rgba(255,255,255,0.35);
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.hero .button.secondary:hover { background: rgba(255,255,255,0.16); color: #fff; }
.button.warn, button.warn {
  background: linear-gradient(135deg, #7a2828, var(--danger));
  box-shadow: 0 10px 24px rgba(143, 47, 47, 0.25);
}
.button.sm, button.sm { padding: 8px 14px; font-size: 0.84rem; }
.button-group { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.stack { display: grid; gap: 16px; }
.stack-lg { gap: 24px; }

/* Forms */
label, .field-label {
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}
input, select, textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--bg-card);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
textarea { min-height: 132px; resize: vertical; }
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500;
  color: var(--muted);
}
.check input { width: auto; margin-top: 4px; accent-color: var(--brand-blue); }

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h) - 160px);
}
.auth-card {
  width: min(480px, 100%);
  padding: clamp(28px, 4vw, 36px);
  border-radius: var(--radius-lg);
  background: var(--card-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.auth-card-wide {
  width: min(720px, 100%);
}
.auth-card h1 { text-align: center; margin-bottom: 8px; }
.auth-card .auth-sub { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: 0.95rem; }
.auth-links { text-align: center; font-size: 0.92rem; color: var(--muted); }
.auth-links a { font-weight: 600; }

/* Registration wizard */
.register-wizard-head {
  display: grid;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.register-eyebrow {
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-gold);
}

.register-wizard h1 {
  margin-bottom: 0;
}

.register-step-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  text-align: center;
}

.register-step-count {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-blue);
}

.register-step-name {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.register-progress-bar {
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--line);
  overflow: hidden;
}

.register-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-navy));
  transition: width 0.3s ease;
}

.register-form {
  display: grid;
  gap: 1.25rem;
}

.register-step-panel {
  position: relative;
  min-height: 12rem;
}

.register-step {
  animation: register-step-in 0.28s ease;
}

.register-step[hidden] {
  display: none !important;
}

@keyframes register-step-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.register-step-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.register-hint-box {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-page);
}

.register-fields {
  gap: 1rem;
}

.register-field-full {
  grid-column: 1 / -1;
}

.register-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.register-review {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-page);
  display: grid;
  gap: 0.65rem;
}

.register-review div {
  display: grid;
  grid-template-columns: minmax(7rem, 34%) minmax(0, 1fr);
  gap: 0.5rem 1rem;
  align-items: baseline;
}

.register-review dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.register-review dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.register-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}

.register-step-actions .register-back {
  margin-right: auto;
}

.register-step-actions .register-next,
.register-step-actions .register-submit {
  min-width: 9.5rem;
}

.register-step-error {
  margin: 0;
}

@media (max-width: 640px) {
  .register-review div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .register-step-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .register-step-actions .register-back {
    margin-right: 0;
  }

  .register-step-actions .register-next,
  .register-step-actions .register-submit {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .register-step {
    animation: none;
  }
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  padding: 0;
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
thead { background: rgba(var(--navy-rgb), 0.04); }
th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
tbody tr:hover td { background: rgba(var(--navy-rgb), 0.03); }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; }

/* Badges & pills */
.badge, .pill {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge { background: var(--warn-soft); color: var(--warn); border-color: rgba(245, 158, 11, 0.22); }
.badge.ok, .pill.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(25, 135, 84, 0.22); }
.badge.bad, .pill.bad { background: var(--danger-soft); color: var(--danger); border-color: rgba(220, 38, 38, 0.22); }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.neutral { background: rgba(107, 98, 86, 0.1); color: var(--muted); }

/* Flashes */
.flashes { display: grid; gap: 10px; margin-bottom: 24px; }
.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  border: 1px solid transparent;
}
.flash.success { background: var(--ok-soft); border-color: rgba(29, 107, 69, 0.2); color: var(--ok); }
.flash.error { background: var(--danger-soft); border-color: rgba(143, 47, 47, 0.2); color: var(--danger); }

/* Portal layout */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
}
.portal-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: grid;
  gap: 20px;
}
.side-panel {
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.side-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(var(--navy-rgb), 0.04);
}
.side-head strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-blue);
}
.side-head span { font-family: var(--serif); font-size: 1.05rem; color: var(--brand-navy); }
.side { display: grid; padding: 8px; gap: 2px; }
.side a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.side a:hover { background: rgba(var(--navy-rgb), 0.05); color: var(--brand-navy); padding-left: 18px; }
.side a.active {
  background: var(--brand-navy);
  color: #ffffff;
  font-weight: 650;
  box-shadow: 0 6px 16px rgba(var(--navy-rgb), 0.22);
}
.side-section {
  padding: 12px 16px 4px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.theme-admin .side a.active {
  background: var(--brand-navy);
  box-shadow: inset 3px 0 0 var(--brand-gold);
}
.portal-main { min-width: 0; }

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2.5vw, 1.25rem);
}
.product-card {
  display: grid;
  gap: 12px;
  overflow: hidden;
  padding: 0;
}
.product-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}
.product-card .product-body { padding: 20px; display: grid; gap: 10px; }
.product-card h2, .product-card h3 { margin: 0; font-size: 1.25rem; }
.product-card h2 a, .product-card h3 a { text-decoration: none; color: var(--brand-navy); }
.product-card h2 a:hover, .product-card h3 a:hover { color: var(--brand-blue); }
.price-row { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.88rem; }
.price-tag {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(var(--navy-rgb), 0.06);
  color: var(--brand-navy);
  font-weight: 600;
}

/* Network tree */
.tree { display: grid; gap: 12px; }
.tree-node {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.tree-node > strong { color: var(--brand-navy); }
.tree-children {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.bars { display: grid; gap: 10px; }
.bar {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  font-size: 0.88rem;
}
.bar-track {
  width: 100%;
  max-width: 220px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(var(--navy-rgb), 0.08);
  overflow: hidden;
}
.bar-fill-primary { fill: var(--brand-navy); }
.bar-fill-accent { fill: var(--brand-blue); }
.bar-value { font-weight: 650; color: var(--brand-navy); font-variant-numeric: tabular-nums; }

/* Lists in cards */
.data-list { list-style: none; padding: 0; margin: 0; }
.data-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.data-list li:last-child { border-bottom: 0; }

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 48px 0 56px;
  color: var(--muted);
  background: var(--bg-page);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 2rem);
}
.footer-brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--brand-navy);
  margin-bottom: 12px;
}
.footer-col h3 {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  padding: 4px 0;
  font-size: 0.92rem;
}
.footer-col a:hover { color: var(--brand-blue); }
.footer-note {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  line-height: 1.6;
}

.narrow { max-width: 520px; margin-inline: auto; }
pre {
  background: rgba(var(--navy-rgb), 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  overflow-x: auto;
  font-size: 0.82rem;
}

/* Responsive � shared breakpoints */
@media (min-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 640px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero {
    grid-template-columns: 3fr 2fr;
    align-items: center;
  }
  .hero h1 { max-width: 16ch; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .faq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rank-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .comp-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .layout, .tree-children { grid-template-columns: 1fr; }
  .portal-sidebar { position: static; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .theme-public:not(.is-auth-page) .header-shell {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: var(--card-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    align-items: stretch;
  }
  .site-nav.open:not(.mobile-drawer) { display: grid; gap: 8px; }
  .nav-primary { flex-direction: column; align-items: stretch; }
  .nav-primary a { padding: 12px 14px; }
  .nav-actions {
    margin: 0;
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
  }
  .nav-actions .button { width: 100%; }
  .site-header { position: sticky; }
  .header-row { position: relative; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .button { width: 100%; min-height: var(--tap-min); }
  .button-group { flex-direction: column; align-items: stretch; }
  .button-group .button,
  .button-group .button.secondary { width: 100%; min-height: var(--tap-min); }
  .membership-list .button-group .button { width: 100%; }
}

@media (max-width: 520px) {
  :root { --page-gutter: clamp(12px, 4vw, 16px); }
}

/* Single-page public site */
body.is-single-page {
  --header-h: 72px;
  --page-max: 1280px;
  --page-gutter: clamp(16px, 4vw, 32px);
  overflow-x: clip;
}

body.is-single-page.nav-open {
  overflow: hidden;
}

body.theme-public.nav-open {
  overflow: hidden;
}

body.is-single-page.nav-open .site-header.has-section-nav,
body.theme-public.nav-open .site-header {
  z-index: 106;
}

.site-header.has-section-nav {
  height: auto;
  background: var(--brand-navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-shell {
  display: grid;
  grid-template-columns: minmax(140px, auto) minmax(0, 1fr) minmax(140px, auto);
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
  padding: 10px 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  flex-shrink: 0;
  min-width: 0;
}

.nav-drawer-auth {
  display: none;
}

.header-link {
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.header-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.header-lang {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.header-lang:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(var(--gold-rgb), 0.45);
}

.section-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  margin: 0 auto;
  width: 100%;
  max-width: none;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
}

.section-nav::-webkit-scrollbar { display: none; }

.nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.nav-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
}

.section-nav a {
  flex: 0 0 auto;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.section-nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.section-nav a.active {
  background: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(var(--blue-rgb), 0.28);
}

.compact-nav {
  justify-content: center;
  gap: 4px;
}

.compact-nav a {
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
}

.compact-nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.page-single-main {
  padding: 0;
  width: 100%;
  max-width: none;
  overflow-x: clip;
}

.page-single-main .flashes {
  padding-top: 20px;
  margin-bottom: 0;
}

.site-sections {
  display: grid;
  gap: 0;
}

.site-section {
  padding: var(--section-y) 0;
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.site-section-alt {
  background: var(--bg-page);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.site-section-hero {
  padding: 0 0 clamp(48px, 6vw, 72px);
  background: var(--bg-page);
}

.site-section-hero .section-cards {
  margin-top: clamp(28px, 4vw, 40px);
}

.section-inner {
  display: grid;
  gap: 28px;
}

.section-head {
  max-width: min(100%, 52rem);
}
.section-head p,
.section-head .lede {
  max-width: var(--prose-max);
}

.section-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  margin-bottom: 12px;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.section-cards {
  margin-top: 8px;
}

.membership-list {
  margin: 0;
  padding-left: 1.35em;
  display: grid;
  gap: clamp(0.75rem, 2vw, 1rem);
}

.membership-list li {
  line-height: 1.65;
  overflow-wrap: anywhere;
  padding-right: var(--space-2);
}

.comp-summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.faq-grid {
  display: grid;
  gap: clamp(0.875rem, 2vw, 1rem);
}

.faq-item {
  min-width: 0;
}

.faq-item h3 {
  margin-bottom: var(--space-2);
  font-size: clamp(1rem, 2.5vw, 1.05rem);
  overflow-wrap: anywhere;
}

.faq-item p {
  overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
  body.is-single-page { --header-h: 64px; }

  body.is-single-page .site-header.has-section-nav {
    height: auto;
    min-height: var(--header-h);
  }

  body.is-single-page .brand { grid-area: brand; }
  body.is-single-page .header-actions { grid-area: actions; }

  body.is-single-page .header-actions .nav-toggle {
    display: inline-flex;
  }

  body.is-single-page .header-actions > :not(.header-lang):not(.nav-toggle) {
    display: none;
  }

  body.is-single-page .brand-name {
    font-size: 0.82rem;
  }

  body.is-single-page .mark {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 860px) {
  .theme-public:not(.is-auth-page) .header-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .theme-public:not(.is-auth-page) .header-actions > :not(.header-lang):not(.nav-toggle) {
    display: none;
  }

  .theme-public:not(.is-auth-page) .site-nav.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    z-index: 105;
    display: flex;
    flex-direction: column;
    width: min(360px, 88vw);
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    background: linear-gradient(180deg, #0a1f42 0%, var(--brand-navy) 42%, #0d2550 100%);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0.32s;
    overflow: hidden;
  }

  .theme-public:not(.is-auth-page) .site-nav.mobile-drawer:not(.open) {
    pointer-events: none;
  }

  .theme-public:not(.is-auth-page) .site-nav.mobile-drawer.open {
    display: flex;
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0s;
  }

  .theme-public:not(.is-auth-page) .mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    padding: max(0.85rem, env(safe-area-inset-top, 0px)) 1rem 0.85rem 1.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
  }

  .theme-public:not(.is-auth-page) .mobile-drawer-close {
    display: inline-flex;
  }

  .theme-public:not(.is-auth-page) .mobile-drawer-kicker {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brand-gold);
  }

  .theme-public:not(.is-auth-page) .mobile-drawer-title {
    margin: 0.25rem 0 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
  }

  .theme-public:not(.is-auth-page) .mobile-drawer-scroll {
    display: block;
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem clamp(1.35rem, 5vw, 2rem) 1.25rem;
  }

  .theme-public:not(.is-auth-page) .nav-group-label {
    display: block;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
    margin: 0 0 0.35rem;
  }

  .theme-public:not(.is-auth-page) .site-nav.mobile-drawer a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.9rem 0.25rem;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    border-left: none;
    border-radius: 0;
    text-decoration: none;
  }

  .theme-public:not(.is-auth-page) .site-nav.mobile-drawer a::after {
    content: "";
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid rgba(255, 255, 255, 0.35);
    border-top: 1.5px solid rgba(255, 255, 255, 0.35);
    transform: rotate(45deg);
  }

  .theme-public:not(.is-auth-page) .site-nav.mobile-drawer a:hover {
    color: #fff;
    background: transparent;
  }

  .theme-public:not(.is-auth-page) .nav-drawer-auth {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.15rem clamp(1.35rem, 5vw, 2rem) calc(1.35rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.18);
  }

  .theme-public:not(.is-auth-page) .nav-drawer-login {
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 600;
    text-decoration: none;
  }

  .theme-public:not(.is-auth-page) .nav-drawer-register {
    width: 100%;
    background: var(--brand-gold) !important;
    color: var(--brand-navy) !important;
    border: none !important;
    font-weight: 700 !important;
  }

}

@media (min-width: 1025px) {
  body.is-single-page .site-header.has-section-nav .nav-toggle { display: none; }

  body.is-single-page .section-nav {
    display: flex;
    flex-wrap: nowrap;
  }
}

@media (min-width: 1025px) and (max-width: 1180px) {
  body.is-single-page .section-nav a {
    font-size: 0.74rem;
    padding: 7px 10px;
  }

  body.is-single-page .nav-divider { display: none; }
}

/* Wallet & financial highlights */
.portal-main .card h2 {
  color: var(--brand-navy);
  font-variant-numeric: tabular-nums;
}

.portal-main .card p strong {
  color: var(--brand-navy);
}

.theme-portal .side a.active {
  box-shadow: inset 3px 0 0 var(--brand-gold);
}

.card-link {
  color: var(--brand-blue);
  font-weight: 650;
}

.card-link:hover {
  color: var(--brand-navy);
}

/* Signed-in portal (/app, /admin) */
body.is-portal {
  --portal-topbar-h: 64px;
  --header-h: var(--portal-topbar-h);
  background: #eef2f8;
}

/* body > * { z-index: 1 } traps fixed children inside <main>; lift portal layers */
body.is-portal > main {
  position: static;
  z-index: auto;
}

body.is-portal > .portal-topbar {
  position: sticky;
  z-index: 110;
}

body.is-portal .portal-sidebar .portal-nav-backdrop {
  display: none;
}

body.is-portal .page-portal {
  padding-top: clamp(16px, 3vw, 28px);
  padding-bottom: clamp(24px, 4vw, 48px);
}

body.is-portal .portal-main .card:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--line);
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 55;
  background: var(--brand-navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(var(--navy-rgb), 0.2);
}

.portal-topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--portal-topbar-h);
}

.portal-menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  flex-shrink: 0;
}

.portal-menu-toggle-bars {
  display: grid;
  gap: 4px;
  width: 18px;
}

.portal-menu-toggle-bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.portal-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  min-width: 0;
  flex: 1;
}

.portal-topbar-brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-blue);
  box-shadow: inset 0 0 0 2px rgba(var(--gold-rgb), 0.45);
  flex-shrink: 0;
}

.portal-topbar-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portal-topbar-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
}

.portal-topbar-title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.portal-topbar-link {
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.portal-topbar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.portal-topbar-logout {
  margin: 0;
}

.portal-topbar-logout .secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.portal-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(var(--navy-rgb), 0.5);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}

.portal-nav-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

body.is-portal.portal-nav-open {
  overflow: hidden;
}

.side-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portal-sidebar-close {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

body.is-portal .layout {
  gap: clamp(16px, 2.5vw, 28px);
}

body.is-portal .portal-sidebar {
  top: calc(var(--portal-topbar-h) + 12px);
}

body.is-portal .side a {
  padding: 11px 14px;
}

body.is-portal .side a.active {
  padding-left: 14px;
}

body.is-portal .portal-main > h1:first-child {
  margin-top: 0;
}

body.is-portal .page-head h1 {
  margin-bottom: 0.35em;
}

body.is-portal .page-head + .stats,
body.is-portal .page-head + .card,
body.is-portal .page-head + .empty-state,
body.is-portal .page-head + .table-wrap {
  margin-top: 0;
}

body.is-portal .data-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px 16px;
  align-items: center;
}

body.is-portal .data-list li > .muted {
  grid-column: 1 / -1;
  font-size: 0.88rem;
}

body.is-portal .empty-state {
  padding: clamp(28px, 4vw, 40px);
  text-align: center;
  color: var(--muted);
}

body.is-portal .form-grid {
  display: grid;
  gap: 16px;
}

body.is-portal .form-grid .span-2 {
  grid-column: 1 / -1;
}

body.is-portal .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}

body.is-portal .portal-form h2 {
  margin: 0;
}

body.is-portal .stat-meta {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

body.is-portal .stats-wallet {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.portal-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  margin-top: auto;
}

.portal-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.portal-footer-inner a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.portal-footer-inner a:hover {
  color: var(--brand-blue);
}

@media (min-width: 720px) {
  body.is-portal .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .portal-menu-toggle {
    display: inline-flex;
  }

  .portal-sidebar-close {
    display: inline-grid;
    place-items: center;
  }

  body.is-portal .portal-sidebar {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    height: auto;
    overflow: visible;
  }

  body.is-portal .portal-sidebar .portal-nav-backdrop:not([hidden]) {
    display: block;
  }

  body.is-portal .portal-sidebar .side-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    max-width: 100%;
    border-radius: 0;
    border-left: 0;
    border-top: 0;
    border-bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.28s var(--ease);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    z-index: 2;
    background: var(--card-solid);
  }

  body.is-portal .portal-sidebar.is-open {
    pointer-events: auto;
  }

  body.is-portal .portal-sidebar.is-open .side-panel {
    transform: translateX(0);
  }

  body.is-portal .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .portal-topbar-link:not([href="/cart"]) {
    display: none;
  }

  .portal-menu-toggle-label {
    display: none;
  }

  body.is-portal .data-list li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  body.is-portal .data-list li > span:last-child {
    justify-self: start;
  }
}

/* Admin premium UI — extended in /assets/admin.css for theme-admin */

.admin-page-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-page-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: var(--prose-max);
}

.admin-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.admin-queue-card {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--card-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.admin-queue-card:hover {
  border-color: rgba(var(--gold-rgb), 0.45);
  box-shadow: var(--shadow);
}

.admin-queue-card strong {
  font-size: 1.75rem;
  color: var(--brand-navy);
  line-height: 1;
}

.admin-queue-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.admin-table-wrap {
  padding: 0;
}

.admin-table {
  font-size: 0.9rem;
}

.admin-table-compact th,
.admin-table-compact td {
  padding: 10px 14px;
}

.admin-table-primary {
  font-weight: 650;
  text-decoration: none;
  color: var(--brand-navy);
}

.admin-table-primary:hover {
  color: var(--brand-blue);
}

.admin-table-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.admin-table-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-table-actions {
  text-align: right;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 16px 20px;
}

.admin-toolbar label {
  flex: 1;
  min-width: 200px;
  margin: 0;
}

.admin-search input {
  width: 100%;
}

.admin-disclosure {
  padding: 0;
  overflow: hidden;
}

.admin-disclosure-summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 650;
  color: var(--brand-navy);
  list-style: none;
}

.admin-disclosure-summary::-webkit-details-marker {
  display: none;
}

.admin-disclosure[open] .admin-disclosure-summary {
  border-bottom: 1px solid var(--line);
}

.admin-disclosure .portal-form {
  padding: 20px;
}

.admin-tabs {
  display: grid;
  gap: 16px;
}

.admin-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(var(--navy-rgb), 0.05);
  border: 1px solid var(--line);
}

.admin-tab,
.admin-tab-nav .admin-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
}

.admin-tab.is-active,
.admin-tab-nav a.admin-tab.is-active {
  background: var(--brand-navy);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--navy-rgb), 0.2);
}

.admin-tab-panel {
  display: grid;
  gap: 16px;
}

.admin-tab-panel[hidden] {
  display: none !important;
}

.admin-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.admin-checklist li {
  padding-left: 1.5rem;
  position: relative;
  color: var(--muted);
}

.admin-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}

.admin-checklist li.ok::before {
  background: var(--ok);
}

.admin-checklist li.ok {
  color: var(--ink-soft);
}

.admin-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-media-grid img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  object-fit: cover;
}

.admin-setting-summaries {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.admin-setting-summaries li {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.admin-setting-summaries li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.admin-setting-summaries .muted {
  grid-column: 1 / -1;
  font-size: 0.88rem;
}

.admin-setting-key {
  font-weight: 650;
  text-transform: capitalize;
  color: var(--brand-navy);
}

.admin-blocker-list {
  margin: 0;
  padding-left: 1.1rem;
}

.admin-blocker-list a {
  font-weight: 600;
  margin-left: 6px;
}

.admin-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.admin-status-card {
  border-left: 4px solid var(--line);
}

.admin-status-card.ok {
  border-left-color: var(--ok);
}

.admin-status-card.bad {
  border-left-color: var(--danger);
}

.admin-status-card.pending {
  border-left-color: var(--warn);
}

.admin-queue-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.admin-queue-item-head h2 {
  margin: 0;
  flex: 1;
}

.admin-queue-amount {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand-navy);
}

body.is-portal .side a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--brand-gold);
  color: var(--brand-navy);
  font-size: 0.68rem;
  font-weight: 800;
}

.side-exports {
  margin: 8px 8px 0;
  padding: 0;
}

.side-exports summary {
  padding: 10px 14px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.side-exports summary::-webkit-details-marker {
  display: none;
}

.side-exports a {
  margin-left: 8px;
  font-size: 0.84rem;
}

body.is-portal .form-grid .form-actions.span-2 {
  grid-column: 1 / -1;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
