/* =========================================================================
   COMPAYTENCE SUBSCRIPTION PLAYBOOK DESIGN SYSTEM
   ========================================================================= */

/* Google Fonts loaded via <link> in index.html head for performance */

:root {
  /* ── Theme-flip primitives (overridden in html.light) ── */
  --ov: 255, 255, 255;     /* overlay tint: white on dark surfaces */
  --srf: 13, 18, 30;       /* raised dark-surface tint (panels, headers, consoles) */
  --ink: #f4f5f7;          /* strong heading text */

  /* Branding Color Palette — Compaytence */
  --bg-space: #0b0f1a;
  --bg-core: #11162a;
  --bg-panel: rgba(var(--srf), 0.45);
  --bg-panel-hover: rgba(18, 28, 54, 0.6);
  --bg-card: rgba(var(--srf), 0.6);
  
  --border-glass: rgba(var(--ov), 0.06);
  --border-glass-bright: rgba(var(--ov), 0.12);
  
  /* New semantic border tokens */
  --border-subtle: rgba(var(--ov), 0.06);
  --border-muted: rgba(var(--ov), 0.1);
  --border-accent: rgba(59, 130, 246, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Brand Accents */
  --accent-cyan: #3b82f6;
  --accent-cyan-glow: rgba(59, 130, 246, 0.25);
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.3);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.25);
  --accent-magenta: #d946ef;
  --accent-magenta-glow: rgba(217, 70, 239, 0.2);
  
  /* Alerts & Checkboxes */
  --color-danger: #ef4444;
  --color-danger-glow: rgba(239, 68, 68, 0.2);
  --color-success: #10b981;
  --color-success-glow: rgba(16, 185, 129, 0.2);
  --color-warning: #f59e0b;
  
  /* Fonts — Compaytence: Geist (UI) + Instrument Serif (display) + Geist Mono (labels) */
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-heading: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;

  /* ── Spacing Scale (multiples of 4px) ── */
  --space-1: 0.25rem;   /* 4px  */
  --space-2: 0.5rem;    /* 8px  */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */

  /* ── Type Scale ── */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */

  /* ── Radius Scale ── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

/* =========================================================================
   RESET & SCROLLBAR
   ========================================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-space);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-space);
}
::-webkit-scrollbar-thumb {
  background: var(--border-glass-bright);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* =========================================================================
   BACKGROUND GRAPHICS (GLOW ORBS & GRID)
   ========================================================================= */
.bg-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.grid-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(var(--ov), 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--ov), 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.8;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.14;
  mix-blend-mode: screen;
}

.orb-top-left {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
  top: -200px;
  left: -200px;
  animation: floatOrb 18s infinite alternate ease-in-out;
}

.orb-mid-right {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
  top: 30%;
  right: -250px;
  animation: floatOrb 25s infinite alternate-reverse ease-in-out;
}

.orb-bottom-left {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  bottom: -150px;
  left: 10%;
  animation: floatOrb 22s infinite alternate ease-in-out 2s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.05); }
  100% { transform: translate(-20px, 30px) scale(0.95); }
}

/* =========================================================================
   APPLICATION LAYOUT
   ========================================================================= */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 320px;
  background: rgba(var(--srf), 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.sidebar-logo {
  height: 15px;
  object-fit: contain;
  align-self: flex-start;
}

.sidebar-brand-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

/* Sidebar Navigation */
.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 1.5rem;
}

.nav-scroll::-webkit-scrollbar {
  width: 4px;
}
.nav-scroll::-webkit-scrollbar-thumb {
  background: rgba(var(--ov),0.05);
  border-radius: 2px;
}
.nav-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

.nav-title,
.nav-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 1rem;
  font-weight: 700;
}

.nav-eyebrow {
  padding: 0 0.25rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ── Sidebar accordion: always-visible module list that expands to sections ── */
.nav-module + .nav-module {
  margin-top: 0.15rem;
}

.nav-module-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-left-color 0.15s ease;
}

.nav-module-header:hover {
  color: var(--text-primary);
  background: rgba(var(--ov), 0.03);
}

.nav-mod-icon {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.nav-mod-name {
  flex: 1;
}

.nav-mod-chevron {
  font-size: 0.7rem;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.3s ease, color 0.15s ease;
}

.nav-module.active > .nav-module-header {
  color: var(--ink);
  font-weight: 600;
  background: rgba(59, 130, 246, 0.06);
  border-left-color: var(--accent-cyan);
}

.nav-module.active > .nav-module-header .nav-mod-chevron {
  transform: rotate(180deg);
  color: var(--accent-cyan);
}

/* Expand/collapse animated via grid-template-rows (0fr → 1fr = auto height) */
.nav-module-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.nav-module.active > .nav-module-body {
  grid-template-rows: 1fr;
}

.nav-module-body > .nav-list {
  overflow: hidden;
  min-height: 0;
  padding-left: 0.6rem;
}

/* Breathing room below the open section list, without leaking height when closed */
.nav-module.active > .nav-module-body > .nav-list {
  padding-bottom: 0.5rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color 0.15s ease, border-left-color 0.15s ease, background 0.15s ease;
  border: none;
  border-left: 3px solid transparent;
}

.nav-item a:hover {
  color: var(--text-primary);
  background: rgba(var(--ov),0.03);
}

.nav-item.active a {
  border-left-color: var(--accent-cyan);
  color: var(--ink);
  font-weight: 600;
  background: rgba(59, 130, 246, 0.04);
}

.nav-num {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  color: var(--accent-cyan);
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.nav-item.active .nav-num {
  background: var(--accent-cyan);
  color: var(--bg-space);
}

/* Sidebar Footer Compliance Ring */
/* Brand-audit entry point — always a glowing blue gradient CTA so it reads as
   a clear button, not part of the dark rail. */
.compliance-ring-container {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: auto;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  animation: complianceGlow 3s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Pulsing glow via drop-shadow so it never conflicts with the state box-shadows
   (and degrades to a subtle static glow under prefers-reduced-motion). */
@keyframes complianceGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.45)); }
  50%      { filter: drop-shadow(0 0 13px rgba(59, 130, 246, 0.85)); }
}

.compliance-ring-container:hover {
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.6);
  transform: translateY(-2px);
}

/* Current page: bright inner ring marks "you are here" */
.compliance-ring-container.active {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), 0 10px 30px rgba(37, 99, 235, 0.7);
}

