:root {
    color-scheme: dark;
    --schf-ink: #16101F;
    --schf-lavender: #A5A2CF;
    --schf-lavender-light: #c3c0e0;
    --schf-white: #fff;
    --schf-muted: #c7c3d0;
    --schf-border: rgba(165, 162, 207, .35);
    --schf-font: Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    background: var(--schf-ink);
    color: var(--schf-white);
    font-family: var(--schf-font);
    line-height: 1.6;
}

a { color: inherit; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
    background: var(--schf-lavender);
    color: #000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
}

.site-nav {
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 50px;
    padding: 0 10px;
}

.mobile-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    padding: 6px;
    border: 0;
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
}

.mobile-menu-toggle span,
.mobile-menu-toggle span::before,
.mobile-menu-toggle span::after {
    display: block;
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background: #000;
}

.mobile-menu-toggle span { position: relative; }
.mobile-menu-toggle span::before,
.mobile-menu-toggle span::after { content: ""; position: absolute; left: 0; }
.mobile-menu-toggle span::before { top: -8px; }
.mobile-menu-toggle span::after { top: 8px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    margin-right: 12px;
    color: #000;
    text-decoration: none;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: .04em;
}

.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand small { display: block; font-size: 10px; letter-spacing: .19em; }

.nav-links, .nav-account {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-links {
    flex: 1 1 auto;
    flex-wrap: wrap;
    width: 100%;
    padding-right: 250px;
}

.nav-account {
    position: absolute;
    top: 50%;
    right: 10px;
    justify-content: flex-end;
    gap: 12px;
    transform: translateY(-50%);
}

.nav-account form { margin: 0; }
.nav-profile, .language-picker { position: relative; display: flex; align-items: center; }

.nav-links a, .account-link {
    padding: 13px 20px;
    border: 0;
    background: transparent;
    color: #000;
    text-decoration: none;
    text-transform: uppercase;
    font: 600 20px/1.3 var(--schf-font);
    white-space: nowrap;
    cursor: pointer;
    transition: transform .3s ease;
}

.nav-links a:hover, .account-link:hover { transform: scale(1.08); }
.nav-username { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; font-weight: 600; text-transform: uppercase; }

.avatar-trigger, .language-switcher {
    display: block;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: transform .2s ease;
}

.avatar-trigger:hover, .language-switcher:hover { transform: scale(1.08); }
.avatar-img, .language-flag {
    display: block;
    width: 42px;
    height: 42px;
    border: 3px solid var(--schf-ink);
    border-radius: 50%;
    background: #d7d7d7;
    object-fit: cover;
}
.language-flag { border-width: 2px; }

.avatar-dropdown, .language-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1300;
    min-width: 240px;
    padding: 8px 10px;
    border-radius: 2px;
    background: var(--schf-lavender);
    color: #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.avatar-dropdown.is-open, .language-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.avatar-dropdown a, .dropdown-action, .dropdown-note {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: #000;
    font: 700 16px/1.4 var(--schf-font);
    text-align: left;
    text-decoration: none;
    text-transform: uppercase;
}
.avatar-dropdown a:hover, .dropdown-action:hover { background: rgba(0, 0, 0, .08); }
.dropdown-action { cursor: pointer; }
.dropdown-note { color: rgba(0, 0, 0, .7); }
.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: #000;
    font: 700 16px/1.4 var(--schf-font);
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
}
.language-option:hover, .language-option.is-active { background: rgba(0, 0, 0, .08); }
.language-option-flag { width: 30px; height: 30px; border-radius: 50%; }

.page-shell {
    width: min(1200px, 100%);
    min-height: calc(100vh - 128px);
    margin: 0 auto;
    padding: 28px 20px 56px;
}

.preview-notice {
    margin: 0 0 16px;
    padding: 11px 16px;
    border: 1px solid rgba(165, 162, 207, .5);
    border-radius: 6px;
    background: #211a2b;
    color: #e2dfeb;
    font-size: .9rem;
    font-weight: 600;
    text-align: center;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 0 0 20px;
    padding: 24px 28px;
    border-radius: 8px;
    background: var(--schf-lavender);
    color: var(--schf-ink);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
}

.page-heading h1, .surface-card h1, .surface-card h2, .surface-card h3 {
    margin: 0 0 .45rem;
    color: inherit;
    line-height: 1.2;
}

.page-heading h1, .surface-card h1 { font-size: clamp(1.65rem, 3vw, 2.2rem); }
.page-heading p { margin: 0; }
.eyebrow { margin: 0 0 .4rem; font-size: .75rem; font-weight: 800; letter-spacing: .14em; }
.heading-copy { opacity: .8; }

