:root {
  --guide-bg: #f4f7fb;
  --guide-surface: #ffffff;
  --guide-surface-soft: #eef3f9;
  --guide-ink: #122033;
  --guide-ink-soft: #31465f;
  --guide-ink-muted: #5d7188;
  --guide-dusk: #18324f;
  --guide-dusk-deep: #10253d;
  --guide-slate: #d8e4f1;
  --guide-line: rgba(24, 50, 79, 0.14);
  --guide-line-strong: rgba(24, 50, 79, 0.28);
  --guide-accent: #3f78aa;
  --guide-accent-soft: rgba(63, 120, 170, 0.12);
  --guide-shadow: 0 22px 48px rgba(16, 37, 61, 0.12);
  --guide-shadow-soft: 0 10px 24px rgba(16, 37, 61, 0.08);
  --guide-radius: 18px;
  --guide-radius-sm: 12px;
  --guide-measure: 68ch;
}

body.guide-shell {
  background:
    radial-gradient(circle at top right, rgba(63, 120, 170, 0.14), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--guide-bg) 18%, #eef3f8 100%);
  color: var(--guide-ink);
}

.guide-main {
  padding: 2.5rem 0 4rem;
}

.guide-frame {
  display: grid;
  gap: 1.25rem;
}

.guide-breadcrumbs {
  color: var(--guide-ink-muted);
  font: 600 0.82rem/1.4 "Archivo", system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guide-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.guide-breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--guide-ink-muted);
}

.guide-breadcrumbs a {
  color: inherit;
}

.guide-article {
  display: grid;
  gap: 1.5rem;
}

.guide-hero {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.9fr);
  align-items: start;
}

.guide-hero__copy,
.guide-panel,
.guide-prose,
.guide-pagination {
  border: 1px solid var(--guide-line);
  border-radius: var(--guide-radius);
  box-shadow: var(--guide-shadow-soft);
}

.guide-hero__copy {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
  padding: 2rem;
}

