/* AuditVane Design System — Enterprise Zero-Upload M365 & Entra Forensics */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --surface-code: #0f172a;
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-soft: #e0f2fe;
  --teal: #0f766e;
  --teal-soft: #ccfbf1;
  --critical: #dc2626;
  --critical-soft: #fee2e2;
  --high: #d97706;
  --high-soft: #fef3c7;
  --medium: #2563eb;
  --medium-soft: #dbeafe;
  --clean: #059669;
  --clean-soft: #d1fae5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 48px -12px rgba(15, 23, 42, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'SFMono-Regular', Menlo, Consolas, monospace;
  --max-w: 1280px;
  --article-w: 840px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;
  --surface-code: #030712;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --border: #1e293b;
  --border-strong: #334155;
  --primary: #38bdf8;
  --primary-hover: #7dd3fc;
  --primary-soft: rgba(56, 189, 248, 0.14);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.14);
  --critical: #f87171;
  --critical-soft: rgba(248, 113, 113, 0.16);
  --high: #fbbf24;
  --high-soft: rgba(251, 191, 36, 0.15);
  --medium: #60a5fa;
  --medium-soft: rgba(96, 165, 250, 0.15);
  --clean: #34d399;
  --clean-soft: rgba(52, 211, 153, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img, svg {
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 16px;
  z-index: 9999;
  font-weight: 600;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
  background: rgba(11, 17, 32, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-name span {
  color: var(--primary);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--clean-soft);
  color: var(--clean);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid rgba(5, 150, 105, 0.25);
  white-space: nowrap;
}

.zero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clean);
  animation: av-dot-pulse 2.2s infinite;
}

.btn-icon, .btn-secondary, .btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 40px;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-icon {
  padding: 8px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-primary {
  padding: 10px 18px;
  background: var(--primary);
  color: #ffffff;
  border: 1px solid transparent;
  font-size: 0.94rem;
}

[data-theme="dark"] .btn-primary {
  color: #0b1120;
}

.btn-primary:hover {
  background: var(--primary-hover);
  text-decoration: none;
}

.btn-secondary {
  padding: 10px 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-size: 0.92rem;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.btn-ghost {
  padding: 7px 12px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  min-height: 36px;
}

.btn-ghost:hover {
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
}

.sample-bar .btn-ghost.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 44px 0 36px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 12% 18%, rgba(2, 132, 199, 0.09), transparent 42%),
    radial-gradient(circle at 86% 24%, rgba(15, 118, 110, 0.09), transparent 40%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 36px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 3.3vw, 2.85rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.hero-title .accent {
  color: var(--primary);
}

.hero-lead {
  margin: 0 0 22px;
  font-size: 1.06rem;
  color: var(--text-muted);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-soft);
}

.hero-metrics strong {
  color: var(--text);
  font-weight: 700;
}

.hero-visual-card {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Hero SVG Animations */
@keyframes av-flow {
  from { stroke-dashoffset: 48; }
  to { stroke-dashoffset: 0; }
}

@keyframes av-dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.65; }
}

@keyframes av-orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes av-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

.svg-flow-line {
  stroke-dasharray: 6 6;
  animation: av-flow 1.4s linear infinite;
}

.svg-radar-ring {
  transform-origin: 250px 155px;
  animation: av-orbit 18s linear infinite;
}

.svg-alert-float {
  animation: av-float 3.4s ease-in-out infinite;
}

.svg-alert-float-delay {
  animation: av-float 3.4s ease-in-out 1.1s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .svg-flow-line,
  .svg-radar-ring,
  .svg-alert-float,
  .svg-alert-float-delay,
  .zero-dot {
    animation: none !important;
  }
}

/* Workbench Section */
.workbench-section {
  padding: 36px 0 44px;
}

.workbench-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.workbench-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.sample-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sample-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
}

