/* SEO Audit Report — Design Framework */
/* Aesthetic: Clean SaaS utility. Light, functional, data-focused. */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ─── Tokens ─── */
:root {
  /* Surfaces */
  --bg:           #ffffff;
  --bg-sidebar:   #1b3c5f;
  --bg-subtle:    #f4f5f7;
  --bg-card:      #ffffff;
  --bg-code:      #f0f2f5;
  --bg-hover:     #eaecf0;
  --bg-badge:     #f0f2f5;

  /* Borders */
  --border:       #dfe1e6;
  --border-light: #ebecf0;

  /* Text */
  --text-primary:   #111111;
  --text-secondary: #222222;
  --text-muted:     #555555;
  --text-inverse:   #ffffff;
  --heading:        #1b3c5f;  /* Matches sidebar navy — gives H1/H2 brand-weighted presence vs. body text */

  /* Accent — muted steel blue */
  --accent:         #4a6fa5;
  --accent-hover:   #3d5f91;
  --accent-light:   #e8eef6;
  --accent-bg:      #f2f5fa;

  /* Status */
  --critical:       #d63031;
  --critical-bg:    #fef2f2;
  --critical-border:#fca5a5;
  --high:           #e67e22;
  --high-bg:        #fffbeb;
  --high-border:    #fcd34d;
  --medium:         #1e4680;
  --medium-bg:      #e6effb;
  --medium-border:  #6b9ad6;
  --low:            #7f8c8d;
  --low-bg:         #f8f9fa;
  --low-border:     #d1d5db;
  --pass:           #27ae60;
  --pass-bg:        #f0fdf4;
  --pass-border:    #86efac;
  --fail:           #d63031;
  --fail-bg:        #fef2f2;

  /* Score gauge colors */
  --score-critical: #d63031;
  --score-poor:     #e67e22;
  --score-fair:     #f1c40f;
  --score-good:     #27ae60;
  --score-great:    #1e8449;

  /* Layout */
  --sidebar-w:    310px;
  --header-h:     64px;
  --radius:       6px;
  --radius-lg:    10px;

  /* Type */
  --font-body:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease, width 0.2s ease;
  color: #c8cdd3;
}

.sidebar-brand {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand-logo {
  max-width: 180px;
  height: auto;
  margin-bottom: 12px;
}

.sidebar-brand .sidebar-site {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.sidebar-brand h2 {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 2px 0 0 0;
}

.sidebar-brand p {
  font-size: 12px;
  color: #ffffff;
  margin-top: 2px;
}

.sidebar-score {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-score-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #ffffff;
  margin-bottom: 8px;
}

.sidebar-score-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
}

.sidebar-score-bar {
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.sidebar-score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6b7280;
  padding: 8px 22px 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 22px;
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.06);
  color: #e5e7eb;
}

.sidebar-nav a.active {
  background: rgba(74,111,165,0.15);
  color: #93b4e0;
  font-weight: 500;
  border-left-color: #93b4e0;
}

.sidebar-nav a .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 1;
}

.sidebar-nav a.active .nav-icon {
  opacity: 1;
}

.sidebar-nav a .nav-score {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.12);
  color: #ffffff !important;     /* defeat any rank-based text-* color */
}

.sidebar-nav a.active .nav-score {
  background: rgba(147,180,224,0.2);
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  /* Cast a shadow upward so the nav behind reads as recessed */
  box-shadow: 0 -8px 16px -6px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  color: #6b7280;
  background: var(--bg-sidebar);
  position: relative;
  z-index: 1;
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: #c8cdd3;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  outline: none;
}
.sidebar-collapse-btn .sidebar-collapse-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 220ms ease;
}
body.sidebar-collapsed .sidebar-collapse-btn .sidebar-collapse-icon {
  transform: rotate(180deg);
}

