:root {
  --bg: #ffffff;
  --text: #1b1d1f;
  --muted: #5b6168;
  --rule: #d9dde1;
  --accent: #1f5f8b;
  --panel: #f4f6f8;
  --caut: #8a5a00;
  --caut-bg: #fff4dc;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --text: #e8eaed; --muted: #a2a9b1; --rule: #33383e; --accent: #7db4dc;
    --panel: #1e2125; --caut: #f2c063; --caut-bg: #33270f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.6; }
.wrap { max-width: 50rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
a { color: var(--accent); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0.4rem 0 0.6rem; }
h2 { font-size: 1.4rem; line-height: 1.25; margin: 2rem 0 0.8rem; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 0.5rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--rule); }
h4 { font-size: 0.95rem; margin: 1rem 0 0.3rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
p { margin: 0 0 0.8rem; }
ul, ol { margin: 0 0 0.9rem; padding-left: 1.3rem; }
li { margin-bottom: 0.35rem; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 0.05em 0.35em; word-break: break-word; }
.ui { font-weight: 600; border-bottom: 1px dotted var(--muted); }
.dmc { font-family: var(--mono); font-size: 0.82em; color: var(--muted); }
.lede { font-size: 1.15rem; color: var(--muted); }
.pmc, .crumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.2rem; }
.status { background: var(--panel); border-left: 4px solid var(--accent); padding: 0.5rem 0.8rem; }
.tp { border-bottom: 2px solid var(--text); padding-bottom: 1rem; margin-bottom: 1rem; }
.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; padding: 0.5rem 0.9rem; border-radius: 6px; font-weight: 600; }
.toc ol { padding-left: 1.3rem; }
.toc h3 { border: 0; margin-bottom: 0.2rem; }
.tw { overflow-x: auto; margin: 0 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; vertical-align: top; padding: 0.5rem 0.6rem; border: 1px solid var(--rule); }
th { background: var(--panel); }
.lodm td:last-child, .lodm th:last-child { white-space: nowrap; }
.dmmeta { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.8rem; color: var(--muted); border-top: 3px solid var(--accent); padding-top: 0.5rem; }
.dm > h2 { margin-top: 0.4rem; }
.caution, .note { border-radius: 6px; padding: 0.7rem 0.9rem; margin: 0.9rem 0; }
.caution { background: var(--caut-bg); border: 2px solid var(--caut); }
.note { background: var(--panel); border-left: 4px solid var(--muted); }
.nl { font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; margin-bottom: 0.25rem; }
.caution .nl { color: var(--caut); text-align: center; }
.caution p:last-child, .note p:last-child { margin-bottom: 0; }
ol.steps { list-style: none; padding: 0; }
ol.steps > li { display: flex; gap: 0.7rem; margin-bottom: 0.7rem; }
ol.steps ol.steps { margin-top: 0.5rem; }
.sn { flex: 0 0 auto; min-width: 2.2rem; font-weight: 700; color: var(--accent); }
.sb { flex: 1; min-width: 0; }
.istep, .iend { border: 1px solid var(--rule); border-radius: 6px; padding: 0.7rem 0.9rem; margin-bottom: 0.7rem; }
.iend { background: var(--panel); }
.il { font-weight: 700; color: var(--accent); margin-bottom: 0.3rem; }
.q { font-weight: 600; }
.ans { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0; }
.ans .yes, .ans .no { font-weight: 700; font-size: 0.8rem; padding: 0.1rem 0.45rem; border-radius: 4px; color: #fff; }
.ans .yes { background: #1d7f53; }
.ans .no { background: #6b7480; margin-left: 0.8rem; }
figure { margin: 1rem 0; }
figure img { width: 100%; height: auto; background: #fff; border: 1px solid var(--rule); border-radius: 6px; }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }
.pn { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: 1rem; font-size: 0.9rem; }
footer { margin-top: 2.5rem; font-size: 0.85rem; color: var(--muted); }
.part { margin-top: 2.5rem; padding-top: 0.6rem; border-top: 2px solid var(--text); }

@media print {
  :root { --bg: #fff; --text: #000; --muted: #444; --panel: #f2f2f2; }
  body { font-size: 10.5pt; }
  .wrap { max-width: none; padding: 0; }
  .btn, .pn, .crumb { display: none; }
  a { color: inherit; text-decoration: none; }
  .part { break-before: page; border: 0; }
  .dm { break-before: page; }
  .part + .dm { break-before: avoid; }
  .lodm, .toc { break-before: page; }
  .istep, .iend, .caution, .note, figure, tr { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }
}
@page { size: A4; margin: 18mm 16mm; }
