@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,600;0,700;1,400&family=Oswald:wght@500;600;700&display=swap');

:root {
  --bg-base: #0b0d0c;
  --bg-surface: #141715;
  --bg-surface-elevated: #1a1e1c;
  --accent: #ff5500;
  --accent-hover: #ff7722;
  --accent-muted: rgba(255, 85, 0, 0.15);
  --text-primary: #e0e0e0;
  --text-muted: #8a8e8b;
  --text-dim: #a6aca7;
  --border: #222623;
  --border-strong: #333834;
  --border-accent: #ff5500;
  --code-bg: #070808;
  --success: #00ff66;
  --warning: #ffaa00;
  --danger: #ff3333;
  --info: #3b82f6;
  --font-header: 'Oswald', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --sidebar-width: 320px;
  --header-height: 56px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
}

/* Accessibility Focus Ring (WCAG 2.1 AA) */
:focus {
  outline: 2px solid var(--accent) !important;
  outline-offset: -2px !important;
}

:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: -2px !important;
}

a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: -2px !important;
}

/* Cyber Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Header ────────────────────────────────────────────────────────────── */
.top-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  font-family: var(--font-header);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  text-decoration: none;
}

.brand-badge {
  background-color: var(--accent-muted);
  color: var(--accent);
  border: 1px solid var(--accent);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 280px;
  height: 32px;
}

