.guide-intro, .concept-nav, .guide-layout {
  width: min(1250px, calc(100% - 40px));
  margin: 0 auto;
}
.guide-intro { padding: 48px 0 24px; }
.guide-intro h1 { font-size: clamp(2rem, 4.5vw, 3.8rem); margin: 12px 0; }
.guide-intro > p { max-width: 850px; line-height: 1.7; }
.guide-note, .guide-progress span { color: var(--muted); font-size: 0.88rem; line-height: 1.6; }
.guide-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 24px; }
.guide-progress progress { width: 180px; height: 10px; accent-color: var(--cyan); }
.concept-nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 28px; }
.concept-nav a {
  padding: 12px 16px; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; text-decoration: none;
}
.concept-nav a[aria-current="step"] { border-color: var(--cyan); color: var(--cyan); background: #123c41; }
.concept-nav a[data-complete="true"]::after { content: " / checked"; font-size: 0.75rem; color: var(--cyan); }
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.guide-concept { min-width: 0; padding: clamp(16px, 3vw, 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.guide-concept h2 { font-size: clamp(1.65rem, 3vw, 2.4rem); margin: 12px 0; }
.guide-lead { color: #c5d7df; line-height: 1.8; }
.guide-figure { margin: 24px 0; }
#guideDiagram { border: 1px solid var(--line); border-radius: 12px; background: #05131e; overflow-x: auto; }
#guideDiagram svg { display: block; width: 100%; height: auto; min-width: 440px; }
.guide-figure figcaption { margin-top: 12px; color: var(--muted); line-height: 1.6; font-size: 0.92rem; }
.guide-svg text { fill: var(--text); font: 16px ui-sans-serif, system-ui, sans-serif; }
.guide-svg .small { font-size: 13px; fill: #b7cbd4; }
.guide-svg .box { fill: #143443; stroke: var(--cyan); stroke-width: 2; }
.guide-svg .wire { fill: none; stroke: var(--cyan); stroke-width: 4; stroke-linejoin: round; }
.guide-svg .clock { fill: none; stroke: var(--blue); stroke-width: 3; }
.guide-svg .outline { fill: none; stroke: #61808d; stroke-width: 2; }
.guide-svg .warning { fill: #442c23; stroke: var(--orange); stroke-width: 2; }
.guide-svg .bad { fill: #472432; stroke: var(--red); stroke-width: 2; }
.guide-svg .dim { fill: #0a202c; stroke: #315362; }
.guide-experiment { padding: 20px; border: 1px solid #36736f; border-radius: 12px; background: #0a262f; }
.guide-experiment h3 { margin-top: 0; }
.guide-experiment p { line-height: 1.6; }
.experiment-control { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 20px 0; }
.experiment-control label { font-weight: 600; }
.experiment-control output { color: var(--cyan); }
.experiment-control input { grid-column: 1 / -1; width: 100%; accent-color: var(--cyan); }
.experiment-result { padding: 16px; border-left: 3px solid var(--cyan); background: #061c25; line-height: 1.7; }
.experiment-result p { margin: 6px 0 0; }
.guide-two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.guide-insight { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.guide-insight h2, .guide-insight h3 { margin-top: 0; font-size: 1.1rem; }
.guide-insight p, .guide-insight li { line-height: 1.7; color: #bdcfd7; }
.guide-insight li + li { margin-top: 10px; }
.guide-insight a, .guide-glossary a { color: var(--cyan); }
.guide-sidebar { display: grid; gap: 16px; }
.guide-sidebar .button { width: 100%; margin-top: 12px; white-space: normal; }
.guide-sidebar .button-primary { color: #062028; }
.guide-sidebar ol, .guide-sidebar ul { padding-left: 20px; }
.misconception { border-top: 3px solid var(--orange); }
.guide-glossary { margin: 24px 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.guide-glossary summary { cursor: pointer; font-weight: 600; }
.guide-glossary dt { color: var(--cyan); margin-top: 14px; }
.guide-glossary dd { margin: 6px 0 0; color: #bdcfd7; line-height: 1.6; }
.guide-check { border-top: 1px solid var(--line); padding-top: 22px; }
#checkChoices { display: grid; gap: 10px; }
#checkChoices button { white-space: normal; text-align: left; line-height: 1.5; }
#checkChoices button[aria-pressed="true"] { border-color: var(--cyan); }
#checkFeedback { min-height: 48px; line-height: 1.7; }
#checkFeedback[data-correct="true"] { color: var(--cyan); }
#checkFeedback[data-correct="false"], #storageNotice { color: var(--yellow); }
.guide-skip { position: absolute; top: -80px; left: 16px; padding: 12px; background: var(--panel); color: var(--cyan); z-index: 200; }
.guide-skip:focus { top: 10px; }
body:has(.guide-layout) :focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.guide-layout + .course-source { margin: 32px auto 45px; line-height: 1.7; }
.beginner-entry {
  width: min(1250px, calc(100% - 40px)); margin: 0 auto 28px; padding: 24px;
  border: 1px solid #36736f; border-radius: 14px; background: linear-gradient(110deg, #123b43, #0b1e28);
}
.beginner-entry h2 { margin: 8px 0; }
.beginner-entry p { line-height: 1.7; max-width: 850px; color: #c5d7df; }
.beginner-entry .button { display: inline-flex; }
.beginner-entry p a { color: var(--cyan); }
@media (max-width: 950px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .guide-layout, .guide-intro, .concept-nav { width: calc(100% - 24px); }
  .guide-two-up, .guide-sidebar { grid-template-columns: 1fr; }
  .concept-nav a { flex: 1 1 40%; padding: 10px; }
  .guide-experiment { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  body:has(.guide-layout) *, body:has(.guide-layout) *::before, body:has(.guide-layout) *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
  }
}
