/* ==========================================================================
   ReSarAs — Setu Archival Limestone · Saarathi Guidance · Shakti Appraisal
   "Connect findings. Keep the sources in view."
   ========================================================================== */
:root {
  --bg: hsl(39, 35%, 94%);
  --bg-alt: hsl(38, 29%, 89%);
  --header-bg: hsla(39, 38%, 95%, 0.88);
  --card: hsl(40, 50%, 98.5%);
  --card-elevated: #ffffff;
  --surface-recessed: hsl(38, 28%, 91.5%);
  --ink: hsl(197, 23%, 12%);
  --ink-secondary: hsl(197, 18%, 22%);
  --muted: hsl(197, 11%, 37%);
  --border: hsl(38, 23%, 81%);
  --border-strong: hsl(37, 21%, 71%);
  --bevel-top: rgba(255, 255, 255, 0.84);
  --primary: hsl(184, 57%, 25%);
  --primary-hover: hsl(184, 60%, 19%);
  --primary-soft: hsl(183, 33%, 91%);
  --copper: hsl(24, 61%, 37%);
  --copper-hover: hsl(23, 65%, 30%);
  --copper-soft: hsl(24, 68%, 94%);
  --brass-surface: hsl(38, 56%, 93%);
  --brass-border: hsl(37, 45%, 71%);
  --brass-ink: hsl(36, 63%, 28%);
  --shadow-xs: inset 0 1px 0 var(--bevel-top), 0 1px 2px rgba(24, 34, 38, 0.05);
  --shadow: inset 0 1px 0 var(--bevel-top), 0 8px 24px -6px rgba(24, 34, 38, 0.07), 0 2px 6px -1px rgba(24, 34, 38, 0.04);
  --shadow-hover: inset 0 1px 0 var(--bevel-top), 0 18px 38px -10px rgba(24, 34, 38, 0.12), 0 4px 10px -2px rgba(24, 34, 38, 0.05);
  --focus-ring: 0 0 0 3px hsla(184, 57%, 25%, 0.22);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font-serif: "Newsreader", "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Calm River Mist Mode (Ocular-Relief Sage & Sea-Glass Clinical Sanctuary) */
body.mist-sanctuary-mode {
  --bg: hsl(174, 24%, 93%);
  --bg-alt: hsl(175, 22%, 89%);
  --header-bg: hsla(174, 26%, 94%, 0.88);
  --card: hsl(172, 36%, 98.4%);
  --card-elevated: #ffffff;
  --surface-recessed: hsl(174, 23%, 90%);
  --border: hsl(174, 20%, 80%);
  --border-strong: hsl(174, 18%, 68%);
  --primary: hsl(183, 60%, 24%);
  --primary-hover: hsl(183, 64%, 18%);
  --primary-soft: hsl(178, 35%, 89%);
}

/* Saarathi Midnight Canopy Night Mode (Zero Purple — Deep Marine Slate, Ivory & Warm Brass) */
body.night-canopy-mode {
  --bg: hsl(211, 42%, 11%);
  --bg-alt: hsl(211, 40%, 13.5%);
  --header-bg: hsla(211, 42%, 11%, 0.88);
  --card: hsl(211, 38%, 16%);
  --card-elevated: hsl(211, 36%, 18.5%);
  --surface-recessed: hsl(211, 44%, 9.5%);
  --ink: hsl(40, 35%, 94%);
  --ink-secondary: hsl(210, 20%, 86%);
  --muted: hsl(210, 17%, 67%);
  --border: rgba(245, 241, 232, 0.13);
  --border-strong: rgba(196, 154, 91, 0.36);
  --bevel-top: rgba(245, 241, 232, 0.07);
  --primary: hsl(183, 49%, 45%);
  --primary-hover: hsl(183, 52%, 52%);
  --primary-soft: rgba(56, 156, 162, 0.18);
  --copper: hsl(36, 46%, 56%);
  --copper-hover: hsl(36, 54%, 63%);
  --copper-soft: rgba(196, 154, 91, 0.18);
  --brass-surface: rgba(196, 154, 91, 0.13);
  --brass-border: rgba(196, 154, 91, 0.40);
  --brass-ink: hsl(38, 66%, 80%);
  --shadow-xs: inset 0 1px 0 var(--bevel-top), 0 2px 5px rgba(4, 9, 15, 0.36);
  --shadow: inset 0 1px 0 var(--bevel-top), 0 14px 32px -8px rgba(4, 9, 15, 0.52), 0 3px 8px rgba(4, 9, 15, 0.34);
  --shadow-hover: inset 0 1px 0 var(--bevel-top), 0 22px 46px -10px rgba(4, 9, 15, 0.68), 0 6px 14px rgba(4, 9, 15, 0.42);
  --focus-ring: 0 0 0 3px rgba(99, 197, 203, 0.30);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: light; scroll-behavior: smooth; }
body {
  position: relative;
  margin: 0;
  font: 15.5px/1.64 var(--font-sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 560px at 14% -6%, rgba(255, 252, 245, 0.80), transparent 62%),
    radial-gradient(900px 480px at 88% 4%, rgba(27, 94, 99, 0.05), transparent 60%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  transition: background-color 0.26s var(--ease-out), color 0.26s var(--ease-out);
}
body.mist-sanctuary-mode {
  background-image:
    radial-gradient(1100px 560px at 14% -6%, rgba(244, 252, 250, 0.88), transparent 64%),
    radial-gradient(900px 480px at 88% 4%, rgba(25, 102, 106, 0.08), transparent 60%);
}
body.night-canopy-mode {
  background-image:
    radial-gradient(1100px 560px at 14% -6%, rgba(56, 156, 162, 0.09), transparent 62%),
    radial-gradient(900px 480px at 88% 4%, rgba(196, 154, 91, 0.065), transparent 60%);
}

/* Subtle Archival Vellum Paper Grain (Zero Grid, Zero Interference) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.024;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
body.night-canopy-mode::before { opacity: 0.03; }

::selection {
  background: var(--primary-soft);
  color: var(--ink);
}

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.87em;
}
p code, li code, td code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-recessed);
  border: 1px solid var(--border);
  color: var(--ink);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ==========================================================================
   STICKY GLASS-LIMESTONE TOPBAR
   ========================================================================== */
header.topbar {
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  transition: box-shadow 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}
header.topbar.is-scrolled {
  box-shadow: 0 6px 22px -8px rgba(24, 34, 38, 0.10);
}
.container { max-width: 1280px; margin: 0 auto; padding: 0 28px; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; gap: 18px; flex-wrap: wrap; }

/* Consolidated Stationary Single-Colour ReSarAs Brand Mark (26px) + Canonical Wordmark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.015em;
  text-transform: none !important;
  font-variant: normal !important;
  font-style: normal;
  color: var(--ink);
  text-decoration: none;
  padding: 2px 4px 2px 0;
}
.rs-brand-exact {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.04em;
  letter-spacing: -0.015em;
  text-transform: none !important;
  font-variant: normal !important;
  font-style: normal;
}
.brand svg.rs-logo-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--ink);
  transition: transform 0.24s var(--ease-out);
}
.brand:hover svg.rs-logo-mark {
  transform: translateY(-1px);
}
body.night-canopy-mode .brand svg.rs-logo-mark {
  color: #c49a5b;
}
.brand span.brand-tagline {
  font-family: var(--font-sans);
  font-size: 0.77rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  padding-left: 11px;
  border-left: 1px solid var(--border-strong);
}

.nav-links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.nav-links a:not(.btn) {
  position: relative;
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 4px 2px;
  transition: color 0.16s var(--ease-out);
}
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s var(--ease-out);
}
.nav-links a:not(.btn):hover,
.nav-links a:not(.btn).is-current {
  color: var(--primary);
}
body.night-canopy-mode .nav-links a:not(.btn):hover,
body.night-canopy-mode .nav-links a:not(.btn).is-current {
  color: #dfc089;
}
.nav-links a:not(.btn):hover::after,
.nav-links a:not(.btn).is-current::after {
  transform: scaleX(1);
}

/* ==========================================================================
   TACTILE CAPSULE BUTTONS & SANCTUARY MOOD SWITCH (ONE UI + LEMONADE DNA)
   ========================================================================== */
.sanctuary-mood-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-recessed);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.mood-seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: 600 0.76rem/1 var(--font-sans);
  padding: 6px 11px;
  min-height: 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.16s var(--ease-out), color 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}
