/* Partner Portal - Documentation Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Brand Colors */
  --brand-primary: #00D5BE;
  --brand-primary-light: #00E8D0;
  --brand-accent: #7CCF00;
  --brand-primary-dark: #009E8E;
  --brand-secondary: #9CA3AF;
  --brand-info: #61C2C0;
  --brand-success: #04CD51;
  --brand-warning: #EBD700;
  --brand-danger: #D10000;
  --brand-link: #0077cc;
  --brand-surface: #9CA3B9;

  /* Neutral Palette */
  --brand-bg: #f3f4f6;
  --brand-bg-white: #ffffff;
  --brand-bg-dark: #4D4D4D;
  --brand-text: #1f2937;
  --brand-text-light: #6b7280;
  --brand-text-white: #ffffff;
  --brand-border: #d1d5db;
  --brand-border-light: #e5e7eb;
  --brand-highlight: #f59e0b;

  /* Nav / Footer */
  --brand-nav-bg: #1E4159;
  --brand-footer-bg: #162f41;
  --brand-footer-bar: #00D5BE;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-mono: "Menlo", "Monaco", "Courier New", monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Nav height */
  --nav-height: 64px;
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--brand-text);
  background: var(--brand-bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-height);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; color: var(--brand-text); }
h1 { font-size: 2.25rem; margin-bottom: var(--space-lg); }
h2 { font-size: 1.75rem; margin-bottom: var(--space-md); }
h3 { font-size: 1.375rem; margin-bottom: var(--space-sm); }
h4 { font-size: 1.125rem; margin-bottom: var(--space-sm); }
p { margin-bottom: var(--space-md); }
a { color: #1E4159; text-decoration: none; transition: color 0.15s, opacity 0.15s; }
a:hover { color: var(--brand-primary); text-decoration: underline; }

/* ========================================
   SITE NAVIGATION (fixed top bar)
   ======================================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--brand-nav-bg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  height: var(--nav-height);
}
.sn-inner {
  width: 100%;
  display: flex;
  align-items: center;
  height: var(--nav-height);
  padding: 0 var(--space-lg);
  gap: var(--space-md);
}

/* Brand / Logo */
.sn-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--brand-text-white);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
  margin-right: var(--space-xl);
  flex-shrink: 0;
}
.sn-brand:hover { text-decoration: none; opacity: 0.95; }
.sn-brand img {
  height: 36px;
  width: auto;
  max-width: 160px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.95);
  padding: 4px 8px;
  border-radius: var(--radius-md);
  object-fit: contain;
}
.sn-brand-sub {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.6;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
}

/* Menu items */
.sn-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}
.sn-menu-item { position: relative; }
.sn-home-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.sn-home-link:hover { color: white; background: rgba(255,255,255,0.1); text-decoration: none; }
.sn-menu-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  transition: all 0.15s;
}
.sn-menu-btn:hover { color: white; background: rgba(255,255,255,0.1); }
.sn-has-dropdown.sn-show > .sn-menu-btn { color: white; background: rgba(255,255,255,0.15); }

/* Dropdown panels */
.sn-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
  min-width: 240px;
  padding: var(--space-sm) 0;
  z-index: 10000;
}
.sn-has-dropdown.sn-show > .sn-dropdown { display: flex; flex-direction: column; }

/* Mega menu for wide dropdowns */
.sn-mega .sn-dropdown {
  flex-direction: row;
  flex-wrap: wrap;
  min-width: 520px;
}
.sn-mega.sn-show > .sn-dropdown { display: flex; }
.sn-mega .sn-dropdown .sn-dropdown-group { min-width: 240px; }

/* Dropdown groups and links */
.sn-dropdown-group { padding: var(--space-xs) 0; }
.sn-dropdown-group + .sn-dropdown-group { border-top: 1px solid var(--brand-border-light); }
.sn-mega .sn-dropdown .sn-dropdown-group + .sn-dropdown-group { border-top: none; }
.sn-dropdown-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-text-light);
  padding: var(--space-sm) var(--space-lg) var(--space-xs);
}
.sn-dropdown-link {
  display: block;
  padding: 6px var(--space-lg);
  color: var(--brand-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.1s;
  border-left: 3px solid transparent;
}
.sn-dropdown-link:hover {
  background: rgba(0,213,190,0.08);
  color: var(--brand-primary);
  text-decoration: none;
  border-left-color: var(--brand-primary);
}
.sn-dropdown-link.sn-active {
  color: var(--brand-primary);
  font-weight: 700;
  background: rgba(0,213,190,0.1);
  border-left-color: var(--brand-primary);
}

/* Mobile hamburger toggle */
.sn-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}
.sn-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 1px;
  transition: all 0.3s;
}
.sn-toggle.sn-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.sn-toggle.sn-open span:nth-child(2) { opacity: 0; }
.sn-toggle.sn-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile responsive nav */
@media (max-width: 900px) {
  .sn-toggle { display: flex; }
  .sn-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--brand-bg-white);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    gap: 0;
  }
  .sn-menu.sn-open { display: flex; }
  .sn-home-link { color: var(--brand-text); padding: 10px var(--space-md); }
  .sn-menu-btn { color: var(--brand-text); padding: 10px var(--space-md); width: 100%; justify-content: space-between; }
  .sn-menu-btn:hover { background: var(--brand-bg); }
  .sn-has-dropdown.sn-show > .sn-menu-btn { background: var(--brand-bg); }
  .sn-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    min-width: 0;
    padding-left: var(--space-md);
  }
  .sn-mega .sn-dropdown { flex-direction: column; min-width: 0; }
}