/* Collapsed sidebar state */
body.sidebar-collapsed .sidebar { width: 60px; }
body.sidebar-collapsed .content { margin-left: 60px; }
body.sidebar-collapsed .sidebar-brand {
  padding: 14px 0;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
body.sidebar-collapsed .sidebar-brand-logo,
body.sidebar-collapsed .sidebar-site,
body.sidebar-collapsed .sidebar-brand h2 { display: none; }

/* Cart icon only appears when sidebar is collapsed */
.sidebar-brand-icon { display: none; }
body.sidebar-collapsed .sidebar-brand-icon {
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto;
}
body.sidebar-collapsed .sidebar-score { display: none; }
body.sidebar-collapsed .sidebar-nav a {
  padding: 10px 0;
  justify-content: center;
  font-size: 0;           /* hides the text node; nav-icon has explicit width/height */
  border-left-width: 0;
}

/* Sidebar collapsed-icon tooltip (shared floating element, positioned via JS) */
.sidebar-tooltip {
  position: fixed;
  transform: translateY(-50%);
  background: rgba(17, 17, 17, 0.96);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease;
  z-index: 300;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.sidebar-tooltip.visible {
  opacity: 1;
  visibility: visible;
}
body.sidebar-collapsed .sidebar-nav a .nav-icon { margin: 0; }
body.sidebar-collapsed .sidebar-nav a .nav-score { display: none; }
body.sidebar-collapsed .sidebar-footer { padding: 8px; }
body.sidebar-collapsed .sidebar-collapse-btn {
  padding: 8px 0;
  justify-content: center;
}
body.sidebar-collapsed .sidebar-collapse-label { display: none; }
body.sidebar-collapsed .sidebar-user { display: none; }

/* ─── Back-to-top button (lives inside .subnav, pinned bottom-left) ─── */
.back-to-top {
  margin: 0 0 4px 10px;
  margin-top: auto;          /* eats remaining flex space so it sits at the bottom of the viewport */
  align-self: flex-start;    /* bottom-LEFT of the subnav rail */
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-sidebar);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 200ms ease, visibility 200ms ease, transform 200ms ease, background 120ms ease;
}
.back-to-top.visible {
  opacity: 0.5;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top.visible:hover,
.back-to-top.visible:focus-visible,
.back-to-top.visible:active {
  opacity: 1;
  background: var(--accent);
  outline: none;
}
.back-to-top svg {
  width: 18px;
  height: 18px;
}

/* ─── Mobile sidebar toggle ─── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-secondary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 90;
}

/* ─── Main Content ─── */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

.page-header {
  padding: 32px 48px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.3;
}

.page-header .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

.page-body {
  padding: 32px 48px 64px;
  max-width: 1100px;
}

/* Two-column variant: sticky sub-nav rail + content */
.page-body-with-subnav {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  max-width: 1320px;
  padding: 32px 48px 64px;
}
.page-body-with-subnav .page-body-content {
  min-width: 0;
}
.page-body-with-subnav .section {
  scroll-margin-top: 24px;
}

.subnav {
  position: sticky;
  top: 24px;
  align-self: start;
  height: calc(100vh - 48px);   /* always fills viewport so flex-bottom sticks to the bottom */
  overflow-y: auto;
  padding: 4px 0 8px;
  display: flex;
  flex-direction: column;
}
.subnav-brand {
  display: block;
  padding: 2px 10px 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
  line-height: 0;
}
.subnav-brand img {
  height: 64px;
  width: auto;
  opacity: 0.95;
  transition: opacity 120ms ease;
}
.subnav-brand:hover img,
.subnav-brand:focus-visible img {
  opacity: 1;
  outline: none;
}
.subnav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 10px;
  padding-left: 10px;
}
.subnav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}
.subnav-link {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  margin-left: -2px;
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.subnav-link:hover {
  color: var(--accent);
  background: var(--accent-bg);
}
.subnav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
  background: var(--accent-bg);
}

@media (max-width: 900px) {
  .page-body-with-subnav {
    display: block;
    padding: 24px 24px 48px;
  }
  .subnav {
    position: static;
    max-height: none;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }
  .subnav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-left: none;
  }
  .subnav-link {
    margin-left: 0;
    border-left: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
  }
  .subnav-link.active {
    border-color: var(--accent);
  }
}