.mood-seg-btn:hover { color: var(--ink); }
.mood-seg-btn.active {
  background: var(--card-elevated);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(24, 34, 38, 0.11);
}
body.night-canopy-mode .mood-seg-btn.active {
  background: rgba(196, 154, 91, 0.22);
  color: #f8e9cd;
}
@media (max-width: 820px) {
  .sanctuary-mood-switch { display: none; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 43px;
  padding: 9px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s var(--ease-out), background-color 0.16s var(--ease-out), border-color 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
  font-size: 0.89rem;
  letter-spacing: -0.005em;
}
.btn:active {
  transform: scale(0.985);
}
.btn-primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 100%), var(--primary);
  color: #ffffff !important;
  border-color: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 14px -3px rgba(27, 94, 99, 0.28);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 8px 20px -4px rgba(27, 94, 99, 0.36);
}
.btn-play-white {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 100%), var(--copper) !important;
  color: #ffffff !important;
  border-color: var(--copper) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 5px 16px -3px rgba(154, 83, 37, 0.28);
}
body.night-canopy-mode .btn-play-white {
  color: #101b27 !important;
  font-weight: 700;
}
.btn-play-white:hover {
  background: var(--copper-hover) !important;
  border-color: var(--copper-hover) !important;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 9px 22px -4px rgba(154, 83, 37, 0.36);
}
.btn-outline {
  background: var(--card);
  color: var(--ink) !important;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
  background: var(--card-elevated);
  border-color: var(--primary);
  color: var(--primary) !important;
  transform: translateY(-1px);
}
body.night-canopy-mode .btn-outline:hover {
  border-color: var(--copper);
  color: #f0d5a6 !important;
}