/* Ring + label tuned for the blue button surface */
.compliance-ring-container .ring-bg { stroke: rgba(255, 255, 255, 0.25); }
.compliance-ring-container .ring-fill { stroke: #ffffff; }
.compliance-ring-container .ring-text { color: #ffffff; }

.ring-cta {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  color: #ffffff;
}

.ring-visual {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

.ring-svg {
  transform: rotate(-90deg);
  width: 54px;
  height: 54px;
}

.ring-bg {
  fill: none;
  stroke: rgba(var(--ov), 0.05);
  stroke-width: 4.5;
}

.ring-fill {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 141.37; /* 2 * PI * r (r=22.5) */
  stroke-dashoffset: 141.37;
  transition: stroke-dashoffset 0.6s ease-in-out;
}

.ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ring-info {
  display: flex;
  flex-direction: column;
}

.ring-info .title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ring-info .desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Main Content Styling */
.main-wrapper {
  margin-left: 320px;
  margin-right: auto;
  flex: 1;
  padding: 3rem 4rem 7rem;
  max-width: 1200px;
  width: 100%;
  position: relative;
  z-index: 10;
}

/* =========================================================================
   COMPOSITIONAL SHEETS & CARD DESIGN
   ========================================================================= */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), inset 0 0 20px rgba(var(--ov),0.02);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--ov), 0.15), transparent);
}

.glass-card {
  background: rgba(var(--srf), 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(var(--ov),0.07);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--ov), 0.08), transparent);
}

.glass-card:hover {
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Breathing room between a card's title and its body copy
   (h4 titles otherwise sit flush on the text via the global margin reset) */
.glass-card > h4 {
  margin-bottom: 0.75rem;
}

/* Accent borders for cards */
.border-cyan { border-left: 3px solid var(--accent-cyan); }
.border-blue { border-left: 3px solid var(--accent-blue); }
.border-purple { border-left: 3px solid var(--accent-purple); }
.border-danger { border-left: 3px solid var(--color-danger); }
.border-success { border-left: 3px solid var(--color-success); }

/* =========================================================================
   TYPOGRAPHY
   ========================================================================= */
h1 {
  font-family: var(--font-display);
  font-size: 3.9rem;
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
  color: var(--ink);
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 750px;
  margin-top: 1.25rem;
}

/* Document Title Header */
.doc-header {
  border-bottom: 1px solid var(--border-glass-bright);
  padding-bottom: 2.5rem;
  margin-bottom: 3rem;
  position: relative;
}

.doc-logo-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.doc-logo {
  height: 44px;
  object-fit: contain;
}

.doc-classification {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.08);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Playbook Sections Styling */
.playbook-section {
  padding-top: 4rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(var(--ov), 0.03);
  /* Native anchor jumps (sidebar nav links) land below the fixed mobile header
     and match switchModule()'s 120px scroll offset. */
  scroll-margin-top: 120px;
}

.playbook-section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.section-num {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-num::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.25) 0%, transparent 100%);
  margin-left: 1rem;
}

h2.section-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 1.5rem;
}

.section-intro {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

h3.subsection-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin: 2.25rem 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

h3.subsection-title i {
  color: var(--accent-blue);
  font-size: 1.1rem;
}

/* Common List items */
p.body-text {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

ul.text-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

ul.text-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
}

ul.text-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-blue);
  font-weight: bold;
}

/* =========================================================================
   COMPONENTS
   ========================================================================= */

/* What's Covered Index */
.toc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}

.toc-card {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  background: rgba(var(--ov),0.015);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.toc-card:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246,0.02) 100%);
  border-color: rgba(59,130,246,0.3);
  transform: translateY(-2px);
}

.toc-num {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(59, 130, 246, 0.08);
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.toc-card:hover .toc-num {
  background: var(--accent-cyan);
  color: var(--bg-space);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

/* Brand Audit — set apart from the normal modules (darker fill + blue outline) */
.toc-card-audit {
  background: rgba(var(--ov), 0.045);
  border-color: rgba(59, 130, 246, 0.4);
}
.toc-card-audit .toc-num {
  background: rgba(59, 130, 246, 0.16);
}

.toc-meta h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.toc-meta p {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Alert Boxes — Left-border pattern, minimal backgrounds */
.alert-box {
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  /* Remove top-line pseudo — no ::before */
}

.alert-box i {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-content h4 {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alert-content p {
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* Danger Box */
.alert-danger {
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.12);
  border-left: 3px solid var(--color-danger);
}
.alert-danger i, .alert-danger h4 {
  color: var(--color-danger);
}
.alert-danger p {
  color: #fca5a5;
}

/* Success/Bulletproof Box */
.alert-success {
  background: rgba(59, 130, 246, 0.03);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--accent-cyan);
}
.alert-success i, .alert-success h4 {
  color: var(--accent-cyan);
}
.alert-success p {
  color: #c7d2fe;
}

/* Warning/Tip Box */
.alert-warning {
  background: rgba(245, 158, 11, 0.03);
  border: 1px solid rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--color-warning);
}
.alert-warning i, .alert-warning h4 {
  color: var(--color-warning);
}
.alert-warning p {
  color: #fde68a;
}

/* Side-by-Side Transition Path Cards */
.path-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.75rem 0;
}

.path-card {
  background: rgba(var(--ov), 0.015);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.path-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--ov),0.06), transparent);
}

.path-card:hover {
  background: rgba(59, 130, 246, 0.03);
  border-color: rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
}

.path-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.path-badge {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.path-card:hover .path-badge {
  background: var(--accent-blue);
  color: var(--ink);
  box-shadow: 0 0 10px var(--accent-blue-glow);
}

.path-card h4 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.path-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* Compliance Comparison Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border-glass);
  margin: 2rem 0;
  background: rgba(var(--srf), 0.4);
  backdrop-filter: blur(10px);
}

.compliance-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.925rem;
}

.compliance-table th {
  background: rgba(var(--srf), 0.8);
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--ink);
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-glass-bright);
  letter-spacing: 0.5px;
}

.compliance-table td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(var(--ov), 0.03);
  vertical-align: middle;
  line-height: 1.5;
}

.compliance-table tr:last-child td {
  border-bottom: none;
}

/* Row states */
.kill-claim {
  color: #fda4af;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kill-claim i {
  color: var(--color-danger);
  font-size: 1.1rem;
}

.kill-claim span {
  text-decoration: line-through;
  opacity: 0.75;
}

.safe-claim {
  color: #a5f3fc;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.safe-claim i {
  color: var(--accent-cyan);
  font-size: 1.1rem;
  text-shadow: 0 0 8px var(--accent-cyan-glow);
}

/* Live Email Mockup */
.email-mockup-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 2rem 0;
}

.email-mockup {
  background: #0b0f19;
  border: 1px solid var(--border-glass-bright);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}

.email-header {
  background: #111827;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.email-window-controls {
  display: flex;
  gap: 6px;
}