/* ─── Score Badge (header) ─── */
.score-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.score-badge small {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.7;
}

.score-badge.score-critical { background: var(--critical-bg); color: var(--critical); }
.score-badge.score-poor     { background: var(--high-bg);     color: var(--high); }
.score-badge.score-fair     { background: var(--medium-bg);   color: var(--medium); }
.score-badge.score-good     { background: var(--pass-bg);     color: var(--pass); }

/* ─── Section ─── */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.section-intro {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}
.section-intro p { margin: 0 0 10px; }
.section-intro p:last-child { margin-bottom: 0; }

/* Collapsible intro: clamp to ~5 lines, slide open on Read more */
.intro-block { margin: 0 0 20px; }
.intro-block > .section-intro { margin-bottom: 0; }
.intro-collapsible {
  position: relative;
  max-height: 8.6em;
  overflow: hidden;
  transition: max-height 320ms ease;
}
.intro-collapsible.expanded { max-height: 200em; }
.intro-collapsible.is-overflowing:not(.expanded)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.4em;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--bg) 85%);
  pointer-events: none;
}
.intro-readmore-btn {
  display: none;
  align-items: center;
  gap: 4px;
  margin: 6px 0 0;
  padding: 4px 0;
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}
.intro-readmore-btn.is-visible { display: inline-flex; }
.intro-readmore-btn:hover,
.intro-readmore-btn:focus-visible {
  color: var(--accent-hover);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.intro-readmore-btn svg {
  width: 12px;
  height: 12px;
  transition: transform 220ms ease;
}
.intro-readmore-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Score Grid ─── */
.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.score-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.score-card-label {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 500;
}

.score-card-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 8px;
}

.score-card-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.score-card-fill {
  height: 100%;
  border-radius: 2px;
}

.score-card-status {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

/* ─── Tables ─── */
/* PageSpeed Insights screenshot figure */
.psi-snapshot {
  margin: 16px 0 24px;
  padding: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.psi-snapshot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 2px);
  background: #ffffff;
}
.psi-snapshot figcaption {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

thead {
  background: var(--bg-subtle);
}

th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: top;
}

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

tr:hover {
  background: var(--accent-bg);
}

/* ─── Priority / Status Badges ─── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-critical { background: var(--critical-bg); color: var(--critical); border: 1px solid var(--critical-border); }
.badge-high     { background: var(--high-bg);     color: var(--high);     border: 1px solid var(--high-border); }
.badge-medium   { background: var(--medium-bg);   color: var(--medium);   border: 1px solid var(--medium-border); }
.badge-low      { background: var(--low-bg);      color: var(--low);      border: 1px solid var(--low-border); }
.badge-pass     { background: var(--pass-bg);     color: var(--pass);     border: 1px solid var(--pass-border); }
.badge-fail     { background: var(--fail-bg);     color: var(--fail);     border: 1px solid var(--critical-border); }
.badge-info     { background: var(--medium-bg);   color: var(--medium);   border: 1px solid var(--medium-border); }

/* ─── Finding Blocks ─── */
.finding {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.finding-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  cursor: pointer;
  user-select: none;
}

.finding-header:hover {
  background: var(--bg-hover);
}

.finding-id {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.finding-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.finding-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.finding.open .finding-chevron {
  transform: rotate(90deg);
}

.finding-body {
  padding: 16px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-light);
  display: none;
}

.finding.open .finding-body {
  display: block;
}

.finding-body p {
  margin-bottom: 12px;
}

.finding-body p:last-child {
  margin-bottom: 0;
}

.finding-critical { border-left: 3px solid var(--critical); }
.finding-high     { border-left: 3px solid var(--high); }
.finding-medium   { border-left: 3px solid var(--medium); }
.finding-low      { border-left: 3px solid var(--low); }

/* ─── Code Blocks ─── */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 12px 0;
  white-space: pre;
  color: var(--text-primary);
}

