:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --subtle: #94a3b8;
    --line: #e2e8f0;
    --accent: #4f46e5;
    --accent-soft: #eef2ff;
    --warn-bg: #fffbeb;
    --warn-line: #fde68a;
    --warn-text: #92400e;
    --danger-bg: #fef2f2;
    --danger-line: #fecaca;
    --danger-text: #b91c1c;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Meiryo UI', Meiryo, 'Noto Sans JP', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}
.layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    max-width: 1120px;
    margin: 0 auto;
    gap: 32px;
    padding: 32px 24px 64px;
}
.toc {
    position: sticky;
    top: 24px;
    align-self: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
}
.toc p { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--subtle); }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 2px 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }
header.doc-header { margin-bottom: 24px; }
.doc-kicker { margin: 0; font-size: 13px; font-weight: 600; color: var(--accent); }
h1 { margin: 4px 0 8px; font-size: 26px; line-height: 1.4; }
.doc-lead { margin: 0; color: var(--muted); }
section.chapter {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px 28px;
    margin-bottom: 20px;
}
h2 {
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    font-size: 19px;
}
h3 { margin: 24px 0 8px; font-size: 16px; }
p { margin: 0 0 12px; }
ol.steps, ul.points { margin: 0 0 12px; padding-left: 22px; }
ol.steps li, ul.points li { margin: 4px 0; }
table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: #f8fafc; font-weight: 600; white-space: nowrap; }
table.matrix th { white-space: normal; }
table.matrix td:not(:first-child) { white-space: nowrap; }
.ui {
    display: inline-block;
    padding: 0 6px;
    border: 1px solid #c7d2fe;
    border-radius: 4px;
    background: var(--accent-soft);
    color: #3730a3;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.7;
    white-space: nowrap;
}
.badge {
    display: inline-block;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
}
.badge-required { background: #fee2e2; color: var(--danger-text); }
.badge-optional { background: #f1f5f9; color: var(--muted); }
.note, .warn {
    border-radius: 6px;
    padding: 10px 14px;
    margin: 12px 0;
    font-size: 14px;
}
.note { background: var(--accent-soft); border: 1px solid #c7d2fe; }
.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); }
.note strong, .warn strong { display: block; margin-bottom: 2px; }
dl.faq dt { font-weight: 600; margin-top: 12px; }
dl.faq dt::before { content: 'Q. '; color: var(--accent); }
dl.faq dd { margin: 4px 0 0 0; color: var(--muted); }
dl.faq dd::before { content: 'A. '; font-weight: 600; color: var(--text); }
.flow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 16px;
    padding: 0;
    list-style: none;
    counter-reset: flow;
}
.flow li {
    counter-increment: flow;
    flex: 1 1 160px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    background: #f8fafc;
}
.flow li::before {
    content: counter(flow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-right: 6px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.doc-footer { color: var(--subtle); font-size: 13px; text-align: center; }
@media (max-width: 860px) {
    .layout { grid-template-columns: 1fr; padding: 16px 16px 48px; gap: 16px; }
    .toc { position: static; }
    section.chapter { padding: 18px 16px; }
    table { display: block; overflow-x: auto; }
}
@media print {
    body { background: #fff; }
    .layout { display: block; padding: 0; }
    .toc { display: none; }
    section.chapter { border: none; padding: 0; page-break-inside: avoid; }
}