.email-dot-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(var(--ov),0.15);
}
.email-dot-btn.red { background: #ef4444; }
.email-dot-btn.yellow { background: #f59e0b; }
.email-dot-btn.green { background: #10b981; }

.email-badge {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.email-meta-details {
  background: rgba(var(--ov),0.01);
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(var(--ov),0.03);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.email-meta-row {
  margin-bottom: 0.35rem;
}
.email-meta-row:last-child {
  margin-bottom: 0;
}

.email-meta-row strong {
  color: var(--text-secondary);
}

.email-body {
  padding: 1.5rem;
  background: #080c14;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.55;
  flex: 1;
}

.email-logo-holder {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(var(--ov),0.03);
  overflow: hidden;
}

.email-logo-holder img {
  height: 22px;
  max-width: 120px;
  width: auto;
  object-fit: contain;
  opacity: 0.8;
  flex-shrink: 0;
}

/* The logo is white; in light mode the email body is also white, which makes it
   invisible. A tight dark drop-shadow outlines it so it stays legible. */
html.light .email-logo-holder img {
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.55)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
  opacity: 1;
}

/* Risk/compliance status badges on the comparison subcards are absolutely
   positioned top-right via inline styles, so on narrow breakpoints they overlap
   the card title. Reflow them into normal flow as a pill above the heading so
   they never collide, at any width. */
.visual-subcard > span[style*="position: absolute"] {
  position: static !important;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.email-greetings {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.email-details-box {
  background: rgba(var(--ov),0.02);
  border: 1px solid rgba(var(--ov),0.05);
  border-radius: 8px;
  padding: 1rem;
  margin: 1.25rem 0;
}

.email-details-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}
.email-details-row:last-child {
  margin-bottom: 0;
}

.email-details-row span {
  color: var(--text-muted);
}
.email-details-row strong {
  color: var(--ink);
}

.email-cta-btn {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem;
  border-radius: 6px;
  margin: 1.5rem 0;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(var(--ov),0.08);
}

.email-cta-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.email-footer-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.5;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(var(--ov),0.03);
}

.email-footer-note a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 500;
}

.email-footer-note a:hover {
  text-decoration: underline;
}

/* Dispute/Chargeback Alert Widget Visualizer */
.dispute-widget-container {
  display: flex;
  gap: 1.5rem;
  margin: 2rem 0;
}

.dispute-metric-card {
  flex: 1;
  background: rgba(var(--ov),0.015);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.dispute-metric-card:hover {
  transform: translateY(-3px);
}

.dispute-metric-num {
  transition: transform 0.22s ease, text-shadow 0.22s ease;
}

.dispute-metric-card:hover .dispute-metric-num {
  transform: scale(1.05);
}

.dispute-metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
}

.dispute-metric-num {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dispute-metric-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.dispute-metric-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Card variants */
.metric-danger {
  border-top: 3px solid var(--color-danger);
}
.metric-danger .dispute-metric-num {
  color: var(--color-danger);
  text-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}
.metric-danger .dispute-metric-label {
  color: #fca5a5;
}

.metric-success {
  border-top: 3px solid var(--color-success);
}
.metric-success .dispute-metric-num {
  color: var(--color-success);
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}
.metric-success .dispute-metric-label {
  color: #a7f3d0;
}

.metric-reduction {
  border-top: 3px solid var(--accent-cyan);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.02) 0%, rgba(var(--ov),0) 100%);
}
.metric-reduction .dispute-metric-num {
  color: var(--accent-cyan);
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}
.metric-reduction .dispute-metric-label {
  color: #c7d2fe;
}

/* Hover: lift each metric card and glow in its own status color */
.metric-danger:hover {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 12px 30px rgba(239, 68, 68, 0.16);
}
.metric-danger:hover .dispute-metric-num {
  text-shadow: 0 0 24px rgba(239, 68, 68, 0.45);
}
.metric-success:hover {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.16);
}
.metric-success:hover .dispute-metric-num {
  text-shadow: 0 0 24px rgba(16, 185, 129, 0.45);
}
.metric-reduction:hover {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.18);
}
.metric-reduction:hover .dispute-metric-num {
  text-shadow: 0 0 24px rgba(59, 130, 246, 0.45);
}

