:root {
    --primary: #00a3ff;
    --primary-soft: rgba(0, 163, 255, 0.12);
    --bg: #f2f2f7;
    --surface: #ffffff;
    --surface-alt: #f7f7fa;
    --text: #111111;
    --text-muted: #5e626b;
    --border: rgba(0, 0, 0, 0.08);
    --glass: rgba(255, 255, 255, 0.9);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    --sat: env(safe-area-inset-top, 0px);
    --sab: max(env(safe-area-inset-bottom), 16px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --surface: #1c1c1e;
        --surface-alt: #252529;
        --text: #f5f5f7;
        --text-muted: #a1a1aa;
        --border: rgba(255, 255, 255, 0.09);
        --glass: rgba(28, 28, 30, 0.84);
        --shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
    }
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}

.container-narrow {
    width: 100%;
    max-width: 896px;
    margin: 0 auto;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}

@media (min-width: 768px) {
    .container,
    .container-narrow {
        padding-left: max(24px, env(safe-area-inset-left));
        padding-right: max(24px, env(safe-area-inset-right));
    }
}

.glass-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding-top: var(--sat);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    min-height: 60px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-shrink: 0;
}

.header-brand .icon-btn {
    margin-left: -8px;
}

.sub-header-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand {
    display: inline-flex;
    align-items: center;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .brand {
        font-size: 23px;
    }
}

.brand:hover {
    text-decoration: none;
}

.brand-accent {
    color: var(--primary);
}

.age-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--surface-alt);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

.glass-header .btn {
    min-height: 36px;
    padding: 7px 14px;
    font-size: 13.5px;
}

@media (max-width: 679px) {
    .header-inner-multi {
        flex-wrap: wrap;
        row-gap: 10px;
        padding-top: 10px;
        padding-bottom: 12px;
    }

    .header-inner-multi .header-actions {
        flex: 1 0 100%;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    .header-inner-multi .header-actions::-webkit-scrollbar {
        display: none;
    }

    .header-inner-multi .btn {
        min-height: 34px;
        padding: 6px 12px;
        font-size: 13px;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    vertical-align: middle;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.brand:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    opacity: 0.92;
}

.btn-primary-soft {
    background: var(--primary-soft);
    color: var(--primary);
}

.btn-primary-soft:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-secondary {
    background: var(--surface-alt);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-lg {
    min-height: 50px;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    gap: 8px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover {
    background: var(--surface-alt);
    text-decoration: none;
}

.icon-btn:active {
    transform: scale(0.95);
}

.svg-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.btn .svg-icon {
    width: 16px;
    height: 16px;
}

.btn-lg .svg-icon {
    width: 20px;
    height: 20px;
}

.hero-card {
    background: var(--surface);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 32px 24px;
    margin: 24px 0 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
}

@media (min-width: 768px) {
    .hero-card {
        flex-direction: row;
        text-align: left;
        padding: 44px 48px;
        gap: 44px;
    }
}

.hero-logo {
    width: 112px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .hero-logo {
        width: 152px;
    }
}

.hero-title {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.18;
    font-weight: 700;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 38px;
    }
}

.hero-sub {
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 16px;
    max-width: 540px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.section-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary);
    margin: 0 0 8px 14px;
}

.card {
    background: var(--surface);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-pad {
    padding: 22px 24px;
}

.list-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
    background: transparent;
    width: 100%;
    text-align: left;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    font: inherit;
    cursor: default;
}

.list-item:first-child {
    border-top: 0;
}

.list-item.clickable {
    cursor: pointer;
    align-items: center;
}

.list-item.clickable:hover {
    background: var(--surface-alt);
    text-decoration: none;
}

.badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    margin-top: 2px;
}

.bg-red { background: #ef4444; }
.bg-orange { background: #f97316; }
.bg-blue { background: #00a3ff; }
.bg-slate { background: #64748b; }
.bg-purple { background: #8b5cf6; }
.bg-green { background: #22c55e; }
.bg-amber { background: #d97706; }

.item-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text);
}

.item-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.48;
}

.chevron {
    margin-left: auto;
    color: var(--text-muted);
}

.sub-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.sub-screen.active {
    transform: translateX(0);
}

.sub-screen-scroll {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 20px 0 calc(56px + var(--sab));
}

.page-main {
    padding-top: 24px;
    padding-bottom: calc(56px + var(--sab));
}

.legal-card {
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 24px 20px;
    margin-bottom: 22px;
}

@media (min-width: 768px) {
    .legal-card {
        padding: 34px 38px;
    }
}

.meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.meta-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.meta-pill-primary {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: transparent;
}

.doc-title {
    margin: 0 0 14px;
    font-size: 25px;
    line-height: 1.24;
    font-weight: 700;
}

@media (min-width: 768px) {
    .doc-title {
        font-size: 32px;
    }
}

.toc-box {
    margin-top: 20px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
}

.toc-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary);
    margin: 0 0 12px;
}

.toc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px 24px;
    font-size: 13.5px;
}

@media (min-width: 768px) {
    .toc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.toc-grid a {
    color: var(--text);
}

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

.legal-doc section {
    scroll-margin-top: 96px;
    margin-bottom: 36px;
}

.legal-doc section:last-child {
    margin-bottom: 0;
}

.legal-doc h3 {
    color: var(--primary);
    font-weight: 700;
    font-size: 19px;
    line-height: 1.35;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 163, 255, 0.2);
}

.legal-doc h4 {
    font-weight: 600;
    font-size: 16px;
    margin: 18px 0 8px;
}

.legal-doc p {
    margin: 0 0 12px;
    line-height: 1.72;
}

.legal-doc p:last-child {
    margin-bottom: 0;
}

.legal-doc ul,
.legal-doc ol {
    margin: 8px 0 14px;
    padding-left: 24px;
    line-height: 1.68;
}

.legal-doc li {
    margin-bottom: 6px;
}

.table-wrap {
    overflow-x: auto;
    margin: 16px 0;
}

.legal-doc table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

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

.legal-doc th {
    background: var(--primary-soft);
    font-weight: 600;
}

.legal-callout {
    margin: 16px 0;
    padding: 14px 18px;
    border-radius: 14px;
    border-left: 4px solid var(--primary);
    background: var(--primary-soft);
    font-size: 14.5px;
    line-height: 1.65;
}

.legal-callout-warn {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.legal-doc code {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    font-size: 0.86em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.site-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin: 40px 0 20px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 10.5pt;
    }
    .no-print {
        display: none !important;
    }
    .legal-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        background: #ffffff !important;
    }
    .legal-doc h3 {
        color: #000000 !important;
        border-bottom-color: #999999 !important;
        page-break-after: avoid;
    }
    .legal-doc h4 {
        page-break-after: avoid;
    }
    .legal-callout,
    .legal-callout-warn {
        border-color: #444444 !important;
        background: #f5f5f5 !important;
        page-break-inside: avoid;
    }
    .legal-doc tr {
        page-break-inside: avoid;
    }
    a {
        color: #000000 !important;
        text-decoration: none !important;
    }
}
