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

:root {
  --color-brand: #005fb8;
  --color-brand-strong: #004578;
  --color-brand-soft: #ebf3fc;
  --color-success: #0f6c0f;
  --color-warning: #8a6d00;
  --color-text: #1f1f1f;
  --color-text-subtle: #616161;
  --color-text-faint: #777777;
  --color-border: #e0e0e0;
  --color-border-strong: #c8c8c8;
  --color-surface: #ffffff;
  --color-surface-muted: #f8f8f8;
  --color-surface-alt: #f3f6fb;
  --color-nav-bg: #ffffff;
  --color-page-bg: #ffffff;

  --font-sans: 'Segoe UI', 'Segoe UI Variable Text', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Cascadia Code', Consolas, monospace;

  --header-height: 64px;
  --sidebar-width: 280px;
  --toc-width: 240px;
  --content-width: 1680px;
  --radius-sm: 4px;
  --radius-md: 6px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  overflow-y: scroll;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--color-text);
  line-height: 1.6;
  background: var(--color-page-bg);
}

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

a:hover {
  color: var(--color-brand-strong);
  text-decoration: underline;
}

button,
input,
textarea,
select {
  font: inherit;
}

code,
kbd {
  font-family: var(--font-mono);
}

code,
kbd {
  padding: 0.08rem 0.3rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 200;
  padding: 8px 12px;
  background: var(--color-brand);
  color: #fff;
}

.skip-link:focus {
  top: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  background: var(--color-nav-bg);
  border-bottom: 1px solid var(--color-border);
}

.topbar__inner {
  max-width: none;
  margin: 0;
  padding: 12px 24px 12px 0;
  display: grid;
  /* Left column = left-margin-of-page + toc-width (min. 300px so the brand always fits).
     At viewport ≥ ~1800px this becomes exact: nav aligns pixel-perfectly with the
     main-content text column. Below that the column is clamped to 300px (brand fits
     at ~280px) and the nav is ~36px off at worst – acceptable and invisible on
     screens where the TOC is already partially clipped. */
  grid-template-columns:
    max(300px, calc(max(24px, (100% - var(--content-width)) / 2) + var(--toc-width)))
    1fr;
  align-items: center;
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text);
  justify-self: end;  /* stick to the right edge of the brand column = 40px left of menu */
  padding-right: 16px; /* small breathing room before column edge */
}

.topbar__brand:hover {
  color: var(--color-text);
  text-decoration: none;
}

.topbar__brand-mark {
  display: inline-flex;
  flex-shrink: 0;
}

.topbar__brand-copy {
  display: grid;
  gap: 1px;
}

.topbar__brand-copy strong {
  font-size: 0.9375rem;
  font-weight: 600;
  position: relative;
  top: 2px;
}

.topbar__brand-copy small {
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
  position: relative;
  top: -2px;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: 0;
  padding-left: 40px; /* aligns nav with main-content text */
}

.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-subtle);
  cursor: pointer;
}

.topbar__link:hover,
.topbar__link:focus-visible {
  background: var(--color-surface-muted);
  color: var(--color-text);
  text-decoration: none;
}

.topbar__link.active {
  color: var(--color-text);
  border-color: var(--color-border);
  background: var(--color-surface-muted);
}

.nav-item {
  position: relative;
}

.nav-button {
  appearance: none;
}

.nav-arrow {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.15s ease;
}

.nav-item.open .nav-arrow {
  transform: rotate(-135deg) translate(-2px, -1px);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(680px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-item.open .nav-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown__intro,
.nav-dropdown__footer,
.nav-dropdown__empty {
  padding: 0;
}

.nav-dropdown__intro {
  margin-bottom: 14px;
  color: var(--color-text-subtle);
}

.nav-dropdown__intro p,
.nav-dropdown__empty {
  margin: 4px 0 0;
  font-size: 0.875rem;
}

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

.nav-dropdown__section-title,
.sidebar__section-title,
.toc__title,
.eyebrow,
.site-footer__eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
}

.nav-dropdown__section-title {
  margin-bottom: 8px;
}

.nav-dropdown__link {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
}

.nav-dropdown__link:hover,
.nav-dropdown__link.active {
  background: var(--color-surface-muted);
  color: var(--color-text);
  text-decoration: none;
}

.nav-dropdown__link[aria-disabled="true"] {
  opacity: 0.58;
  pointer-events: none;
}

.nav-dropdown__name {
  display: inline-block;
  font-weight: 600;
}

.nav-dropdown__tagline {
  display: block;
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--color-text-subtle);
}