.search-input {
  width: 100%;
  height: 32px;
  background-color: var(--bg-base);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 32px;
  padding: 0 54px 0 32px;
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-icon-prefix {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 11px;
  pointer-events: none;
  z-index: 2;
}

.search-hint {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 9px;
  font-family: var(--font-mono);
  border: 1px solid var(--border-strong);
  padding: 1px 4px;
  pointer-events: none;
  background-color: var(--bg-surface);
  z-index: 2;
  line-height: 1;
}

.search-result-count {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.header-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  transition: all 0.15s ease;
}

.header-nav-link:hover {
  color: #ffffff;
  border-color: var(--accent);
  background-color: var(--accent-muted);
}

/* ── Hamburger Menu Button (Mobile/Tablet Only) ────────────────────────── */
.hamburger-btn {
  display: none !important;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 18px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  line-height: 1;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.hamburger-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── App Container ─────────────────────────────────────────────────────── */
.app-container {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  width: 100%;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-strong);
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  z-index: 900;
  transition: transform 0.2s ease;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: var(--bg-surface);
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}

.nav-module-group {
  border-bottom: 1px solid var(--border);
}

.nav-module-title {
  font-family: var(--font-header);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 12px 20px;
  text-transform: uppercase;
  background-color: rgba(255, 255, 255, 0.02);
  border-left: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: all 0.15s ease;
}

.nav-module-title:hover {
  color: var(--accent);
  background-color: var(--accent-muted);
}

.nav-module-group.active .nav-module-title {
  color: var(--accent);
  border-left-color: var(--accent);
  background-color: var(--accent-muted);
}

.nav-sub-list {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.nav-module-group.active .nav-sub-list {
  max-height: 800px;
}

.nav-sub-item a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 20px 7px 36px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

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

.nav-sub-item.active a {
  color: #ffffff;
  border-left-color: var(--accent);
  background-color: var(--bg-surface-elevated);
  font-weight: 600;
}

/* ── Main Content Area ─────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 36px 48px 100px 48px;
  max-width: 1800px;
  width: calc(100% - var(--sidebar-width));
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Constrain prose text for comfortable typographic reading measure on ultrawide monitors */
.doc-section p,
.doc-section ul,
.doc-section ol,
.section-desc {
  max-width: 1050px;
}

/* ── Typography & Content Cards ────────────────────────────────────────── */
.doc-section {
  display: none;
}
.doc-section.active {
  display: block;
}

.section-header {
  border-bottom: 2px solid var(--border-strong);
  padding-bottom: 14px;
  margin-bottom: 28px;
}

.section-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.section-header h1 {
  font-family: var(--font-header);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  text-transform: uppercase;
}

.section-desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-family: var(--font-header);
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

p {
  margin-bottom: 14px;
  color: var(--text-primary);
  overflow-wrap: break-word;
}

h3 {
  font-family: var(--font-header);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  margin-top: 20px;
}

ul, ol {
  margin-bottom: 14px;
  padding-left: 24px;
}

ul li, ol li {
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 13px;
  overflow-wrap: break-word;
}

/* ── Step List (Numbered Flow Steps) ──────────────────────────────────── */
.step-list {
  counter-reset: step-counter;
  list-style: none;
  padding-left: 0;
}

.step-list li {
  counter-increment: step-counter;
  position: relative;
  padding: 12px 16px 12px 48px;
  border-left: 3px solid var(--border-strong);
  margin-bottom: 10px;
  background-color: var(--bg-surface-elevated);
  overflow-wrap: break-word;
  line-height: 1.6;
  min-height: 48px;
}

.step-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 24px;
  height: 24px;
  background-color: var(--accent);
  color: #000000;
  font-family: var(--font-header);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Alerts ────────────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  margin-bottom: 18px;
  border-left: 4px solid var(--border-strong);
  background-color: var(--bg-surface-elevated);
  font-size: 13px;
  overflow-wrap: break-word;
}

.alert-title {
  font-family: var(--font-header);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.alert.important {
  border-left-color: var(--accent);
  background-color: var(--accent-muted);
}
.alert.important .alert-title {
  color: var(--accent);
}

.alert.warning {
  border-left-color: var(--warning);
  background-color: rgba(255, 170, 0, 0.1);
}
.alert.warning .alert-title {
  color: var(--warning);
}

.alert.note {
  border-left-color: var(--info);
  background-color: rgba(59, 130, 246, 0.1);
}
.alert.note .alert-title {
  color: #60a5fa;
}

.alert.success {
  border-left-color: var(--success);
  background-color: rgba(0, 255, 102, 0.08);
}
.alert.success .alert-title {
  color: var(--success);
}

/* ── Code Blocks ───────────────────────────────────────────────────────── */
.code-block-container {
  position: relative;
  margin-bottom: 18px;
}

.code-header {
  background-color: #101211;
  border: 1px solid var(--border-strong);
  border-bottom: none;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-btn {
  background-color: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background-color: var(--accent);
  color: #000000;
  border-color: var(--accent);
}

pre {
  background-color: var(--code-bg);
  border: 1px solid var(--border-strong);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--success);
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  word-break: normal;
  max-width: 100%;
}

code {
  font-family: var(--font-mono);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--accent);
  padding: 1px 5px;
  font-size: 12px;
  border: 1px solid var(--border);
  overflow-wrap: break-word;
}

/* ── Data Tables ───────────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  width: 100%;
  margin-bottom: 20px;
  border: 1px solid var(--border-strong);
  position: relative;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
  table-layout: auto;
}

th {
  background-color: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-family: var(--font-header);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 11px 16px;
  border-bottom: 2px solid var(--border-strong);
  white-space: nowrap;
}

td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: top;
  line-height: 1.6;
}

/* Prevent identifiers, flags, variables, and parameters from breaking awkwardly across lines */
td code {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  display: inline-block;
  vertical-align: middle;
  margin: 1px 0;
}

/* Specific table column width allocation & protection across all 9 modules */
#sec-cli-flags table {
  min-width: 840px;
}
#sec-cli-flags th:first-child,
#sec-cli-flags td:first-child {
  min-width: 230px;
  width: 230px;
  white-space: nowrap;
  font-weight: 600;
}
#sec-cli-flags th:nth-child(2),
#sec-cli-flags td:nth-child(2) {
  min-width: 90px;
  width: 95px;
  white-space: nowrap;
}
#sec-cli-flags th:nth-child(3),
#sec-cli-flags td:nth-child(3) {
  min-width: 90px;
  width: 95px;
  white-space: nowrap;
}

#sec-config-env table {
  min-width: 840px;
}
#sec-config-env th:first-child,
#sec-config-env td:first-child {
  min-width: 260px;
  width: 260px;
  white-space: nowrap;
  font-weight: 600;
}
#sec-config-env th:nth-child(2),
#sec-config-env td:nth-child(2) {
  min-width: 100px;
  width: 110px;
  white-space: nowrap;
}

#sec-cli-profiles table {
  min-width: 860px;
}
#sec-cli-profiles th:first-child,
#sec-cli-profiles td:first-child {
  min-width: 200px;
  white-space: nowrap;
}
#sec-cli-profiles th:nth-child(2),
#sec-cli-profiles td:nth-child(2) {
  min-width: 380px;
}
#sec-cli-profiles td:nth-child(2) code {
  white-space: normal;
  word-break: normal;
  line-height: 1.8;
}

#sec-engine-scoring table {
  min-width: 820px;
}
#sec-engine-scoring th:first-child,
#sec-engine-scoring td:first-child {
  min-width: 220px;
  white-space: nowrap;
}

