:root {
  --bg: #fff;
  --bg-subtle: #f8f9fa;
  --text: #202124;
  --text-2: #5f6368;
  --hairline: #dadce0;
  --cta: #1a73e8;
  --cta-hover: #1557b0;
  --radius: 12px;
  --max: 52rem;
  --rawgraded: #0f2744;
  --company: #137333;
  --social: #9334e6;
  --warn-bg: #fef7e0;
  --warn-border: #fdd663;
  --tip-bg: #e8f0fe;
  --tip-border: #c6dafc;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cta); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; color: var(--cta-hover); }

.guide-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--hairline);
  max-width: 1080px;
  margin: 0 auto;
  font-size: 14px;
  color: var(--text-2);
}
.guide-banner a { font-weight: 600; }

.guide-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  padding: 16px 24px;
}
.guide-top-inner { max-width: var(--max); margin: 0 auto; }
.guide-top .eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.guide-top h1 { margin: 0 0 8px; font-size: 1.5rem; line-height: 1.25; }
.guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}
.guide-toc a { font-weight: 500; }

.guide-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.guide-main h2 {
  margin: 48px 0 16px;
  font-size: 1.35rem;
  scroll-margin-top: 88px;
}
.guide-main h2:first-of-type { margin-top: 24px; }
.guide-main h3 {
  margin: 28px 0 10px;
  font-size: 1.1rem;
}
.guide-main p { margin: 0 0 14px; color: var(--text); }
.guide-main .lead { font-size: 1.05rem; color: var(--text-2); }

.callout {
  padding: 16px 18px;
  border-radius: var(--radius);
  margin: 20px 0;
  font-size: 15px;
}
.callout--warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
}
.callout--tip {
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
}

.score-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
@media (min-width: 520px) {
  .score-grid { grid-template-columns: repeat(3, 1fr); }
}
.score-card {
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.score-card strong { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); margin-bottom: 4px; }

.cert-list { list-style: none; padding: 0; margin: 12px 0 24px; }
.cert-list li {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.cert-list a { font-size: 15px; }
.cert-list .note { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; color: var(--text-2); }

.check-card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  margin-bottom: 16px;
  background: #fff;
}
.check-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.check-card__title { margin: 0; font-size: 1rem; flex: 1 1 12rem; }
.check-card__id {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.check-card__rule { margin: 0 0 12px; font-size: 15px; }

.cite-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.cite-badge--rawgraded { background: #e8eef5; color: var(--rawgraded); }
.cite-badge--company { background: #e6f4ea; color: var(--company); }
.cite-badge--social { background: #f3e8fd; color: var(--social); }
.cite-badge--reference { background: #fef7e0; color: #b06000; }

.check-card__visual-heading,
.check-card__refs-heading {
  margin: 16px 0 8px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.house-hero {
  margin: 16px 0 24px;
  max-width: 36rem;
}

.ref-compare {
  display: grid;
  gap: 16px;
  margin: 0 0 8px;
}
@media (min-width: 640px) {
  .ref-compare {
    grid-template-columns: 1fr 1fr;
  }
  .ref-compare:has(.ref-figure:only-child) {
    grid-template-columns: 1fr;
    max-width: 28rem;
  }
}

.ref-figure {
  margin: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: #1a1a1a;
}
.ref-figure--diagram {
  background: var(--bg-subtle);
}
.ref-figure__variant {
  display: block;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-subtle);
  color: var(--text-2);
  border-bottom: 1px solid var(--hairline);
}
.ref-figure--authentic .ref-figure__variant { color: var(--company); }
.ref-figure--suspect .ref-figure__variant { color: #c5221f; }
.ref-figure__zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}
.ref-figure__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  margin: 0 auto;
}
.ref-figure--diagram .ref-figure__img {
  max-height: none;
  background: #fff;
}
.ref-figure figcaption {
  padding: 10px 12px 12px;
  background: #fff;
  font-size: 13px;
}
.ref-figure__caption {
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.45;
}
.ref-figure__attr {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 12px;
}
.ref-figure__attr a {
  font-weight: 600;
  font-size: 12px;
}

.guide-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 16px;
}
.guide-lightbox[hidden] {
  display: none !important;
}
.guide-lightbox__img {
  max-width: min(96vw, 1100px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
}
.guide-lightbox__close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
body.guide-lightbox-open {
  overflow: hidden;
}

.cite-list { list-style: none; padding: 0; margin: 0; }
.cite-list li {
  margin-bottom: 10px;
  padding-left: 0;
  font-size: 14px;
}
.cite-list .cite-list__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 2px;
}
.cite-list .note { color: var(--text-2); font-weight: 400; margin: 0; }

.guide-cta {
  margin-top: 40px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid var(--hairline);
  text-align: center;
}
.guide-cta .btn {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 24px;
  background: var(--cta);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}
.guide-cta .btn:hover { background: var(--cta-hover); color: #fff; text-decoration: none; }

.guide-footer {
  border-top: 1px solid var(--hairline);
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
}

#guide-mount[data-state="loading"]::after {
  content: "Loading checklist…";
  color: var(--text-2);
  font-size: 14px;
}
#guide-mount[data-state="error"] .callout--warn { display: block; }