.dropzone-wrap {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  background: var(--bg);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone h2 {
  margin: 8px 0 6px;
  font-size: 1.15rem;
}

.dropzone p {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.paste-panel {
  margin-top: 14px;
}

.paste-panel textarea {
  width: 100%;
  min-height: 112px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  resize: vertical;
}

.paste-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* KPI Row */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.kpi-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.kpi-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

.kpi-value {
  margin-top: 4px;
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text);
}

.kpi-value.is-critical { color: var(--critical); }
.kpi-value.is-high { color: var(--high); }

/* Charts & Findings */
.analytics-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.panel-card h3 {
  margin: 0 0 10px;
  font-size: 0.96rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.findings-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  margin-top: 12px;
}

.finding-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  padding: 14px;
  min-width: 0;
  overflow-wrap: break-word;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.finding-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.finding-card.sev-critical { border-left-color: var(--critical); }
.finding-card.sev-high { border-left-color: var(--high); }
.finding-card.sev-medium { border-left-color: var(--medium); }

.finding-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sev-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sev-badge.critical { background: var(--critical-soft); color: var(--critical); }
.sev-badge.high { background: var(--high-soft); color: var(--high); }
.sev-badge.medium { background: var(--medium-soft); color: var(--medium); }
.sev-badge.clean { background: var(--clean-soft); color: var(--clean); }

.finding-title {
  margin: 0 0 4px;
  font-size: 0.96rem;
  font-weight: 700;
}

.finding-meta {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Filter Toolbar & Events Table */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.filter-bar input[type="search"],
.filter-bar select {
  min-height: 38px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
}

.filter-bar input[type="search"] {
  flex: 1 1 240px;
}

.export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 540px;
}

.article-main .table-scroll,
.section-block .table-scroll {
  max-height: none;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.article-main .table-scroll .doc-table,
.section-block .table-scroll .doc-table {
  margin: 0;
  min-width: 580px;
}

.table-scroll .doc-table th:first-child,
.table-scroll .doc-table td:first-child {
  border-left: none;
}

.table-scroll .doc-table th:last-child,
.table-scroll .doc-table td:last-child {
  border-right: none;
}

.events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.events-table th {
  position: sticky;
  top: 0;
  background: var(--surface-alt);
  text-align: left;
  padding: 10px 12px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.events-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-family: var(--font-mono);
  font-size: 0.81rem;
  word-break: break-word;
}

.events-table tbody tr {
  cursor: pointer;
}

.events-table tbody tr:hover {
  background: var(--primary-soft);
}

.ioc-panel {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.ioc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ioc-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Modal Inspector */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 500;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* Content Sections, Hubs & Cards */
.section-block {
  padding: 48px 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

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

.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.hero-grid > *,
.analytics-grid > *,
.card-grid-3 > *,
.card-grid-2 > *,
.kpi-grid > *,
.footer-grid > *,
.article-shell > *,
.kpi-card,
.panel-card,
.cta-box,
.toc-box,
.author-card {
  min-width: 0;
  max-width: 100%;
}

input, select, textarea {
  min-width: 0;
  max-width: 100%;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow-wrap: break-word;
}

.info-card a {
  overflow-wrap: anywhere;
}

.info-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.info-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.pillar-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
}

/* Article / Guide Layout */
.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 32px;
  padding: 32px 0 56px;
  align-items: start;
}

.article-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 38px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

.article-main a {
  overflow-wrap: anywhere;
}

.article-main figure {
  max-width: 100%;
  overflow: hidden;
}

.article-main figure svg {
  width: 100%;
  height: auto;
  display: block;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 14px;
}

.article-main h1 {
  margin: 0 0 14px;
  font-size: clamp(1.65rem, 2.8vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.86rem;
  color: var(--text-soft);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.answer-box {
  background: var(--primary-soft);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.answer-box-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 6px;
}

.article-main h2 {
  margin: 30px 0 12px;
  font-size: 1.38rem;
  letter-spacing: -0.015em;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.article-main h3 {
  margin: 22px 0 8px;
  font-size: 1.12rem;
}

.article-main pre {
  background: var(--surface-code);
  color: #e2e8f0;
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  position: relative;
}

.article-main code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 5px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-main pre code {
  background: transparent;
  padding: 0;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.9rem;
}

.doc-table th,
.doc-table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: normal;
}

.doc-table td code {
  overflow-wrap: break-word;
  word-break: break-word;
}

.doc-table th {
  background: var(--surface-alt);
  font-weight: 700;
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 86px;
}

.toc-box, .cta-box, .author-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.toc-box h3, .cta-box h3 {
  margin: 0 0 10px;
  font-size: 0.96rem;
}

.toc-box ul {
  margin: 0;
  padding-left: 16px;
  font-size: 0.88rem;
}

.toc-box li {
  margin-bottom: 6px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg);
}

.faq-item summary {
  font-weight: 700;
  cursor: pointer;
}

/* AdSense-Friendly Reserved Slot (Non-Intrusive, Zero CLS) */
.ad-slot {
  margin: 26px auto;
  padding: 14px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-soft);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-slot[data-ad-live="false"] {
  display: none;
}

/* Footer */
.site-footer {
  background: #0b1120;
  color: #cbd5e1;
  border-top: 1px solid #1e293b;
  padding: 48px 0 28px;
}

.site-footer a {
  color: #cbd5e1;
}

.site-footer a:hover {
  color: #38bdf8;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid #1e293b;
}

.footer-col h4 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Filter Pills on Guides Hub */
.pillar-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  scroll-margin-top: 92px;
}

.pillar-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  scroll-margin-top: 92px;
}

.pillar-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

[data-theme="dark"] .pillar-tab.is-active {
  color: #0b1120;
}

/* Circular Go-To-Top Button with Scroll Percentage & Outline Progress Ring */
.scroll-top-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 95;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(0.9);
  transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

[data-theme="dark"] .scroll-top-btn {
  background: rgba(17, 24, 39, 0.92);
  box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.65), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.scroll-top-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-lg);
}