/* ========================================
   SITE FOOTER
   ======================================== */
.site-footer {
  background: var(--brand-footer-bg);
  color: rgba(255,255,255,0.8);
  margin-top: var(--space-3xl);
}
body.arch-page .site-footer {
  margin-top: 0;
}
.sf-columns {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-2xl);
  padding: var(--space-2xl) var(--space-xl);
}
.sf-col h4 {
  color: var(--brand-text-white);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  font-style: italic;
}
.sf-col a {
  display: block;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 3px 0;
  transition: color 0.15s;
}
.sf-col a:hover { color: white; text-decoration: none; }
.sf-col p {
  color: rgba(255,255,255,0.75);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 0;
}
.sf-credit {
  text-align: center;
  padding: var(--space-md) var(--space-xl);
  background: var(--brand-footer-bar);
  color: rgba(255,255,255,0.95);
  font-size: 0.82rem;
  font-weight: 500;
}

/* ========================================
   LAYOUT
   ======================================== */
.doc-container { max-width: 1200px; margin: 0 auto; padding: var(--space-xl); }
.doc-container-narrow { max-width: 900px; margin: 0 auto; padding: var(--space-xl); }

/* Page header (brand bar at top of content pages) */
.doc-header {
  background: linear-gradient(135deg, #1E4159 0%, #0f2333 100%);
  color: var(--brand-text-white);
  padding: var(--space-lg) var(--space-xl);
  margin: calc(-1 * var(--space-xl));
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--brand-primary);
}
.doc-header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: rgba(0,213,190,0.1);
  border-radius: 50%;
  pointer-events: none;
}
.doc-header h1 { color: var(--brand-text-white); margin-bottom: var(--space-xs); }
.doc-header p { color: rgba(255,255,255,0.85); margin-bottom: 0; }
.doc-header .subtitle { font-size: 1.1rem; opacity: 0.9; }
.doc-header .breadcrumb { font-size: 0.85rem; opacity: 0.7; margin-bottom: var(--space-sm); }
.doc-header .breadcrumb a { color: rgba(255,255,255,0.8); }

/* Grid */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.card-accent { border-left: 4px solid var(--brand-primary); }
.card h3 { color: #1E4159; }

/* Feature Cards */
.feature-card {
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover {
  box-shadow: 0 8px 24px rgba(0,213,190,0.15);
  transform: translateY(-3px);
}
.feature-card .icon {
  width: 56px; height: 56px;
  background: rgba(0,213,190,0.12);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-md);
  font-size: 1.5rem;
  color: var(--brand-primary);
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: var(--space-sm); }
.feature-card p { font-size: 0.9rem; color: var(--brand-text-light); margin-bottom: 0; }

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand-primary); color: var(--brand-text-white); }
.btn-primary:hover { background: var(--brand-primary-light); }
.btn-outline { background: transparent; color: var(--brand-primary); border: 2px solid var(--brand-primary); }
.btn-outline:hover { background: var(--brand-primary); color: var(--brand-text-white); }
.btn-white { background: var(--brand-bg-white); color: var(--brand-primary); }
.btn-white:hover { background: var(--brand-bg); }
.btn-lg { padding: 0.875rem 2rem; font-size: 1.1rem; }

/* ========================================
   HERO SECTIONS
   ======================================== */