#sec-overview-pillars table,
#sec-overview-v28 table,
#sec-engine-waf table,
#sec-webui-health table,
#sec-output-parquet table,
#sec-test-diagnostic table {
  min-width: 780px;
}

#sec-test-diagnostic th:nth-child(2),
#sec-test-diagnostic td:nth-child(2) {
  min-width: 280px;
}

tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.01);
}

tr:hover {
  background-color: rgba(255, 85, 0, 0.05);
}

/* ── Interactive CLI Builder ───────────────────────────────────────────── */
.builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.builder-field {
  margin-bottom: 12px;
}

.builder-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}

.builder-input, .builder-select {
  width: 100%;
  background-color: var(--bg-base);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 12px;
  outline: none;
  transition: border-color 0.15s ease;
}

.builder-input:focus, .builder-select:focus {
  border-color: var(--accent);
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  background-color: var(--bg-base);
  padding: 7px 12px;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease;
}

.checkbox-label:hover {
  border-color: var(--border-strong);
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

/* ── Details/Summary Accordion ─────────────────────────────────────────── */
details {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  margin-bottom: 12px;
}

details summary {
  padding: 10px 16px;
  cursor: pointer;
  font-family: var(--font-header);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
  transition: color 0.15s ease, background-color 0.15s ease;
  list-style: none;
}

details summary::before {
  content: '[+] ';
  color: var(--accent);
  font-weight: 700;
}

details[open] summary::before {
  content: '[-] ';
}

details summary:hover {
  color: var(--accent);
  background-color: var(--accent-muted);
}

details .details-content {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

/* ── WAF Pipeline Hierarchy Diagram ─────────────────────────────────────── */
.waf-diagram-container {
  margin-bottom: 24px;
  background-color: #0d0f0e;
  border: 1px solid var(--border-strong);
  padding: 20px 16px;
  overflow-x: hidden;
}

.waf-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.waf-tier-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  padding: 10px 4px;
  text-align: center;
  position: relative;
  transition: all 0.15s ease;
  min-width: 0;
}

.waf-tier-card:hover {
  border-color: var(--accent);
  background-color: var(--accent-muted);
}

.waf-tier-card.active {
  border: 2px solid var(--accent);
  background-color: rgba(255, 85, 0, 0.12);
}

.waf-tier-badge {
  font-family: var(--font-header);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.waf-tier-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 4px;
  overflow-wrap: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.waf-tier-overhead {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.waf-tier-arrow {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  z-index: 5;
  pointer-events: none;
}

.waf-diagram-caption {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}

/* Responsive Grid Breakdown for 8-Tier Pipeline */
@media (max-width: 1280px) {
  .waf-pipeline-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .waf-tier-card {
    padding: 12px 8px;
  }
  .waf-tier-card:nth-child(4) .waf-tier-arrow {
    display: none;
  }
  .waf-tier-card:last-child .waf-tier-arrow {
    display: none;
  }
}

@media (max-width: 640px) {
  .waf-pipeline-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .waf-tier-card .waf-tier-arrow {
    display: none;
  }
  .waf-tier-card:nth-child(odd) .waf-tier-arrow {
    display: block;
    right: -7px;
  }
  .waf-tier-card:last-child .waf-tier-arrow {
    display: none;
  }
}

/* ── Visual Documentation Figures ───────────────────────────────────────── */
.doc-figure {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  padding: 12px;
  margin: 20px 0;
}

.doc-screenshot {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  background-color: #000;
}

.doc-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 10px;
  text-align: center;
  letter-spacing: 0.5px;
}

.doc-figure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

@media (max-width: 820px) {
  .doc-figure-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Generic Multi-Step Flow Diagrams ──────────────────────────────────── */
.flow-diagram-container {
  margin-bottom: 24px;
  background-color: #0d0f0e;
  border: 1px solid var(--border-strong);
  padding: 20px 16px;
  overflow-x: hidden;
}

.flow-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.flow-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  padding: 12px 8px;
  text-align: center;
  position: relative;
  transition: all 0.15s ease;
  min-width: 0;
}

.flow-card:hover {
  border-color: var(--accent);
  background-color: var(--accent-muted);
}

.flow-card.active {
  border: 2px solid var(--accent);
  background-color: rgba(255, 85, 0, 0.12);
}

.flow-badge {
  font-family: var(--font-header);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.flow-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow-metric {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.flow-arrow {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  z-index: 5;
  pointer-events: none;
}

@media (max-width: 820px) {
  .flow-pipeline-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .flow-card .flow-arrow {
    display: none;
  }
  .flow-card:nth-child(odd) .flow-arrow {
    display: block;
    right: -8px;
  }
  .flow-card:last-child .flow-arrow {
    display: none;
  }
}

.waf-step-box {
  fill: #181c19 !important;
  stroke: #333834 !important;
  stroke-width: 1.5;
}

.waf-step-box.active {
  fill: #26140a !important;
  stroke: #ff5500 !important;
  stroke-width: 2;
}

.waf-text-title {
  fill: #ff5500 !important;
  font-family: var(--font-header);
  font-size: 13px;
  font-weight: 700;
  text-anchor: middle;
}

.waf-text-desc {
  fill: #ffffff !important;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-anchor: middle;
}

.waf-arrow {
  stroke: #ff5500 !important;
  stroke-width: 2;
  marker-end: url(#arrowhead);
}

/* ── Toast Notifications ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--accent);
  color: #000000;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 18px;
  border: 2px solid #ffffff;
  z-index: 2000;
  display: none;
  text-transform: uppercase;
}

/* ── Search Highlight ──────────────────────────────────────────────────── */
mark.search-highlight {
  background-color: var(--accent);
  color: #000000;
  padding: 0 3px;
}

/* ── Scroll-to-Top Button ──────────────────────────────────────────────── */
.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  left: calc(var(--sidebar-width) + 30px);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 18px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 800;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.scroll-top-btn:hover {
  background-color: var(--accent);
  color: #000000;
  border-color: var(--accent);
}

.scroll-top-btn.visible {
  display: flex;
}

/* ── New Feature Badges & Tactical Cards ───────────────────────────────── */
.badge-new {
  background-color: var(--accent);
  color: #000000;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  display: inline-block;
  vertical-align: middle;
}

.tactical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.tactical-metric-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  padding: 16px;
  border-left: 3px solid var(--accent);
}

.tactical-metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tactical-metric-title {
  font-family: var(--font-header);
  font-size: 13px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tactical-metric-tag {
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
}

.tactical-metric-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Site Footer ───────────────────────────────────────────────────────── */
.doc-footer {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1.5px;
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 440px;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.badge-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.footer-nav-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-heading {
  font-family: var(--font-header);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.footer-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color var(--transition-fast);
}

.footer-link-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-link-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.footer-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.footer-sysinfo {
  color: var(--accent);
  font-weight: 600;
}

/* ── Sidebar Overlay (mobile) ──────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 850;
}

.sidebar-overlay.active {
  display: block;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .main-content {
    padding: 30px 32px 90px 32px;
  }
}

@media (max-width: 960px) {
  .hamburger-btn {
    display: inline-flex !important;
  }

  .sidebar {
    transform: translateX(-100%);
    z-index: 950;
    width: 320px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.8);
  }

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

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 24px 20px 80px 20px;
  }

  .builder-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .search-box-container {
    width: 200px;
  }

  .search-hint {
    display: none;
  }

  .scroll-top-btn {
    left: auto;
    right: 20px;
    bottom: 20px;
  }

  .brand-badge {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand-col {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .top-header {
    padding: 0 12px;
    height: 56px;
  }

  .brand-container {
    gap: 10px;
  }

  .brand-logo {
    font-size: 16px;
    letter-spacing: 1px;
  }

  .search-box-container {
    width: 140px;
  }

  .header-nav-link {
    display: none;
  }

  .section-header h1 {
    font-size: 22px;
  }

  .card {
    padding: 16px;
    margin-bottom: 16px;
  }

  .builder-grid {
    grid-template-columns: 1fr;
  }

  .builder-input, .builder-select {
    font-size: 16px !important; /* Prevents auto-zoom in iOS Safari */
    min-height: 44px;
  }

  .checkbox-label {
    min-height: 44px;
    padding: 10px 12px;
  }

  .nav-sub-item a {
    min-height: 44px;
    font-size: 13px;
  }

  .step-list li {
    min-height: 48px;
    padding-left: 44px;
  }

  .scroll-top-btn {
    width: 44px;
    height: 44px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-brand-col {
    grid-column: span 1;
  }

  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .search-box-container {
    width: 110px;
  }

  .brand-logo {
    font-size: 14px;
  }
}

/* ── High-Resolution, Ultrawide & Zoom-Out Viewport Scaling ─────────────── */

/* Tier 2: 2K, Ultrawide & 75% zoom (1921px - 2800px) */
@media (min-width: 1921px) {
  :root {
    --sidebar-width: 380px;
    --header-height: 64px;
  }

  body {
    font-size: 16px;
  }

  .top-header {
    padding: 0 36px;
  }

  .brand-logo {
    font-size: 26px;
  }

  .brand-badge {
    font-size: 12px;
    padding: 3px 10px;
  }

  .search-box-container {
    width: 360px;
    height: 38px;
  }

  .search-input {
    height: 38px;
    font-size: 13px;
    padding: 0 60px 0 38px;
  }

  .search-icon-prefix {
    font-size: 13px;
  }

  .header-nav-link {
    font-size: 13px;
    padding: 8px 16px;
  }

  .nav-module-title {
    font-size: 16px;
    padding: 14px 24px;
  }

  .nav-sub-item a {
    font-size: 14px;
    min-height: 44px;
    padding: 9px 24px 9px 42px;
  }

  .main-content {
    max-width: 2400px;
    padding: 44px 64px 120px 64px;
  }

  .section-header h1 {
    font-size: 40px;
  }

  .card-title {
    font-size: 22px;
  }

  .doc-section p,
  .doc-section ul,
  .doc-section ol,
  .section-desc {
    max-width: 1400px;
    font-size: 16px;
  }

  .card {
    padding: 30px;
    margin-bottom: 30px;
  }

  .table-container table {
    font-size: 14px;
  }

  .table-container th,
  .table-container td {
    padding: 14px 18px;
  }

  pre {
    font-size: 14px;
    padding: 18px;
  }

  code {
    font-size: 14px;
  }

  .code-header {
    font-size: 13px;
    padding: 10px 18px;
  }

  .copy-btn {
    font-size: 12px;
    padding: 4px 12px;
  }

  .footer-logo {
    font-size: 18px;
  }

  .footer-tagline {
    font-size: 15px;
    max-width: 550px;
  }

  .footer-heading {
    font-size: 16px;
  }

  .footer-link-list a {
    font-size: 15px;
  }

  .footer-bottom-bar {
    font-size: 13px;
  }
}

/* Tier 3: 4K UHD, 3K & 50% zoom (2801px - 4800px) */
@media (min-width: 2801px) {
  :root {
    --sidebar-width: 480px;
    --header-height: 80px;
  }

  body {
    font-size: 20px;
    line-height: 1.7;
  }

  .top-header {
    padding: 0 48px;
  }

  .brand-logo {
    font-size: 34px;
    letter-spacing: 2px;
  }

  .brand-badge {
    font-size: 14px;
    padding: 4px 12px;
  }

  .search-box-container {
    width: 460px;
    height: 48px;
  }

  .search-input {
    height: 48px;
    font-size: 17px;
    padding: 0 70px 0 44px;
  }

  .search-icon-prefix {
    font-size: 16px;
    left: 14px;
  }

  .search-hint {
    font-size: 13px;
    padding: 2px 6px;
  }

  .header-nav-link {
    font-size: 16px;
    padding: 10px 22px;
  }

  .nav-module-title {
    font-size: 20px;
    padding: 18px 30px;
  }

  .nav-sub-item a {
    font-size: 17px;
    min-height: 52px;
    padding: 12px 30px 12px 52px;
  }

  .main-content {
    max-width: 3800px;
    padding: 60px 96px 160px 96px;
  }

  .section-header h1 {
    font-size: 52px;
  }

  .section-tag {
    font-size: 14px;
  }

  .section-desc {
    font-size: 20px;
    max-width: 2200px;
  }

  .card-title {
    font-size: 28px;
    margin-bottom: 20px;
  }

  .doc-section p,
  .doc-section ul,
  .doc-section ol {
    max-width: 2200px;
    font-size: 20px;
  }

  .card {
    padding: 40px;
    margin-bottom: 40px;
    border-width: 2px;
  }

  .table-container table {
    font-size: 17px;
  }

  .table-container th,
  .table-container td {
    padding: 18px 22px;
  }

  pre {
    font-size: 17px;
    padding: 22px;
    line-height: 1.6;
  }

  code {
    font-size: 17px;
  }

  .code-header {
    font-size: 15px;
    padding: 12px 22px;
  }

  .copy-btn {
    font-size: 14px;
    padding: 6px 16px;
  }

  .flow-card {
    padding: 18px 14px;
  }

  .flow-badge {
    font-size: 16px;
  }

  .flow-name {
    font-size: 16px;
  }

  .flow-metric {
    font-size: 14px;
  }

  .builder-grid {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 28px;
  }

  .builder-input,
  .builder-select {
    height: 50px;
    font-size: 18px;
    padding: 0 16px;
  }

  .checkbox-label {
    font-size: 18px;
    min-height: 52px;
    padding: 14px 18px;
  }

  .footer-grid {
    gap: 56px;
  }

  .footer-logo {
    font-size: 22px;
  }

  .footer-tagline {
    font-size: 18px;
    max-width: 700px;
  }

  .footer-heading {
    font-size: 20px;
  }

  .footer-link-list a {
    font-size: 18px;
  }

  .footer-bottom-bar {
    font-size: 16px;
    padding-top: 28px;
  }

  .badge-tag {
    font-size: 14px;
    padding: 4px 12px;
  }
}

/* Tier 4: 8K, 5K & Extreme 25% Zoom (min-width: 4801px) */
@media (min-width: 4801px) {
  :root {
    --sidebar-width: 680px;
    --header-height: 110px;
  }

  body {
    font-size: 28px;
    line-height: 1.8;
  }

  .top-header {
    padding: 0 64px;
  }

  .brand-logo {
    font-size: 46px;
    letter-spacing: 3px;
  }

  .brand-badge {
    font-size: 20px;
    padding: 6px 16px;
  }

  .search-box-container {
    width: 640px;
    height: 64px;
  }

  .search-input {
    height: 64px;
    font-size: 24px;
    padding: 0 90px 0 60px;
  }

  .search-icon-prefix {
    font-size: 22px;
    left: 20px;
  }

  .search-hint {
    font-size: 18px;
    padding: 4px 10px;
    right: 16px;
  }

  .header-nav-link {
    font-size: 22px;
    padding: 14px 30px;
  }

  .nav-module-title {
    font-size: 28px;
    padding: 26px 40px;
  }

  .nav-sub-item a {
    font-size: 24px;
    min-height: 72px;
    padding: 18px 40px 18px 72px;
  }

  .main-content {
    max-width: 6400px;
    padding: 80px 120px 220px 120px;
  }

  .section-header {
    padding-bottom: 24px;
    margin-bottom: 44px;
  }

  .section-tag {
    font-size: 20px;
    letter-spacing: 2.5px;
  }

  .section-header h1 {
    font-size: 72px;
  }

  .section-desc {
    font-size: 28px;
    max-width: 3800px;
    margin-top: 12px;
  }

  .card-title {
    font-size: 40px;
    margin-bottom: 28px;
  }

  .doc-section p,
  .doc-section ul,
  .doc-section ol {
    max-width: 3800px;
    font-size: 28px;
  }

  .card {
    padding: 56px;
    margin-bottom: 56px;
    border-width: 2px;
  }

  .table-container table {
    font-size: 24px;
  }

  .table-container th,
  .table-container td {
    padding: 24px 30px;
  }

  pre {
    font-size: 24px;
    padding: 30px;
    line-height: 1.6;
    border-width: 2px;
  }

  code {
    font-size: 24px;
    padding: 2px 8px;
  }

  .code-header {
    font-size: 20px;
    padding: 16px 28px;
  }

  .copy-btn {
    font-size: 18px;
    padding: 8px 22px;
  }

  .flow-card {
    padding: 24px 18px;
    border-width: 2px;
  }

  .flow-badge {
    font-size: 22px;
  }

  .flow-name {
    font-size: 22px;
  }

  .flow-metric {
    font-size: 18px;
  }

  .builder-grid {
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 36px;
  }

  .builder-input,
  .builder-select {
    height: 68px;
    font-size: 24px;
    padding: 0 22px;
  }

  .checkbox-label {
    font-size: 24px;
    min-height: 68px;
    padding: 18px 24px;
  }

  .footer-grid {
    gap: 72px;
  }

  .footer-logo {
    font-size: 30px;
  }

  .footer-tagline {
    font-size: 24px;
    max-width: 1000px;
  }

  .footer-heading {
    font-size: 28px;
  }

  .footer-link-list a {
    font-size: 24px;
  }

  .footer-bottom-bar {
    font-size: 22px;
    padding-top: 36px;
  }

  .badge-tag {
    font-size: 18px;
    padding: 6px 18px;
  }

  .scroll-top-btn {
    width: 64px;
    height: 64px;
    font-size: 24px;
    right: 36px;
    bottom: 36px;
  }
}