/* =========================================================================
   COMPOSITIONAL AUDIT CHECKLIST (INTERACTIVE SECTION)
   ========================================================================= */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.checklist-dashboard {
  background: linear-gradient(135deg, rgba(var(--srf), 0.5) 0%, rgba(var(--srf), 0.8) 100%);
  border: 1px solid var(--border-glass-bright);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.dashboard-score-ring {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.dashboard-svg {
  transform: rotate(-90deg);
  width: 100px;
  height: 100px;
}

.dashboard-ring-bg {
  fill: none;
  stroke: rgba(var(--ov), 0.03);
  stroke-width: 8;
}

.dashboard-ring-fill {
  fill: none;
  stroke: url(#cyan-blue-grad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 276.46; /* 2 * PI * r (r=44) */
  stroke-dashoffset: 276.46;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dashboard-pct {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.dashboard-lbl {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.dashboard-info h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.dashboard-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Checklist Filter categories */
.checklist-filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(var(--ov), 0.02);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.filter-btn:hover {
  background: var(--bg-panel-hover);
  color: var(--ink);
  border-color: rgba(var(--ov), 0.15);
}

.filter-btn.active {
  background: var(--accent-blue);
  color: var(--ink);
  border-color: var(--accent-blue);
  box-shadow: 0 4px 15px var(--accent-blue-glow);
}

/* Actual items */
.checklist-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.checklist-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(var(--ov),0.05);
  border-radius: 0;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.checklist-item:first-child {
  border-top: 1px solid rgba(var(--ov),0.05);
}

.checklist-item:hover {
  background: rgba(var(--ov), 0.02);
}

.checklist-checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(var(--ov),0.15);
  background: transparent;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  margin-top: 2px;
}

.checklist-checkbox-container i {
  font-size: 0.65rem;
  color: var(--bg-space);
  opacity: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
  transform: scale(0.6);
}

.checklist-item.checked .checklist-checkbox-container {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(59, 130, 246,0.3);
}

.checklist-item.checked .checklist-checkbox-container i {
  opacity: 1;
  transform: scale(1);
}

.checklist-details {
  flex: 1;
}

.checklist-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.checklist-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  transition: color 0.15s ease, opacity 0.15s ease;
}

.checklist-item.checked .checklist-label {
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.75;
}

.checklist-category-tag {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Category Tag Colors */
.tag-payment {
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.tag-website {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.tag-enrollment {
  background: rgba(139, 92, 246, 0.1);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.2);
}
.tag-emails {
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.tag-support {
  background: rgba(217, 70, 239, 0.1);
  color: #f472b6;
  border: 1px solid rgba(217, 70, 239, 0.2);
}
.tag-authrates {
  background: rgba(6, 182, 212, 0.1);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.2);
}
.tag-entity {
  background: rgba(251, 146, 60, 0.1);
  color: #fdba74;
  border: 1px solid rgba(251, 146, 60, 0.2);
}
.tag-checkout {
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.tag-chargebacks {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.tag-marketing {
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.tag-tokens {
  background: rgba(139, 92, 246, 0.1);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.2);
}
.tag-operations {
  background: rgba(217, 70, 239, 0.1);
  color: #f0abfc;
  border: 1px solid rgba(217, 70, 239, 0.2);
}

.checklist-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  transition: all 0.2s ease;
}

.checklist-item.checked .checklist-desc {
  opacity: 0.5;
}

/* Mobile Sidebar Trigger */
.mobile-header {
  display: none;
  background: rgba(var(--srf), 0.9);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border-glass);
  padding: 1rem 1.5rem;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 101;
  justify-content: space-between;
  align-items: center;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
}

/* =========================================================================
   RESPONSIVENESS & MEDIA QUERIES
   ========================================================================= */
/* =========================================================================
   RESPONSIVE: 1024px (Tablet Landscape)
   ========================================================================= */
@media (max-width: 1024px) {
  .main-wrapper {
    padding: 3rem 2rem;
  }

  .path-container,
  .email-mockup-wrapper,
  .dispute-widget-container {
    grid-template-columns: 1fr;
  }

  .email-mockup-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================================================
   RESPONSIVE: 768px (Tablet Portrait / Large Phone)
   ========================================================================= */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-320px);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-header {
    display: flex;
  }

  .main-wrapper {
    margin-left: 0;
    padding: 6rem 1.25rem 6rem;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2.section-title {
    font-size: 1.6rem;
  }

  .glass-panel {
    padding: 1.5rem;
    border-radius: 14px;
  }

  .playbook-section {
    padding: 2rem 0;
  }

  /* Module tab bar: scrollable row on mobile */
  .module-tab-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    top: 56px; /* below mobile header */
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    gap: 0.2rem;
  }
  .module-tab-bar::-webkit-scrollbar { display: none; }

  .modules-header-label {
    display: none; /* hide on small screens to save space */
  }

  /* Module tab: icon-only always on mobile */
  .module-tab .tab-label {
    display: none !important;
  }
  .module-tab {
    padding: 0.5rem 0.7rem;
  }
  .module-tab.active {
    padding: 0.5rem 0.7rem;
  }

  /* Next module button: full width on mobile */
  .next-module-bar {
    justify-content: stretch;
  }
  .next-module-btn {
    width: 100%;
    justify-content: space-between;
  }

  /* TOC grid single column */
  .toc-grid {
    grid-template-columns: 1fr;
  }

  /* Tables: allow horizontal scroll */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .compliance-table {
    min-width: 480px;
  }

  /* Email mockups: single column */
  .email-mockup-wrapper {
    grid-template-columns: 1fr;
  }

  /* Visual mockup subcards stack */
  .visual-mockup-card > div {
    grid-template-columns: 1fr !important;
  }

  /* Path container */
  .path-container {
    grid-template-columns: 1fr;
  }

  /* RYZE objection box */
  .ryze-objection-box {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Checklist dashboard */
  .checklist-dashboard {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    align-items: center;
  }

  /* Checklist filter buttons */
  .checklist-filters {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* Sidebar overlay */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
  }
  .sidebar-overlay.open {
    display: block;
  }

  /* Checkout screen: single column */
  .checkout-grid-layout {
    grid-template-columns: 1fr !important;
  }

  /* Term bubbles wrap nicely */
  .checkout-bubbles-demo {
    gap: 0.6rem;
  }
  .checkout-bubble {
    min-width: 120px;
  }

  /* Dispute metric widget */
  .dispute-widget-container {
    grid-template-columns: 1fr;
  }

  /* Alert boxes tighter padding */
  .alert-box {
    padding: 1rem;
    gap: 0.75rem;
  }

  /* Section number badge */
  .section-num {
    font-size: 3.5rem;
  }

  /* Tracking timeline: full width */
  .tracking-step-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* =========================================================================
   RESPONSIVE: 480px (Small Phone)
   ========================================================================= */
@media (max-width: 480px) {
  .main-wrapper {
    padding: 5.5rem 1rem 2.5rem;
  }

  h1 {
    font-size: 1.85rem;
    line-height: 1.2;
  }

  h2.section-title {
    font-size: 1.4rem;
  }

  h3.subsection-title {
    font-size: 1rem;
  }

  .glass-panel {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .section-num {
    font-size: 2.75rem;
  }

  /* RYZE console tabs wrap */
  .ryze-tabs-container {
    flex-wrap: nowrap;
  }
  .ryze-tab {
    font-size: 0.72rem;
    padding: 0.75rem 0.65rem;
    min-width: 90px;
  }

  /* Email logo even smaller on tiny screens */
  .email-logo-holder img {
    height: 18px;
    max-width: 90px;
  }

  /* Email body padding */
  .email-body {
    padding: 1rem;
  }

  /* Metric numbers in checklist ring */
  .ryze-metric-num {
    font-size: 1.2rem;
  }

  /* Next module button text */
  .next-name {
    font-size: 0.85rem;
  }

  /* TOC cards padding */
  .toc-card {
    padding: 0.9rem 1rem;
  }

  /* Filter buttons shrink */
  .filter-btn {
    font-size: 0.72rem;
    padding: 0.4rem 0.75rem;
  }

  /* Policy template summary text */
  .policy-template-details summary {
    font-size: 0.85rem;
    padding: 0.85rem 1rem;
  }

  /* Alert box icon shrink */
  .alert-box > i {
    font-size: 1.1rem;
    margin-top: 2px;
  }
}

/* =========================================================================
   ADDITIONS: CHECKOUT BUBBLES, DETAILS TEMPLATES, AND CALLOUTS
   ========================================================================= */

/* Collapsible Details Styles for Policy Templates */
details.policy-template-details {
  background: rgba(var(--ov), 0.01);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  margin: 1.5rem 0;
  overflow: hidden;
  transition: all 0.3s ease;
}
details.policy-template-details[open] {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(var(--srf), 0.2);
}
details.policy-template-details summary {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  outline: none;
}
details.policy-template-details summary::-webkit-details-marker {
  display: none;
}
details.policy-template-details summary::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  transition: transform 0.3s ease;
}
details.policy-template-details[open] summary::after {
  transform: rotate(180deg);
}
.policy-template-body {
  padding: 1.75rem;
  border-top: 1px solid var(--border-glass);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
  background: rgba(var(--srf), 0.4);
}

/* Checkout Term Bubbles */
.checkout-bubbles-demo {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.checkout-bubble {
  flex: 1;
  min-width: 140px;
  background: rgba(var(--ov), 0.015);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}
.checkout-bubble:hover {
  border-color: rgba(var(--ov), 0.15);
  background: rgba(var(--ov), 0.03);
}
.checkout-bubble.active {
  border-color: var(--accent-cyan);
  background: rgba(59, 130, 246, 0.04);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}
.checkout-bubble-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.checkout-bubble-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* General Brand Callout Details */
/* Booking CTAs are brand-forward: a blue-tinted glass panel with a glowing blue
   border and a persistent soft glow so they never blend into the page. Hover
   lifts the card and blooms the Compaytence-blue glow. */
.cta-callout {
  position: relative;
  background:
    radial-gradient(135% 130% at 0% 0%, color-mix(in srgb, var(--accent-blue) 14%, transparent) 0%, transparent 55%),
    var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--accent-blue) 34%, var(--border-glass));
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.16);
  transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.cta-callout:hover {
  border-color: color-mix(in srgb, var(--accent-blue) 62%, transparent);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.45), 0 16px 48px rgba(37, 99, 235, 0.42);
  transform: translateY(-3px);
}

/* The booking button carries a persistent, gently pulsing brand-blue glow so the
   eye lands on it; hover brightens and lifts. The static box-shadow remains under
   prefers-reduced-motion (which freezes the drop-shadow pulse at its first frame). */
.cta-callout .email-cta-btn {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.55);
  animation: ctaBtnGlow 2.8s ease-in-out infinite;
}
.cta-callout .email-cta-btn:hover {
  animation: none;
  filter: brightness(1.12) drop-shadow(0 0 16px rgba(59, 130, 246, 0.95));
  transform: translateY(-2px);
}
@keyframes ctaBtnGlow {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(59, 130, 246, 0.55)); }
  50%      { filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.95)); }
}