.theme-toggle-btn {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--ink-secondary);
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s var(--ease-out), color 0.16s var(--ease-out), background-color 0.16s var(--ease-out);
}
.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ==========================================================================
   SETU STEPPING-STONES EDITORIAL SPLIT HERO + TRACEABLE SPECIMEN FOLIO
   ========================================================================== */
.hero {
  background-color: #efe9dc;
  background-image:
    linear-gradient(94deg, rgba(246, 242, 234, 0.98) 0%, rgba(246, 242, 234, 0.94) 52%, rgba(246, 242, 234, 0.56) 100%),
    url('/hero-backdrop.jpg');
  background-size: cover;
  background-position: center right;
  color: var(--ink);
  padding: 68px 0 60px;
  border-bottom: 1px solid var(--border);
}
body.mist-sanctuary-mode .hero {
  background-color: #e4eeec;
  background-image:
    linear-gradient(94deg, rgba(232, 242, 240, 0.98) 0%, rgba(232, 242, 240, 0.93) 54%, rgba(226, 239, 236, 0.62) 100%),
    url('/hero-backdrop.jpg');
}
body.night-canopy-mode .hero {
  background-color: #101b27;
  background-image:
    linear-gradient(94deg, #101b27 0%, rgba(16, 27, 39, 0.94) 54%, rgba(16, 27, 39, 0.68) 100%),
    url('/hero-backdrop.jpg');
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(330px, 0.92fr);
  gap: 34px;
  align-items: center;
}
@media (max-width: 980px) {
  .hero-split { grid-template-columns: 1fr; gap: 26px; }
}

.hero-kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--primary);
  margin-bottom: 12px;
}
body.night-canopy-mode .hero-kicker {
  color: #c49a5b;
}
.hero h1 {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: clamp(2.15rem, 3.6vw, 3.2rem);
  line-height: 1.09;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  max-width: 780px;
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
}
.hero p {
  font-size: 1.02rem;
  color: var(--ink-secondary);
  max-width: 680px;
  margin: 0 0 26px;
  line-height: 1.65;
  text-wrap: pretty;
}

.hero-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(24, 34, 38, 0.11);
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}
body.night-canopy-mode .hero-trust-strip {
  border-top-color: rgba(245, 241, 232, 0.14);
}
.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hero-trust-mark {
  color: var(--primary);
  font-weight: 800;
}
body.night-canopy-mode .hero-trust-mark {
  color: #c49a5b;
}

