/* Route-scoped styles for the canonical TablePredict Guide. */

.guide-skip-link {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 100;
  min-height: 44px;
  padding: 12px 16px;
  transform: translateY(calc(-100% - 24px));
  color: #07111a;
  background: var(--yellow);
  border: 2px solid #07111a;
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.guide-skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.guide-page {
  min-width: 0;
  max-width: min(1240px, calc(100% - 32px));
  padding-bottom: 54px;
  scroll-margin-top: 92px;
}

.guide-page:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.guide-page :is(section, article)[id],
.guide-page :is(h2, h3)[id] {
  scroll-margin-top: 92px;
}

.guide-page :is(h1, h2, h3) {
  text-wrap: balance;
}

.guide-page :is(p, li, dd, a) {
  overflow-wrap: break-word;
}

.guide-hero {
  margin-bottom: 14px;
}

.guide-toc,
.guide-section,
.guide-final-cta {
  margin-top: 18px;
  background: var(--panel);
  border-top: 3px solid rgba(12, 18, 24, 0.78);
  box-shadow: 0 16px 32px rgba(28, 23, 14, 0.08);
}

.guide-toc {
  padding: 18px 22px 20px;
}

.guide-toc-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.guide-toc-links a {
  display: flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  background: #f5efe3;
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.035em;
  line-height: 1.15;
  text-transform: uppercase;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(239, 189, 61, 0.24);
}

.guide-toc-links a::after {
  content: "\2193";
  flex: none;
  color: var(--green-2);
  font-size: 16px;
}

.guide-page a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.guide-toc-links a:focus-visible,
.guide-actions a:focus-visible {
  border-color: var(--blue);
  background: #fff;
}

.guide-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.48fr);
  gap: 4px 24px;
  align-items: end;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.guide-section-heading > *,
.guide-card,
.guide-callout,
.guide-faq-list,
.guide-final-cta > * {
  min-width: 0;
}

.guide-section-heading .eyebrow {
  grid-column: 1 / -1;
}

.guide-section-heading h2 {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
}

.guide-section-heading > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.guide-card-grid,
.guide-steps {
  margin: 18px 22px;
}

.guide-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.guide-card {
  padding: 16px;
  border: 1px solid var(--line);
  background: #f8f3e8;
}

.guide-card h3 {
  font-size: 19px;
  line-height: 1.1;
}

.guide-card p,
.guide-card li {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.guide-card h3 + p,
.guide-card p + p,
.guide-card :is(ul, ol) {
  margin-top: 9px;
}

.guide-card :is(ul, ol) {
  margin-bottom: 0;
  padding-left: 20px;
}

.guide-card li + li {
  margin-top: 5px;
}

.guide-card a,
.guide-steps a,
.guide-legal-note a {
  text-decoration: underline;
  text-decoration-color: rgba(12, 18, 24, 0.35);
  text-underline-offset: 3px;
}

.guide-steps {
  counter-reset: guide-step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 0;
  list-style: none;
}

.guide-steps > li {
  counter-increment: guide-step;
  position: relative;
  min-width: 0;
  min-height: 154px;
  padding: 50px 16px 16px;
  border: 1px solid var(--line);
  background: #f8f3e8;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.guide-steps > li::before {
  content: counter(guide-step, decimal-leading-zero);
  position: absolute;
  top: 15px;
  left: 16px;
  color: var(--green-2);
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
}

.guide-steps strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 15px;
}

.guide-callout {
  margin: 0 22px 20px;
  padding: 15px 16px;
  border-left: 5px solid var(--yellow);
  background: #e7dfcf;
}

.guide-callout strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.guide-callout p,
.guide-legal-note {
  color: #4d5a52;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 22px 20px;
}

.guide-actions .build-cta,
.guide-actions .secondary-cta {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.055em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(239, 189, 61, 0.24);
}

.guide-actions .build-cta {
  border-color: #d7a62f;
  background: var(--yellow);
  color: #111;
}

.guide-actions .secondary-cta {
  background: #f5efe3;
  color: var(--ink);
}

.guide-badge-grid .guide-card {
  border-top: 3px solid var(--green-2);
}

.guide-legal-note {
  margin: 0 22px 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #f5efe3;
}

.guide-faq-list {
  margin: 18px 22px 22px;
  border: 1px solid var(--line);
  background: #f8f3e8;
}

.guide-faq-list details + details {
  border-top: 1px solid var(--line);
}

.guide-faq-list summary {
  min-height: 52px;
  padding: 14px 42px 14px 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(239, 189, 61, 0.24);
}

.guide-faq-list summary::marker {
  color: var(--green-2);
}

.guide-faq-list summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

.guide-faq-list details[open] summary {
  background: #eee7da;
}

.guide-faq-list details p {
  max-width: 900px;
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.guide-final-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, auto);
  gap: 20px;
  align-items: center;
  padding: 20px 22px;
}

.guide-final-cta h2 {
  margin-top: 3px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
}

.guide-final-cta > div > p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.guide-final-cta .guide-actions {
  justify-content: flex-end;
  padding: 0;
}

@media (hover: hover) {
  .guide-toc-links a:hover,
  .guide-actions .secondary-cta:hover {
    border-color: var(--green-2);
    background: #fff;
  }

  .guide-actions .build-cta:hover {
    border-color: #07111a;
    background: #f6ca59;
  }

  .guide-card a:hover,
  .guide-steps a:hover,
  .guide-legal-note a:hover {
    color: #0c4f89;
  }
}

@media (max-width: 900px) {
  .guide-toc-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-section-heading,
  .guide-final-cta {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .guide-final-cta .guide-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .guide-page {
    scroll-margin-top: 128px;
  }

  .guide-page :is(section, article)[id],
  .guide-page :is(h2, h3)[id] {
    scroll-margin-top: 128px;
  }

  .guide-toc,
  .guide-section-heading,
  .guide-final-cta {
    padding: 16px;
  }

  .guide-toc-links,
  .guide-card-grid,
  .guide-steps {
    grid-template-columns: 1fr;
  }

  .guide-card-grid,
  .guide-steps {
    margin: 14px 16px;
  }

  .guide-steps > li {
    min-height: 0;
  }

  .guide-callout,
  .guide-legal-note,
  .guide-faq-list {
    margin-right: 16px;
    margin-left: 16px;
  }

  .guide-actions {
    width: 100%;
    padding-right: 16px;
    padding-left: 16px;
  }

  .guide-actions .build-cta,
  .guide-actions .secondary-cta {
    width: 100%;
  }

  .guide-final-cta .guide-actions {
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:has(.guide-page) {
    scroll-behavior: auto;
  }
}