.hero {
  background: linear-gradient(135deg, #1E4159 0%, #0f2333 100%);
  color: var(--brand-text-white);
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  border-bottom: 3px solid var(--brand-primary);
}
.hero h1 { color: var(--brand-text-white); font-size: 2.5rem; }
.hero p { color: rgba(255,255,255,0.9); font-size: 1.2rem; max-width: 700px; margin: 0 auto var(--space-lg); }
.hero-banner {
  background: linear-gradient(135deg, #1E4159 0%, #0f2333 100%);
  color: var(--brand-text-white);
  padding: var(--space-3xl) var(--space-xl);
  margin: calc(-1 * var(--space-xl));
  margin-bottom: var(--space-xl);
  border-bottom: 3px solid var(--brand-primary);
}
.hero-banner h1 { color: var(--brand-text-white); font-size: 2.75rem; }

/* Image Placeholder */
.img-placeholder {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  border: 2px dashed var(--brand-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  color: var(--brand-text-light);
  font-style: italic;
  font-size: 0.9rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-placeholder::before {
  content: "IMAGE";
  display: block;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
  opacity: 0.5;
}

/* ========================================
   UI MOCKUPS (for how-to guides)
   ======================================== */
.mockup {
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-lg) 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.mockup-browser-bar {
  background: #f0f0f0;
  border-bottom: 1px solid var(--brand-border);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.mockup-dots { display: flex; gap: 6px; }
.mockup-dots span {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.mockup-dots .red { background: #ff5f57; }
.mockup-dots .yellow { background: #ffbd2e; }
.mockup-dots .green { background: #28c840; }
.mockup-url {
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-sm);
  padding: 2px 12px;
  font-size: 0.8rem;
  color: var(--brand-text-light);
  flex: 1;
}
.mockup-body { padding: var(--space-lg); }
.mockup-sidebar {
  background: var(--brand-bg-dark);
  color: var(--brand-text-white);
  padding: var(--space-md);
  width: 220px;
  min-height: 300px;
}
.mockup-sidebar-item {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 2px;
}
.mockup-sidebar-item.active { background: rgba(255,255,255,0.15); }
.mockup-sidebar-item:hover { background: rgba(255,255,255,0.1); }
.mockup-sidebar-group {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.5);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
}
.mockup-layout { display: flex; }
.mockup-main { flex: 1; padding: var(--space-lg); }

/* Mockup Form Elements */
.mock-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--brand-bg-white);
  color: var(--brand-text-light);
  margin-bottom: var(--space-sm);
}
.mock-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  display: block;
}
.mock-btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  background: var(--brand-primary);
  color: var(--brand-text-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.mock-btn-outline {
  background: transparent;
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
}

/* Mockup Table (Invoice Grid) */
.mock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.mock-table th {
  background: var(--brand-bg);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--brand-border);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--brand-text-light);
}
.mock-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--brand-border-light);
}
.mock-table tr:hover { background: rgba(0,213,190,0.04); }

/* ========================================
   AGING INDICATORS & STATUS BADGES
   ======================================== */
.aging-current { border-left: 4px solid var(--brand-success); }
.aging-30 { border-left: 4px solid var(--brand-warning); }
.aging-60 { border-left: 4px solid var(--brand-highlight); }
.aging-90 { border-left: 4px solid var(--brand-danger); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-success { background: rgba(4,205,81,0.15); color: #037a2e; }
.badge-warning { background: rgba(235,215,0,0.2); color: #8a7d00; }
.badge-danger { background: rgba(209,0,0,0.12); color: #b30000; }
.badge-info { background: rgba(97,194,192,0.2); color: #2a7a78; }
.badge-neutral { background: var(--brand-bg); color: var(--brand-text-light); }
.badge-primary { background: rgba(0,213,190,0.12); color: var(--brand-primary); }

/* ========================================
   STEP INDICATORS (How-To guides)
   ======================================== */
.steps { counter-reset: step-counter; }
.step {
  position: relative;
  padding-left: 4rem;
  margin-bottom: var(--space-xl);
  min-height: 3rem;
}
.step::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 3rem;
  height: 3rem;
  background: var(--brand-primary);
  color: var(--brand-text-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.step h4 { margin-bottom: var(--space-xs); }
.step p { color: var(--brand-text-light); margin-bottom: var(--space-sm); }

/* ========================================
   TIP / NOTE BOXES
   ======================================== */
.tip {
  background: rgba(97,194,192,0.1);
  border-left: 4px solid var(--brand-info);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: var(--space-md) 0;
  font-size: 0.9rem;
}
.tip strong { color: var(--brand-info); }
.warning-box {
  background: rgba(235,215,0,0.1);
  border-left: 4px solid var(--brand-warning);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: var(--space-md) 0;
  font-size: 0.9rem;
}

/* ========================================
   NEXT STEPS / NAVIGATION
   ======================================== */
.next-steps {
  background: var(--brand-bg);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-xl);
}
.next-steps h3 { font-size: 1rem; margin-bottom: var(--space-md); }
.next-steps ul { list-style: none; }
.next-steps li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--brand-border-light);
}
.next-steps li:last-child { border-bottom: none; }
.next-steps a { font-weight: 600; }

/* ========================================
   STATS SECTION
   ======================================== */
.stats { display: flex; justify-content: center; gap: var(--space-2xl); flex-wrap: wrap; }
.stat { text-align: center; }
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--brand-primary); line-height: 1; }
.stat-label { font-size: 0.9rem; color: var(--brand-text-light); margin-top: var(--space-xs); }

/* ========================================
   SECTION DIVIDERS
   ======================================== */
.section { margin-bottom: var(--space-2xl); }
section[id] { scroll-margin-top: calc(var(--nav-height) + 1rem); }
.section-title {
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: var(--space-sm);
}
.section-subtitle {
  text-align: center;
  color: var(--brand-text-light);
  font-size: 1.05rem;
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.divider {
  border: none;
  border-top: 1px solid var(--brand-border-light);
  margin: var(--space-xl) 0;
}

/* ========================================
   TABLES
   ======================================== */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--brand-bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--brand-border-light);
}
table.data-table th {
  background: var(--brand-bg);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 2px solid var(--brand-border);
}
table.data-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--brand-border-light);
  font-size: 0.9rem;
}
table.data-table tr:hover { background: var(--brand-bg); }

/* ========================================
   CHECKLIST
   ======================================== */
.checklist { list-style: none; }
.checklist li {
  padding: var(--space-sm) 0;
  padding-left: var(--space-lg);
  position: relative;
}
.checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--brand-success);
  font-weight: 700;
}

/* ========================================
   MARKETING CTA SECTION
   ======================================== */
.cta-section {
  background: linear-gradient(135deg, #009E8E 0%, #7CCF00 100%);
  color: var(--brand-text-white);
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  border-radius: var(--radius-lg);
  margin: var(--space-xl) 0;
}
.cta-section h2 { color: var(--brand-text-white); }
.cta-section p { color: rgba(255,255,255,0.85); max-width: 500px; margin: 0 auto var(--space-lg); }

/* ========================================
   FAQ ACCORDION
   ======================================== */
.faq-section { margin-bottom: var(--space-xl); }
.faq-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1E4159;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--brand-border-light);
}
.faq-item {
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}
.faq-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-text);
  text-align: left;
  transition: background 0.15s;
}
.faq-toggle:hover { background: var(--brand-bg); }
.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.25s;
  color: var(--brand-text-light);
}
.faq-answer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  padding: 0 var(--space-lg);
}
.faq-answer-inner {
  padding: 0 0 var(--space-lg) 0;
  font-size: 0.9rem;
  color: var(--brand-text-light);
  line-height: 1.7;
}