/* Interactive Traceable Evidence Specimen Folio (One UI 22px Concentric Squircle) */
.specimen-folio {
  background: rgba(252, 250, 246, 0.94);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 22px 24px;
  box-shadow: var(--shadow-hover);
}
body.mist-sanctuary-mode .specimen-folio {
  background: rgba(248, 253, 252, 0.94);
}
body.night-canopy-mode .specimen-folio {
  background: rgba(22, 36, 51, 0.92);
}
.folio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.folio-eyebrow {
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.folio-seal-tag {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(27, 94, 99, 0.22);
}
body.night-canopy-mode .folio-seal-tag {
  color: #99f6e4;
}
.folio-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-recessed);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.folio-tab {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 600 0.77rem/1.2 var(--font-sans);
  cursor: pointer;
  transition: background-color 0.16s var(--ease-out), color 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}
.folio-tab:hover {
  color: var(--ink);
}
.folio-tab.active {
  background: var(--card-elevated);
  color: var(--primary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
body.night-canopy-mode .folio-tab.active {
  color: #dfc089;
}
.folio-pane[hidden] { display: none; }
.folio-pane {
  animation: folioReveal 0.18s var(--ease-out);
}
@keyframes folioReveal {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.folio-title {
  font-family: var(--font-serif);
  font-size: 1.03rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.32;
}
.folio-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.81rem;
  font-variant-numeric: tabular-nums;
}
.folio-row:last-of-type {
  border-bottom: none;
}
.folio-row-k {
  color: var(--muted);
}
.folio-row-v {
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}
.folio-cite-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--brass-surface);
  border: 1px solid var(--brass-border);
  color: var(--brass-ink);
  margin-right: 5px;
}
.folio-hash-bar {
  margin-top: 12px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--surface-recessed);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.folio-hash-bar strong {
  color: var(--primary);
}
body.night-canopy-mode .folio-hash-bar strong {
  color: #99f6e4;
}

/* ==========================================================================
   UNIVERSITY & STATUTORY COMPATIBILITY RIBBON
   ========================================================================== */
.standards-ribbon {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.standards-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 22px;
  flex-wrap: wrap;
}
.standards-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.standards-tags {
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-secondary);
}
.standards-sep {
  color: var(--border-strong);
  user-select: none;
}

/* ==========================================================================
   EDITORIAL SECTIONS, GRIDS & ELEVATED CARDS
   ========================================================================== */
.section { padding: 64px 0; }
.section.alt-band {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-eyebrow {
  display: block;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}
body.night-canopy-mode .section-eyebrow {
  color: #c49a5b;
}
.section h2 {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: clamp(1.65rem, 2.5vw, 2.05rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--ink);
  font-weight: 600;
  text-wrap: balance;
}
.section-sub {
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 820px;
  font-size: 0.98rem;
  line-height: 1.62;
  text-wrap: pretty;
}

.grid-5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(226px, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); gap: 18px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 25px 26px;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: var(--card-elevated);
  box-shadow: var(--shadow-hover);
}
.card h3 {
  font-family: var(--font-serif);
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.28;
  letter-spacing: -0.012em;
  font-weight: 600;
}
.card p { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.58; }

.step-num {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(27, 94, 99, 0.20);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.69rem;
  letter-spacing: 0.055em;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
body.night-canopy-mode .step-num {
  color: #99f6e4;
  border-color: rgba(99, 197, 203, 0.28);
}

/* ==========================================================================
   5-STEP CLINICAL AI GOVERNANCE & BENCHMARK TABLE
   ========================================================================== */
.exec-checklist-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.exec-check-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.exec-check-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.exec-check-sq {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
body.night-canopy-mode .exec-check-sq {
  background: #c49a5b;
  color: #101b27;
}
.exec-check-card p {
  margin: 0;
  font-size: 0.91rem;
  color: var(--ink-secondary);
  line-height: 1.54;
}

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.54; }
th {
  background: var(--surface-recessed);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}
tbody tr:hover td {
  background: rgba(27, 94, 99, 0.025);
}
tr:last-child td { border-bottom: none; }
.win { color: var(--primary); font-weight: 600; background: var(--primary-soft); }
body.night-canopy-mode .win { color: #99f6e4; }

/* ==========================================================================
   PRICING, INTERACTIVE FEE-CAP ESTIMATOR & LEMONADE SPLIT-PAY BAR
   ========================================================================== */
.cap-guarantee-banner {
  background: var(--brass-surface);
  border: 1px solid var(--brass-border);
  border-radius: 18px;
  padding: 16px 22px;
  margin-bottom: 18px;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.58;
  box-shadow: var(--shadow-xs);
}

.fee-estimator-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: 18px 20px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
@media (max-width: 860px) {
  .fee-estimator-bar { grid-template-columns: 1fr; }
}
.fee-est-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.fee-est-field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}
.fee-est-field select,
.fee-est-field input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}
.fee-est-field input[type="range"] {
  height: 8px;
  border-radius: 999px;
  cursor: pointer;
}
.fee-est-field select {
  min-height: 40px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font: 600 0.85rem/1.3 var(--font-sans);
}
.fee-est-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 15px 18px;
  border-radius: 16px;
  background: var(--surface-recessed);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.fee-est-num {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}
