:root {
    --bg: #F7F8F7;
    --card: #FFFFFF;
    --text: #222225;
    --sub: #6B6B70;
    --line: #EAEAEA;
    --brand: #09AA5C;
    --brand-soft: #E8F7EF;
    --todo-bg: #FFF3BF;
    --todo-text: #7A5B00;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121413;
        --card: #1C1F1D;
        --text: #EDEDEE;
        --sub: #A0A0A6;
        --line: #2E3230;
        --brand: #2BC77A;
        --brand-soft: #16291F;
        --todo-bg: #4A3D10;
        --todo-text: #FFE08A;
    }
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
    font-size: 15px;
    line-height: 1.75;
    word-break: keep-all;
}

.header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

.header-inner,
.container {
    max-width: 760px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.header-inner {
    padding-top: 28px;
    padding-bottom: 28px;
}

.brand {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-soft);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}

h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.35;
    font-weight: 800;
}

.container {
    padding-top: 24px;
    padding-bottom: 64px;
}

.intro {
    margin: 0 0 24px;
    padding: 16px 18px;
    background: var(--brand-soft);
    border-radius: 12px;
}

section {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px 20px 8px;
    margin-bottom: 14px;
}

h2 {
    margin: 0 0 12px;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 800;
}

h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 15px;
    margin-right: 8px;
    vertical-align: -2px;
    border-radius: 2px;
    background: var(--brand);
}

p {
    margin: 0 0 12px;
}

.note {
    color: var(--sub);
    font-size: 13.5px;
}

.sub-title {
    margin: 16px 0 6px;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
    margin: 0 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 13.5px;
    line-height: 1.6;
}

th,
td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

th {
    background: var(--brand-soft);
    font-weight: 700;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

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

/* 문서에 남아 있는 [확정 필요] 등 미확정 표시 - 배포 전에 모두 내용으로 교체 필요 */
mark.todo {
    background: var(--todo-bg);
    color: var(--todo-text);
    padding: 1px 4px;
    border-radius: 4px;
}

.footer {
    margin-top: 28px;
    text-align: center;
    color: var(--sub);
    font-size: 13px;
}


/* legal-doc additions */
/* 이용약관의 조 제목(h3)을 처리방침·결제정책의 조 제목(h2)과 같은 모양으로 맞춤 */
section > h3 { margin: 0 0 12px; font-size: 17px; line-height: 1.4; font-weight: 800; }
section > h3::before { content: ""; display: inline-block; width: 4px; height: 15px; margin-right: 8px; vertical-align: -2px; border-radius: 2px; background: var(--brand); }
h2.chapter { font-size: 20px; margin: 32px 0 4px; padding-top: 12px; border-top: 2px solid var(--brand); }
ol, ul { margin: 6px 0 10px; padding-left: 22px; }
li { margin: 3px 0; }
.table-wrap { overflow-x: auto; margin: 10px 0; }

.easy { background: #f1f7ff; border-radius: 8px; padding: 4px 16px; margin: 12px 0; }

.doc-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 8px max(20px, calc((100% - 720px) / 2)) 10px;
}

.tab-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-row.sub {
    margin-top: 8px;
}

.tab-row.sub a {
    padding: 4px 12px;
    font-size: 13px;
}

.doc-tabs a {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--sub);
    font-size: 14px;
    text-decoration: none;
}

.doc-tabs a.active {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
    font-weight: 600;
}

.doc-status {
    margin: 16px 0 0;
    color: var(--sub);
    font-size: 14px;
}

.doc-status span {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

.history table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.history th,
.history td {
    padding: 8px 10px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.history th {
    background: var(--brand-soft);
}

.version-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.version-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.version-list a {
    color: var(--brand);
    font-weight: 600;
}

.doc-footer {
    margin: 24px 0 8px;
    color: var(--sub);
    font-size: 13px;
    text-align: center;
}