/* ========================================
   PAGE TOC (scroll spy sidebar)
   ======================================== */
.doc-layout-with-toc {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: var(--space-xl);
  align-items: start;
}
@media (max-width: 1024px) {
  .doc-layout-with-toc { grid-template-columns: 1fr; }
  #page-toc { display: none; }
}
#page-toc {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-xl));
}
/* Section headings: icon + h2 on same line */
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.section-heading .material-symbols-outlined {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  color: var(--brand-primary);
}
.section-heading h2 {
  margin: 0;
  line-height: 1.2;
}
/* Card-nested section-headings (sub-headers inside cards) stay center-aligned */
.card .section-heading {
  align-items: center;
  margin-bottom: 1rem;
}

/* TOC progress bar */
.toc-progress-bar {
  height: 3px;
  background: rgba(0,213,190,0.15);
  border-radius: 2px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.toc-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.toc-nav {
  border-left: 2px solid var(--brand-border-light);
  padding-left: var(--space-md);
}
.toc-link {
  display: block;
  padding: 4px 0;
  font-size: 0.8rem;
  color: var(--brand-text-light);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -18px;
  padding-left: var(--space-md);
  transition: all 0.15s;
}
.toc-link:hover { color: var(--brand-primary); text-decoration: none; }
.toc-link.active {
  color: var(--brand-primary);
  font-weight: 600;
  border-left-color: var(--brand-primary);
}

/* ========================================
   ARCHITECTURE SPECIFIC
   ======================================== */
.arch-diagram {
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-md) 0;
  text-align: center;
}
.arch-diagram img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.code-block {
  text-align: left;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: var(--space-md) 0;
}
.code-block code { color: inherit; background: none; }

/* Code block wrapper (header + pre) */
.code-block-wrapper {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--brand-border-light);
  margin: var(--space-md) 0;
}
.code-header {
  background: #334155;
  padding: 0.4rem var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}
.code-label {
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Callout boxes */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border-left: 4px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  background: var(--brand-bg);
}
.callout-warning { border-color: #f59e0b; background: rgba(245,158,11,0.05); }
.callout-info    { border-color: var(--brand-primary); background: rgba(0,213,190,0.05); }
.callout-success { border-color: #059669; background: rgba(16,185,129,0.05); }
.callout-danger  { border-color: #f43f5e; background: rgba(244,63,94,0.05); }

/* Highlight box (gradient accent box for key concepts) */
.highlight-box {
  background: linear-gradient(to right, rgba(0,213,190,0.1), rgba(97,194,192,0.1));
  border: 1px solid rgba(0,213,190,0.25);
  border-radius: 1rem;
  padding: 1.5rem;
  margin: var(--space-lg) 0;
}
.highlight-box.highlight-violet {
  background: linear-gradient(to right, rgba(139,92,246,0.1), rgba(168,85,247,0.05));
  border-color: rgba(139,92,246,0.25);
}
.highlight-box.highlight-amber {
  background: linear-gradient(to right, rgba(245,158,11,0.1), rgba(251,191,36,0.05));
  border-color: rgba(245,158,11,0.25);
}

/* Table wrapper */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-border-light);
  margin: var(--space-md) 0;
}

/* Flow diagram — suppress hover lift on feature-cards used as nodes */
.flow-diagram .feature-card {
  transition: none;
  transform: none !important;
}
.flow-diagram .feature-card:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transform: none !important;
}

/* IDE-style code block for all pre elements (arch pages use inline-styled pre tags) */
pre {
  text-align: left !important;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  overflow-x: auto;
  margin: var(--space-md) 0;
  white-space: pre;
  word-break: normal;
  tab-size: 2;
}
pre code {
  text-align: left;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  display: block;
}
/* Inline code spans */
.code-inline {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(30, 41, 59, 0.08);
  color: #0f6cbd;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  white-space: nowrap;
}
.arch-card {
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}
.arch-card h3 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.arch-card h3 .material-symbols-outlined {
  font-size: 1.25rem;
  color: var(--brand-primary);
}

/* ========================================
   VIDEO CARDS
   ======================================== */
.video-card {
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.video-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.video-thumb {
  display: block;
  position: relative;
  overflow: hidden;
  height: 160px;
  background: linear-gradient(135deg, #1E4159 0%, #0f2333 100%);
  color: inherit;
  text-decoration: none;
}
.video-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.video-card:hover .video-thumb-img { transform: scale(1.06); }
.video-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.28);
  transition: background 0.2s;
}
.video-card:hover .video-thumb-overlay { background: rgba(0,0,0,0.5); }
.video-play-icon {
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1E4159;
  font-size: 1.1rem;
  padding-left: 3px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.45);
  transition: transform 0.2s, background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.video-card:hover .video-play-icon {
  transform: scale(1.12);
  background: var(--brand-primary);
  color: white;
}
.video-tour-icon {
  width: 44px;
  height: 44px;
  background: rgba(0,213,190,0.88);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  padding-left: 3px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
  transition: transform 0.2s, background 0.2s;
  flex-shrink: 0;
}
.video-card:hover .video-tour-icon {
  transform: scale(1.12);
  background: var(--brand-primary-dark);
}
.video-thumb .duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}
.video-card-body { padding: var(--space-md); }
.video-card-body h3 { font-size: 1rem; margin-bottom: var(--space-xs); }
.video-card-body p { font-size: 0.85rem; color: var(--brand-text-light); margin-bottom: var(--space-sm); }

