:root {
  --doc-navy: #052235;
  --doc-navy-deep: #031724;
  --doc-cyan: #0891b2;
  --doc-cyan-soft: #ecfeff;
}

.documentation-page {
  background:
    radial-gradient(circle at 92% 4%, rgba(8, 145, 178, 0.08), transparent 28rem),
    #f6f8fb;
}

.documentation-page .nav-links .is-current {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.doc-reading-progress {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  z-index: 11;
  height: 3px;
  pointer-events: none;
}

.doc-reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #0891b2);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.42);
}

.doc-loading {
  min-height: 60vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.doc-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(54px, 8vw, 104px) 0 clamp(46px, 6vw, 78px);
  color: #f4fbff;
  background:
    radial-gradient(circle at 84% 14%, rgba(34, 211, 238, 0.19), transparent 26rem),
    linear-gradient(145deg, var(--doc-navy), var(--doc-navy-deep));
}

.doc-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(120, 220, 240, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 220, 240, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
}

.doc-hero .container {
  position: relative;
  z-index: 1;
}

.doc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: #9db8c7;
  font-size: 0.9rem;
  font-weight: 700;
}

.doc-breadcrumb a {
  color: #c9f4fb;
  text-underline-offset: 3px;
}

.doc-hero .eyebrow {
  border-color: rgba(154, 234, 250, 0.38);
  background: rgba(57, 215, 238, 0.1);
  color: #9aeafa;
}

.doc-hero h1 {
  max-width: 920px;
  margin-top: 16px;
  font-size: clamp(2.7rem, 7vw, 5.5rem);
}

.doc-hero .lead {
  max-width: 860px;
  color: #b4cad5;
}

.doc-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.doc-hero-actions .btn {
  border-color: rgba(154, 234, 250, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #eefcff;
}

.doc-hero-actions .btn-primary {
  border-color: #39d7ee;
  background: #39d7ee;
  color: #00191e;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.doc-meta span {
  border: 1px solid rgba(154, 234, 250, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #b9d2dd;
  padding: 7px 11px;
  font-size: 0.8rem;
  font-weight: 800;
}

.doc-download-section {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: clamp(32px, 5vw, 48px) 0;
}

.doc-download-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.doc-download-head h2 {
  margin-top: 10px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.doc-download-head p {
  max-width: 570px;
  margin: 0;
  color: var(--muted);
}

.doc-download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.doc-download-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 16px;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.035);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.doc-download-card:hover,
.doc-download-card:focus-visible {
  border-color: rgba(8, 145, 178, 0.5);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
  transform: translateY(-2px);
  outline: none;
}

.doc-download-type {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--doc-navy);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.doc-download-copy {
  min-width: 0;
}

.doc-download-copy strong,
.doc-download-copy small {
  display: block;
}

.doc-download-copy strong {
  font-size: 1.02rem;
}

.doc-download-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.doc-download-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--doc-cyan-soft);
  color: var(--accent-strong);
  font-size: 1.15rem;
  font-weight: 900;
}

.doc-toc-section {
  padding: clamp(44px, 6vw, 70px) 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  scroll-margin-top: 92px;
}

.doc-toc-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.doc-toc-head h2 {
  margin-top: 12px;
}

.doc-toc-head p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
}

.doc-toc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 28px;
}

.doc-toc a {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
  padding: 12px;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.doc-toc a:hover,
.doc-toc a:focus-visible,
.doc-toc a.is-active {
  border-color: rgba(8, 145, 178, 0.48);
  background: var(--doc-cyan-soft);
  transform: translateY(-1px);
  outline: none;
}

.doc-toc-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #bae6fd;
  border-radius: 7px;
  background: #ffffff;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.doc-toc strong {
  display: block;
  min-width: 0;
  font-size: 0.96rem;
  line-height: 1.15;
}

.doc-toc small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.doc-content {
  padding: clamp(46px, 6vw, 76px) 0 86px;
}

.doc-intro-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  max-width: 920px;
  margin-bottom: 24px;
  border: 1px solid rgba(8, 145, 178, 0.24);
  border-radius: 9px;
  background: var(--doc-cyan-soft);
  padding: 16px;
}

.doc-intro-note > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

.doc-intro-note p {
  margin: 0;
  color: #155e75;
  font-weight: 700;
}

.doc-chapters {
  display: grid;
  gap: 18px;
}

.doc-chapter {
  scroll-margin-top: 92px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.045);
}

.doc-chapter:target {
  border-color: rgba(8, 145, 178, 0.54);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.08), 0 18px 44px rgba(15, 23, 42, 0.06);
}

.doc-chapter-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: clamp(20px, 3vw, 30px);
}