.code-inline {
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13.5px;
  font-weight: 500;
  color: #0f2d5c;
}

/* ─── Callout Boxes ─── */
.callout {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 16px 0;
  font-size: 1rem;
  line-height: 1.6;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 13px;
}

.callout-critical { background: var(--critical-bg); border: 1px solid var(--critical-border); color: #991b1b; }
.callout-warning  { background: var(--high-bg);     border: 1px solid var(--high-border);     color: #92400e; }
.callout-info     { background: var(--medium-bg);   border: 1px solid var(--medium-border);   color: #1e40af; }
.callout-success  { background: var(--pass-bg);     border: 1px solid var(--pass-border);     color: #166534; }

/* ─── Image / Screenshot ─── */
.screenshot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}

.screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-caption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
}

.screenshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

/* ─── Roadmap / Timeline ─── */
.roadmap {
  margin: 20px 0;
}

.roadmap-phase {
  position: relative;
  padding-left: 28px;
  padding-bottom: 24px;
  border-left: 2px solid var(--border);
}

.roadmap-phase:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.roadmap-dot {
  position: absolute;
  left: -7px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.roadmap-phase-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.roadmap-phase-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.roadmap-phase-items {
  list-style: none;
  font-size: 13px;
  color: var(--text-secondary);
}

.roadmap-phase-items li {
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}

.roadmap-phase-items li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

/* ─── Gauge (circular) ─── */
.gauge {
  width: 100px;
  height: 100px;
  position: relative;
}

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

.gauge-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.gauge-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
}

/* ─── Lists ─── */
.check-list {
  list-style: none;
  font-size: 1rem;
}

.check-list li {
  padding: 6px 0 6px 24px;
  position: relative;
  color: var(--text-secondary);
}

.check-list li::before {
  position: absolute;
  left: 0;
  font-size: 14px;
}

.check-list li.pass::before { content: '✓'; color: var(--pass); font-weight: 700; }
.check-list li.fail::before { content: '✗'; color: var(--fail); font-weight: 700; }
.check-list li.warn::before { content: '!'; color: var(--high); font-weight: 700; }

/* ─── Utility ─── */
.text-critical { color: var(--critical) !important; }
.text-high     { color: var(--high) !important; }
.text-medium   { color: var(--medium) !important; }
.text-pass     { color: var(--pass) !important; }
.text-muted    { color: var(--text-muted) !important; }
.text-mono     { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex { display: flex; }
.items-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: flex;
  }
  .sidebar-overlay.open {
    display: block;
  }
  .content {
    margin-left: 0;
  }
  .page-header {
    padding: 24px 24px 20px;
    padding-top: 64px;
  }
  .page-body {
    padding: 24px 24px 48px;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .screenshot-grid {
    grid-template-columns: 1fr;
  }
  .score-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
  }
  .score-grid {
    grid-template-columns: 1fr 1fr;
  }
  table {
    font-size: 12px;
  }
  th, td {
    padding: 8px 10px;
  }
}

/* ─── Print ─── */
@media print {
  .sidebar, .sidebar-toggle, .sidebar-overlay { display: none; }
  .content { margin-left: 0; }
  .page-header { padding: 16px 0; }
  .page-body { padding: 16px 0; }
  .finding-body { display: block !important; }
}

/* ─── Implementation Checklist ─── */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}
.checklist-item:hover {
  background: var(--bg-subtle);
  border-color: var(--border);
}
.checklist-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0 0;
  cursor: pointer;
  accent-color: var(--pass);
}
.checklist-item label {
  flex: 1 1 auto;
  cursor: default;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
}
.checklist-item label a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.checklist-item label a:hover {
  color: var(--accent-hover);
}
.checklist-item .checklist-meta {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
  align-items: center;
}
.checklist-item .checklist-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-badge);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}
.checklist-item .checklist-tag.critical { background: var(--critical-bg); color: var(--critical); border-color: var(--critical-border); }
.checklist-item .checklist-tag.high     { background: var(--high-bg);     color: var(--high);     border-color: var(--high-border); }
.checklist-item .checklist-tag.medium   { background: var(--medium-bg);   color: var(--medium);   border-color: var(--medium-border); }
.checklist-item .checklist-tag.low      { background: var(--low-bg);      color: var(--low);      border-color: var(--low-border); }
.checklist-item .checklist-attribution {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #8a96a3;
  font-style: italic;
}
.checklist-item .checklist-attribution::before { content: "Completed by "; }
.checklist-item.done {
  background: var(--pass-bg);
  border-color: var(--pass-border);
}
/* Brief highlight when the user lands on /{page}#chk-{slug} from the activity log */
.checklist-item:target {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  animation: chk-target-flash 1.6s ease-out;
}
.checklist-item input[type="checkbox"]:target,
.checklist-item input[type="checkbox"]:target + label {
  /* if the anchor lands on the input itself, lift the parent visually */
}
.checklist-item:has(:target),
.checklist-item:has(input:target) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  animation: chk-target-flash 1.6s ease-out;
}
@keyframes chk-target-flash {
  0%   { background: var(--accent-light); }
  100% { background: inherit; }
}
.checklist-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px 0;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 13px;
}
.checklist-progress-label {
  color: var(--text-muted);
}
.checklist-progress-count {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}
.checklist-progress-bar {
  flex: 1 1 auto;
  max-width: 240px;
  height: 6px;
  margin: 0 12px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}
