body {
    transition: background .18s ease, color .18s ease;
}

.utility-switches {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.utility-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.lang-switch,
.theme-switch {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius, 8px);
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .54);
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.lang-switch.active,
.theme-switch.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.account-summary {
    display: grid;
    gap: 3px;
    padding: 6px 2px 2px;
}

.account-summary strong {
    font-size: 15px;
    line-height: 1.2;
}

.account-summary span {
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.settings-grid {
    display: grid;
    gap: 14px;
    margin: 20px 0;
    max-width: 560px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius, 8px);
    background: rgba(255, 255, 255, .58);
}

.settings-grid h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.settings-row {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.settings-row > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.segmented-control {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(44px, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    background: rgba(17, 24, 39, .06);
}

.segmented-control .lang-switch {
    min-height: 32px;
    border: 0;
    background: transparent;
}

.segmented-control .lang-switch.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 6px 16px rgba(17, 24, 39, .08);
}

.icon-theme-switch {
    width: 38px;
    min-width: 38px;
    padding: 0;
    border-radius: 999px;
    font-size: 16px;
}

.brand-mark {
    position: relative;
    overflow: visible;
    background: transparent !important;
    box-shadow: none !important;
}

.brand-mark svg,
.brand-logo-img {
    display: block !important;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}

.brand-mark::before {
    content: none !important;
}

.brand-mark::after {
    content: none !important;
}

.landing-topbar .topbar-inner {
    width: calc(100% - 24px) !important;
    max-width: none !important;
    margin-right: auto !important;
    margin-left: auto !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    display: grid !important;
    grid-template-columns: auto minmax(24px, 1fr) auto !important;
}

.dashboard-topbar .topbar-inner {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-right: 24px !important;
    padding-left: 24px !important;
    display: grid !important;
    grid-template-columns: auto minmax(24px, 1fr) auto !important;
}

.landing-topbar .brand,
.dashboard-topbar .brand {
    grid-column: 1;
    justify-self: start;
}

.landing-topbar .nav-actions,
.dashboard-topbar .nav-actions {
    grid-column: 3;
    justify-self: end;
    margin-left: 0 !important;
    justify-content: flex-end !important;
}

.topbar .icon-theme-switch {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
}

body.night {
    color-scheme: dark;
    --ink: #eef4f8;
    --muted: #a7b4c2;
    --line: rgba(238, 244, 248, .13);
    --paper: #141a22;
    --soft: #0d1117;
    --warm: #151b22;
    --accent: #25d0bd;
    --accent-dark: #72f1df;
    --blue: #7eb0ff;
    --rose: #ff86a1;
    --gold: #f2c766;
    --danger: #ff8a80;
    --shadow: 0 24px 70px rgba(0, 0, 0, .36);
    background:
        linear-gradient(135deg, rgba(37, 208, 189, .14), transparent 34%),
        linear-gradient(315deg, rgba(255, 134, 161, .10), transparent 34%),
        var(--soft);
}

body.night .topbar,
body.night aside,
body.night .sidebar {
    background: rgba(14, 18, 25, .78);
}

body.night .card,
body.night .project-card,
body.night .panel,
body.night .empty-state,
body.night .login-card,
body.night .stat,
body.night .user-card,
body.night .site-card,
body.night .table-shell,
body.night .chart,
body.night details,
body.night .usage-card,
body.night .settings-grid,
body.night .modal-card {
    background: rgba(20, 26, 34, .86);
    border-color: var(--line);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .24);
}

body.night .proof-panel {
    background:
        linear-gradient(135deg, rgba(37, 208, 189, .10), transparent 48%),
        rgba(20, 26, 34, .92);
    border-color: var(--line);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .24);
}

body.night .review {
    background: rgba(238, 244, 248, .07);
    border-color: var(--line);
}

body.night .proof-copy p,
body.night .review p {
    color: var(--muted);
}

body.night .btn,
body.night .button,
body.night button:not(.ghost):not(.secondary):not(.danger):not(.danger-button):not(.lang-switch):not(.theme-switch):not(.close-button):not(.auth-tab) {
    background: #eef4f8;
    color: #0d1117;
}

body.night .ghost,
body.night .secondary,
body.night .button.secondary,
body.night .header-link,
body.night .user-pill,
body.night .badge,
body.night .lang-switch,
body.night .theme-switch {
    background: rgba(238, 244, 248, .08);
    color: var(--ink);
    border-color: var(--line);
}

body.night .lang-switch.active,
body.night .theme-switch.active,
body.night .segmented-control .lang-switch.active,
body.night .tab-button.active,
body.night .auth-tab.active,
body.night .segmented input:checked + span {
    background: #eef4f8;
    color: #0d1117;
}

body.night input,
body.night textarea,
body.night select {
    background: rgba(238, 244, 248, .08);
    color: var(--ink);
    border-color: var(--line);
}

body.night .preview,
body.night iframe {
    background: #0d1117;
}

body.night .preview-loader {
    background:
        linear-gradient(135deg, rgba(37, 208, 189, .12), transparent 42%),
        linear-gradient(315deg, rgba(255, 134, 161, .10), transparent 42%),
        rgba(13, 17, 23, .88);
}

body.night .message.system,
body.night .loader-box,
body.night .bubble.user {
    background: rgba(238, 244, 248, .08);
    color: var(--ink);
    border-color: var(--line);
}

body.night .status.off,
body.night .slug,
body.night .arrow,
body.night .empty {
    background: rgba(238, 244, 248, .08);
    color: var(--muted);
}

@media (min-width: 981px) {
    .wrap,
    .footer-inner {
        width: calc(100% - 56px);
        max-width: 1380px;
    }

    .topbar-inner {
        align-items: center;
        min-height: 60px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .hero h1 {
        font-size: clamp(44px, 6.8vw, 78px);
        line-height: .95;
    }

    .hero {
        padding-top: 44px;
    }
}

@media (max-width: 640px) {
    .utility-switches {
        width: 100%;
    }

    .lang-switch,
    .theme-switch {
        min-height: 36px;
        padding: 0 10px;
    }

    .proof-panel {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .proof-actions,
    .proof-actions .btn,
    .proof-actions .ghost {
        width: 100%;
    }
}