/* Processor-network proof strip (inside a cta-callout) */
.proc-network {
  margin: 0 0 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-glass);
}
.proc-network-count {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.proc-network-count strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0;
  color: var(--accent-blue);
  margin-right: 0.35rem;
  vertical-align: -0.05em;
}
.proc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.proc-chip {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.proc-chip--more {
  color: var(--accent-blue);
  border-color: color-mix(in srgb, var(--accent-blue) 35%, transparent);
  background: color-mix(in srgb, var(--accent-blue) 8%, transparent);
}

/* Interactive RYZE Case Study Console */
.ryze-console {
  background: linear-gradient(135deg, rgba(var(--srf), 0.6) 0%, rgba(var(--srf), 0.8) 100%);
  border: 1px solid var(--border-glass-bright);
  border-radius: 16px;
  margin: 2.25rem 0;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.ryze-console-header {
  background: rgba(var(--srf), 0.7);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ryze-console-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.ryze-console-title i {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px var(--accent-cyan-glow);
}

.ryze-console-subtitle {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  background: rgba(59, 130, 246,0.08);
  border: 1px solid rgba(59, 130, 246,0.2);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ryze-objection-box {
  padding: 1.5rem;
  background: rgba(239, 68, 68, 0.03);
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.9rem;
  line-height: 1.55;
  color: #fca5a5;
  display: flex;
  gap: 1rem;
}

.ryze-objection-box i {
  font-size: 1.35rem;
  color: var(--color-danger);
  margin-top: 2px;
}

.ryze-objection-text strong {
  color: var(--ink);
}

.ryze-tabs-container {
  display: flex;
  background: rgba(var(--srf), 0.4);
  border-bottom: 1px solid var(--border-glass);
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar for standard styling */
}

.ryze-tabs-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Webkit */
}

.ryze-tab {
  flex: 1;
  min-width: 130px;
  padding: 1rem 1.25rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  border-bottom: 3px solid transparent;
  text-align: center;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.ryze-tab:hover {
  background: rgba(var(--ov),0.02);
  color: var(--ink);
}

.ryze-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(59, 130, 246,0.02);
  text-shadow: 0 0 10px var(--accent-cyan-glow);
}

.ryze-content-panel {
  padding: 2rem;
  min-height: 200px;
  background: rgba(var(--srf), 0.3);
}

.ryze-panel {
  display: none;
  animation: ryzeFadeIn 0.4s ease forwards;
}

.ryze-panel.active {
  display: block;
}

@keyframes ryzeFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ryze-panel h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ryze-panel p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.ryze-visual-metric {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.ryze-metric {
  background: rgba(var(--ov),0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ryze-metric-num {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-cyan);
  text-shadow: 0 0 10px var(--accent-cyan-glow);
}

.ryze-metric-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =========================================================================
   MODULE TAB BAR & PANELS
   ========================================================================= */

.module-tab-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: rgba(var(--srf), 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.module-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.3px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-bottom-color 0.15s ease, padding 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.module-tab:hover {
  color: var(--text-primary);
}

.module-tab.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent-cyan);
  padding: 0.5rem 1rem;
}

.module-tab i {
  font-size: 0.75rem;
  color: var(--accent-cyan);
}

.module-panel {
  display: none;
}

.module-panel.active {
  display: block;
  animation: fadeInModule 0.3s ease;
}

@keyframes fadeInModule {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Sidebar nav lists live inside accordion groups; the group controls reveal.
   (The .active class on the list is still used by ScrollSpy.) */
.nav-module-body > .nav-list { display: flex; }

/* =========================================================================
   MODULE TAB — ICON ONLY + SLIDE LABEL
   ========================================================================= */

/* Tab label hidden by default — slides in when tab is active */
.module-tab .tab-label {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  vertical-align: middle;
  transition: max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin-left 0.32s ease;
  margin-left: 0;
}

.module-tab.active .tab-label {
  max-width: 180px;
  opacity: 1;
  margin-left: 0.3rem;
}

/* MODULES header label in tab bar */
.modules-header-label {
  display: flex;
  align-items: center;
  padding: 0 0.75rem 0 0.25rem;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  border-right: 1px solid rgba(var(--ov),0.08);
  margin-right: 0.5rem;
  flex-shrink: 0;
  white-space: nowrap;
  user-select: none;
}

/* =========================================================================
   NEXT MODULE NAVIGATION BUTTON
   ========================================================================= */

/* Old in-flow "next module" bars — superseded by the floating module nav
   (.module-floatnav). Kept hidden rather than deleted from each module panel. */
.next-module-bar {
  display: none;
}

.next-module-btn {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  background: rgba(var(--ov),0.03);
  border: 1px solid rgba(var(--ov),0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.next-module-btn:hover {
  border-color: var(--border-accent);
  transform: translateX(3px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.next-module-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.next-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.next-name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--ink);
}

.next-module-btn > i {
  font-size: 1rem;
  color: var(--accent-cyan);
  transition: transform 0.2s ease;
  /* No glow filter — clean icon */
}

/* =========================================================================
   FLOATING MODULE NAVIGATION
   Next floats bottom-right while reading; at the end of a module it slides
   to center and reveals a (dimmer) Previous button. JS sets --fn-shift.
   ========================================================================= */
.module-floatnav {
  position: fixed;
  bottom: 1.5rem;
  left: 320px;                                   /* clear the sidebar rail */
  width: min(1200px, calc(100vw - 320px));       /* mirror .main-wrapper box */
  padding: 0 4rem;
  z-index: 60;
  display: flex;
  justify-content: flex-end;                     /* rest: Next at bottom-right */
  pointer-events: none;                          /* clicks pass through gaps */
}

.fn-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
  transform: translateX(var(--fn-shift, 0px));
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.fn-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease,
              background 0.2s ease, border-color 0.2s ease;
}

.fn-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.fn-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
}

.fn-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
}

/* Next — the bright, prominent action */
.fn-next {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
  border: 1px solid transparent;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}
.fn-next .fn-label { color: rgba(255, 255, 255, 0.85); }
.fn-next .fn-name { color: #fff; }
.fn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45);
}

/* Previous — present but deliberately dimmer; absolutely placed so it never
   changes the measured width of the group (keeps the slide math stable) */
.fn-prev {
  position: absolute;
  right: calc(100% + 0.6rem);
  top: 0;
  background: rgba(var(--srf), 0.92);
  border: 1px solid var(--border-glass-bright);
  color: var(--text-secondary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  text-align: right;
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
}
.fn-prev .fn-text { align-items: flex-start; }
.fn-prev .fn-label { color: var(--text-dim); }
.fn-prev .fn-name { color: var(--text-secondary); font-size: 0.85rem; }
.fn-prev:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  color: var(--ink);
}

/* Revealed only at the end of the module */
.module-floatnav.at-end .fn-prev:not(.fn-hidden) {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Last module (no Next): the Back button is the only control, so take it out of
   absolute positioning and center it in normal flow. This stops the group from
   collapsing to 0 height and pushing the button below the viewport. */
.module-floatnav.only-prev { justify-content: center; }
.module-floatnav.only-prev .fn-group { transform: none !important; }
.module-floatnav.only-prev .fn-prev {
  position: static;
  transform: none;
  text-align: left;
}

.fn-hidden { display: none !important; }

/* Floating nav spans full width once the sidebar collapses to a drawer.
   Placed after the base rule so it wins the cascade at <=768px. */
@media (max-width: 768px) {
  .module-floatnav {
    left: 0;
    width: 100vw;
    padding: 0 1rem;
  }
  .fn-btn { padding: 0.6rem 1rem; }
  .fn-next .fn-name { font-size: 0.85rem; }
}

/* =========================================================================
   AFFILIATE / PARTNER LINKS
   ========================================================================= */
.partner-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-decoration: none;
  transition: gap 0.2s ease, color 0.15s ease;
}
.partner-link:hover { color: var(--ink); gap: 0.6rem; }
.partner-link i { font-size: 0.68rem; }

.aff-inline {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font-weight: 600;
  transition: color 0.15s ease;
}
.aff-inline:hover { color: var(--ink); }

/* =========================================================================
   POLICY TEMPLATES (DETAILS / SUMMARY ACCORDION)
   ========================================================================= */

.policy-template-details {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.policy-template-details[open] {
  border-color: rgba(59, 130, 246, 0.25);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.policy-template-details summary {
  list-style: none;
  padding: 1rem 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  border-radius: 12px;
  transition: background 0.2s ease;
}

.policy-template-details summary::-webkit-details-marker { display: none; }

.policy-template-details summary::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.policy-template-details[open] summary::after {
  transform: rotate(180deg);
}

.policy-template-details summary:hover {
  background: var(--bg-panel-hover);
}

.policy-template-details summary span {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.policy-template-details summary i {
  font-size: 1rem;
}

.policy-template-body {
  padding: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border-glass);
}

/* =========================================================================
   VERSION BADGE
   ========================================================================= */
.version-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: 0.3px;
}

.version-badge i {
  font-size: 0.65rem;
}

.version-badge-scope {
  background: rgba(var(--ov), 0.03);
  border-color: rgba(var(--ov), 0.1);
  color: var(--text-muted);
}

/* =========================================================================
   RESET AUDIT BUTTON
   ========================================================================= */
.reset-audit-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  color: rgba(239, 68, 68, 0.7);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-audit-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

/* =========================================================================
   AUDIT RESULTS CARD
   ========================================================================= */
.audit-results-card {
  margin-top: 2.5rem;
  padding: 2rem;
  border: 1px solid var(--border-glass);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.audit-results-card.audit-critical {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.08);
}
.audit-results-card.audit-moderate {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.08);
}
.audit-results-card.audit-good {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.08);
}

.audit-results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.audit-results-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.4rem;
}

.audit-results-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.audit-score-badge {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-cyan);
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 0.5rem 1.1rem;
  min-width: 80px;
  text-align: center;
}

