:root {
    color-scheme: light;
    --ink: #202631;
    --muted: #657184;
    --line: #d7dde6;
    --surface: #ffffff;
    --surface-soft: #f5f6f8;
    --brand: #db3a0a;
    --brand-dark: #9f2908;
    --accent: #ffb000;
    --accent-soft: #fff0e8;
    font-family: "Noto Sans JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
    line-height: 1.75;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 20rem;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% -8%, rgb(219 58 10 / 9%), transparent 30rem),
        var(--surface-soft);
}

a {
    color: var(--brand-dark);
    text-underline-offset: 0.2em;
}

a:hover {
    color: #721d05;
}

:focus-visible {
    outline: 3px solid #126bc5;
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 10;
    top: 0.5rem;
    left: 0.5rem;
    transform: translateY(-160%);
    padding: 0.55rem 0.8rem;
    border-radius: 0.4rem;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 0.4rem 1.2rem rgb(32 38 49 / 18%);
}

.skip-link:focus {
    transform: none;
}

.document-header {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}

.document-header__inner {
    width: min(62rem, calc(100% - 2rem));
    margin-inline: auto;
    padding: 1rem 0 1.15rem;
}

.document-header__brand {
    display: inline-flex;
    align-items: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-decoration: none;
}

.document-nav {
    margin-top: 0.75rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.document-nav ul {
    display: flex;
    gap: 0.25rem;
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.document-nav a {
    display: block;
    padding: 0.42rem 0.65rem;
    border-radius: 0.35rem;
    color: #fff5ef;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none;
}

.document-nav a:hover,
.document-nav a[aria-current="page"] {
    color: #fff;
    background: rgb(255 255 255 / 18%);
}

.document-main {
    width: min(62rem, calc(100% - 2rem));
    margin: 1.25rem auto 2.5rem;
    padding: clamp(1.25rem, 4vw, 3rem);
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: var(--surface);
    box-shadow: 0 0.4rem 1.4rem rgb(32 38 49 / 7%);
}

.document-main h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.35;
}

.document-lead {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.08rem);
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin: 1rem 0 0;
    padding: 0.75rem 0;
    border-block: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
}

.document-section {
    padding-top: 1.75rem;
}

.document-section + .document-section {
    margin-top: 1.75rem;
    border-top: 1px solid var(--line);
}

.document-section h2 {
    margin: 0 0 0.75rem;
    color: var(--brand-dark);
    font-size: clamp(1.22rem, 3vw, 1.55rem);
    line-height: 1.5;
}

.document-section h3 {
    margin: 1.35rem 0 0.45rem;
    font-size: 1.05rem;
}

.document-section p {
    margin: 0.65rem 0 0;
}

.document-section ul,
.document-section ol {
    margin: 0.65rem 0 0;
    padding-left: 1.35rem;
}

.document-section li + li {
    margin-top: 0.4rem;
}

.note,
.warning {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-left: 0.3rem solid var(--brand);
    background: var(--accent-soft);
}

.warning {
    border-left-color: #b75c00;
    color: #713f12;
    background: #fff8e7;
}

.document-table-wrapper {
    margin-top: 1rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 0.55rem;
}

.document-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.document-table th,
.document-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.document-table th {
    min-width: 9rem;
    background: var(--surface-soft);
}

.document-table tr:last-child th,
.document-table tr:last-child td {
    border-bottom: 0;
}

.document-steps {
    counter-reset: step;
    padding-left: 0 !important;
    list-style: none;
}

.document-steps > li {
    position: relative;
    min-height: 2rem;
    padding-left: 2.6rem;
    counter-increment: step;
}

.document-steps > li::before {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 1.9rem;
    height: 1.9rem;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--brand);
    content: counter(step);
    font-size: 0.82rem;
    font-weight: 900;
}

code,
kbd {
    padding: 0.12em 0.3em;
    border-radius: 0.25rem;
    font-family: Consolas, "Courier New", monospace;
}

code {
    background: #f2f3f5;
    overflow-wrap: anywhere;
}

kbd {
    border: 1px solid #bdc5d0;
    background: #fff;
    box-shadow: 0 1px 0 #bdc5d0;
}

.document-footer {
    width: min(62rem, calc(100% - 2rem));
    margin: 0 auto 2rem;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}

@media (max-width: 38rem) {
    .document-header__inner,
    .document-main,
    .document-footer {
        width: min(100% - 1rem, 62rem);
    }

    .document-main {
        margin-top: 0.5rem;
        padding: 1.1rem;
        border-radius: 0.55rem;
    }

    .document-table th,
    .document-table td {
        display: block;
        width: 100%;
        border-bottom: 0;
    }

    .document-table td {
        border-bottom: 1px solid var(--line);
    }
}

@media print {
    body {
        color: #000;
        background: #fff;
        font-size: 10.5pt;
    }

    .skip-link,
    .document-header,
    .document-footer {
        display: none;
    }

    .document-main {
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .document-section,
    .note,
    .warning,
    .document-table tr {
        break-inside: avoid;
    }
}
