.guide-page {
  background:
    radial-gradient(
      circle at 85% 4%,
      rgba(114, 216, 223, 0.1),
      transparent 28%
    ),
    radial-gradient(
      circle at 15% 0%,
      rgba(243, 207, 81, 0.11),
      transparent 28%
    ),
    var(--bg);
}

.guide-page code {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.12em 0.38em;
  background: color-mix(in srgb, var(--surface-soft) 74%, transparent);
  color: var(--accent-bright);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.88em;
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.6fr);
  gap: clamp(34px, 7vw, 110px);
  width: min(calc(100% - 44px), var(--max-width));
  margin: 0 auto;
  padding: clamp(150px, 14vw, 220px) 0 clamp(80px, 9vw, 140px);
  align-items: center;
}

.guide-hero h1 {
  max-width: 900px;
  margin: 18px 0 24px;
  font-size: clamp(48px, 7vw, 104px);
  line-height: 0.94;
  letter-spacing: -0.065em;
}

.guide-hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.guide-hero-copy > p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(18px, 1.55vw, 23px);
  line-height: 1.6;
}

.guide-hero .hero-actions {
  margin-top: 34px;
  flex-wrap: wrap;
}

.guide-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
}

.guide-badges span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--surface) 66%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.guide-hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: var(--radius-lg);
  padding: clamp(28px, 3.5vw, 50px);
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--accent) 10%, transparent),
      transparent 58%
    ),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(140%);
}

.guide-hero-card::after {
  position: absolute;
  top: -80px;
  right: -70px;
  width: 180px;
  height: 180px;
  border: 30px solid color-mix(in srgb, var(--accent) 11%, transparent);
  border-radius: 50%;
  content: '';
}

.card-kicker,
.guide-toc > span,
.section-number {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.guide-hero-card > strong {
  display: block;
  margin: 14px 0 24px;
  font-size: clamp(25px, 2.5vw, 38px);
  letter-spacing: -0.04em;
}

.guide-hero-card ol {
  display: grid;
  gap: 15px;
  margin: 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.45;
}

.guide-hero-card li::marker {
  color: var(--accent);
  font-weight: 900;
}

.guide-hero-card p {
  margin: 26px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(36px, 6vw, 96px);
  width: min(calc(100% - 44px), 1240px);
  margin: 0 auto;
  padding-bottom: 120px;
}

.guide-toc {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  display: flex;
  height: max-content;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.guide-toc > span {
  margin-bottom: 10px;
}

.guide-toc a {
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.guide-toc a:hover {
  background: var(--surface-soft);
  color: var(--text);
}

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

.guide-section {
  scroll-margin-top: calc(var(--header-height) + 26px);
  border-top: 1px solid var(--line);
  padding: clamp(54px, 7vw, 92px) 0;
}

.guide-section:first-child {
  border-top-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

.guide-section h2 {
  margin: 10px 0 18px;
  font-size: clamp(34px, 4.4vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.guide-section h3 {
  margin: 0;
  font-size: 24px;
}

.guide-section > p:not(.section-number),
.section-lede {
  max-width: 850px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.step-grid,
.rule-grid,
.facility-grid,
.error-list {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.step-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.step-grid article,
.facility-grid article {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
}

.step-grid b {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.step-grid strong,
.facility-grid strong {
  margin-bottom: 8px;
  font-size: 17px;
}

.step-grid span,
.facility-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.callout {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  margin-top: 30px;
  border: 1px solid color-mix(in srgb, var(--cyan) 32%, var(--line));
  border-radius: var(--radius);
  padding: 22px;
  background: color-mix(in srgb, var(--cyan) 7%, var(--surface));
}

.callout.important {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.callout > div {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--accent-ink);
  font-weight: 950;
}

.callout.important > div {
  background: var(--accent);
}

.callout p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.callout strong {
  color: var(--text);
}

.rule-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rule-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 17px 19px;
  background: var(--surface);
}

.rule-grid strong {
  font-size: 14px;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.copy-button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 17px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.copy-button.copied {
  border-color: var(--green);
  color: var(--green);
}

.code-card {
  overflow: auto;
  max-height: 760px;
  margin: 30px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 34px);
  background: #090b09;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #e5e8dd;
  font:
    13px/1.72 'SFMono-Regular',
    Consolas,
    'Liberation Mono',
    monospace;
  tab-size: 2;
}

.code-card code {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.table-wrap table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.wide-table table {
  min-width: 820px;
}

.table-wrap th,
.table-wrap td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.table-wrap th {
  background: color-mix(in srgb, var(--surface-soft) 74%, transparent);
  color: var(--quiet);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.table-wrap td {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.table-wrap td:first-child {
  color: var(--text);
  font-weight: 760;
}

.facility-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.facility-grid article {
  min-height: 132px;
}

.guide-section details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 20px;
  background: var(--surface);
}

.guide-section summary {
  padding: 18px 0;
  cursor: pointer;
  font-weight: 850;
}

.guide-section details p {
  color: var(--muted);
  line-height: 1.6;
}

.id-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 4px;
}

.error-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.error-list article {
  border-top: 2px solid color-mix(in srgb, var(--red) 65%, var(--line));
  border-radius: 0 0 15px 15px;
  padding: 22px;
  background: var(--surface);
}

.error-list strong {
  font-size: 15px;
}

.error-list p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.finish-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 32px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: var(--radius-lg);
  padding: clamp(26px, 4vw, 44px);
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--accent) 10%, var(--surface)),
    var(--surface)
  );
}

.finish-card span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.finish-card h3 {
  margin-top: 7px;
}

.finish-card p {
  max-width: 630px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1050px) {
  .guide-hero {
    grid-template-columns: 1fr;
  }

  .guide-hero-card {
    max-width: 720px;
  }

  .step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .guide-shell {
    grid-template-columns: 1fr;
  }

  .guide-toc {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--surface);
  }

  .guide-toc > span {
    grid-column: 1 / -1;
  }

  .rule-grid,
  .facility-grid,
  .error-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .guide-hero,
  .guide-shell {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .guide-hero {
    padding-top: 124px;
  }

  .guide-hero h1 {
    font-size: clamp(44px, 14vw, 64px);
  }

  .guide-hero .hero-actions,
  .guide-hero .button {
    width: 100%;
  }

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

  .step-grid article {
    min-height: 160px;
  }

  .section-heading-row,
  .finish-card {
    align-items: stretch;
    flex-direction: column;
  }

  .copy-button {
    align-self: flex-start;
  }

  .guide-toc {
    grid-template-columns: 1fr;
  }

  .guide-toc > span {
    grid-column: 1;
  }

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

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