.checklist-progress-fill {
  height: 100%;
  background: var(--pass);
  width: 0%;
  transition: width 180ms ease;
}

/* Drag handle + sortable states */
.checklist-drag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: 1px 2px 0 -4px;
  color: var(--text-muted);
  cursor: grab;
  opacity: 0.35;
  transition: opacity 120ms ease, color 120ms ease;
  user-select: none;
  touch-action: none;
}
.checklist-item:hover .checklist-drag {
  opacity: 0.85;
  color: var(--accent);
}
.checklist-drag:active,
.checklist-item.ui-sortable-helper .checklist-drag {
  cursor: grabbing;
  opacity: 1;
  color: var(--accent);
}
.checklist-item.ui-sortable-helper {
  box-shadow: 0 10px 28px rgba(17, 17, 17, 0.14);
  border-color: var(--accent);
  background: var(--bg-card);
}
.checklist-item-placeholder {
  height: 48px;
  margin: 10px 0;
  background: var(--accent-light);
  border: 1px dashed var(--accent);
  border-radius: 6px;
  visibility: visible !important;
  list-style: none;
}

/* ─── Accordion (native <details>) ─── */
.accordion {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  margin: 16px 0;
  background: var(--bg-card);
  overflow: hidden;
}
.accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-subtle);
  transition: background 120ms ease;
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::marker { display: none; content: ""; }
.accordion > summary:hover { background: var(--bg-hover); }
.accordion > summary::after {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  margin-left: 12px;
  transition: transform 160ms ease;
}
.accordion[open] > summary::after {
  transform: rotate(-135deg);
}
.accordion[open] > summary {
  background: var(--accent-light);
  color: var(--accent);
  border-bottom: 1px solid var(--border-light);
}
.accordion-body {
  padding: 14px 16px 16px;
}
.accordion-body > :first-child { margin-top: 0; }
.accordion-body > :last-child { margin-bottom: 0; }

