:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #eef3f8;
    --text: #172033;
    --muted: #68758a;
    --line: #dce4ee;
    --accent: #2563eb;
    --accent-soft: #e8f0ff;
    --success: #0f766e;
    --warning: #a16207;
    --danger: #b42318;
    --radius: 18px;
    --shadow: 0 12px 36px rgba(31, 41, 55, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

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

a:hover {
    text-decoration: underline;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(220, 228, 238, 0.9);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.header-inner {
    min-height: 76px;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 24px;
    align-items: center;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--text);
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--text);
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 16px;
}

.brand small {
    margin-top: 1px;
    max-width: 510px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.primary-nav,
.locale-nav {
    display: flex;
    gap: 14px;
    align-items: center;
}

.primary-nav a,
.locale-nav a {
    color: #42516a;
    font-weight: 650;
    font-size: 14px;
}

.locale-nav a {
    padding: 4px 7px;
    border-radius: 8px;
    font-size: 12px;
}

.locale-nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.page-shell {
    padding: 52px 0 72px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    gap: 28px;
    align-items: end;
    margin-bottom: 28px;
}

.hero h1,
.page-title h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.hero p,
.page-title p {
    margin: 16px 0 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 17px;
}

.hero-note,
.panel,
.card,
.tier,
.change-row {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-note {
    padding: 20px;
    color: var(--muted);
    font-size: 14px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin: 26px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.filters label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

select,
button {
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 0 12px;
    color: var(--text);
    font: inherit;
}

button {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.card {
    padding: 22px;
}

.card h2,
.card h3,
.tier h3 {
    margin: 0;
    line-height: 1.25;
}

.card p {
    color: var(--muted);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

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

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: #45546b;
    font-size: 12px;
    font-weight: 750;
}

.badge.ended {
    background: #fef3f2;
    color: var(--danger);
}

.empty {
    padding: 36px;
    text-align: center;
    border: 1px dashed #c7d1de;
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.65);
}

.page-title {
    margin-bottom: 28px;
}

.page-title h1 {
    font-size: clamp(32px, 4vw, 48px);
}

.meta-grid,
.detail-grid {
    display: grid;
    gap: 18px;
}

.meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 24px 0;
}

.meta-item,
.fact {
    padding: 14px 16px;
    border-radius: 13px;
    background: var(--surface-soft);
}

.meta-item dt,
.fact dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.meta-item dd,
.fact dd {
    margin: 5px 0 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.detail-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    align-items: start;
}

.stack {
    display: grid;
    gap: 18px;
}

.panel {
    padding: 22px;
}

.panel h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.tier {
    padding: 20px;
}

.tier + .tier {
    margin-top: 14px;
}

.fact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

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

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

.limit-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.source-list,
.simple-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.source-list li,
.simple-list li {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.source-list small,
.simple-list small {
    display: block;
    color: var(--muted);
}

.change-list {
    display: grid;
    gap: 14px;
}

.change-row {
    padding: 18px;
}

.change-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: baseline;
}

.change-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.code-value,
pre {
    margin: 0;
    padding: 12px;
    border-radius: 12px;
    background: #111827;
    color: #e5edf8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}

.footer-inner {
    min-height: 92px;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
}

.footer-inner strong {
    color: var(--text);
}

@media (max-width: 900px) {
    .header-inner {
        grid-template-columns: 1fr auto;
        padding: 12px 0;
    }

    .primary-nav {
        grid-column: 1 / -1;
        order: 3;
    }

    .brand small {
        max-width: 300px;
    }

    .hero,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .grid,
    .meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .shell {
        width: min(100% - 22px, 1180px);
    }

    .grid,
    .meta-grid,
    .fact-grid,
    .change-values {
        grid-template-columns: 1fr;
    }

    .primary-nav {
        overflow-x: auto;
    }

    .brand small {
        display: none;
    }

    .locale-nav {
        gap: 5px;
    }

    .page-shell {
        padding-top: 34px;
    }

    .footer-inner {
        padding: 20px 0;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
    }
}
