:root {
  color-scheme: light;
  --navy-950: #071c2c;
  --navy-900: #0b2538;
  --ink-900: #17242e;
  --ink-700: #465964;
  --ink-500: #657984;
  --teal-700: #09626a;
  --teal-100: #dff2f1;
  --line: #d7e0e4;
  --soft: #f3f6f7;
  --paper: #ffffff;
  --amber-100: #fff4d9;
  --amber-800: #6e4908;
  --red-100: #fbe8e7;
  --red-800: #862d2a;
}

* { box-sizing: border-box; }
html { min-width: 0; scroll-behavior: smooth; background: var(--soft); }
body { margin: 0; color: var(--ink-900); background: var(--soft); font: 16px/1.55 Inter, Aptos, "Segoe UI", Arial, sans-serif; }
a { color: var(--teal-700); }
a:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgb(13 120 128 / 0.28); outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 20; padding: 8px 12px; color: #fff; background: var(--navy-950); border-radius: 6px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.guide-header { min-height: 164px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 34px max(28px, calc((100vw - 1240px) / 2)); color: #fff; background: linear-gradient(120deg, var(--navy-950), #0b4350); }
.guide-header h1 { margin: 2px 0 3px; font: 500 clamp(30px, 4vw, 46px)/1.05 Georgia, "Times New Roman", serif; letter-spacing: -0.035em; }
.kicker { margin: 0; color: #79c9c6; font-size: 12px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.subtitle { margin: 0; color: #c6d7de; font-size: 14px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 15px; color: var(--navy-950); background: #fff; border: 1px solid rgb(255 255 255 / 0.35); border-radius: 7px; font-weight: 750; text-decoration: none; }
.button:hover { background: var(--teal-100); }

.pilot-boundary { display: flex; align-items: center; justify-content: center; gap: 10px 22px; padding: 12px 24px; color: var(--amber-800); background: var(--amber-100); border-bottom: 1px solid #ead7a6; font-size: 14px; }
.guide-layout { max-width: 1240px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 34px; margin: 0 auto; padding: 42px 28px 80px; }
.guide-nav { position: sticky; top: 20px; height: fit-content; display: grid; gap: 2px; padding: 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.guide-nav strong { margin-bottom: 7px; color: var(--navy-900); font-size: 13px; }
.guide-nav a { padding: 7px 8px; color: var(--ink-700); border-radius: 6px; font-size: 13px; text-decoration: none; }
.guide-nav a:hover { color: var(--teal-700); background: var(--teal-100); }
main { min-width: 0; }

.guide-intro { padding: 32px; color: #fff; background: var(--navy-900); border-radius: 14px; box-shadow: 0 14px 38px rgb(7 28 44 / 0.13); }
.guide-intro h2 { margin: 4px 0 8px; font: 500 clamp(27px, 3vw, 38px)/1.1 Georgia, "Times New Roman", serif; }
.guide-intro > p:not(.kicker) { max-width: 760px; margin: 0; color: #cedce2; }
.five-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 26px 0 0; padding: 0; list-style: none; background: rgb(255 255 255 / 0.16); border: 1px solid rgb(255 255 255 / 0.12); }
.five-steps li { min-height: 92px; display: grid; align-content: center; gap: 5px; padding: 12px; background: rgb(255 255 255 / 0.06); }
.five-steps span { width: 24px; height: 24px; display: grid; place-items: center; color: #d7f4f2; background: rgb(89 188 183 / 0.22); border-radius: 50%; font-size: 11px; font-weight: 800; }
.five-steps strong { font-size: 13px; }

.guide-section { scroll-margin-top: 20px; display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 20px; padding: 44px 4px; border-bottom: 1px solid var(--line); }
.section-number { width: 42px; height: 42px; display: grid; place-items: center; margin: 0; color: var(--teal-700); background: var(--teal-100); border-radius: 50%; font-size: 12px; font-weight: 800; }
.guide-section h2 { margin: 0 0 18px; color: var(--navy-950); font: 500 29px/1.15 Georgia, "Times New Roman", serif; letter-spacing: -0.02em; }
.guide-section h3 { margin: 0 0 5px; color: var(--navy-900); font-size: 15px; }
.guide-section p { color: var(--ink-700); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-grid article { min-height: 132px; padding: 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.check-grid p { margin: 0; font-size: 14px; }
.practice-files { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.practice-files a { min-height: 42px; display: inline-flex; align-items: center; padding: 8px 11px; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; font-size: 13px; font-weight: 700; text-decoration: none; }
.practice-files a:hover { background: var(--teal-100); }

.run-list, .plain-steps { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; counter-reset: run; }
.run-list li { counter-increment: run; display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; padding: 15px 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.run-list strong::before { content: counter(run) ". "; color: var(--teal-700); }
.run-list span { color: var(--ink-700); font-size: 14px; }
.meaning { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; margin-top: 12px; padding: 16px 17px; color: var(--amber-800); background: var(--amber-100); border: 1px solid #ead7a6; border-radius: 8px; font-size: 14px; }

.challenge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.challenge-grid article { min-height: 82px; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 10px; padding: 13px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.challenge-grid span { width: 27px; height: 27px; display: grid; place-items: center; color: var(--teal-700); background: var(--teal-100); border-radius: 50%; font-size: 12px; font-weight: 800; }
.challenge-grid p { margin: 0; font-size: 14px; }
.stop-rule { margin: 12px 0 0; padding: 15px 17px; color: var(--red-800) !important; background: var(--red-100); border: 1px solid #efc6c3; border-radius: 8px; }

.plain-steps { counter-reset: plain; }
.plain-steps li { counter-increment: plain; position: relative; padding: 13px 15px 13px 49px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.plain-steps li::before { content: counter(plain); position: absolute; top: 11px; left: 14px; width: 25px; height: 25px; display: grid; place-items: center; color: var(--teal-700); background: var(--teal-100); border-radius: 50%; font-size: 11px; font-weight: 800; }
.note { margin: 12px 0 0; padding: 13px 15px; background: #eaf2f7; border-left: 4px solid #3a7197; }
.recovery-table { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.recovery-table > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.recovery-table > div:last-child { border-bottom: 0; }
.recovery-table span { color: var(--ink-700); font-size: 14px; }
.rules-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.rules-list li { position: relative; padding: 13px 15px 13px 42px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.rules-list li::before { content: "✓"; position: absolute; left: 15px; color: var(--teal-700); font-weight: 900; }
.final-section { border-bottom: 0; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px max(28px, calc((100vw - 1184px) / 2)); color: #a9bdc6; background: var(--navy-950); font-size: 12px; }

@media (max-width: 900px) {
  .pilot-boundary { align-items: flex-start; flex-direction: column; }
  .guide-layout { display: block; padding-top: 24px; }
  .guide-nav { position: static; display: flex; flex-wrap: wrap; margin-bottom: 18px; }
  .guide-nav strong { width: 100%; }
  .five-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .five-steps li:last-child { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .guide-header { align-items: flex-start; flex-direction: column; padding: 28px 18px; }
  .pilot-boundary { padding-inline: 18px; }
  .guide-layout { padding: 18px 14px 54px; }
  .guide-intro { padding: 24px 18px; }
  .five-steps, .check-grid, .challenge-grid { grid-template-columns: 1fr; }
  .five-steps li:last-child { grid-column: auto; }
  .guide-section { grid-template-columns: 1fr; gap: 12px; padding-block: 34px; }
  .run-list li, .meaning, .recovery-table > div { grid-template-columns: 1fr; gap: 5px; }
  footer { align-items: flex-start; flex-direction: column; padding: 20px 18px; }
}

@media (pointer: coarse) {
  .guide-nav a, .practice-files a { min-height: 44px; display: inline-flex; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  @page { size: Letter portrait; margin: 0.55in; }
  body { color: #111; background: #fff; font-size: 10pt; }
  .skip-link, .button, .guide-nav, .practice-files { display: none !important; }
  .guide-header { min-height: 0; padding: 0 0 18px; color: #111; background: none; border-bottom: 1px solid #777; }
  .guide-header .kicker, .guide-header .subtitle { color: #444; }
  .pilot-boundary { padding: 10px 0; color: #111; background: none; border-bottom: 1px solid #aaa; }
  .guide-layout { display: block; max-width: none; padding: 0; }
  .guide-intro { margin: 16px 0 0; padding: 18px; color: #111; background: none; border: 1px solid #777; box-shadow: none; }
  .guide-intro .kicker, .guide-intro > p:not(.kicker) { color: #333; }
  .five-steps { background: #ccc; border-color: #aaa; }
  .five-steps li { min-height: 0; color: #111; background: #fff; }
  .guide-section { break-inside: avoid; padding: 22px 0; }
  .check-grid article, .run-list li, .challenge-grid article, .plain-steps li, .recovery-table, .rules-list li { box-shadow: none; }
  footer { padding: 16px 0 0; color: #333; background: none; border-top: 1px solid #777; }
}