.audit-risk-bar-wrap {
  margin-bottom: 1.75rem;
}

.audit-risk-bar {
  height: 8px;
  background: rgba(var(--ov), 0.06);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.audit-risk-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.audit-risk-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-dim);
  font-family: var(--font-body);
  letter-spacing: 0.3px;
}

.audit-gaps-section {
  margin-bottom: 1.75rem;
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.audit-gaps-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fca5a5;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audit-gaps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.audit-gaps-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(var(--ov), 0.04);
}

.audit-gaps-list li:last-child {
  border-bottom: none;
}

.gap-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  white-space: nowrap;
  flex-shrink: 0;
}

.gap-more {
  font-size: 0.75rem !important;
  color: var(--text-dim) !important;
  font-style: italic;
}

.audit-cta-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-glass);
  flex-wrap: wrap;
}

.audit-cta-copy {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  min-width: 200px;
}

.audit-cta-copy strong {
  color: var(--ink);
}

.audit-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.audit-cta-btn:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.25) 100%);
  border-color: rgba(59, 130, 246, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
  animation: none;
  filter: drop-shadow(0 0 14px rgba(59, 130, 246, 0.85));
}

/* Match the booking CTAs: the Brand Audit call button carries the same pulsing brand glow. */
.audit-cta-btn {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28);
  animation: ctaBtnGlow 2.8s ease-in-out infinite;
}

.audit-cta-btn i {
  color: var(--accent-cyan);
}