.scroll-top-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.scroll-top-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
  pointer-events: none;
}

.scroll-grad-start {
  stop-color: var(--primary);
}

.scroll-grad-end {
  stop-color: var(--teal);
}

.scroll-top-track {
  stroke: var(--border-strong);
  opacity: 0.45;
}

[data-theme="dark"] .scroll-top-track {
  stroke: rgba(148, 163, 184, 0.25);
  opacity: 1;
}

.scroll-top-progress {
  stroke-dasharray: 150.796;
  stroke-dashoffset: 150.796;
  transition: stroke-dashoffset 0.08s linear;
}

.scroll-top-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  pointer-events: none;
}

.scroll-top-arrow {
  width: 11px;
  height: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.scroll-top-pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  transition: color 0.2s ease;
}

.scroll-top-btn:hover .scroll-top-arrow {
  transform: translateY(-2px);
  color: var(--primary);
}

.scroll-top-btn:hover .scroll-top-pct {
  color: var(--primary);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top-btn,
  .scroll-top-progress,
  .scroll-top-arrow {
    transition: none;
  }
}

@media print {
  .scroll-top-btn,
  .donate-btn {
    display: none !important;
  }
}

/* Animated PayPal Donate Button (Top Bar & Footer) */
@keyframes av-donate-gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes av-donate-shimmer {
  0% { transform: translateX(-150%) skewX(-22deg); }
  36%, 100% { transform: translateX(260%) skewX(-22deg); }
}

@keyframes av-heart-beat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.22); }
  28% { transform: scale(1); }
  42% { transform: scale(1.16); }
  56%, 100% { transform: scale(1); }
}

@keyframes av-donate-glow {
  0%, 100% { box-shadow: 0 4px 14px -2px rgba(2, 132, 199, 0.36), 0 0 0 0 rgba(56, 189, 248, 0.38); }
  50% { box-shadow: 0 6px 20px -2px rgba(37, 99, 235, 0.5), 0 0 0 5px rgba(56, 189, 248, 0); }
}

.donate-btn,
.main-nav a.donate-btn-nav,
.site-footer a.donate-btn-footer {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 999px;
  background: linear-gradient(120deg, #0070ba, #2563eb, #0f766e, #0070ba);
  background-size: 220% 220%;
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  animation: av-donate-gradient 5.5s ease infinite, av-donate-glow 2.8s ease-in-out infinite;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.2s ease;
}

.donate-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  pointer-events: none;
  animation: av-donate-shimmer 4s ease-in-out infinite;
}

.main-nav a.donate-btn-nav {
  padding: 7px 14px;
  min-height: 36px;
  font-size: 0.86rem;
  margin-left: 4px;
}

.site-footer a.donate-btn-footer {
  padding: 10px 18px;
  min-height: 40px;
  font-size: 0.9rem;
}

.footer-donate-wrap {
  margin-top: 16px;
}

.donate-heart {
  flex-shrink: 0;
  color: #fda4af;
  animation: av-heart-beat 2.2s ease-in-out infinite;
  transition: color 0.18s ease;
}