/* ========================================
   TAB FILTER
   ======================================== */
.tab-bar {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}
.tab-btn {
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid var(--brand-border-light);
  border-radius: 999px;
  background: var(--brand-bg-white);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-text-light);
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.tab-btn.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-text-white);
}

/* ========================================
   QUALIFYING QUESTION CARDS
   ======================================== */
.qq-card {
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  border-left: 4px solid var(--brand-primary);
}
.qq-card .qq-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--brand-primary);
  color: var(--brand-text-white);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
}
.qq-card h3 { font-size: 1.15rem; margin-bottom: var(--space-md); color: var(--brand-text); }
.qq-subsection { margin-bottom: var(--space-md); }
.qq-subsection h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-primary);
  margin-bottom: var(--space-xs);
}
.qq-subsection p { font-size: 0.9rem; color: var(--brand-text-light); margin-bottom: var(--space-xs); }

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  body { background: white; font-size: 11pt; padding-top: 0; }
  .site-nav, .site-footer { display: none !important; }
  .doc-container, .doc-container-narrow { padding: 0; max-width: 100%; }
  .doc-header { margin: 0; padding: var(--space-md); }
  .hero, .hero-banner { padding: var(--space-lg); margin: 0; margin-bottom: var(--space-md); break-inside: avoid; }
  .card, .feature-card { box-shadow: none; break-inside: avoid; }
  .mockup { box-shadow: none; break-inside: avoid; }
  .btn { border: 1px solid var(--brand-primary); }
  .no-print { display: none !important; }
  a { color: var(--brand-text); }
  .next-steps { break-inside: avoid; }
  .step { break-inside: avoid; }
  #page-toc { display: none; }
  .doc-layout-with-toc { grid-template-columns: 1fr; }
  @page { margin: 0.75in; }
}

@media print {
  .one-pager { padding: 0; }
  .one-pager .hero { padding: var(--space-md); font-size: 0.9rem; }
  .one-pager h1 { font-size: 1.5rem; }
  .one-pager h2 { font-size: 1.1rem; }
  .one-pager .feature-card { padding: var(--space-sm); }
}

/* ========================================
   ARCHITECTURE 3-COLUMN LAYOUT (Phase 2)
   ======================================== */
.arch-layout {
  display: grid;
  grid-template-columns: 240px 1fr 220px;
  gap: 0;
  align-items: stretch;
  min-height: calc(100vh - var(--nav-height));
}

/* Left sidebar — stretches to fill full grid height for background coverage */
.arch-sidebar {
  width: 240px;
  background: #1a2d3d;
  border-right: 1px solid rgba(255,255,255,0.07);
  transition: width 0.25s;
  flex-shrink: 0;
}
/* Sticky inner wrapper handles scroll/overflow */
.arch-sidebar-sticky {
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.arch-sidebar.collapsed { width: 52px; }
.arch-sidebar.collapsed .arch-sidebar-sticky { overflow: hidden; }
.arch-layout:has(.arch-sidebar.collapsed) {
  grid-template-columns: 52px 1fr 220px;
}
.arch-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-md) var(--space-sm);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.arch-sidebar-top span {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.4);
}
.arch-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  display: flex;
  align-items: center;
}
.arch-collapse-btn:hover { color: white; background: rgba(255,255,255,0.08); }
.arch-sidebar.collapsed .arch-sidebar-top span { display: none; }
.arch-sidebar.collapsed .arch-collapse-btn svg { transform: rotate(180deg); }

/* Sidebar nav groups */
.arch-nav-group { }
.arch-nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.45);
  transition: color 0.15s;
  margin-top: var(--space-xs);
}
.arch-nav-group-header:hover { color: rgba(255,255,255,0.7); }
.arch-nav-group-header svg { transition: transform 0.2s; flex-shrink: 0; }
.arch-nav-group-header.collapsed svg { transform: rotate(-90deg); }
.arch-sidebar.collapsed .arch-nav-group-header { justify-content: center; padding: var(--space-sm) 0; }
.arch-sidebar.collapsed .arch-nav-group-header span { display: none; }
.arch-sidebar.collapsed .arch-nav-group-header svg { display: none; }

.arch-nav-group-items {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.3s ease;
}
.arch-nav-group-items.collapsed { max-height: 0; }
.arch-sidebar.collapsed .arch-nav-group-items { max-height: 0; }