.fee-est-sub {
  font-size: 0.77rem;
  color: var(--muted);
  margin-top: 3px;
}

/* Lemonade-Inspired Visual 2-Stage Split-Pay Breakdown Bar */
.split-pay-pill-bar {
  grid-column: 1 / -1;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.split-pay-track {
  display: flex;
  width: 100%;
  height: 30px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-recessed);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 2px rgba(24, 34, 38, 0.06);
}
.split-seg-s1,
.split-seg-s2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: width 0.28s var(--ease-out);
  font-variant-numeric: tabular-nums;
}
.split-seg-s1 {
  background: var(--primary);
  color: #ffffff;
  padding: 0 12px;
}
body.night-canopy-mode .split-seg-s1 {
  color: #09141d;
}
.split-seg-s2 {
  background: var(--copper-soft);
  color: var(--copper);
  padding: 0 12px;
}
body.night-canopy-mode .split-seg-s2 {
  color: #f6dcb2;
}
.split-pay-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.79rem;
  color: var(--muted);
}
.split-pay-caption strong {
  color: var(--ink);
}
.split-zero-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(27, 94, 99, 0.22);
}
body.night-canopy-mode .split-zero-pill {
  color: #99f6e4;
}

.price-card { display: flex; flex-direction: column; justify-content: space-between; }
.price-tag {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 8px 0;
  font-variant-numeric: tabular-nums;
}
.price-card ul { padding-left: 18px; margin: 12px 0 22px; color: var(--muted); font-size: 0.885rem; line-height: 1.52; }
.price-card li { margin: 7px 0; }
.featured {
  background: var(--card-elevated);
  border: 1.5px solid var(--copper);
  border-radius: 24px;
  position: relative;
  box-shadow: var(--shadow-hover);
}
.featured-pill {
  position: absolute;
  top: -12px;
  right: 18px;
  background: var(--copper);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  padding: 3px 12px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(154, 83, 37, 0.24);
}
body.night-canopy-mode .featured-pill {
  color: #101b27;
}

/* ==========================================================================
   CTA BAND, FOOTER, LEGAL CHARTER & CHECKOUT MODAL
   ========================================================================== */
.cta-band {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  color: var(--ink);
  padding: 64px 0;
  text-align: center;
}
.cta-band h2 {
  font-family: var(--font-serif);
  color: var(--ink);
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 2.6vw, 2.15rem);
  letter-spacing: -0.02em;
}
footer {
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
footer a { color: var(--primary); font-weight: 700; text-underline-offset: 2px; }
body.night-canopy-mode footer a { color: #dfc089; }

/* Editorial Charter Styling for /tos */
.tos-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.tos-pill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  box-shadow: var(--shadow-xs);
}
.tos-pill-card strong {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 3px;
}
body.night-canopy-mode .tos-pill-card strong { color: #c49a5b; }
.tos-pill-card span {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}
.tos-article {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.tos-article:first-child { padding-top: 0; }
.tos-article:last-child { border-bottom: none; padding-bottom: 0; }

dialog.checkout-modal {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 28px 32px;
  max-width: 650px;
  width: 92vw;
  box-shadow: 0 30px 70px -12px rgba(10, 18, 24, 0.34);
}
dialog.checkout-modal::backdrop {
  background: rgba(16, 27, 39, 0.56);
  backdrop-filter: blur(6px);
}
dialog.checkout-modal label {
  display: block;
  margin: 11px 0;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--ink-secondary);
}
dialog.checkout-modal input,
dialog.checkout-modal select {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  margin-top: 5px;
  transition: border-color 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .brand span.brand-tagline { display: none; }
  .hero { padding: 44px 0 42px; }
  .section { padding: 46px 0; }
  dialog.checkout-modal { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
