:root {
  --guide-ink: #172033;
  --guide-muted: #5f6b7a;
  --guide-line: #dbe3ec;
  --guide-soft: #f5f8fc;
  --guide-accent: #315efb;
  --guide-accent-soft: #edf2ff;
  --guide-success: #0f766e;
  --guide-warning: #9a5b00;
}

.guide-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  margin: 0 0 1.1rem;
  color: var(--guide-muted);
  font-size: .9rem;
}

.guide-breadcrumb a { color: inherit; text-decoration: none; }
.guide-breadcrumb a:hover { color: var(--guide-accent); }
.guide-breadcrumb span[aria-hidden="true"] { color: #9aa6b5; }

.guide-hero {
  padding: clamp(1.35rem, 3vw, 2.35rem);
  border: 1px solid var(--guide-line);
  border-radius: 1.4rem;
  background: linear-gradient(145deg, #fff 0%, #f7f9ff 100%);
  box-shadow: 0 18px 44px rgba(31, 48, 78, .07);
}

.guide-kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .8rem;
  color: var(--guide-accent);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.guide-hero h1 {
  max-width: 900px;
  margin: 0;
  color: var(--guide-ink);
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  line-height: 1.16;
  letter-spacing: -.035em;
}

.guide-lead {
  max-width: 820px;
  margin: 1rem 0 0;
  color: var(--guide-muted);
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  line-height: 1.75;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  margin-top: 1.1rem;
  color: var(--guide-muted);
  font-size: .88rem;
}

.guide-meta a { color: var(--guide-accent); }

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  gap: 1.4rem;
  align-items: start;
  margin-top: 1.4rem;
}

.guide-article,
.guide-sidebar-card,
.guide-hub-card,
.guide-related-card {
  min-width: 0;
  border: 1px solid var(--guide-line);
  border-radius: 1.2rem;
  background: #fff;
}

.guide-article { padding: clamp(1.2rem, 3vw, 2.2rem); }
.guide-sidebar { position: sticky; top: 5.4rem; display: grid; gap: 1rem; }
.guide-sidebar-card { padding: 1.1rem; }
.guide-sidebar-card h2 { margin: 0 0 .75rem; font-size: 1rem; }

.guide-toc {
  display: grid;
  gap: .3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-toc a {
  display: block;
  padding: .5rem .6rem;
  border-radius: .65rem;
  color: var(--guide-muted);
  font-size: .91rem;
  line-height: 1.45;
  text-decoration: none;
}

.guide-toc a:hover,
.guide-toc a:focus-visible { color: var(--guide-accent); background: var(--guide-accent-soft); }

.quick-answer {
  margin: 0 0 1.5rem;
  padding: 1.15rem 1.2rem;
  border-left: 4px solid var(--guide-accent);
  border-radius: .9rem;
  background: var(--guide-accent-soft);
}

.quick-answer strong { display: block; margin-bottom: .45rem; color: var(--guide-ink); }
.quick-answer p { margin: 0; color: #34425a; line-height: 1.72; }

.guide-article h2 {
  scroll-margin-top: 6rem;
  margin: 2.15rem 0 .8rem;
  color: var(--guide-ink);
  font-size: clamp(1.3rem, 2.7vw, 1.65rem);
  line-height: 1.35;
}

.guide-article h2:first-of-type { margin-top: .2rem; }
.guide-article h3 { margin: 1.5rem 0 .55rem; color: var(--guide-ink); font-size: 1.08rem; }
.guide-article p,
.guide-article li { color: #39465a; line-height: 1.84; }
.guide-article p { margin: .65rem 0 1rem; }
.guide-article ul,
.guide-article ol { padding-left: 1.35rem; }
.guide-article li + li { margin-top: .45rem; }

.guide-formula {
  overflow-wrap: anywhere;
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid #cbd8ff;
  border-radius: .9rem;
  background: #f8faff;
  color: #1f3f99;
  font-weight: 700;
  line-height: 1.65;
}

.guide-checklist,
.guide-warning,
.guide-example {
  margin: 1.1rem 0;
  padding: 1rem 1.1rem;
  border-radius: .9rem;
}

.guide-checklist { border: 1px solid #b8ded8; background: #f0fbf9; }
.guide-warning { border: 1px solid #ecd6ac; background: #fff9ed; }
.guide-example { border: 1px solid var(--guide-line); background: var(--guide-soft); }
.guide-checklist strong { color: var(--guide-success); }
.guide-warning strong { color: var(--guide-warning); }

.guide-table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--guide-line); border-radius: .9rem; }
.guide-table { width: 100%; min-width: 580px; border-collapse: collapse; background: #fff; }
.guide-table th,
.guide-table td { padding: .8rem .9rem; border-bottom: 1px solid var(--guide-line); text-align: left; vertical-align: top; }
.guide-table th { background: var(--guide-soft); color: var(--guide-ink); font-size: .9rem; }
.guide-table td { color: #465366; font-size: .92rem; line-height: 1.6; }
.guide-table tr:last-child td { border-bottom: 0; }

.guide-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin: 1.7rem 0;
  padding: 1.15rem 1.2rem;
  border-radius: 1rem;
  background: #172033;
  color: #fff;
}

.guide-cta strong { display: block; font-size: 1.05rem; }
.guide-cta p { margin: .35rem 0 0; color: #d9e2ef; line-height: 1.55; }
.guide-cta .btn { white-space: nowrap; }

.guide-sources {
  margin-top: 2rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--guide-line);
}
.guide-sources h2 { margin-top: 0; }
.guide-sources a { overflow-wrap: anywhere; }

.guide-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.2rem;
}

.guide-hub-intro { margin-bottom: 1.4rem; }
.guide-hub-grid,
.guide-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.guide-hub-card,
.guide-related-card {
  display: flex;
  flex-direction: column;
  padding: 1.15rem;
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.guide-hub-card:hover,
.guide-related-card:hover {
  transform: translateY(-2px);
  border-color: #b7c7ff;
  box-shadow: 0 14px 30px rgba(31, 48, 78, .08);
}

.guide-card-label { color: var(--guide-accent); font-size: .78rem; font-weight: 700; }
.guide-hub-card h2,
.guide-related-card h3 { margin: .55rem 0 .45rem; color: var(--guide-ink); line-height: 1.4; }
.guide-hub-card h2 { font-size: 1.08rem; }
.guide-related-card h3 { font-size: 1rem; }
.guide-hub-card p,
.guide-related-card p { margin: 0; color: var(--guide-muted); line-height: 1.65; font-size: .92rem; }
.guide-card-action { margin-top: auto; padding-top: .9rem; color: var(--guide-accent); font-size: .88rem; font-weight: 700; }

.guide-cluster-section { margin: 1.6rem 0; }
.guide-cluster-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: .9rem; }
.guide-cluster-heading h2 { margin: 0; }
.guide-cluster-heading p { margin: .25rem 0 0; color: var(--guide-muted); }

.reading-progress {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--guide-accent);
  pointer-events: none;
}

@media (max-width: 960px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-sidebar { position: static; order: -1; }
  .guide-sidebar-card[data-desktop-toc] { display: none; }
  .guide-hub-grid,
  .guide-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .guide-hero { border-radius: 1rem; }
  .guide-article { border-radius: 1rem; padding: 1.05rem; }
  .guide-hub-grid,
  .guide-related-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-cta { grid-template-columns: minmax(0, 1fr); }
  .guide-cta .btn { width: 100%; }
  .guide-cluster-heading { align-items: start; flex-direction: column; }
  .guide-meta { display: grid; gap: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .guide-hub-card,
  .guide-related-card { transition: none; }
}