.nav-dropdown__footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.nav-dropdown__footer a {
  font-weight: 600;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(200px, var(--toc-width)) minmax(0, 1fr) minmax(240px, var(--sidebar-width));
  grid-template-areas: "toc main sidebar";
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-shell--no-sidebar {
  grid-template-columns: minmax(200px, var(--toc-width)) minmax(0, 1fr);
  grid-template-areas: "toc main";
}

.sidebar {
  grid-area: sidebar;
  position: sticky;
  top: var(--header-height);
  align-self: start;
  max-height: calc(100vh - var(--header-height));
  overflow: auto;
  padding: 32px 24px 32px 20px;
  border-left: 1px solid var(--color-border);
}

.sidebar__block {
  margin-bottom: 18px;
}

.sidebar__block--highlight {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.sidebar__link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  padding: 6px 0;
  color: var(--color-text-subtle);
}

.sidebar__link:hover,
.sidebar__link.active {
  color: var(--color-brand);
  text-decoration: none;
}

.sidebar__link-meta,
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  background: #fff;
}

.pill--brand,
.sidebar__link-meta {
  color: var(--color-brand);
  border-color: #cfe1f5;
  background: var(--color-brand-soft);
}

.pill--muted {
  color: var(--color-text-subtle);
}

.pill--success {
  color: var(--color-success);
  border-color: #d7e9d7;
  background: #f3faf3;
}

.pill--warning {
  color: var(--color-warning);
  border-color: #ebe2bf;
  background: #fffbee;
}

.sidebar__product-name {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 600;
}

.sidebar__product-tagline,
.sidebar__meta-row {
  margin-top: 8px;
  color: var(--color-text-subtle);
  font-size: 0.875rem;
}

.sidebar__meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sidebar__meta-row--link {
  justify-content: flex-start;
}

.sidebar__meta-row--link a {
  font-size: 0.8125rem;
  font-weight: 600;
}

.main-content {
  grid-area: main;
  min-width: 0;
  padding: 32px 40px 64px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--color-text-subtle);
  font-size: 0.875rem;
}

.breadcrumb a {
  color: var(--color-text-subtle);
}

.breadcrumb__sep {
  color: #999;
}

.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.15;
  font-weight: 600;
}

.page-meta {
  margin: 10px 0 0;
  font-size: 1rem;
  color: var(--color-text-subtle);
}

.hero,
.surface,
.alert,
.product-card,
.stack-card,
.support-card,
.timeline,
.prose-card, .faq-card,
.metric-card {
  background: #fff;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.8fr);
  gap: 28px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.hero--single {
  grid-template-columns: 1fr;
}

.hero__title {
  margin: 6px 0 0;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.2;
  font-weight: 600;
}

.hero__text,
.section-heading p,
.support-card p,
.surface p,
.prose-card p, .faq-card p,
.stack-card p {
  color: var(--color-text-subtle);
}

.prose-card p, .faq-card p {
  margin: 0;
}

.hero__text {
  margin: 12px 0 0;
}

.hero__actions,
.action-row,
.product-card__links,
.tag-list,
.quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero__actions,
.action-row {
  margin-top: 18px;
}

.hero__aside,
.stack-card,
.support-card,
.surface,
.prose-card, .faq-card,
.metric-card {
  padding: 0;
}

.hero__aside {
  padding-left: 20px;
  border-left: 1px solid var(--color-border);
}

.quick-facts {
  flex-direction: column;
  margin-top: 12px;
}

.quick-facts__item {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--color-border);
}

.quick-facts__item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.quick-facts__item strong {
  display: block;
  font-size: 1.125rem;
  line-height: 1.2;
  font-weight: 600;
}

.quick-facts__item span {
  display: block;
  margin-top: 4px;
  color: var(--color-text-subtle);
  font-size: 0.875rem;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2,
.main-content h2 {
  margin: 0;
  font-size: clamp(1.375rem, 2vw, 1.875rem);
  line-height: 1.25;
  font-weight: 600;
}

.main-content h2 {
  margin-top: 0;
}

.section-heading h2 {
  margin-top: 12px;
}

.main-content h3 {
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 600;
}

.main-content li + li {
  margin-top: 6px;
}

.content-section {
  margin-top: 28px;
}

.feature-grid {
  gap: 24px;
}

.feature-grid,
.info-grid,
.metric-grid,
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(max(220px, calc(25% - 16px)), 1fr));
  gap: 16px;
  align-items: stretch;
}

.info-grid {
  padding-top: 16px;
  margin-bottom: 16px;
}

.feature-grid,
.metric-grid,
.checklist {
  margin-bottom: 16px;
}

