:root {
    --accent: #7B52A0;
    --accent-ink: #5A3A7E;
    --accent-soft: #F1EEF7;
    --bg: #F3F0F8;
    --card: #FFFFFF;
    --line: #E4DDEE;
    --ink: #2B2236;
    --ink-2: #4E4460;
    --ink-3: #6B6078;
    --radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 16px;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font-family: "Noto Sans KR", "Noto Sans Devanagari", "Noto Sans Thai", "Noto Sans Arabic", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Hiragino Sans", "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

html:lang(ko) body {
    word-break: keep-all;
}

body.is-web [id] {
    scroll-margin-top: 72px;
}

a {
    color: var(--accent);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 800;
    font-size: 18px;
    text-decoration: none;
}

.brand img {
    border-radius: 8px;
}

.lang select {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    font-size: 14px;
    color: var(--ink-2);
    background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A3A7E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding-block: 6px;
    padding-inline: 14px 32px;
    max-width: 180px;
    cursor: pointer;
}

[dir="rtl"] .lang select {
    background-position: left 12px center;
}

.page {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.is-app .page {
    padding-top: 16px;
}

.hero {
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 28px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero p {
    margin-top: 6px;
    color: var(--ink-2);
}

.toc {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 28px;
}

.toc h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-3);
    margin-bottom: 8px;
}

.toc ol {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 16px;
    counter-reset: toc;
}

.toc li {
    counter-increment: toc;
}

.toc a {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
}

.toc a::before {
    content: counter(toc);
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

.toc a:hover {
    color: var(--accent);
}

.section {
    margin-bottom: 28px;
}

.section h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    padding-inline-start: 2px;
}

.item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}

.item summary {
    list-style: none;
    cursor: pointer;
    position: relative;
    padding-block: 14px;
    padding-inline: 18px 48px;
    font-weight: 700;
    color: var(--ink);
}

.item summary::-webkit-details-marker {
    display: none;
}

.item summary::after {
    content: "";
    position: absolute;
    inset-inline-end: 18px;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-top: -7px;
    border-right: 2.5px solid var(--accent);
    border-bottom: 2.5px solid var(--accent);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.item[open] summary::after {
    margin-top: -2px;
    transform: rotate(-135deg);
}

.item summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-radius: var(--radius);
}

.answer {
    padding: 0 18px 16px;
    color: var(--ink-2);
}

.answer p + p,
.answer p + ul,
.answer p + ol,
.answer ul + p,
.answer ol + p {
    margin-top: 10px;
}

.answer ul,
.answer ol {
    padding-inline-start: 20px;
}

.answer li + li {
    margin-top: 6px;
}

.answer .shot {
    margin: 0 0 14px;
    border-radius: 12px;
    background: var(--accent-soft);
    overflow: hidden;
}

.answer .shot img {
    display: block;
    width: 100%;
    height: auto;
}

.answer strong {
    color: var(--ink);
    font-weight: 700;
}

.answer .note {
    background: var(--accent-soft);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
}

.contact {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 20px;
    text-align: center;
}

.contact h2 {
    font-size: 18px;
    font-weight: 800;
}

.contact p {
    margin-top: 6px;
    color: var(--ink-2);
}

.btn {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 22px;
    border-radius: 999px;
    background: var(--accent);
    color: #FFFFFF;
    font-weight: 700;
    text-decoration: none;
}

.btn:hover {
    background: var(--accent-ink);
}

.to-top {
    display: block;
    width: fit-content;
    margin: 20px auto 0;
    font-size: 14px;
    color: var(--ink-3);
}

.foot {
    border-top: 1px solid var(--line);
    padding: 18px 16px 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    font-size: 13px;
    color: var(--ink-3);
}

.foot a {
    color: var(--ink-2);
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 24px;
    }

    .toc ol {
        grid-template-columns: minmax(0, 1fr);
    }
}

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

    .item summary::after {
        transition: none;
    }
}
