:root {
  --ink: #1d232a;
  --muted: #5d6873;
  --paper: #fbfaf6;
  --rule: #ddd8cc;
  --accent: #1f5fa8;
  --lcd: #2346d8;
  --warn-bg: #fff3e0;
  --warn: #c26100;
  --note-bg: #eef4fb;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
}
a { color: var(--accent); }
code, kbd, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; }
code { background: #efece4; padding: 0.1em 0.3em; border-radius: 3px; }
kbd {
  display: inline-block; min-width: 1.8em; text-align: center;
  padding: 0.05em 0.4em; border: 1px solid #b9b3a5; border-bottom-width: 3px;
  border-radius: 5px; background: #fff; font-weight: 600;
}
pre {
  background: #1d232a; color: #e8eef4; padding: 0.9rem 1rem; border-radius: 6px;
  overflow-x: auto; line-height: 1.45;
}
pre code { background: none; padding: 0; color: inherit; }

.cover {
  background: linear-gradient(135deg, #10295c, var(--lcd));
  color: #fff; padding: 3.5rem 1.5rem 3rem; text-align: center;
}
.cover h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0.2rem 0; line-height: 1.15; }
.kicker { text-transform: uppercase; letter-spacing: 0.25em; font-size: 0.8rem; margin: 0; opacity: 0.85; }
.sub { margin: 0.6rem 0 0; opacity: 0.9; }
.edition { margin: 1.2rem 0 0; font-size: 0.85rem; opacity: 0.7; }

.layout { display: grid; grid-template-columns: 15rem minmax(0, 46rem); gap: 3rem; justify-content: center; padding: 2rem 1.5rem 4rem; }
.toc { position: sticky; top: 1rem; align-self: start; font-size: 0.92rem; }
.toc h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); margin: 0 0 0.5rem; }
.toc ol { margin: 0; padding-left: 1.4rem; }
.toc li { margin: 0.25rem 0; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

section { border-top: 1px solid var(--rule); padding-top: 1.5rem; margin-top: 2.5rem; }
section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
section::after { content: ""; display: table; clear: both; }
h2 { font-size: 1.6rem; margin: 0 0 1rem; display: flex; align-items: center; gap: 0.6rem; }
.num {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; flex: none;
  border-radius: 50%; background: var(--lcd); color: #fff; font-size: 1rem;
}
h3 { font-size: 1.15rem; margin: 1.6rem 0 0.4rem; }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { border-bottom: 2px solid var(--ink); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
th.group { background: #efece4; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.compact td { padding: 0.3rem 0.5rem; }

.note { background: var(--note-bg); border-left: 4px solid var(--accent); padding: 0.75rem 1rem; border-radius: 0 6px 6px 0; margin: 1.2rem 0; }
.note.warn { background: var(--warn-bg); border-left-color: var(--warn); }
.muted { color: var(--muted); font-size: 0.93rem; }

ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin: 0.8rem 0; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.05rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 2px solid var(--lcd);
  color: var(--lcd); font-weight: 700; display: grid; place-items: center; font-size: 0.9rem;
}
ol.steps > li > p:first-child { margin-top: 0; }

dl.faq dt { font-weight: 700; margin-top: 1.2rem; }
dl.faq dd { margin: 0.3rem 0 0 0; padding-left: 1rem; border-left: 3px solid var(--rule); }
dl.faq dd p { margin: 0.3rem 0; }

figure { margin: 1.2rem 0; }
figure img { width: 100%; height: auto; border-radius: 6px; display: block; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
figure.side { float: right; width: 15rem; margin: 0 0 1rem 1.5rem; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9rem; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .toc { position: static; border: 1px solid var(--rule); border-radius: 6px; padding: 1rem; background: #fff; }
}
@media (max-width: 600px) {
  figure.side { float: none; width: 100%; margin: 1rem 0; }
  .gallery { grid-template-columns: 1fr; }
}
@media print {
  .toc { display: none; }
  .layout { display: block; padding: 0; }
  .cover { background: none; color: var(--ink); }
  section { break-inside: avoid-page; }
  pre { background: #f2f2f2; color: #000; }
}