.surface,
.prose-card, .faq-card,
.stack-card,
.support-card,
.product-card,
.timeline,
.metric-card {
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.info-grid > .surface {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.info-grid > .surface + .surface {
  margin-top: 0;
}

.checklist {
  padding-top: 16px;
}

.checklist > li + li {
  margin-top: 0;
}

.stack-card__icon,
.metric-card__icon {
  display: block;
  color: var(--color-brand);
  margin-bottom: 12px;
}

.stack-card h3,
.surface h3,
.prose-card h3, .faq-card h3,
.metric-card h3 {
  margin-top: 0;
}

.support-card h3 {
  margin-top: 12px;
}

.faq-card h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.faq-card h3::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    position: relative;
    top: 5px;
    background-color: var(--color-brand);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='currentColor'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M12 17.25h.008v.008H12v-.008z' transform='translate(2.4, 2.4) scale(0.8)'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='currentColor'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M12 17.25h.008v.008H12v-.008z' transform='translate(2.4, 2.4) scale(0.8)'/%3E%3C/svg%3E") no-repeat center / contain;
  }
.prose-card + .prose-card,
.faq-card + .faq-card,
.surface + .surface {
  margin-top: 16px;
}

.metric-card strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
}

.metric-card span {
  display: block;
  margin-top: 6px;
  color: var(--color-text-subtle);
  font-size: 0.875rem;
}

.alert {
  --alert-border: #c7ddf7;
  --alert-bg: #eef6fc;
  --alert-title: #0f3b68;
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='7' stroke='%23005fb8' stroke-width='1.5'/%3E%3Cpath d='M8 7v4' stroke='%23005fb8' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='4.5' r='1' fill='%23005fb8'/%3E%3C/svg%3E");
  margin: 24px 0;
  padding: 16px 18px;
  border: 1px solid var(--alert-border);
  border-radius: var(--radius-md);
  background: var(--alert-bg);
}

.alert.is-info {
  --alert-border: #c7ddf7;
  --alert-bg: #eef6fc;
  --alert-title: #0f3b68;
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='7' stroke='%23005fb8' stroke-width='1.5'/%3E%3Cpath d='M8 7v4' stroke='%23005fb8' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='4.5' r='1' fill='%23005fb8'/%3E%3C/svg%3E");
}

.alert.is-success {
  --alert-border: #b9d9b5;
  --alert-bg: #edf7ec;
  --alert-title: #215c21;
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M5.8 10.6H3.9c-.5 0-.9-.4-.9-.9 0-.2.1-.5.3-.7l1.2-1.1A3.9 3.9 0 0 1 8.2 2c2.3 0 4.2 1.8 4.2 4.1 0 .9-.3 1.8-.9 2.5l-.8.9c-.2.2-.3.4-.3.7v.4H7.1v-.4c0-.8.3-1.6.9-2.2l.9-.9c.3-.3.4-.7.4-1.1 0-.8-.6-1.4-1.4-1.4s-1.4.6-1.4 1.4H5c0-1.6 1.3-2.9 2.9-2.9s2.9 1.3 2.9 2.9c0 .8-.3 1.6-.9 2.2l-.9.9c-.2.2-.3.4-.4.7h1.1c.4 0 .8.3.8.8s-.4.8-.8.8H7.5v.8h1.9c.4 0 .8.3.8.8s-.4.8-.8.8H5.8c-.4 0-.8-.3-.8-.8s.4-.8.8-.8h.2v-.8h-.2c-.4 0-.8-.3-.8-.8s.4-.8.8-.8Z' fill='%230f6c0f'/%3E%3C/svg%3E");
}

.alert.is-warning {
  --alert-border: #ecdca6;
  --alert-bg: #fff9e8;
  --alert-title: #6b5300;
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M8.9 2.4l5.4 9.4A1 1 0 0 1 13.4 13H2.6a1 1 0 0 1-.87-1.52l5.4-9.08a1 1 0 0 1 1.77 0Z' stroke='%238a6d00' stroke-width='1.2' fill='%23fff4ce'/%3E%3Cpath d='M8 5.2v4.1' stroke='%238a6d00' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.5' r='1' fill='%238a6d00'/%3E%3C/svg%3E");
}

.alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px !important;
  color: var(--alert-title);
  font-size: 0.9375rem;
  line-height: 1.3;
  font-weight: 600;
}