.arch-nav-link {
  display: block;
  padding: 6px var(--space-md) 6px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arch-nav-link:hover { color: white; background: rgba(255,255,255,0.06); text-decoration: none; }
.arch-nav-link.active {
  color: var(--brand-primary);
  font-weight: 700;
  border-left-color: var(--brand-primary);
  background: rgba(0,213,190,0.08);
}
.arch-sidebar.collapsed .arch-nav-link { display: none; }

/* Main content area */
.arch-main {
  min-width: 0;
  overflow: hidden;
}
.arch-main .doc-container {
  max-width: none;
}

/* Right TOC column — full-height background via grid stretch; inner sticky for content */
.arch-toc-col {
  width: 220px;
  transition: width 0.25s;
  background: #1a2d3d;
  border-left: 1px solid rgba(255,255,255,0.07);
}
/* Inner sticky panel — content-sized, no max-height/overflow to avoid accidental scroll void */
.arch-toc-col #page-toc {
  position: sticky;
  top: var(--nav-height);
  padding: var(--space-xl) var(--space-md);
}
.arch-toc-col .toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.4);
  margin-bottom: var(--space-md);
}
.toc-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.toc-collapse-btn:hover { color: white; background: rgba(255,255,255,0.08); }
.toc-collapse-btn .material-symbols-outlined { font-size: 1.1rem; }
/* Dark-bg overrides scoped to arch TOC column */
.arch-toc-col .toc-nav { border-left: 2px solid rgba(255,255,255,0.12); }
.arch-toc-col .toc-link { color: rgba(255,255,255,0.55); }
.arch-toc-col .toc-link:hover { color: rgba(255,255,255,0.9); }
.arch-toc-col .toc-link.active { color: var(--brand-primary); border-left-color: var(--brand-primary); }
.arch-toc-col .toc-progress-bar { background: rgba(255,255,255,0.1); }
/* Collapsed state */
.arch-toc-col.toc-collapsed { width: 32px; overflow: hidden; }
.arch-toc-col.toc-collapsed #page-toc { padding: var(--space-md) 0; }
.arch-toc-col.toc-collapsed .toc-title-text { display: none; }
.arch-toc-col.toc-collapsed .toc-header { justify-content: center; margin-bottom: 0; }
.arch-toc-col.toc-collapsed .toc-nav,
.arch-toc-col.toc-collapsed .toc-progress-bar { display: none; }
/* Grid column shrinks when TOC is collapsed */
.arch-layout:has(.arch-toc-col.toc-collapsed) {
  grid-template-columns: 240px 1fr 32px;
}
.arch-layout:has(.arch-sidebar.collapsed):has(.arch-toc-col.toc-collapsed) {
  grid-template-columns: 52px 1fr 32px;
}

/* Responsive: collapse arch layout at smaller widths */
@media (max-width: 1280px) {
  .arch-layout { grid-template-columns: 0 1fr 220px; }
  .arch-sidebar { display: none; }
}
@media (max-width: 1024px) {
  .arch-layout { grid-template-columns: 1fr; }
  .arch-sidebar { display: none; }
  .arch-toc-col { display: none; }
}

/* ========================================
   FLOATING TOC (non-arch pages, Phase 2)
   ======================================== */
.toc-float {
  position: fixed;
  right: 1.5rem;
  top: calc(var(--nav-height) + 2rem);
  width: 200px;
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-height: calc(100vh - var(--nav-height) - 4rem);
  overflow-y: auto;
  z-index: 100;
}
.toc-float .toc-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-text-light);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.toc-float .toc-header .toc-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand-text-light);
  padding: 0;
  font-size: 0.75rem;
  line-height: 1;
}
.toc-float.collapsed .toc-nav { display: none; }
@media (max-width: 1400px) { .toc-float { display: none; } }

/* ========================================
   SECTION NAVIGATION (prev/next, Phase 2)
   ======================================== */
.section-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-2xl) calc(-1 * var(--space-xl)) calc(-1 * var(--space-xl));
  border-top: 1px solid var(--brand-border-light);
  background: var(--brand-bg);
}
.section-nav-prev, .section-nav-next {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--brand-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: background 0.15s;
}
.section-nav-prev:hover, .section-nav-next:hover { background: rgba(0,213,190,0.1); text-decoration: none; }
.section-nav-index {
  font-size: 0.82rem;
  color: var(--brand-text-light);
  text-decoration: none;
  text-align: center;
}
.section-nav-index:hover { color: var(--brand-primary); text-decoration: none; }

/* ========================================
   SEARCH OVERLAY (Phase 2)
   ======================================== */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6rem;
}
.search-overlay[hidden] { display: none; }
.search-modal {
  width: 100%;
  max-width: 680px;
  background: var(--brand-bg-white);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  overflow: hidden;
}
.search-input-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--brand-border-light);
  padding: 0 var(--space-md);
}
.search-input-row svg { color: var(--brand-text-light); flex-shrink: 0; }
#search-input {
  flex: 1;
  padding: var(--space-md);
  font-family: inherit;
  font-size: 1rem;
  border: none;
  outline: none;
  background: transparent;
  color: var(--brand-text);
}
#search-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand-text-light);
  font-size: 1.25rem;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
#search-close:hover { background: var(--brand-bg); color: var(--brand-text); }
/* Full-text search toggle row */
.search-fulltext-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px var(--space-md);
  border-bottom: 1px solid var(--brand-border-light);
  background: var(--brand-bg-alt);
}
.srch-fulltext-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--brand-text-light);
  cursor: pointer;
  transition: all 0.15s;
}
.srch-fulltext-btn .material-symbols-outlined { font-size: 0.95rem; line-height: 1; }
.srch-fulltext-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.srch-fulltext-btn.active {
  background: rgba(0,213,190,0.1);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 600;
}
.srch-fulltext-hint {
  font-size: 0.72rem;
  color: var(--brand-text-light);
  font-style: italic;
  margin-left: auto;
}
.search-filters {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--brand-border-light);
  flex-wrap: wrap;
}
.search-filter {
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--brand-border-light);
  background: var(--brand-bg-white);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-text-light);
  cursor: pointer;
  transition: all 0.12s;
}
.search-filter:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.search-filter.active { background: var(--brand-primary); border-color: var(--brand-primary); color: white; }
#search-results {
  max-height: 420px;
  overflow-y: auto;
  padding: var(--space-sm) 0;
}
.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
  color: inherit;
}
.search-result-item:hover { background: var(--brand-bg); text-decoration: none; color: inherit; }
.search-result-item.keyboard-focus { background: rgba(0,213,190,0.1); }
.search-result-body { flex: 1; min-width: 0; }
.search-result-title { font-weight: 600; font-size: 0.9rem; color: var(--brand-text); margin-bottom: 2px; }
.search-result-title mark { background: rgba(0,213,190,0.25); color: inherit; border-radius: 2px; }
.search-result-excerpt { font-size: 0.8rem; color: var(--brand-text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-section-badge { flex-shrink: 0; margin-top: 2px; }
.search-no-results {
  text-align: center;
  padding: var(--space-xl);
  color: var(--brand-text-light);
  font-size: 0.9rem;
}

/* Search button in nav */
.sn-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  margin-left: auto;
}
.sn-search-btn:hover { color: white; background: rgba(255,255,255,0.1); }

/* ========================================
   SEARCH — MODE SWITCH + SETTINGS PANEL
   ======================================== */

/* Pill-switch: Quick Search / Full Text */
.search-mode-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px var(--space-md);
  border-bottom: 1px solid var(--brand-border-light);
  background: var(--brand-bg-alt);
}
.srch-mode-switch {
  display: inline-flex;
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}
.srch-mode-btn {
  background: none;
  border: none;
  padding: 5px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--brand-text-light);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}
