:root {
  --ink: #15163a;
  --muted: #4e4f6e;
  --paper: #f7f5f0;
  --surface: #ffffff;
  --line: #e6e2d8;
  --primary: #3b3fc9;
  --primary-ink: #ffffff;
  --accent: #0e7490;
  --hold: #8a5a00;
  --danger: #9f2d2d;
  --focus: #3b3fc9;
  --shadow: 0 1px 2px rgb(21 22 58 / 0.05), 0 8px 24px -12px rgb(21 22 58 / 0.18);
  --sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --max: 72rem;
  --nav: 16rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); }
a:hover { text-decoration: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--surface);
  color: var(--ink);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  z-index: 20;
}
.skip:focus { transform: none; }

.top {
  background: #111238;
  color: #fff;
}
.top-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}
.brand img { width: 32px; height: 32px; }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand span { display: block; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: #9ae7f5; }
.menu-btn {
  margin-left: auto;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid rgb(255 255 255 / 0.25);
  background: transparent;
  color: #fff;
  border-radius: 8px;
  font: inherit;
  padding: 0 0.8rem;
}
.top-search { display: none; }

.layout {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
}
.nav {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 1rem 1rem;
}
.nav.is-open { display: block; }
.nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.98rem;
}
.nav a[aria-current="page"] {
  background: #ececff;
  color: var(--primary);
  font-weight: 650;
}
.nav a:hover { background: #f3f1ea; }
.nav-label {
  margin: 0.4rem 0.7rem 0.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

main { padding: 1.25rem 1.1rem 3rem; min-width: 0; }
h1 { font-size: 1.85rem; line-height: 1.2; letter-spacing: -0.03em; margin: 0 0 0.6rem; }
h2 { font-size: 1.28rem; line-height: 1.3; margin: 1.8rem 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 1.3rem 0 0.4rem; }
p, li { max-width: 42rem; }
.lede { font-size: 1.12rem; color: #2a2b4a; }
ol.steps { padding-left: 1.3rem; }
ol.steps > li { margin: 0.45rem 0; }
ol.steps > li::marker { font-weight: 700; color: var(--primary); }

.callout, .note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  box-shadow: var(--shadow);
  max-width: 42rem;
}
.note { border-left-color: var(--hold); }
.callout strong, .note strong { display: block; margin-bottom: 0.2rem; }

figure {
  margin: 1rem 0 1.4rem;
  max-width: 52rem;
}
figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 42rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: block;
  max-width: 52rem;
}
thead, tbody { display: block; }
tr { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; }
th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { background: #f3f1ea; font-size: 0.92rem; }

.search-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  box-shadow: var(--shadow);
  margin: 1rem 0 1.4rem;
  max-width: 42rem;
}
.search-panel label { display: block; font-weight: 650; margin-bottom: 0.35rem; }
.search-panel input, .top-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfcabe;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.results { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.results li { margin: 0; }
.results a { display: block; min-height: 44px; padding: 0.45rem 0.2rem; }
.results p { margin: 0.1rem 0 0.45rem; color: var(--muted); font-size: 0.92rem; }
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0.55rem 0;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  max-width: 42rem;
}
.task-list a:hover { border-color: var(--primary); }
.task-list strong { display: block; color: var(--primary); }
.task-list span { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 0.15rem; }

.footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 1.1rem 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.footer-inner { max-width: var(--max); margin: 0 auto; }

@media (min-width: 900px) {
  .menu-btn { display: none; }
  .top-search { display: block; margin-left: auto; width: min(22rem, 36vw); }
  .layout { grid-template-columns: var(--nav) 1fr; align-items: start; }
  .nav {
    display: block;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow: auto;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding: 1rem 0.6rem 2rem;
  }
  main { padding: 2rem 2rem 3.5rem; }
  table, thead, tbody, tr { display: revert; }
  table { display: table; }
}

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