:root {
    --red: #b90000;
    --red-dark: #900000;
    --ink: #181818;
    --cream: #fffaf4;
    --paper: #fff;
    --soft: #f4f2ef;
    --line: #e2dad2;
    --muted: #706a64;
    --green: #3f7755;
    --warning: #fff1d8;
    --shadow: 0 18px 50px rgba(45,30,20,.10);
    --radius: 18px;
    --max: 1480px
}

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

html {
    scroll-behavior: smooth
}

body {
    font-family: Arial,Helvetica,sans-serif;
    background: var(--cream);
    color: var(--ink);
    line-height: 1.45
}

    body.modal-open {
        overflow: hidden
    }

a {
    text-decoration: none;
    color: inherit
}

button, input, select, textarea {
    font: inherit
}

button {
    cursor: pointer
}

img {
    display: block;
    max-width: 100%
}

.container {
    width: min(calc(100% - 72px),var(--max));
    margin: auto
}

.hidden {
    display: none !important
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
    transition: .18s ease
}

    .btn:hover {
        transform: translateY(-1px)
    }

.btn-primary {
    background: var(--red);
    border-color: var(--red);
    color: #fff
}

    .btn-primary:hover {
        background: var(--red-dark);
        border-color: var(--red-dark)
    }

.btn-dark {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff
}

.btn-ghost {
    background: transparent;
    border-color: rgba(255,255,255,.4);
    color: #fff
}

    .btn-ghost:hover {
        background: rgba(255,255,255,.08);
        border-color: #fff
    }

.site-header {
    height: 94px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #181818;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08)
}

.nav {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(190px,auto) minmax(430px,1fr) auto;
    align-items: center;
    gap: 34px
}

.brand {
    display: flex;
    align-items: center
}

    .brand img {
        height: 58px;
        width: auto
    }

.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    font-size: .76rem;
    font-weight: 800;
    color: rgba(255,255,255,.82);
    white-space: nowrap
}

    .nav-links a:hover {
        color: #fff
    }

.auth-slot {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    white-space: nowrap
}

.auth-user {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px
}

.auth-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px
}

.auth-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    border: 1px solid rgba(255,255,255,.3)
}

.auth-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .76rem;
    font-weight: 800;
    color: #fff
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 8px
}

    .auth-actions .btn {
        min-height: 42px;
        padding-inline: 16px
    }

.page {
    min-height: calc(100vh - 94px)
}

.section {
    padding: 72px 0
}

.section-title {
    font-size: clamp(1.8rem,3vw,2.8rem);
    letter-spacing: -.045em
}

.muted {
    color: var(--muted)
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 25px rgba(40,25,15,.04)
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    display: grid;
    gap: 9px
}

.toast {
    min-width: 250px;
    max-width: 380px;
    padding: 13px 15px;
    border-radius: 12px;
    background: #181818;
    color: #fff;
    box-shadow: var(--shadow);
    font-size: .72rem
}

    .toast.error {
        background: #8d1717
    }

    .toast.success {
        background: #306a49
    }

@media(max-width:1280px) {
    .container {
        width: min(calc(100% - 40px),var(--max))
    }

    .nav {
        grid-template-columns: auto 1fr auto;
        gap: 22px
    }

    .nav-links {
        gap: 20px;
        font-size: .7rem
    }

    .auth-name {
        display: none
    }
}

@media(max-width:980px) {
    .nav-links {
        display: none
    }

    .nav {
        grid-template-columns: auto 1fr
    }

    .auth-slot {
        justify-self: end
    }
}

@media(max-width:680px) {
    .site-header {
        height: 76px
    }

    .brand img {
        height: 44px
    }

    .container {
        width: min(calc(100% - 28px),var(--max))
    }

    .auth-avatar, .auth-identity {
        display: none
    }

    .auth-actions .btn {
        min-height: 38px;
        padding-inline: 12px;
        font-size: .68rem
    }

    .page {
        min-height: calc(100vh - 76px)
    }

    .section {
        padding: 50px 0
    }
}