.donate-btn:hover,
.main-nav a.donate-btn-nav:hover,
.site-footer a.donate-btn-footer:hover {
  background: linear-gradient(120deg, #0070ba, #2563eb, #0f766e, #0070ba);
  background-size: 220% 220%;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1.5px) scale(1.03);
  filter: brightness(1.07);
}

.donate-btn:hover .donate-heart {
  color: #ffe4e6;
}

.donate-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .donate-btn,
  .main-nav a.donate-btn-nav,
  .site-footer a.donate-btn-footer,
  .donate-btn::after,
  .donate-heart,
  .site-footer a.dev-badge-link,
  .site-footer a.dev-badge-link::after,
  .dev-badge-name {
    animation: none !important;
  }
}

/* Centered Animated Developer Credit at Bottom of Footer */
@keyframes av-dev-text-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

@keyframes av-dev-pill-glow {
  0%, 100% {
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 2px 10px -2px rgba(56, 189, 248, 0.2), inset 0 0 10px rgba(56, 189, 248, 0.06);
  }
  50% {
    border-color: rgba(45, 212, 191, 0.7);
    box-shadow: 0 4px 18px -2px rgba(45, 212, 191, 0.34), inset 0 0 14px rgba(45, 212, 191, 0.14);
  }
}

.footer-credit {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.footer-credit-inner {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.86rem;
  color: #94a3b8;
  font-weight: 500;
}

.site-footer a.dev-badge-link {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  animation: av-dev-pill-glow 3.2s ease-in-out infinite;
  transition: transform 0.18s ease, background 0.18s ease;
}

.site-footer a.dev-badge-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.25), transparent);
  pointer-events: none;
  animation: av-donate-shimmer 4.4s ease-in-out infinite;
}

.site-footer a.dev-badge-link:hover {
  background: rgba(30, 41, 59, 0.95);
  color: #7dd3fc;
  text-decoration: none;
  transform: translateY(-1.5px) scale(1.03);
}

.dev-gh-icon {
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.site-footer a.dev-badge-link:hover .dev-gh-icon {
  transform: rotate(-8deg) scale(1.1);
}

.dev-badge-name {
  background: linear-gradient(90deg, #38bdf8, #2dd4bf, #a78bfa, #38bdf8);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: av-dev-text-flow 4.5s linear infinite;
}

.site-footer a.dev-badge-link:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 3px;
}

/* Responsive Breakpoints */
@media (max-width: 1160px) {
  .zero-pill {
    display: none;
  }
  .main-nav a {
    padding: 8px 9px;
    font-size: 0.86rem;
  }
  .main-nav a.donate-btn-nav {
    padding: 7px 12px;
    font-size: 0.84rem;
    min-height: 36px;
  }
}

@media (max-width: 1024px) {
  .hero-grid,
  .analytics-grid,
  .article-shell {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sidebar-stack {
    position: static;
  }
}

@media (max-width: 900px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px;
    box-shadow: var(--shadow-md);
  }
  .main-nav.is-open {
    display: flex;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .zero-pill {
    display: none;
  }
  .main-nav a.donate-btn-nav {
    margin: 6px 0 2px;
    padding: 10px 16px;
  }
}

@media (max-width: 760px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-grid-3,
  .card-grid-2,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .article-main {
    padding: 22px 18px;
  }
  .export-bar {
    margin-left: 0;
    width: 100%;
  }
  .scroll-top-btn {
    width: 50px;
    height: 50px;
    right: 16px;
    bottom: 16px;
  }
  .scroll-top-pct {
    font-size: 0.64rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 14px;
  }
  .header-inner {
    gap: 8px;
    min-height: 60px;
  }
  .header-actions {
    gap: 6px;
  }
  .brand-sub {
    font-size: 0.58rem;
    letter-spacing: 0.05em;
  }
  #theme-toggle .theme-label {
    display: none;
  }
  .workbench-topbar,
  .dropzone-wrap,
  .findings-section,
  .filter-bar,
  .ioc-panel,
  .analytics-grid,
  .kpi-grid {
    padding-left: 14px;
    padding-right: 14px;
  }
  .article-main {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }
  .info-card {
    padding: 16px;
  }
  .article-main pre {
    padding: 12px;
    font-size: 0.78rem;
  }
  .scroll-top-btn {
    width: 46px;
    height: 46px;
    right: 12px;
    bottom: 12px;
  }
  .scroll-top-pct {
    font-size: 0.62rem;
  }
}
