:root {
  --bg: #070b0f;
  --bg2: #0d1419;
  --panel: rgba(10, 18, 24, .82);
  --panel-solid: #101922;
  --line: rgba(139, 184, 196, .22);
  --text: #eef7f8;
  --muted: #91a8ad;
  --cyan: #53d9e8;
  --teal: #2fbda8;
  --amber: #f0b45a;
  --red: #ff6a6a;
  --green: #63d98b;
  --shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 72px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(18px, 4vw, 54px);
  background: rgba(7, 11, 15, .76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: max-content; }
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid rgba(83, 217, 232, .5);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(83, 217, 232, .2), rgba(47, 189, 168, .08));
  color: var(--cyan);
  font-weight: 800;
}
.brand strong { display: block; letter-spacing: .02em; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: -2px; }

.nav { display: flex; gap: 22px; margin-left: auto; color: var(--muted); font-size: 14px; }
.nav a:hover, .footer a:hover { color: var(--cyan); }
.nav-action {
  color: #061014;
  background: var(--cyan);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.hero {
  min-height: 94vh;
  position: relative;
  overflow: hidden;
  padding-top: 72px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("/assets/hero-infrastructure.png");
  background-size: cover;
  background-position: center right;
  filter: saturate(.92) brightness(.78);
  transform: scale(1.02);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 11, 15, .98) 0%, rgba(7, 11, 15, .74) 42%, rgba(7, 11, 15, .25) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(7, 11, 15, 0) 22%);
}
.hero-inner {
  position: relative;
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(44px, 7vw, 96px) 22px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .8fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.eyebrow {
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 14px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 780px;
  font-size: clamp(44px, 6.5vw, 84px);
  line-height: .95;
  letter-spacing: 0;
  margin-bottom: 22px;
}
.hero-text {
  max-width: 650px;
  color: #c4d3d7;
  font-size: clamp(17px, 2vw, 20px);
  margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.primary-link, .secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
}
.primary-link { background: var(--cyan); color: #061014; }
.secondary-link { border: 1px solid var(--line); color: var(--text); background: rgba(255, 255, 255, .04); }

.scanner-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(18px);
}
.panel-heading { margin-bottom: 18px; }
.panel-heading h2 { font-size: 25px; margin: 9px 0 6px; }
.panel-heading p { color: var(--muted); margin-bottom: 0; }
.status-pill {
  display: inline-flex;
  border: 1px solid rgba(83, 217, 232, .35);
  color: var(--cyan);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}
.scan-form label:first-child {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}
.input-row { display: flex; gap: 8px; }
.input-row input, .kb-search input {
  width: 100%;
  color: var(--text);
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  outline: none;
}
.input-row input:focus, .kb-search input:focus { border-color: var(--cyan); }
.input-row button, .kb-search button {
  border: 0;
  color: #061014;
  background: var(--cyan);
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
  cursor: pointer;
}
.input-row button:disabled { opacity: .55; cursor: progress; }
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #b2c4c8;
  font-size: 13px;
  margin-top: 13px;
}
.consent input { margin-top: 3px; accent-color: var(--cyan); }

.scan-state {
  margin-top: 18px;
  padding: 14px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}
.scan-state p { margin: 8px 0 0; }
.scan-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.scan-progress span {
  height: 4px;
  border-radius: 999px;
  background: rgba(83,217,232,.22);
}
.scan-progress.active span { animation: pulse 1.2s infinite ease-in-out; }
.scan-progress.active span:nth-child(2) { animation-delay: .12s; }
.scan-progress.active span:nth-child(3) { animation-delay: .24s; }
.scan-progress.active span:nth-child(4) { animation-delay: .36s; }
@keyframes pulse { 50% { background: var(--cyan); } }