.doc-chapter-number {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  background: var(--doc-cyan-soft);
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.doc-chapter-kicker {
  color: var(--accent-strong);
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.doc-chapter h2 {
  margin-top: 7px;
  font-size: clamp(1.8rem, 3.6vw, 2.65rem);
}

.doc-chapter-head p {
  max-width: 840px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.doc-chapter-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(22px, 4vw, 42px);
  padding: clamp(20px, 3vw, 30px);
}

.doc-chapter-body h3 {
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

.doc-steps {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: doc-step;
}

.doc-steps li {
  position: relative;
  min-height: 34px;
  padding-left: 44px;
  color: #334155;
  counter-increment: doc-step;
}

.doc-steps li::before {
  content: counter(doc-step);
  position: absolute;
  top: -2px;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #bae6fd;
  border-radius: 7px;
  background: var(--doc-cyan-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.doc-steps li + li {
  margin-top: 12px;
}

.doc-result {
  align-self: start;
  border: 1px solid rgba(8, 145, 178, 0.2);
  border-radius: 10px;
  background: #f8fafc;
  padding: 18px;
}

.doc-result > p {
  margin: 9px 0 0;
  color: var(--muted);
}

.doc-result .doc-check-title {
  margin-top: 22px;
  font-size: 1rem;
}

.doc-checks {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.doc-checks li {
  position: relative;
  padding-left: 24px;
  color: #334155;
  font-size: 0.94rem;
}

.doc-checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 900;
}

.doc-module-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.doc-module-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(8, 145, 178, 0.28);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-strong);
  padding: 8px 11px;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.doc-module-links a:hover {
  border-color: var(--accent);
  background: var(--doc-cyan-soft);
}

.doc-visual-section {
  border-top: 1px solid var(--line);
  background: #fbfdff;
  padding: clamp(22px, 3vw, 30px);
}

.doc-visual-head {
  margin-bottom: 18px;
}

.doc-visual-head h3 {
  margin-top: 6px;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
}

.doc-visual-grid {
  display: grid;
  gap: 18px;
}

.doc-visual-card {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.45fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.045);
}

.doc-shot {
  min-width: 0;
  margin: 0;
  border-right: 1px solid var(--line);
}

.doc-shot > a {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: var(--doc-shot-ratio, 1600 / 913);
  background: #e8f0f4;
}

.doc-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #061a27;
  transition: transform 220ms ease, filter 220ms ease;
}

.doc-shot > a:hover img,
.doc-shot > a:focus-visible img {
  filter: brightness(0.8);
  transform: scale(1.008);
}

.doc-shot > a:focus-visible {
  outline: 3px solid rgba(8, 145, 178, 0.45);
  outline-offset: -3px;
}

.doc-shot-open {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(2, 20, 31, 0.9);
  color: #ffffff;
  padding: 8px 11px;
  font-size: 0.8rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.doc-shot > a:hover .doc-shot-open,
.doc-shot > a:focus-visible .doc-shot-open {
  opacity: 1;
  transform: translateY(0);
}

.doc-shot figcaption {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 700;
}

.doc-shot-notes {
  align-self: stretch;
  padding: 18px;
  background: #ffffff;
}

.doc-shot-notes h4 {
  color: var(--doc-navy);
  font-size: 1rem;
}

.doc-shot-notes ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.doc-shot-notes li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.45;
}

.doc-shot-notes li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.doc-chapter-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px clamp(20px, 3vw, 30px);
}

.doc-chapter-nav a {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.doc-back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(8, 145, 178, 0.36);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-strong);
  font-size: 1.15rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.doc-back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .doc-download-head {
    align-items: start;
    flex-direction: column;
  }

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

  .doc-chapter-body,
  .doc-visual-card {
    grid-template-columns: 1fr;
  }

  .doc-shot {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .doc-toc-section,
  .doc-chapter {
    scroll-margin-top: 184px;
  }

  .doc-reading-progress {
    top: 0;
  }

  .doc-hero-actions {
    display: grid;
  }

  .doc-hero-actions .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .doc-toc-head {
    align-items: start;
    flex-direction: column;
  }

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

  .doc-download-grid {
    grid-template-columns: 1fr;
  }

  .doc-chapter-head {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 13px;
  }

  .doc-chapter-number {
    width: 44px;
    height: 44px;
  }

  .doc-chapter-nav {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  .site-header,
  .doc-reading-progress,
  .doc-hero-actions,
  .doc-download-section,
  .doc-back-top,
  .doc-chapter-nav,
  .site-footer {
    display: none !important;
  }

  .doc-hero {
    padding: 32px 0;
    color: #111827;
    background: #ffffff;
  }

  .doc-hero .lead,
  .doc-breadcrumb {
    color: #475569;
  }

  .doc-chapter {
    break-inside: avoid;
    box-shadow: none;
  }

  .doc-shot-open {
    display: none;
  }
}