.surface-card {
    margin: 0 0 20px;
    padding: 26px;
    border-radius: 8px;
    background: var(--schf-lavender);
    color: var(--schf-ink);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
}

.welcome-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.welcome-card p { max-width: 720px; margin: .5rem 0 0; }

.homepage-welcome {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
    gap: 1.25rem;
    margin: 0 0 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(22, 16, 31, .14);
    border-radius: 8px;
    background: var(--schf-lavender);
    color: var(--schf-ink);
}
.homepage-welcome-authenticated { grid-template-columns: auto minmax(0, 1fr) 12.5rem; }
.homepage-welcome-content { display: flex; flex-direction: column; min-width: 0; }
.homepage-welcome-avatar, .homepage-welcome-mark {
    display: block;
    width: 100%;
    height: auto;
    min-width: 5.5rem;
    max-width: 8rem;
    aspect-ratio: 1;
    border: 3px solid var(--schf-ink);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 14px rgba(22, 16, 31, .15);
    object-fit: cover;
}
.homepage-welcome-mark { display: grid; place-items: center; }
.homepage-welcome-mark-logo {
    display: block;
    width: 90%;
    height: 90%;
    background: var(--schf-ink);
    -webkit-mask: url("/static/meets/logo_plemenka.png") center / contain no-repeat;
    mask: url("/static/meets/logo_plemenka.png") center / contain no-repeat;
}
.homepage-welcome-eyebrow { margin: 0 0 .3rem; color: #433e66; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.homepage-welcome h2 { margin: 0; color: var(--schf-ink); font-size: 1.65rem; line-height: 1.2; }
.homepage-welcome-copy { margin: .55rem 0 0; color: #302b49; line-height: 1.5; }
.homepage-role-list { display: flex; flex-wrap: wrap; gap: 1rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.homepage-role-list li { display: inline-flex; align-items: center; justify-content: center; min-height: 45px; padding: .5rem 1rem; border-radius: 12px; background: #3498db; color: var(--schf-ink); font-size: 1rem; font-weight: 700; }
.homepage-welcome-links { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .75rem; }
.homepage-welcome-account-actions { display: flex; grid-column: 3; grid-row: 1; flex-direction: column; align-items: flex-end; gap: .65rem; }
.homepage-welcome-account-actions form { margin: 0; }
.homepage-welcome-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: .55rem .9rem;
    border: 1px solid var(--schf-ink);
    border-radius: 6px;
    background: var(--schf-ink);
    color: #fff;
    font: 700 15px/1.3 var(--schf-font);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.homepage-welcome-link-secondary { background: transparent; color: var(--schf-ink); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 20px;
    border: 0;
    border-radius: 8px;
    font: 700 15px/1.3 var(--schf-font);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.button:hover { transform: translateY(-1px); }
.button-dark { background: var(--schf-ink); color: #fff; }
.button-dark:hover { background: #241a33; }
.button-light { background: rgba(22, 16, 31, .12); color: var(--schf-ink); }
.button-danger { min-height: 36px; padding: 7px 12px; background: #8f2424; color: #fff; }

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

.meeting-card {
    display: flex;
    min-height: 230px;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--schf-border);
    border-radius: 8px;
    background: #211a2b;
    color: #fff;
}

.meeting-card h2 { margin: 14px 0 4px; font-size: 1.3rem; }
.meeting-card-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meeting-date { margin: 0; color: var(--schf-lavender-light); font-weight: 600; }
.meeting-description { margin: 12px 0; color: #e2dfeb; }
.meeting-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; font-size: .88rem; color: var(--schf-muted); }
.text-link { color: var(--schf-lavender-light); font-weight: 700; text-decoration: none; white-space: nowrap; }
.text-link:hover, .back-link a:hover { text-decoration: underline; }

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}

.badge-public { background: #126a4b; color: #fff; }
.badge-private { background: #8a3838; color: #fff; }
.badge-finished { background: #4b4653; color: #fff; }

.empty-state { padding: 44px 24px; text-align: center; }
.empty-state p { margin: .5rem 0 1.25rem; }
.empty-mark { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin-bottom: 12px; border-radius: 50%; background: var(--schf-ink); color: var(--schf-lavender); font-size: 24px; font-weight: 800; }

.form-card { max-width: 800px; }
.meeting-form { display: grid; gap: 18px; }
.form-field { display: grid; gap: 7px; }
.form-field label { font-weight: 700; }
.form-field input, .form-field textarea, .form-field select, .invite-created input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(22, 16, 31, .25);
    border-radius: 5px;
    background: #fff;
    color: #20192a;
    font: 400 16px/1.4 var(--schf-font);
}

.form-field textarea { min-height: 100px; resize: vertical; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { outline: 3px solid rgba(22, 16, 31, .2); }
.field-error, .form-errors { color: #781919; font-weight: 600; }
.help-text, .muted-copy { color: rgba(22, 16, 31, .72); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.back-link { margin: 0 0 14px; }
.back-link a { color: var(--schf-lavender-light); text-decoration: none; font-weight: 600; }
.detail-card h1 { margin-top: 18px; }
.detail-date { margin: 0 0 18px; font-size: 1.1rem; font-weight: 700; }
.detail-description { margin: 0 0 18px; }
.detail-organizer { margin: 0 0 18px; color: rgba(22, 16, 31, .72); }
.invite-panel h2 { margin-bottom: 8px; }
.section-title { display: flex; justify-content: space-between; }
.invite-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .7fr) auto; align-items: end; gap: 12px; margin: 18px 0 24px; }
.invite-created { display: grid; gap: 8px; margin: 16px 0; padding: 14px; border-radius: 6px; background: rgba(255,255,255,.55); }
.subheading { margin-top: 22px !important; }
.invitation-list { display: grid; }
.invitation-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid rgba(22, 16, 31, .16); }
.invitation-row > div { display: grid; gap: 2px; }
.invitation-row form { margin: 0; }
.guest-card { max-width: 680px; margin: 30px auto; }
.guest-card .detail-date { margin-top: 12px; }
.guest-card .muted-copy { margin-bottom: 20px; }

.messages { margin: 0 0 16px; }
.alert { margin-bottom: 10px; padding: 13px 16px; border-radius: 5px; background: #d7e9ef; color: #102b33; }
.alert-success { background: #d5efdf; color: #16482a; }
.alert-error { background: #f3d9d9; color: #681b1b; }
.alert-warning { background: #f4e9c9; color: #594112; }

.site-footer { display: flex; justify-content: center; padding: 24px 20px; border-top: 1px solid var(--schf-border); color: #7f8c8d; font-size: .875rem; text-align: center; }
.footer-copy p { margin: 0; }
.footer-copy .footer-links { display: flex; justify-content: center; gap: .5rem; margin-top: .5rem; font-size: .75rem; }
.site-footer a { color: #3498db; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 1200px) {
    .nav-links { gap: .25rem; padding-right: 0; }
    .nav-links a, .account-link { font-size: 18px; }
    .nav-account { position: static; margin-left: auto; transform: none; }
}

@media (max-width: 820px) {
    .site-nav { gap: 8px; }
    .mobile-menu-toggle { display: block; }
    .brand { margin-right: auto; }
    .nav-links {
        position: fixed;
        top: 61px;
        left: 0;
        z-index: 1200;
        display: none;
        width: 100vw;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 10px 12px;
        border-top: 1px solid rgba(0, 0, 0, .15);
        background: var(--schf-lavender);
        box-shadow: 0 4px 8px rgba(0, 0, 0, .18);
    }
    .nav-links.is-open { display: flex; }
    .nav-links a, .account-link { padding: 12px 14px; font-size: 16px; }
    .nav-links a { font-weight: 700; }
    .nav-account { gap: 3px; }
    .nav-username { display: none; }
    .homepage-welcome, .homepage-welcome-authenticated { grid-template-columns: 4rem minmax(0, 1fr); gap: .85rem; padding: 1.25rem; }
    .homepage-welcome-content { display: contents; }
    .homepage-welcome-avatar, .homepage-welcome-mark { grid-column: 1; grid-row: 1; width: 4rem; height: 4rem; min-width: 4rem; }
    .homepage-welcome-mark { place-items: center; }
    .homepage-welcome h2 { grid-column: 2; align-self: center; font-size: 1.3rem; }
    .homepage-welcome-eyebrow { grid-column: 1 / -1; }
    .homepage-welcome-copy, .homepage-role-list, .homepage-welcome-links, .homepage-welcome-account-actions { grid-column: 1 / -1; }
    .homepage-welcome-account-actions { grid-row: auto; align-items: stretch; width: 100%; margin-top: .5rem; }
    .homepage-welcome-links { flex-direction: column; }
    .homepage-welcome-link { width: 100%; }
    .page-shell { padding: 18px 14px 40px; }
    .page-heading { align-items: flex-start; flex-direction: column; padding: 20px; }
    .meeting-grid { grid-template-columns: 1fr; }
    .surface-card { padding: 20px; }
    .welcome-card { align-items: flex-start; flex-direction: column; }
    .invite-form { grid-template-columns: 1fr; }
    .meeting-card-bottom { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
    .brand { font-size: 15px; }
    .brand img { width: 36px; height: 36px; }
    .nav-account { flex-wrap: nowrap; }
    .avatar-dropdown, .language-menu { min-width: 220px; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .invitation-row { align-items: flex-start; flex-direction: column; }
}