.hidden { display: none !important; }
.report {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px;
}
.score-row small { color: var(--muted); display: block; }
.score-row strong { font-size: 40px; line-height: 1; }
.grade {
  min-width: 52px;
  min-height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  color: var(--cyan);
  font-weight: 900;
}
.issue {
  padding: 10px 0;
  border-top: 1px solid rgba(139,184,196,.16);
}
.issue strong { display: block; font-size: 13px; }
.issue p { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.sev-critical { color: var(--red); }
.sev-high { color: var(--amber); }
.sev-medium { color: #f3d174; }
.sev-low { color: var(--green); }
.report-link { display: inline-flex; margin-top: 12px; color: var(--cyan); font-weight: 800; font-size: 14px; }

.metrics-strip {
  max-width: 1220px;
  margin: -34px auto 0;
  position: relative;
  z-index: 2;
  padding: 0 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.metrics-strip div {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.metrics-strip strong { display: block; font-size: 24px; }
.metrics-strip span { color: var(--muted); font-size: 13px; }

.section {
  max-width: 1220px;
  margin: 0 auto;
  padding: 92px 22px 0;
}
.section-head { max-width: 760px; margin-bottom: 28px; }
.section-head h2 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  margin-bottom: 13px;
}
.section-head p:not(.eyebrow) { color: var(--muted); font-size: 17px; }
.feature-grid, .pricing-grid, .seo-grid, .faq-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.feature-grid article, .pricing-grid article, .kb-results article, .seo-grid article, .faq-list article {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}
.feature-grid span {
  color: var(--cyan);
  font-weight: 900;
  font-size: 12px;
}
.feature-grid h3, .pricing-grid h3, .seo-grid h3, .faq-list h3 { margin: 14px 0 8px; }
.feature-grid p, .pricing-grid li, .kb-results p, .seo-grid p, .faq-list p { color: var(--muted); font-size: 14px; }
.seo-section .section-head,
.faq-section .section-head { max-width: 880px; }
.seo-section .section-head p,
.faq-section .section-head p { line-height: 1.7; }
.faq-list { grid-template-columns: repeat(3, 1fr); }

.kb-search {
  display: flex;
  gap: 8px;
  max-width: 740px;
  margin-bottom: 18px;
}
.kb-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.kb-results article h3 { font-size: 16px; margin-bottom: 8px; }
.kb-results article a { color: var(--cyan); font-size: 13px; font-weight: 800; }
.tagline { color: var(--cyan); font-size: 12px; font-weight: 800; }

.pricing { padding-bottom: 96px; }
.pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pricing-grid .featured { border-color: rgba(83,217,232,.6); box-shadow: 0 0 0 1px rgba(83,217,232,.14) inset; }
.price { color: var(--cyan); font-size: 28px; font-weight: 900; margin-bottom: 12px; }
.pricing-grid ul { padding-left: 18px; margin-bottom: 0; }
.pricing-grid li { margin-bottom: 8px; }

.footer {
  border-top: 1px solid var(--line);
  padding: 34px clamp(22px, 4vw, 54px);
  display: grid;
  grid-template-columns: minmax(260px, .95fr) minmax(420px, 1.35fr);
  gap: clamp(28px, 5vw, 64px);
  color: var(--muted);
  background: rgba(5, 10, 14, .72);
}
.footer p { margin: 4px 0 0; }
.footer strong { color: var(--text); }
.footer-legal, .footer-version { font-size: 12px; }
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.trust-badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 8px;
  max-width: 420px;
}
.trust-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(83,217,232,.24);
  border-radius: 8px;
  color: rgba(223,252,255,.78);
  background: rgba(83,217,232,.055);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
}
.ecosystem-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  color: rgba(188, 213, 221, .66);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .86;
}
.ecosystem-mark::before {
  content: "";
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, rgba(83,217,232,.55), rgba(83,217,232,0));
}
.ecosystem-mark img {
  width: 108px;
  height: auto;
  display: block;
  opacity: .86;
  filter: drop-shadow(0 0 6px rgba(83,217,232,.16));
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.footer-nav div {
  display: grid;
  gap: 9px;
  align-content: start;
}
.footer-nav strong {
  color: var(--text);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.footer-nav a {
  color: var(--muted);
  font-size: 13px;
}
.footer-nav a:hover { color: var(--cyan); }

@media (max-width: 980px) {
  .nav { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .scanner-panel { max-width: 680px; }
  .metrics-strip, .feature-grid, .seo-grid, .faq-list, .kb-results { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .topbar { height: 64px; }
  .nav-action { display: none; }
  .hero { padding-top: 64px; }
  .hero-inner { padding-top: 36px; }
  h1 { font-size: 42px; }
  .footer { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: 1fr; }
  .trust-badges { grid-template-columns: 1fr; }
  .input-row, .kb-search { flex-direction: column; }
  .input-row button, .kb-search button { min-height: 46px; }
  .metrics-strip, .feature-grid, .seo-grid, .faq-list, .kb-results, .pricing-grid { grid-template-columns: 1fr; }
  .metrics-strip { margin-top: 0; }
  .ecosystem-mark {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .ecosystem-mark::before { width: 42px; }
  .ecosystem-mark img { width: 104px; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   ROUTER / PAGES
═══════════════════════════════════════════════════════════════════════════ */
.page { display: none; }
.page--active { display: block; }

.static-page {
  max-width: 980px;
  margin: 0 auto;
  padding: calc(72px + 46px) 22px 80px;
}
.static-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  padding: clamp(22px, 4vw, 38px);
  box-shadow: var(--shadow);
}
.static-shell h1 {
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.05;
  margin-bottom: 14px;
}
.static-shell h2 {
  font-size: 22px;
  margin: 28px 0 10px;
}
.static-shell p,
.static-shell li {
  color: var(--muted);
  line-height: 1.72;
}
.static-shell code {
  color: var(--cyan);
  background: rgba(83,217,232,.1);
  border-radius: 3px;
  padding: 1px 5px;
}
.static-shell ul { padding-left: 22px; }
.status-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  padding: 16px;
}
.status-card strong { display: block; color: var(--text); margin-bottom: 5px; }
.status-ok {
  color: var(--green);
  font-weight: 900;
}
@media (max-width: 720px) {
  .status-board { grid-template-columns: 1fr; }
}

.cookie-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid rgba(83,217,232,.32);
  border-radius: 8px;
  background: rgba(8, 18, 25, .96);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 16px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner strong { display: block; margin-bottom: 4px; }
.cookie-banner p { margin: 0; color: var(--muted); font-size: 13px; }
.cookie-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cookie-actions a,
.cookie-actions button {
  border-radius: 8px;
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}
.cookie-actions a {
  display: inline-flex;
  align-items: center;
  color: var(--cyan);
}
.cookie-actions button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
}
.cookie-actions button:last-child {
  border-color: transparent;
  background: var(--cyan);
  color: #061014;
}
@media (max-width: 720px) {
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .cookie-actions { justify-content: flex-start; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   SHARED UTILITIES
═══════════════════════════════════════════════════════════════════════════ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0;
  transition: color .15s;
}
.back-link:hover { color: var(--cyan); }

.sev-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sev-badge--critical { background: rgba(239,68,68,.18);   color: #ef4444; }
.sev-badge--high     { background: rgba(249,115,22,.18);  color: #f97316; }
.sev-badge--medium   { background: rgba(234,179,8,.18);   color: #eab308; }
.sev-badge--low      { background: rgba(96,165,250,.18);  color: #60a5fa; }
.sev-badge--info     { background: rgba(107,114,128,.18); color: #9ca3af; }

.status-icon--fail    { color: #ef4444; }
.status-icon--warn    { color: #f97316; }
.status-icon--pass    { color: #22c55e; }
.status-icon--timeout { color: #9ca3af; }
.status-icon--error   { color: #ef4444; }
.status-icon--info    { color: #6b7280; }

.loading-state, .error-state {
  text-align: center;
  padding: 64px 22px;
  color: var(--muted);
  font-size: 16px;
}
.error-state { color: var(--red); }


/* ═══════════════════════════════════════════════════════════════════════════
   INLINE REPORT ENHANCEMENTS (scanner panel mini-report)
═══════════════════════════════════════════════════════════════════════════ */
.issue-public-title { font-size: 13px; font-weight: 600; }
.issue-explanation  { color: var(--muted); font-size: 12px; margin: 2px 0 0; }

.report-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.btn-full-report {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--cyan);
  color: #061014;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  border: none;
}
.btn-full-report:hover { opacity: .9; }

.btn-pdf-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s;
}
.btn-pdf-mini:hover { border-color: var(--cyan); color: var(--cyan); }


/* ═══════════════════════════════════════════════════════════════════════════
   REPORT PAGE
═══════════════════════════════════════════════════════════════════════════ */
.report-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(72px + 28px) 22px 80px;
  min-height: 100vh;
}

.report-page__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid rgba(83,217,232,.4);
  background: rgba(83,217,232,.08);
  color: var(--cyan);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn-pdf:hover { background: rgba(83,217,232,.16); border-color: var(--cyan); }

/* Report header card */
.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 24px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-wrap: wrap;
}
.report-header__target {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  margin: 0 0 8px;
  word-break: break-all;
  line-height: 1.2;
}
.report-header__meta {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.report-header__grade-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 80px;
}
.report-grade {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid currentColor;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}
.report-score { font-size: 13px; color: var(--muted); }

/* Executive summary */
.exec-summary {
  padding: 24px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 20px;
}
.exec-summary__section-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.exec-summary__headline {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
}
.exec-summary__desc {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
  line-height: 1.6;
}
.exec-summary__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.exec-col h4 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.exec-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.exec-col li {
  font-size: 14px;
  padding: 4px 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px solid rgba(139,184,196,.08);
}
.exec-col li:last-child { border-bottom: none; }
.exec-col--works li::before    { content: "✓"; color: #22c55e; flex-shrink: 0; }
.exec-col--attention li::before { content: "⚠"; color: #f97316; flex-shrink: 0; }
.exec-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.exec-summary__fix-time {
  font-size: 13px;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.exec-summary__fix-time strong { color: var(--text); }

/* Foundation collapse analysis */
.foundation-card {
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--foundation-color) 42%, transparent);
  border-left: 4px solid var(--foundation-color);
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--foundation-color) 12%, transparent), transparent 42%),
    var(--panel-solid);
}
.foundation-card__head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.foundation-card__eyebrow {
  color: var(--foundation-color);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.foundation-card h2 { margin: 0 0 8px; font-size: 24px; }
.foundation-card p { color: var(--muted); margin: 0; line-height: 1.55; }
.foundation-status {
  min-width: 180px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--foundation-color) 56%, transparent);
  border-radius: 8px;
  text-align: center;
  background: color-mix(in srgb, var(--foundation-color) 10%, transparent);
}
.foundation-status span {
  display: block;
  color: var(--foundation-color);
  font-weight: 900;
  font-size: 14px;
}
.foundation-status small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 11px;
}
.foundation-pyramid {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  max-width: 520px;
}
.foundation-pyramid span,
.foundation-pyramid strong {
  display: block;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(15, 23, 42, .42);
}
.foundation-pyramid strong {
  color: var(--text);
  border-color: color-mix(in srgb, var(--foundation-color) 48%, transparent);
  background: color-mix(in srgb, var(--foundation-color) 12%, rgba(15, 23, 42, .42));
}
.foundation-point {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, .2);
  background: rgba(3, 7, 18, .36);
}
.foundation-point__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.foundation-point__meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(83, 217, 232, .1);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
}
.foundation-point h4 { margin: 0 0 8px; font-size: 17px; }
.foundation-point p + p { margin-top: 8px; }
.foundation-empty {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  color: var(--text);
  background: rgba(34, 197, 94, .1);
  border: 1px solid rgba(34, 197, 94, .2);
}
.foundation-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.foundation-controls span {
  color: var(--text);
  background: rgba(34, 197, 94, .1);
  border: 1px solid rgba(34, 197, 94, .2);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
}
.foundation-method { margin-top: 14px !important; font-size: 12px; }

/* Severity counts row */
.sev-counts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 28px;
}
.sev-count-item {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 10px;
  text-align: center;
}
.sev-count-item__num {
  display: block;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}
.sev-count-item__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sev-count-item--critical .sev-count-item__num { color: #ef4444; }
.sev-count-item--high .sev-count-item__num     { color: #f97316; }
.sev-count-item--medium .sev-count-item__num   { color: #eab308; }
.sev-count-item--low .sev-count-item__num      { color: #60a5fa; }
.sev-count-item--info .sev-count-item__num     { color: #9ca3af; }

/* Findings groups */
.findings-list-heading {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.findings-group { margin-bottom: 24px; }
.findings-group__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 0 0 10px;
  margin: 0 0 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Finding card — accordion */
.finding-card {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-left: 3px solid var(--sev-color, var(--line));
  border-radius: 8px;
  margin-bottom: 6px;
  overflow: hidden;
}
.finding-card--critical { --sev-color: #ef4444; }
.finding-card--high     { --sev-color: #f97316; }
.finding-card--medium   { --sev-color: #eab308; }
.finding-card--low      { --sev-color: #60a5fa; }
.finding-card--info     { --sev-color: #6b7280; }

.finding-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.finding-card__header:hover { background: rgba(255,255,255,.022); }

.finding-card__icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-style: normal;
}
.finding-card__title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.finding-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.fix-time-hint { font-size: 11px; color: var(--muted); }
.finding-card__chevron {
  color: var(--muted);
  font-size: 18px;
  flex-shrink: 0;
  transition: transform .2s;
  display: inline-block;
  line-height: 1;
}
.finding-card.is-open .finding-card__chevron { transform: rotate(90deg); }
.finding-card__body {
  display: none;
  padding: 2px 14px 16px 44px;
  border-top: 1px solid var(--line);
}
.finding-card.is-open .finding-card__body { display: block; }

.finding-body__explanation {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 12px 0 10px;
}
.finding-body__explanation p { margin: 0 0 8px; }
.ports-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}
.ports-list strong { color: var(--text); }
.finding-body__impact {
  font-size: 13px;
  color: var(--amber);
  margin-bottom: 10px;
}
.finding-body__rec {
  font-size: 14px;
  margin-bottom: 10px;
}
.finding-body__rec strong { color: var(--text); }
.finding-body__code-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.finding-body__code {
  background: rgba(0,0,0,.4);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  color: var(--cyan);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}
.finding-body__ai-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(83,217,232,.3);
  background: rgba(83,217,232,.06);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.ai-btn:hover { background: rgba(83,217,232,.14); }
.ai-btn:disabled {
  cursor: wait;
  opacity: .62;
}
.ai-btn--explain { border-color: rgba(99,217,139,.3); background: rgba(99,217,139,.06); color: #63d98b; }
.ai-btn--explain:hover { background: rgba(99,217,139,.14); }

.ai-output-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 220;
  width: min(720px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  background: rgba(8, 14, 20, .97);
  border: 1px solid rgba(83,217,232,.28);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.ai-output-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.ai-output-panel__close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
}

.premium-ai-card {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(83, 217, 232, .22);
  background: linear-gradient(180deg, rgba(83, 217, 232, .08), rgba(99, 217, 139, .04));
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.premium-ai-card__eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

.premium-ai-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--text);
}

.premium-ai-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.premium-ai-card__button {
  border: 1px solid rgba(83, 217, 232, .42);
  background: rgba(83, 217, 232, .13);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.premium-ai-card__button:hover { background: rgba(83, 217, 232, .2); }
.premium-ai-card__button:disabled { opacity: .65; cursor: wait; }

.premium-ai-card__result {
  grid-column: 1 / -1;
}

.premium-ai-paywall,
.premium-ai-ready,
.premium-ai-loading,
.premium-ai-error {
  border: 1px solid rgba(148, 163, 184, .2);
  background: rgba(15, 23, 42, .45);
  border-radius: 8px;
  padding: 14px;
}

.premium-ai-paywall a {
  display: inline-flex;
  margin-top: 10px;
  color: var(--cyan);
  font-weight: 900;
}

.premium-ai-priority {
  margin: 12px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.premium-ai-priority code {
  background: rgba(83, 217, 232, .1);
  border: 1px solid rgba(83, 217, 232, .25);
  border-radius: 5px;
  padding: 2px 6px;
}

.premium-ai-finding {
  border-top: 1px solid rgba(148, 163, 184, .18);
  padding-top: 14px;
  margin-top: 14px;
}

.premium-ai-finding h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 16px;
}

.premium-ai-finding h4 {
  margin: 12px 0 6px;
  color: var(--text);
  font-size: 13px;
}

.premium-ai-finding ol,
.premium-ai-finding ul {
  margin: 0 0 8px 18px;
  color: var(--muted);
  line-height: 1.55;
}

.premium-ai-code-label {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  margin-top: 10px;
}

.premium-ai-code {
  margin: 6px 0 8px;
  padding: 10px;
  border-radius: 7px;
  background: rgba(2, 6, 23, .65);
  border: 1px solid rgba(148, 163, 184, .18);
  color: #dbeafe;
  overflow-x: auto;
  font-size: 12px;
}

.premium-ai-time {
  margin-top: 10px;
  color: var(--cyan);
  font-weight: 800;
}

.finding-body__kb-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.finding-body__kb-link:hover { color: var(--cyan); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 200;
  max-width: 360px;
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }


/* ═══════════════════════════════════════════════════════════════════════════
   KB ARTICLE PAGE
═══════════════════════════════════════════════════════════════════════════ */
.kb-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(72px + 28px) 22px 80px;
  min-height: 100vh;
}
.kb-page__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.kb-article-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.kb-article-header h1 {
  font-size: clamp(22px, 3.5vw, 34px);
  margin: 0 0 12px;
  line-height: 1.2;
}
.kb-article-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.kb-article-summary {
  max-width: 780px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}
.kb-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
}
.kb-sidebar {
  position: sticky;
  top: 92px;
  order: 2;
  display: grid;
  gap: 14px;
}
.kb-sidebar__block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  padding: 14px;
}
.kb-sidebar__block strong {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}
.kb-sidebar__block ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.kb-sidebar__block li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.kb-sidebar__block a {
  color: var(--muted);
  text-decoration: none;
}
.kb-sidebar__block a:hover { color: var(--cyan); }
.sev-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-top: 4px;
  background: #9ca3af;
}
.sev-dot--critical { background: #ef4444; }
.sev-dot--high { background: #f97316; }
.sev-dot--medium { background: #eab308; }
.sev-dot--low { background: #60a5fa; }
.sev-dot--info { background: #9ca3af; }
.kb-article-layout > .markdown { min-width: 0; }

/* Markdown content */
.markdown { font-size: 15px; line-height: 1.75; color: var(--text); }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 {
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 10px;
  line-height: 1.25;
}
.markdown h1 { font-size: 24px; }
.markdown h2 { font-size: 20px; border-bottom: 1px solid var(--line); padding-bottom: 7px; }
.markdown h3 { font-size: 17px; }
.markdown p { margin: 0 0 14px; }
.markdown ul, .markdown ol { padding-left: 22px; margin: 0 0 14px; }
.markdown li { margin-bottom: 6px; }
.markdown code {
  font-family: "Courier New", Courier, monospace;
  font-size: 12.5px;
  background: rgba(83,217,232,.1);
  color: var(--cyan);
  padding: 1px 5px;
  border-radius: 3px;
}
.markdown pre {
  background: rgba(0,0,0,.4);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
}
.markdown pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--cyan);
}
.markdown blockquote {
  border-left: 3px solid var(--cyan);
  padding: 4px 16px;
  margin: 0 0 14px;
  color: var(--muted);
}
.markdown strong { color: var(--text); }
.markdown a { color: var(--cyan); text-decoration: underline; }
.markdown a:hover { color: var(--teal); }
.markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 14px;
}
.markdown th {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.markdown td {
  border: 1px solid var(--line);
  padding: 8px 12px;
}
.markdown hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE ADDITIONS
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .sev-counts { grid-template-columns: repeat(3, 1fr); }
  .exec-summary__cols { grid-template-columns: 1fr; }
  .foundation-card__head { flex-direction: column; }
  .foundation-status { width: 100%; min-width: 0; }
  .kb-article-layout { grid-template-columns: 1fr; }
  .kb-sidebar {
    position: static;
    order: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .report-page { padding: calc(64px + 18px) 16px 60px; }
  .kb-page     { padding: calc(64px + 18px) 16px 60px; }
  .sev-counts  { grid-template-columns: repeat(3, 1fr); }
  .finding-card__title { font-size: 13px; }
  .fix-time-hint { display: none; }
  .report-header { flex-direction: column; }
  .report-page__nav { flex-direction: column; align-items: flex-start; }
  .finding-card__body { padding-left: 14px; }
  .kb-sidebar { grid-template-columns: 1fr; }
  .ai-output-panel {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}