/* ─── Snippet Library (cards + lightbox modal) ─── */
.snippet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin: 16px 0 20px;
}
.snippet-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
  position: relative;
}
.snippet-card:hover,
.snippet-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(74, 111, 165, 0.12);
  outline: none;
  transform: translateY(-1px);
}
.snippet-card-prereq {
  background: var(--high-bg);
  border-color: var(--high-border);
}
.snippet-card-prereq .snippet-card-file {
  color: var(--high);
}
.snippet-card-prereq .snippet-card-foot {
  border-top-color: var(--high-border);
}
.snippet-card-prereq .snippet-card-view {
  color: var(--high);
}
.snippet-card-prereq:hover,
.snippet-card-prereq:focus-visible {
  border-color: var(--high);
  box-shadow: 0 6px 20px rgba(230, 126, 34, 0.18);
}
.snippet-card-file {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
  word-break: break-all;
  line-height: 1.35;
}
.snippet-card-purpose {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1 1 auto;
}
.snippet-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  margin-top: 2px;
}
.snippet-card-included {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.snippet-card-view {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Lightbox modal */
.snippet-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(880px, calc(100vw - 32px));
  width: 100%;
  max-height: calc(100vh - 48px);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(17, 17, 17, 0.28);
  overflow: hidden;
  /* Center in viewport */
  inset: 0;
  margin: auto;
}
.snippet-modal::backdrop {
  background: rgba(17, 17, 17, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.snippet-modal[open] {
  display: flex;
  flex-direction: column;
  animation: snippet-modal-in 180ms ease-out;
}
@keyframes snippet-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.snippet-modal-inner {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  max-height: calc(100vh - 48px);
  width: 100%;
}
.snippet-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  flex: 0 0 auto;
}
.snippet-modal-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.snippet-modal-title {
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.35;
}
.snippet-modal-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.snippet-modal-close:hover,
.snippet-modal-close:focus-visible {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
  outline: none;
}
.snippet-modal-body {
  padding: 22px 22px 26px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}
.snippet-modal-body > :first-child { margin-top: 0; }
.snippet-modal-body > :last-child { margin-bottom: 0; }
.snippet-modal-body p {
  margin: 0 0 14px;
  color: var(--text-secondary);
}
.snippet-modal-body h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 18px 0 8px;
}
.snippet-modal-body h4:first-of-type { margin-top: 6px; }
.snippet-modal-body ul {
  margin: 0 0 14px;
  padding-left: 20px;
}
.snippet-modal-body li {
  margin: 0 0 6px;
  color: var(--text-secondary);
}
.snippet-modal-body li code { word-break: break-word; }
.snippet-modal-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin: 0 0 16px;
  font-size: 13px;
}
.snippet-modal-meta dt {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  align-self: center;
}
.snippet-modal-meta dd {
  margin: 0;
  color: var(--text-primary);
  word-break: break-word;
}

/* Multi-line code block inside modal */
.code-block {
  display: block;
  background: #12243b;
  color: #e8eefb;
  font-family: 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 12.5px;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin: 4px 0 14px;
  overflow-x: auto;
  white-space: pre;
  border: 1px solid #1b3c5f;
}
.code-block .tok-comment { color: #7d96b8; font-style: italic; }
.code-block .tok-liquid  { color: #ffb267; }
.code-block .tok-key     { color: #9cd6ff; }
.code-block .tok-string  { color: #c6f09d; }
.code-block .tok-punct   { color: #b8c6d9; }

/* Wide variant for embedded reports (iframe content) */
.snippet-modal-wide {
  max-width: min(1280px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
}
.snippet-modal-wide .snippet-modal-inner {
  height: 100%;
  max-height: 100%;
}
.snippet-modal-body-iframe {
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  flex: 1 1 auto;
  min-height: 0;
}
.snippet-modal-body-iframe iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 75vh;
  border: 0;
  background: #ffffff;
}

/* Link-styled button for opening reports */
.report-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.report-link:hover,
.report-link:focus-visible {
  color: var(--accent-hover);
  outline: none;
}

@media (max-width: 640px) {
  .snippet-grid { grid-template-columns: 1fr; }
  .snippet-modal { max-width: calc(100vw - 16px); }
  .snippet-modal-body { padding: 18px 16px 22px; }
  .snippet-modal-body-iframe { padding: 0; }
  .snippet-modal-header { padding: 14px 16px; }
  .snippet-modal-meta { grid-template-columns: 1fr; gap: 4px; }
  .snippet-modal-meta dt { margin-top: 6px; }
}