.guide-return,
.guide-panel a,
.guide-breadcrumbs a,
.guide-prose a,
.guide-pagination a {
  color: var(--guide-accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.guide-return {
  display: inline-flex;
  margin-bottom: 0.85rem;
  font: 700 0.84rem/1.3 "Archivo", system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guide-path-marker,
.guide-panel-label,
.guide-position-badge,
.guide-topic {
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-path-marker {
  margin: 0 0 0.85rem;
  color: var(--guide-dusk);
}

.guide-hero h1 {
  margin: 0;
  color: var(--guide-dusk-deep);
  font: 700 clamp(2rem, 3vw, 3rem)/1.08 "Fraunces", Georgia, serif;
}

.guide-dek {
  max-width: 42rem;
  margin: 1rem 0 0;
  color: var(--guide-ink-soft);
  font: 400 clamp(1.02rem, 1.3vw, 1.14rem)/1.65 "Plus Jakarta Sans", system-ui, sans-serif;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: start;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--guide-line);
}

.guide-topic {
  margin: 0;
  color: var(--guide-ink-muted);
}

.guide-authorship p {
  margin: 0.1rem 0;
  color: var(--guide-ink-soft);
  font: 500 0.95rem/1.55 "Archivo", system-ui, sans-serif;
}

.guide-panel {
  background: linear-gradient(180deg, var(--guide-dusk) 0%, var(--guide-dusk-deep) 100%);
  color: #f5f8fc;
  padding: 1.5rem;
  box-shadow: var(--guide-shadow);
}

.guide-panel--quiet {
  background: linear-gradient(180deg, rgba(24, 50, 79, 0.06), rgba(24, 50, 79, 0.02));
  color: var(--guide-ink-soft);
  box-shadow: none;
}

.guide-panel--quiet p {
  margin: 0;
}

.guide-panel-label {
  margin: 0 0 0.4rem;
  color: var(--guide-slate);
}

.guide-panel-title {
  margin: 0;
  font: 700 1.35rem/1.18 "Fraunces", Georgia, serif;
}

.guide-panel-copy {
  margin: 0.85rem 0 0;
  color: rgba(245, 248, 252, 0.85);
  font: 400 0.98rem/1.65 "Plus Jakarta Sans", system-ui, sans-serif;
}

.guide-position-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.guide-position-badge {
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(216, 228, 241, 0.28);
  border-radius: 999px;
  background: rgba(216, 228, 241, 0.08);
  color: #f5f8fc;
}

.guide-prerequisites {
  padding: 1.15rem 1.35rem;
  border: 1px solid var(--guide-line-strong);
  border-radius: var(--guide-radius-sm);
  background: linear-gradient(180deg, rgba(63, 120, 170, 0.08), rgba(255, 255, 255, 0.92));
}

.guide-prerequisites h2 {
  margin: 0 0 0.45rem;
  color: var(--guide-dusk);
  font: 700 1.02rem/1.2 "Fraunces", Georgia, serif;
}

.guide-prerequisites p {
  margin: 0;
  color: var(--guide-ink-soft);
}

.guide-prose {
  background: rgba(255, 255, 255, 0.98);
  padding: clamp(1.3rem, 2vw, 2.3rem);
}

.guide-prose > * {
  max-width: var(--guide-measure);
}

.guide-prose > * + * {
  margin-top: 1rem;
}

.guide-prose h2,
.guide-prose h3,
.guide-prose h4,
.guide-prose h5,
.guide-prose h6 {
  margin-bottom: 0.35rem;
  color: var(--guide-dusk-deep);
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.18;
}

.guide-prose h2 {
  margin-top: 2.2rem;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
}

.guide-prose h3 {
  margin-top: 1.8rem;
  font-size: 1.3rem;
}

.guide-prose p,
.guide-prose li,
.guide-prose blockquote,
.guide-prose td,
.guide-prose th {
  color: var(--guide-ink);
  font: 400 1.05rem/1.78 "Archivo", system-ui, sans-serif;
}

.guide-prose ul,
.guide-prose ol {
  padding-left: 1.3rem;
}

.guide-prose li + li {
  margin-top: 0.5rem;
}

.guide-prose blockquote {
  margin-left: 0;
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--guide-accent);
  border-radius: 0 var(--guide-radius-sm) var(--guide-radius-sm) 0;
  background: linear-gradient(180deg, rgba(24, 50, 79, 0.06), rgba(63, 120, 170, 0.04));
  color: var(--guide-ink-soft);
}

.guide-prose hr {
  max-width: 14rem;
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--guide-line-strong);
}

.guide-prose code {
  padding: 0.15rem 0.35rem;
  border-radius: 0.4rem;
  background: rgba(24, 50, 79, 0.08);
  color: var(--guide-dusk-deep);
  font: 600 0.92rem/1.3 "Archivo", system-ui, sans-serif;
}

.guide-prose pre {
  overflow-x: auto;
  padding: 1rem 1.15rem;
  border-radius: var(--guide-radius-sm);
  background: var(--guide-dusk-deep);
  color: #f5f8fc;
}

.guide-prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.guide-prose th,
.guide-prose td {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--guide-line);
  text-align: left;
}

.guide-prose th {
  background: var(--guide-surface-soft);
  color: var(--guide-dusk-deep);
}

.guide-prose img,
.guide-prose iframe {
  max-width: 100%;
}

.guide-prose :where(p, li, blockquote, code, a, h2, h3, h4, h5, h6) {
  overflow-wrap: anywhere;
}

.guide-pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--guide-surface);
}

.guide-nav-link,
.guide-nav-empty {
  flex: 1 1 0;
}

.guide-nav-link:last-child {
  text-align: right;
}

.guide-nav-link {
  color: var(--guide-dusk-deep);
  font: 700 0.92rem/1.5 "Archivo", system-ui, sans-serif;
}

.guide-nav-link:focus-visible,
.guide-return:focus-visible,
.guide-panel a:focus-visible,
.guide-breadcrumbs a:focus-visible,
.guide-prose a:focus-visible {
  outline: 2px solid var(--guide-accent);
  outline-offset: 3px;
}

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

@media (max-width: 640px) {
  .guide-main {
    padding-top: 1.5rem;
  }

  .guide-hero__copy,
  .guide-panel,
  .guide-prose,
  .guide-pagination {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .guide-pagination {
    flex-direction: column;
  }

  .guide-nav-link:last-child {
    text-align: left;
  }
}

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

@media print {
  body.guide-shell {
    background: #fff;
  }

  .shell-navbar,
  .shell-footer,
  .guide-pagination {
    display: none;
  }

  .guide-prose,
  .guide-panel,
  .guide-hero__copy {
    box-shadow: none;
    border-color: #c9d2dd;
  }
}
