:root {
  --guide-blue: #0b5d7a;
  --guide-blue-dark: #17394b;
  --guide-teal: #2c7f86;
  --guide-ink: #20343f;
  --guide-muted: #5d6d75;
  --guide-border: #d9e1e5;
  --guide-soft: #f3f7f8;
  --guide-warning: #fff8e6;
  --guide-card: #ffffff;
  --guide-font-ui: Aptos, "Segoe UI", Arial, sans-serif;
  --guide-font-display: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #eef3f5;
  color: var(--guide-ink);
  font-family: var(--guide-font-ui);
  line-height: 1.62;
  overflow-wrap: break-word;
}

.guide-main a[data-download-state="preparing"]::after {
  content: " (preparing download\2026)";
  font-size: 0.875em;
}
a { color: var(--guide-blue); }
a:hover { color: var(--guide-blue-dark); }
a:focus-visible,
button:focus-visible {
  outline: 3px solid #f2b84b;
  outline-offset: 3px;
}

.guide-masthead {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 86px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--guide-border);
  background: var(--guide-card);
}
.guide-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.guide-logo { width: 108px; height: auto; }
.guide-kicker {
  color: var(--guide-teal);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.guide-title {
  margin: 1px 0 0;
  color: var(--guide-blue-dark);
  font-family: var(--guide-font-display);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.12;
}
.guide-return {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid var(--guide-border);
  border-radius: 8px;
  background: var(--guide-soft);
  font-size: 0.83rem;
  font-weight: 750;
  text-decoration: none;
}

.guide-shell {
  display: grid;
  grid-template-columns: minmax(220px, 286px) minmax(0, 820px);
  justify-content: center;
  align-items: start;
  gap: clamp(28px, 5vw, 64px);
  padding: 36px clamp(18px, 4vw, 56px) 80px;
}
.guide-sidebar {
  position: sticky;
  top: 22px;
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--guide-border);
  border-radius: 12px;
  background: var(--guide-card);
  box-shadow: 0 8px 24px rgba(23, 57, 75, 0.06);
}
.guide-sidebar-title {
  margin: 0 0 10px;
  color: var(--guide-blue-dark);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.guide-contents-toggle {
  display: none;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--guide-border);
  border-radius: 8px;
  background: var(--guide-soft);
  color: var(--guide-blue-dark);
  font: inherit;
  font-weight: 750;
  text-align: left;
}
.guide-contents {
  display: grid;
  gap: 2px;
}
.guide-contents a {
  padding: 5px 8px;
  border-left: 3px solid transparent;
  border-radius: 0 5px 5px 0;
  color: var(--guide-muted);
  font-size: 0.82rem;
  line-height: 1.25;
  text-decoration: none;
}
.guide-contents a:hover,
.guide-contents a[aria-current="location"] {
  border-left-color: var(--guide-teal);
  background: var(--guide-soft);
  color: var(--guide-blue-dark);
}

.guide-main {
  min-width: 0;
  max-width: 100%;
  padding: clamp(26px, 4vw, 48px);
  border: 1px solid var(--guide-border);
  border-radius: 14px;
  background: var(--guide-card);
  box-shadow: 0 12px 34px rgba(23, 57, 75, 0.07);
}
.guide-main > h1 {
  margin: 0;
  color: var(--guide-blue-dark);
  font-family: var(--guide-font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.04;
}
.guide-main h2 {
  scroll-margin-top: 24px;
  margin: 3.25rem 0 1rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--guide-border);
  color: var(--guide-blue-dark);
  font-family: var(--guide-font-display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.18;
}
.guide-main h2:first-of-type { margin-top: 2rem; }
.guide-main h3 {
  scroll-margin-top: 24px;
  margin: 2rem 0 0.65rem;
  color: var(--guide-blue);
  font-size: 1.08rem;
  line-height: 1.3;
}
.guide-main p { margin: 0.7rem 0; }
.guide-main ul,
.guide-main ol { padding-left: 1.45rem; }
.guide-main li { margin: 0.38rem 0; }
.guide-main li::marker { color: var(--guide-teal); font-weight: 750; }
.guide-main blockquote {
  float: none;
  display: block;
  width: auto;
  margin: 1rem 0 1.5rem;
  padding: 16px 18px;
  border-left: 4px solid var(--guide-blue);
  border-radius: 0 8px 8px 0;
  background: var(--guide-soft);
}
.guide-main blockquote p { margin: 0; }
.guide-main strong { color: var(--guide-blue-dark); }

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px 0 24px;
  color: var(--guide-muted);
  font-size: 0.85rem;
}
.guide-meta span { min-width: 0; }
.guide-translation-notice {
  margin: 0 0 24px;
  padding: 13px 15px;
  border: 1px solid #ead49c;
  border-radius: 8px;
  background: var(--guide-warning);
  color: #5b4a20;
  font-size: 0.9rem;
}
.guide-translation-notice[hidden] { display: none; }
.guide-back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 4;
  padding: 9px 12px;
  border: 1px solid var(--guide-border);
  border-radius: 999px;
  background: var(--guide-card);
  box-shadow: 0 6px 20px rgba(23, 57, 75, 0.16);
  color: var(--guide-blue);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration: none;
}
.guide-back-to-top[hidden] { display: none; }

@media (max-width: 860px) {
  .guide-masthead { align-items: flex-start; }
  .guide-logo { width: 92px; }
  .guide-shell { display: block; padding-top: 18px; }
  .guide-sidebar {
    position: static;
    max-height: none;
    margin: 0 auto 16px;
  }
  .guide-sidebar-title { display: none; }
  .guide-contents-toggle { display: block; }
  .guide-contents { display: none; margin-top: 8px; }
  .guide-contents--open { display: grid; }
}

@media (max-width: 560px) {
  .guide-masthead {
    display: grid;
    gap: 12px;
    padding: 13px 16px;
  }
  .guide-brand { gap: 11px; }
  .guide-logo { width: 76px; }
  .guide-return { justify-self: start; }
  .guide-shell { padding: 12px 10px 64px; }
  .guide-main {
    width: 100%;
    padding: 24px 19px 36px;
    overflow-wrap: anywhere;
    border-radius: 10px;
  }
  .guide-back-to-top { right: 12px; bottom: 12px; }
}

@media print {
  body { background: #fff; }
  .guide-masthead { position: static; padding: 0 0 18px; }
  .guide-return,
  .guide-sidebar,
  .guide-back-to-top,
  .guide-translation-notice { display: none !important; }
  .guide-shell { display: block; padding: 0; }
  .guide-main { max-width: none; padding: 0; border: 0; box-shadow: none; }
  .guide-main h2 { break-after: avoid; }
  .guide-main a { color: inherit; }
}