.alert-title::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background-image: var(--alert-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

.alert-content {
  min-width: 0;
}

.alert-title + .alert-content {
  margin-top: 8px;
}

.alert-content p:first-child {
  margin-top: 0;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card__eyebrow,
.product-card__meta,
.tag-list,
.toc__list a,
article.surface {
  align-self: start;
}
.site-footer__copy,
.site-footer__nav a {
  font-size: 0.875rem;
}

.product-card__title {
  margin: 12px 0 0;
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 600;
}

.product-card__header-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

a.tag {
  transition: all 0.2s ease;
  text-decoration: none;
}

a.tag:hover,
a.tag:focus {
  background: var(--color-surface-hover, #e2e8f0);
  border-color: var(--color-border-hover, #cbd5e1);
  color: var(--color-text);
}

.product-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--color-text-subtle);
}

.product-card__desc {
  margin: 0;
  color: var(--color-text-subtle);
  flex: 1;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  color: var(--color-text-subtle);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-brand-strong);
  border-color: var(--color-brand-strong);
  color: #fff;
}

.btn--outline {
  background: #fff;
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-surface-muted);
}

.btn--muted {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--color-border);
}

.data-table th {
  width: 32%;
  font-weight: 600;
  background: var(--color-surface-muted);
}

.timeline {
  padding: 0;
}

.timeline ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 16px 20px;
}

.timeline li + li {
  border-top: 1px solid var(--color-border);
}

.timeline__step {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-subtle);
  background: #fff;
}

.checklist strong {
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.checklist__icon {
  flex-shrink: 0;
  color: var(--color-brand);
}

.toc {
  grid-area: toc;
  position: sticky;
  top: var(--header-height);
  align-self: start;
  max-height: calc(100vh - var(--header-height));
  overflow: auto;
  padding: 32px 20px 32px 24px;
  border-right: 1px solid var(--color-border);
}

.toc__card {
  padding: 0;
}

.toc__card + .toc__card {
  margin-top: 24px;
}

.toc__section-nav {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.toc__section-link {
  display: block;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text-subtle);
  font-size: 0.875rem;
  font-weight: 600;
}

.toc__section-link:hover,
.toc__section-link.active {
  border-color: #c7ddf7;
  background: var(--color-brand-soft);
  color: var(--color-brand-strong);
  text-decoration: none;
}

.toc__list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.toc__list li + li {
  margin-top: 4px;
}

.toc__list a {
  display: block;
  padding: 4px 0;
  color: var(--color-text-subtle);
}

.toc__list a:hover,
.toc__list a.active {
  color: var(--color-brand);
  text-decoration: none;
}

.toc__empty {
  margin-top: 10px;
  color: var(--color-text-subtle);
  font-size: 0.875rem;
}

.site-footer {
  margin-top: 16px;
  padding: 24px;
  border-top: 1px solid var(--color-border);
  background: #fff;
}

.site-footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer__copy {
  max-width: 70ch;
  color: var(--color-text-subtle);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer__nav a {
  color: var(--color-text-subtle);
}

.site-footer__nav a:hover {
  color: var(--color-brand);
}

@media (max-width: 1320px) {
  .page-shell {
    grid-template-columns: minmax(0, 1fr) minmax(240px, var(--sidebar-width));
    grid-template-areas: "main sidebar";
  }

  .page-shell--no-sidebar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main";
  }

  .toc {
    display: none;
  }

  /* Revert topbar to flex when toc column is no longer visible */
  .topbar__inner {
    display: flex;
    padding: 12px 24px;
    gap: 24px;
  }

  .topbar__brand {
    justify-self: auto;
    padding-right: 0;
  }

  .topbar__nav {
    margin-left: 8px;
    padding-left: 0;
  }
}

@media (max-width: 1024px) {
  .page-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "sidebar";
  }

  .page-shell--no-sidebar {
    grid-template-areas: "main";
  }

  .sidebar {
    position: static;
    max-height: none;
    padding: 20px 20px 0;
    border-left: 0;
    border-top: 1px solid var(--color-border);
  }

  .main-content {
    padding: 24px 20px 56px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero__aside {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
  }
}

@media (max-width: 720px) {
  .topbar__inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }

  .topbar__nav {
    width: 100%;
  }

  .nav-dropdown {
    left: 0;
    right: auto;
    width: min(640px, calc(100vw - 32px));
  }

  .sidebar {
    display: none;
  }

  .page-title {
    font-size: 1.875rem;
  }

  .product-card__links,
  .hero__actions,
  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

/* ── Focus fallback for older browsers ────────────────────────────────────── */
.topbar__link:focus,
.btn:focus,
.sidebar__link:focus,
.toc__list a:focus,
.toc__section-link:focus,
.nav-dropdown__link:focus {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.step-icon {
  color: var(--color-brand);
}