.srch-mode-btn + .srch-mode-btn { border-left: 1.5px solid var(--brand-border); }
.srch-mode-btn.active { background: var(--brand-primary); color: white; }
.srch-mode-btn:hover:not(.active) { background: rgba(0,213,190,0.1); color: var(--brand-primary); }
.srch-mode-btn.offline { opacity: 0.5; cursor: not-allowed; }
.srch-mode-btn.offline::after {
  content: "offline";
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #e55;
  color: white;
  padding: 1px 5px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
/* Hint + gear */
.srch-fulltext-hint {
  font-size: 0.72rem;
  color: var(--brand-text-light);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: var(--space-xs);
}
.srch-settings-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand-text-light);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.srch-settings-btn .material-symbols-outlined { font-size: 1.05rem; line-height: 1; }
.srch-settings-btn:hover { color: var(--brand-text); background: var(--brand-bg); }
.srch-settings-btn.active { color: var(--brand-primary); }

/* Settings drawer */
.srch-settings-panel {
  background: var(--brand-bg);
  border-bottom: 1px solid var(--brand-border-light);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.srch-settings-panel.open { max-height: 320px; }
.srch-settings-body {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.srch-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.srch-settings-label {
  font-size: 0.83rem;
  color: var(--brand-text);
  font-weight: 500;
}
/* Toggle switch (reusable) */
.toggle-switch { display: inline-flex; cursor: pointer; position: relative; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--brand-border);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.toggle-switch input:checked + .toggle-track { background: var(--brand-primary); }
.toggle-switch input:checked + .toggle-track .toggle-thumb { left: 18px; }
/* Density buttons */
.srch-density-btns {
  display: inline-flex;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.srch-density-btn {
  background: none;
  border: none;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--brand-text-light);
  transition: all 0.12s;
}
.srch-density-btn + .srch-density-btn { border-left: 1px solid var(--brand-border); }
.srch-density-btn.active { background: var(--brand-primary); color: white; }
/* Clear history button */
.srch-clear-history-btn {
  background: none;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--brand-text-light);
  cursor: pointer;
  transition: all 0.15s;
}
.srch-clear-history-btn:hover { border-color: #e55; color: #e55; }

/* History chips */
.srch-history-header {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-text-light);
  padding: var(--space-sm) var(--space-lg) 4px;
}
.srch-history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px var(--space-lg) var(--space-md);
}
.srch-history-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.8rem;
  color: var(--brand-text);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.srch-history-chip:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(0,213,190,0.06);
}

/* View all results link */
.srch-view-all-row {
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--brand-border-light);
  text-align: center;
  background: var(--brand-bg-alt);
}
.srch-view-all-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-primary);
  text-decoration: none;
}
.srch-view-all-link:hover { text-decoration: underline; }

/* Density variants for overlay results */
#search-results.density-compact .search-result-item { padding: 6px var(--space-lg); }
#search-results.density-compact .search-result-excerpt { display: none; }
#search-results.density-compact .search-result-title { font-size: 0.84rem; }

/* ========================================
   SEARCH RESULTS PAGE
   ======================================== */
.sr-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-2xl);
}
.sr-search-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}
.sr-search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--brand-bg-white);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-sm) 0 var(--space-md);
  gap: var(--space-sm);
  min-width: 260px;
  transition: border-color 0.15s;
}
.sr-search-bar:focus-within { border-color: var(--brand-primary); }
.sr-search-bar svg { color: var(--brand-text-light); flex-shrink: 0; }
#sr-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 0;
  background: transparent;
  color: var(--brand-text);
}
#sr-input::placeholder { color: var(--brand-text-light); }
.sr-search-submit {
  background: var(--brand-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.sr-search-submit:hover { background: var(--brand-primary-dark); }

/* 2-column layout */
.sr-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-2xl);
  align-items: start;
}
@media (max-width: 768px) {
  .sr-layout { grid-template-columns: 1fr; }
  .sr-sidebar { display: none; }
  .sr-page { padding: var(--space-lg); }
}
.sr-sidebar {
  position: sticky;
  top: calc(var(--nav-height, 60px) + var(--space-xl));
}
.sr-sidebar-section { margin-bottom: var(--space-xl); }
.sr-sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-text-light);
  margin-bottom: var(--space-sm);
}
.sr-filter-list { display: flex; flex-direction: column; gap: 2px; }
.sr-filter-btn {
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 6px var(--space-md);
  font-size: 0.84rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--brand-text);
  cursor: pointer;
  transition: all 0.12s;
}
.sr-filter-btn:hover { background: var(--brand-bg); color: var(--brand-primary); border-left-color: var(--brand-primary); }
.sr-filter-btn.active {
  background: rgba(0,213,190,0.08);
  color: var(--brand-primary);
  font-weight: 700;
  border-left-color: var(--brand-primary);
}
/* Share button */
.sr-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  padding: 6px var(--space-md);
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--brand-text-light);
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  justify-content: center;
}
.sr-share-btn .material-symbols-outlined { font-size: 0.95rem; }
.sr-share-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