@media (max-width: 600px) {
  .audit-results-header { flex-direction: column-reverse; }
  .audit-score-badge { font-size: 1.5rem; padding: 0.4rem 0.85rem; min-width: 0; }
  .audit-cta-row { flex-direction: column; align-items: stretch; }
  .audit-cta-btn { justify-content: center; }
  .reset-audit-btn { margin-left: 0; }
  .checklist-filters { flex-wrap: wrap; }
}

/* =========================================================================
   ACCESSIBILITY — FOCUS STATES
   ========================================================================= */

/* Visible focus for keyboard navigation */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
details summary:focus-visible,
.module-tab:focus-visible,
.ryze-tab:focus-visible,
.filter-btn:focus-visible,
.checklist-item:focus-visible,
.next-module-btn:focus-visible,
.toc-card:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* =========================================================================
   MOTION — prefers-reduced-motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ring-fill,
  .dashboard-ring-fill {
    transition: none !important;
  }

  .glow-orb {
    animation: none !important;
  }
}

/* =========================================================================
   PRINT STYLING
   ========================================================================= */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  
  .sidebar, .bg-decorations, .mobile-header, .checklist-filters, .filter-btn {
    display: none !important;
  }
  
  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  
  .glass-panel, .glass-card, .email-mockup, .checklist-dashboard {
    background: #fff !important;
    border: 1px solid #ddd !important;
    color: #000 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    page-break-inside: avoid;
  }
  
  h1, h2, h3, h4, .checklist-label {
    color: #000 !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
  }
  
  .alert-box {
    border: 1px solid #ccc !important;
    background: #f9f9f9 !important;
    page-break-inside: avoid;
  }
  
  .alert-danger p, .alert-success p, .alert-warning p {
    color: #333 !important;
  }
  
  .compliance-table th {
    background: #f0f0f0 !important;
    color: #000 !important;
    border-bottom: 2px solid #ccc !important;
  }
  
  .compliance-table td {
    border-bottom: 1px solid #eee !important;
  }
}

/* =========================================================================
   COMPAYTENCE THEME — LIGHT MODE + TYPOGRAPHY + TOGGLE
   (appended re-skin: dark is the base theme; html.light flips the tokens)
   ========================================================================= */

:root { color-scheme: dark; }

html.light {
  color-scheme: light;
  --ov: 15, 23, 42;          /* overlay tint flips white -> slate on cream */
  --srf: 244, 244, 240;      /* raised surfaces become warm cream */
  --ink: #0b0f14;            /* strong heading text -> near-black */

  --bg-space: #fafaf7;       /* page = warm cream */
  --bg-core: #ffffff;
  --bg-panel: #ffffff;       /* solid white panels for crisp cards */
  --bg-panel-hover: #f1f1ec;
  --bg-card: #ffffff;

  --text-primary: #1f2329;
  --text-secondary: #3f444b;
  --text-muted: #5c6066;
  --text-dim: #8b8e94;

  --accent-cyan: #2563eb;    /* Compaytence light-mode accent blue */
  --accent-blue: #2563eb;
  --border-accent: rgba(37, 99, 235, 0.35);

  --color-danger: #e40014;
  --color-success: #00a544;
  --color-warning: #b75000;
}

/* ── Editorial display titles (Instrument Serif) ── */
h2.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
}

/* ── Tracked uppercase labels (Geist Mono) ── */
.hero-subtitle, .nav-title, .nav-num, .section-num, .doc-classification,
.version-badge, .checklist-category-tag, .path-badge, .gap-tag,
.compliance-table th, .filter-btn, .module-tab, .modules-header-label,
.dispute-metric-label, .next-label, .audit-results-label,
.email-badge, .ryze-console-subtitle, .ryze-metric-label, .toc-meta p,
.audit-gaps-label, .dashboard-lbl, .ring-info .title {
  font-family: var(--font-mono);
}

