:root {
  color-scheme: light;
  --primary: #0017c1;
  --primary-dark: #000d80;
  --text: #1a1a1c;
  --muted: #626264;
  --line: #d8d8db;
  --surface: #f7f7fa;
  --info: #eef1fb;
  --danger: #a30000;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
a:focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }

.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 10;
  padding: 10px 14px;
  color: #fff;
  background: var(--primary);
}

.skip-link:focus { top: 12px; }

.site-header {
  color: #fff;
  background: linear-gradient(120deg, #000b66, var(--primary));
  border-bottom: 4px solid #ffbf47;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 28px 24px;
}

.brand {
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  text-decoration: none;
}

.brand:hover { color: #fff; text-decoration: underline; }
.header-inner p { max-width: 760px; margin: 5px 0 14px; color: #f2f4ff; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.button {
  display: inline-block;
  padding: 7px 14px;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}

.button:hover { color: #fff; background: rgb(255 255 255 / 12%); }
.button.primary { color: var(--primary); background: #fff; }
.button.primary:hover { color: var(--primary-dark); background: #f2f4ff; }

.page-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 34px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 28px 70px;
}

.guide-nav {
  position: sticky;
  top: 20px;
  align-self: start;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.guide-nav strong { display: block; margin-bottom: 6px; }
.guide-nav a { display: block; padding: 6px 3px; color: var(--text); text-decoration: none; }
.guide-nav a:hover { color: var(--primary); text-decoration: underline; }

.prose { min-width: 0; max-width: 860px; }
.prose > h1:first-child { margin-top: 0; }
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.35rem); line-height: 1.35; }
.prose h2 { margin-top: 2.5rem; padding-left: 12px; border-left: 5px solid var(--primary); font-size: 1.45rem; line-height: 1.5; }
.prose h3 { margin-top: 2rem; padding-bottom: 5px; border-bottom: 1px solid var(--line); font-size: 1.15rem; }
.prose h4 { margin-top: 1.5rem; color: var(--primary); }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin-bottom: .35rem; }
.prose strong { font-weight: 700; }

.prose blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  background: var(--info);
  border-left: 5px solid var(--primary);
}

.prose blockquote > :last-child { margin-bottom: 0; }

.prose code {
  padding: 2px 6px;
  overflow-wrap: anywhere;
  background: #f0f0f3;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
}

.prose pre {
  max-width: 100%;
  margin: 16px 0 22px;
  padding: 16px;
  overflow-x: auto;
  color: #f7f7fa;
  background: #1a1a1c;
  border-radius: 8px;
  line-height: 1.55;
}

.prose pre code { padding: 0; color: inherit; background: none; overflow-wrap: normal; }

.prose table {
  display: block;
  width: 100%;
  margin: 16px 0 24px;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .92rem;
}

.prose th, .prose td { min-width: 130px; padding: 9px 11px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--surface); white-space: nowrap; }
.prose hr { margin: 36px 0; border: 0; border-top: 1px solid var(--line); }

.next-actions {
  display: grid;
  gap: 7px;
  margin-top: 48px;
  padding: 18px;
  background: var(--info);
  border: 1px solid #b7c1ee;
  border-radius: 8px;
}

.site-footer { padding: 22px 28px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); font-size: .86rem; }
.site-footer p { max-width: var(--max-width); margin: 0 auto; }

@media (max-width: 780px) {
  .header-inner { padding: 22px 20px; }
  .page-shell { grid-template-columns: 1fr; gap: 22px; padding: 22px 20px 55px; }
  .guide-nav { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-nav strong { grid-column: 1 / -1; }
}

@media print {
  .skip-link, .header-actions, .guide-nav, .next-actions { display: none; }
  .site-header { color: var(--text); background: #fff; border-bottom: 2px solid var(--text); }
  .brand, .header-inner p { color: var(--text); }
  .page-shell { display: block; max-width: none; padding: 20px 0; }
  .prose { max-width: none; }
}