/* Results header */
.sr-results-header {
  font-size: 0.88rem;
  color: var(--brand-text-light);
  margin-bottom: var(--space-md);
  min-height: 1.4em;
}
.sr-results-list { display: flex; flex-direction: column; gap: var(--space-sm); }

/* Result card */
.sr-result-item {
  display: block;
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.sr-result-item:hover {
  box-shadow: 0 4px 18px rgba(0,213,190,0.13);
  border-color: var(--brand-primary);
  text-decoration: none;
  color: inherit;
  transform: translateY(-1px);
}
.sr-result-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 6px;
}
.sr-result-breadcrumb {
  font-size: 0.7rem;
  color: var(--brand-text-light);
  opacity: 0.8;
}
.sr-result-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--brand-text);
  margin-bottom: var(--space-xs);
  line-height: 1.35;
}
.sr-result-title mark { background: rgba(0,213,190,0.25); color: inherit; border-radius: 2px; padding: 0 1px; }
.sr-result-excerpt {
  font-size: 0.87rem;
  color: var(--brand-text-light);
  line-height: 1.6;
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sr-result-excerpt mark { background: rgba(0,213,190,0.2); color: inherit; border-radius: 2px; padding: 0 1px; }
.sr-result-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--space-xs); }
.sr-tag {
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--brand-bg);
  border: 1px solid var(--brand-border-light);
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--brand-text-light);
  text-transform: lowercase;
}

/* Load more */
.sr-load-more-wrap { text-align: center; margin-top: var(--space-xl); padding-bottom: var(--space-xl); }

/* Empty / loading states */
.sr-state {
  text-align: center;
  padding: var(--space-2xl) 0;
  color: var(--brand-text-light);
  font-size: 0.95rem;
}
.sr-state strong { color: var(--brand-text); }

/* ========================================
   GLOSSARY PAGE (Phase 2)
   ======================================== */
.glossary-alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-xl);
}
.glossary-alpha-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  color: var(--brand-text);
  transition: all 0.12s;
}
.glossary-alpha-link:hover { background: var(--brand-primary); color: white; border-color: var(--brand-primary); text-decoration: none; }
.glossary-alpha-link.disabled { opacity: 0.3; pointer-events: none; }
.glossary-section { margin-bottom: var(--space-2xl); }
.glossary-letter {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brand-primary);
  border-bottom: 2px solid var(--brand-primary);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-lg);
  display: inline-block;
  min-width: 2.5rem;
}
.glossary-term { margin-bottom: var(--space-md); padding-bottom: var(--space-md); border-bottom: 1px solid var(--brand-border-light); }
.glossary-term:last-child { border-bottom: none; }
.glossary-term dt { font-weight: 700; font-size: 1rem; color: var(--brand-text); margin-bottom: var(--space-xs); }
.glossary-term dd { font-size: 0.9rem; color: var(--brand-text-light); line-height: 1.6; margin-left: 0; }
.glossary-see-also { font-size: 0.82rem; color: var(--brand-text-light); margin-top: var(--space-xs); }
.glossary-see-also a { color: var(--brand-primary); font-weight: 600; }

/* ========================================
   QUICK LINKS / ROLE CARDS (Phase 2)
   ======================================== */
.role-section { margin-bottom: var(--space-2xl); }
.role-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--brand-border-light);
}
.role-section-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.role-section-header h2 { margin-bottom: 2px; }
.role-section-header p { font-size: 0.9rem; color: var(--brand-text-light); margin-bottom: 0; }
.role-link-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--brand-bg-white);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.role-link-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-1px); border-color: var(--brand-primary); text-decoration: none; color: inherit; }
.role-link-card-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.role-link-card h4 { font-size: 0.95rem; margin-bottom: 2px; color: var(--brand-text); }
.role-link-card p { font-size: 0.82rem; color: var(--brand-text-light); margin-bottom: 0; }

/* ========================================
   SITEMAP PAGE (Phase 2)
   ======================================== */
.sitemap-section { margin-bottom: var(--space-2xl); }
.sitemap-section-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-primary);
  padding: var(--space-sm) var(--space-md);
  background: rgba(0,213,190,0.08);
  border-left: 4px solid var(--brand-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: var(--space-md);
}
.sitemap-subsection { margin-bottom: var(--space-md); }
.sitemap-subsection-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-text-light);
  margin-bottom: var(--space-sm);
  padding-left: var(--space-md);
}
.sitemap-links { list-style: none; }
.sitemap-links li {
  padding: 4px var(--space-md);
  font-size: 0.88rem;
}
.sitemap-links a {
  color: var(--brand-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: color 0.12s;
}
.sitemap-links a:hover { color: var(--brand-primary); text-decoration: none; }
.sitemap-links a::before { content: "›"; color: var(--brand-primary); font-weight: 700; }

/* Arch TOC collapse support */
.arch-toc-col #page-toc.collapsed .toc-nav { display: none; }