/* ── Theme toggle control ── */
.sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.theme-toggle {
  background: rgba(var(--ov), 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.theme-toggle:hover {
  color: var(--accent-blue);
  border-color: var(--border-accent);
  background: rgba(var(--ov), 0.08);
}

/* =========================================================================
   LIGHT-MODE LEGIBILITY OVERRIDES
   (elements whose text colors were tuned for dark backgrounds)
   ========================================================================= */

/* Email mockup stays a dark email-client preview in both themes */
html.light .email-meta-details,
html.light .email-footer-note,
html.light .email-badge { color: #9ca0a8; }
html.light .email-greetings,
html.light .email-details-row strong { color: #f4f5f7; }
html.light .email-meta-row strong { color: #d7d9de; }

/* Compliance table claim states */
html.light .safe-claim { color: #1447e6; }
html.light .kill-claim { color: #b3261e; }

/* Alert paragraph text */
html.light .alert-danger p { color: #a01019; }
html.light .alert-success p { color: #0069a4; }
html.light .alert-warning p { color: #7b3306; }

/* Stat / metric labels */
html.light .metric-danger .dispute-metric-label { color: #b3261e; }
html.light .metric-success .dispute-metric-label { color: #0a6b3a; }
html.light .metric-reduction .dispute-metric-label { color: #1447e6; }

/* RYZE objection + audit gaps (pale-red text on light) */
html.light .ryze-objection-box,
html.light .audit-gaps-label { color: #a01019; }

/* Glow orbs fade out on cream (screen blend already washes them) */
html.light .glow-orb { opacity: 0.05; }
html.light .grid-overlay { opacity: 0.5; }

/* =========================================================================
   PERMANENT DARK NAVIGATION RAIL
   The sidebar + mobile header stay dark in BOTH themes (Compaytence app
   dark-rail / cream-canvas look). Scoping the theme-flip custom properties
   to these elements re-darkens every descendant without touching each rule.
   ========================================================================= */
.sidebar,
.mobile-header {
  --srf: 13, 18, 30;        /* raised surface -> dark navy */
  --ov: 255, 255, 255;      /* overlays -> white (visible on dark) */
  --ink: #f4f5f7;           /* strong text -> off-white */
  --text-primary: #f4f5f7;
  --text-secondary: #d7d9de;
  --text-muted: #9ca0a8;
  --text-dim: #8b8e94;
}

/* =========================================================================
   ENGAGEMENT COMPONENTS (v1.3) — at-a-glance, pull-quote, stat callouts,
   timeline, tier cards, bottom-line, glossary, cheat sheet, whitespace
   ========================================================================= */

/* Readability: cap long body line-length + a touch more breathing room */
p.body-text, .section-intro { max-width: 72ch; }
.playbook-section { padding-top: 4.5rem; }

/* ── At-a-glance module summary ── */
.at-a-glance {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-left: 3px solid var(--accent-blue);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin: 0 0 2.75rem;
}
.at-a-glance-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-blue);
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.at-a-glance ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.at-a-glance li {
  position: relative;
  padding-left: 1.65rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.at-a-glance li::before {
  content: '\2022';
  font-family: var(--font-body);
  font-weight: 700;
  position: absolute;
  left: 0.35rem;
  top: -0.05rem;
  color: var(--accent-blue);
  font-size: 1.15rem;
  line-height: 1.5;
}

/* ── Pull-quote (editorial Instrument Serif) ── */
.pull-quote {
  font-family: var(--font-display);
  font-size: 1.95rem;
  line-height: 1.3;
  color: var(--ink);
  font-style: italic;
  border-left: 3px solid var(--accent-blue);
  padding: 0.4rem 0 0.4rem 1.6rem;
  margin: 2.75rem 0;
  max-width: 60ch;
}
.pull-quote cite {
  display: block;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ── Stat callouts ── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.25rem;
  margin: 2.25rem 0;
}
.stat-callout {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
}
.stat-callout .stat-num {
  font-family: var(--font-display);
  font-size: 2.7rem;
  line-height: 1;
  color: var(--accent-blue);
}
.stat-callout .stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-top: 0.6rem;
  line-height: 1.4;
}

/* ── Timeline (numbered process steps) ── */
.timeline { position: relative; margin: 2.25rem 0; padding-left: 2.25rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0.6rem; top: 0.4rem; bottom: 0.4rem;
  width: 2px;
  background: var(--border-glass-bright);
}
.timeline-step { position: relative; padding-bottom: 1.85rem; }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before {
  content: '';
  position: absolute;
  left: -1.97rem; top: 0.15rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg-space);
  border: 2px solid var(--accent-blue);
}
.timeline-step h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.timeline-step p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; }

/* ── Tier / comparison cards ── */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 2.25rem 0;
}
.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-top: 3px solid var(--accent-blue);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.tier-card .tier-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
}
.tier-card h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.tier-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }

/* ── Bottom-line confidence box (calm, reassuring) ── */
.bottom-line {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: rgba(var(--ov), 0.03);
  border: 1px solid var(--border-glass);
  border-left: 3px solid var(--color-success);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 2.75rem 0 0;
}
.bottom-line > i { color: var(--color-success); font-size: 1.2rem; margin-top: 2px; flex-shrink: 0; }
.bottom-line h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-success);
  margin-bottom: 0.35rem;
}
.bottom-line p { font-size: 0.92rem; line-height: 1.6; color: var(--text-secondary); }

/* ── Glossary ── */
.glossary {
  margin: 2rem 0;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.glossary-item {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 1.25rem;
  align-items: baseline;
}
.glossary-item:last-child { border-bottom: none; }
.glossary-term { font-family: var(--font-mono); font-weight: 600; color: var(--ink); font-size: 0.85rem; }
.glossary-def { font-size: 0.92rem; color: var(--text-muted); line-height: 1.5; }
@media (max-width: 600px) {
  .glossary-item { grid-template-columns: 1fr; gap: 0.3rem; }
  .pull-quote { font-size: 1.5rem; }
  .stat-callout .stat-num { font-size: 2.1rem; }
}

/* =========================================================================
   v1.3.1 FIXES — solid dark rail + light-mode mockups
   ========================================================================= */
/* Sidebar/mobile rail: solid dark in BOTH themes (no cream bleed-through) */
.sidebar { background: #0b0f1a; }
.mobile-header { background: #0b0f1a; }

/* Email mockups become a light email preview in light mode */
html.light .email-mockup { background: #ffffff; }
html.light .email-header { background: #f4f4f0; }
html.light .email-body { background: #ffffff; color: #3f444b; }
html.light .email-greetings,
html.light .email-details-row strong,
html.light .email-meta-row strong { color: #1f2329; }
html.light .email-meta-details,
html.light .email-footer-note,
html.light .email-badge { color: #5c6066; }
html.light .email-cta-btn { color: #ffffff; }

/* ===================================================================
   PARTNER BOXES — brand-colored partner/affiliate cards
   Per-box brand color is passed inline via --brand (+ --brand-ink).
   =================================================================== */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}
.partner-box {
  --brand: #2563eb;
  --brand-ink: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  background: rgba(var(--srf), 0.5);
  border: 1px solid rgba(var(--ov), 0.08);
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.1rem;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.partner-box::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--brand);
}
.partner-box:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 14px 32px -14px var(--brand);
}
.partner-box:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
/* Static partnership cards (e.g. processors merchants can only set up through
   Compaytence): shown to signal the relationship, with no CTA and no link out. */
.partner-box--static { cursor: default; }
.partner-box--static:hover {
  transform: none;
  border-color: rgba(var(--ov), 0.08);
  box-shadow: none;
}
.partner-box-head { display: flex; align-items: center; gap: 0.85rem; }
.partner-logo {
  flex-shrink: 0;
  width: 58px; height: 58px;
  border-radius: 10px;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.14);
}
.partner-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.partner-name {
  font-family: var(--font-heading);
  font-size: 1.05rem; font-weight: 700; line-height: 1.2;
  color: var(--ink);
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem;
}
.partner-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  padding: 0.12rem 0.45rem; border-radius: 4px;
}
.partner-blurb { font-size: 0.85rem; color: var(--text-muted); line-height: 1.45; margin: 0; flex: 1; }
.partner-cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--brand); color: var(--brand-ink);
  font-family: var(--font-body); font-size: 0.8rem; font-weight: 700;
  padding: 0.5rem 1rem; border-radius: 8px;
  transition: gap .18s ease, filter .18s ease;
}
.partner-box:hover .partner-cta { gap: 0.7rem; filter: brightness(1.08); }
@media (prefers-reduced-motion: reduce) {
  .partner-box, .partner-box:hover { transform: none; }
  .partner-box:hover .partner-cta { gap: 0.45rem; }
}
/* logo-less partners: brand-colored tile with an icon */
.partner-logo--mono { background: var(--brand); padding: 0; }
.partner-logo--mono i { color: var(--brand-ink); font-size: 1.6rem; }
/* Full-bleed app icons: the logo already has its own square background, so it
   should fill the tile edge-to-edge and inherit the rounded corners (no white padding). */
.partner-logo--full { padding: 0; background: transparent; overflow: hidden; }
.partner-logo--full img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; border-radius: inherit; }
/* partner directory (Quick Reference) */
.partner-category-label {
  font-family: var(--font-mono);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
  color: var(--accent-blue);
  margin: 2rem 0 0.25rem;
  display: flex; align-items: center; gap: 0.55rem;
}
.partner-category-label::after { content: ""; flex: 1; height: 1px; background: rgba(var(--ov), 0.1); }
