@media screen and (min-width: 1101px) {
    main{
        padding: 0 305px;
        padding-top: 70px;
        padding-bottom: 20px;
    }
}

@media screen and (max-width: 1100px) {
    aside{
        display: none;
    }

    main{
        margin-right: 0;
    }

    .sidePanel{
        display: block;
    }

    .logo.n h1{
        display: block;
        white-space: nowrap;
        margin: 0;
    }

    header .logo{
        left: 68px;
    }

    .search_btn_full{
        display: none;
    }

    .search {
        display: flex;
        align-items: center;
        gap: 0;
        position: absolute;
        right: 150px;
        left: auto;
        z-index: 1002;
        width: 44px;
        height: auto;
        max-width: none;
        padding: 0;
        border-radius: 999px;
        background-color: transparent;
        border: none;
        overflow: hidden;
        transition: width 0.4s ease, right 0.4s ease, padding 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
        justify-content: flex-end;
        box-sizing: border-box;
    }

    .search .header-search-skeleton {
        padding: 0;
        justify-content: flex-end;
    }

    .search .header-search-skeleton__desktop {
        display: none;
    }

    .search .header-search-skeleton__mobile {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    body.auth-visible header .search {
        right: 150px;
    }

    body.exit-visible header .search {
        right: 150px;
    }

    body.search-open header .search,
    body.auth-visible header .search:focus-within,
    body.exit-visible header .search:focus-within,
    .search:focus-within {
        right: 12px;
        width: calc(100vw - 24px);
        max-width: none;
        overflow: hidden;
        gap: 8px;
        border: none;
        padding: 6px;
        background-color: var(--theme-input-bg);
        box-shadow: 0 0 8px var(--theme-shadow);
    }

    .search .search-icon {
        left: 0;
        right: auto;
        position: relative;
        z-index: 2;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: none;
        background-position: center;
        background-size: 16px 16px;
        background-color: var(--theme-button-secondary);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='white' fill='none' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16' y1='16' x2='21' y2='21'/%3E%3C/svg%3E");
        box-shadow: none;
        transition: background 0.2s ease;
    }

    .search input {
        flex: 1 1 auto;
        min-width: 0;
        height: 100%;
        padding: 9px 18px;
        border-radius: 0;
        font-size: 18px;
        border-radius: 999px;
        border: none;
        opacity: 0;
        transition: opacity 0.4s ease;
        background: none;
        box-sizing: border-box;
        box-shadow: none;
    }

    body.search-open header .search input,
    .search:focus-within input {
        opacity: 1;
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
        border: none;
        padding: 0 18px 0 4px;
        border-radius: 0;
        box-shadow: none;
        position: relative;
        z-index: 0;
        background-color: var(--theme-input-bg);
        color: var(--theme-text-primary);
    }

    .search input:focus {
        border: none;
        outline: none;
        box-shadow: none;
    }

    .search:not(:focus-within) input {
        flex: 0 1 0;
        width: 0;
        min-width: 0;
        padding: 0;
        border: none;
        overflow: hidden;
    }


    body.search-open header #btnAuth,
    body.search-open header #btnExit {
        opacity: 0;
        pointer-events: none;
    }

    body.search-open header .logo {
        opacity: 0;
        pointer-events: none;
    }

    body.search-open .nav-toggle {
        opacity: 0;
        pointer-events: none;
    }

    .club_info{
        img{
            width: 40px;       
        }

        h2{
            font-size: 16px;
        }
    }

    .info {
        img{
            width: 40px;       
        }

        button img{
                width: 20px;
                border-radius: 0;
                margin: 0;
            }      
    }
}

@media screen and (max-width: 680px) {
    body,header,.news article,.events article, .settings article, .feedback article, .club_info article, .reference article{
        background-color: white;
        box-shadow: none;
    }

    body.page-news-feed section.news article,
    body.page-events-feed section.news article {
        box-shadow: none;
    }

    body.page-news-feed .events-filter-control .custom-select,
    body.page-news-feed .custom-select-wrapper:has(#sort-select) .custom-select,
    body.page-events-feed .events-filter-control .custom-select,
    body.page-events-feed .custom-select-wrapper:has(#sort-select) .custom-select {
        box-shadow: none;
    }

    body:has(.publication) {
        background-color: #ffffff;
    }

    html[data-theme="dark"] body:has(.publication) {
        background-color: #0f1218;
    }

    .publication article {
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
    }

    .publication article .publication-section-hint {
        margin-top: 8px;
        padding: 10px;
        border-radius: 10px;
        font-size: 12px;
    }

    .feedback article input,.feedback article textarea {
        border: 2px solid #eaeaea;
    }

    .feedback-modal {
        align-items: stretch;
    }

    .feedback-modal-content {
        width: 100vw;
        max-width: none;
        min-height: 100dvh;
        max-height: 100dvh;
        padding: 24px 16px 32px;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .feedback-form {
        flex: 1 1 auto;
        min-height: 0;
    }

    .feedback-form-group--message {
        flex: 1 1 auto;
        min-height: 0;
    }

    .feedback-form-group--message textarea {
        flex: 1 1 auto;
        min-height: 88px;
        height: auto;
        resize: none;
    }

    /* Телефон в альбомной ориентации: ужимаем отступы, иначе кнопка не помещается на экран */
    @media (max-height: 520px) {
        .feedback-modal-content {
            padding: 16px 16px 20px;
        }

        .feedback-form {
            gap: 16px;
        }

        .feedback-modal-content h2 {
            margin-bottom: 16px;
        }
    }

    .settings article{

        &.settings-card{
            gap: 40px;
        }

        border-radius: 0;
        border-bottom: 1px solid #ccc;
        button:not(.general-info-open-btn):not(.stats-open-btn):not(.social-toggle-btn):not(.settings-edit-profile-btn){
            background-color: white;
            border-color: white;
        }

        button:not(.general-info-open-btn):not(.stats-open-btn):not(.social-toggle-btn):not(.settings-edit-profile-btn):hover {
            background: white;
        }
    }

    .profileEditing article{
        background: none;
        border-radius: 0;

        button{
            background-color: white;
            border-color: white;
        }
    }

    .post-title {
        padding: 0 24px;
        margin-bottom: 12px;

        h3 {
            font-size: 18px;
            line-height: 1.2;
            overflow-wrap: break-word;
            word-break: break-word;
        }
    }

    .post-hashtags {
        margin-top: 12px;
        
        .hashtag {
            font-size: 12px;
            padding: 3px 6px;
        }
    }

    .news, .events{
        width: 100%;
        
        article{
            width: 100%;
            max-width: 680px;
        }
    }

    .scheduled-preview-content {
        padding: 16px;
        max-width: calc(100vw - 32px);
    }
}

@media screen and (max-width: 640px) {
    .events-table-container {
        overflow-x: visible;
        background: transparent;
        border: none;
    }

    .events-table {
        border: none;
        background: transparent;
    }

    .events-table,
    .events-table thead,
    .events-table tbody,
    .events-table th,
    .events-table td,
    .events-table tr {
        display: block;
    }

    .events-table thead {
        display: none;
    }

    .events-table tr {
        background: var(--theme-bg-secondary);
        border: 1px solid var(--theme-border);
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 12px;
    }

    .events-table td {
        padding: 6px 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        text-align: right;
    }

    .events-table td::before {
        content: attr(data-label) ":";
        font-weight: 600;
        color: var(--theme-text-secondary);
        min-width: 160px;
        text-align: left;
        flex: 0 0 auto;
    }

    .events-table td[colspan] {
        display: block;
        text-align: center;
    }

    .events-table td[colspan]::before {
        content: none;
    }
}

@media screen and (max-width: 550px) {
    .nameProfile .infoProfile{
        margin-right: 0;
    }
}

@media screen and (max-width: 396px) {
    .settings article.settings-card div {
        border: none;
        background: none;
        padding: 0;
    }
}

/* Адаптив для страницы общей информации */
@media screen and (max-width: 640px) {
    .general-info-page .general-info-tabs label {
        font-size: 0.8rem;
        padding: 0 0.5rem;
        min-width: 120px;
    }

    .general-info-page .general-info-tabs,
    .general-info-page .general-info-tabs .glider {
        height: 40px;
    }
    .general-info-page .general-info-tabs {
        padding: 0.4rem;
        gap: 4px;
    }
}
@media screen and (max-width: 1024px) {
    .general-info-page .general-info-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 6px;
    }
    .general-info-page .general-info-tabs::-webkit-scrollbar {
        display: none;
    }
    .general-info-page .general-info-tabs label {
        flex: 0 0 auto;
        min-width: 140px;
    }
    .general-info-page .general-info-tabs .glider {
        display: none;
    }
}
@media screen and (max-width: 480px) {
    .general-info-page .general-info-tabs label {
        min-width: 108px;
        height: 38px;
        font-size: 0.75rem;
    }
    .general-info-page .general-info-tabs,
    .general-info-page .general-info-tabs .glider {
        height: 38px;
    }
}
@media screen and (min-width: 641px) and (max-width: 1024px) {
    .general-info-page .general-info-tabs label {
        min-width: 128px;
    }
}

@media screen and (max-width: 1100px) {
    .general-info-page .events-filters {
        flex-direction: column;
        align-items: stretch;
    }

    /* В разделах Пользователи и Скрытые: поиск и кнопка остаются в одну строку */
    #tab-panel-4 .events-filters,
    #tab-panel-5 .events-filters {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .general-info-page .filter-apply-btn,
    .general-info-page .filter-reset-btn {
        width: 100%;
        min-width: 0;
    }

    #tab-panel-4 .events-filters .filter-apply-btn,
    #tab-panel-4 .events-filters .filter-reset-btn,
    #tab-panel-5 .events-filters .filter-apply-btn,
    #tab-panel-5 .events-filters .filter-reset-btn {
        width: auto;
        min-width: 120px;
    }
}

/* Адаптив для events-tabs */
@media screen and (max-width: 1024px) {
    .events-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 6px;
    }
    .events-tabs::-webkit-scrollbar {
        display: none;
    }
    .events-tabs .tab-btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 140px;
    }
}
@media screen and (max-width: 640px) {
    .events-tabs .tab-btn {
        min-width: 120px;
        font-size: 0.85rem;
        padding: 10px 16px;
    }
}
@media screen and (max-width: 480px) {
    .events-tabs .tab-btn {
        min-width: 108px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}
@media screen and (min-width: 641px) and (max-width: 1024px) {
    .events-tabs .tab-btn {
        min-width: 128px;
    }
}

@media screen and (max-width: 640px) {
    .general-info-page .table-actions {
        flex-wrap: wrap;
    }

    .general-info-page .clubs-table th,
    .general-info-page .clubs-table td {
        padding: 8px;
        font-size: 13px;
    }
}

/* Адаптивные стили для раздела записи на мероприятия */
@media screen and (max-width: 680px) {
    .registration-type-options {
        padding: 12px;
    }
    
    .radio-option {
        padding: 10px;
    }
    
    .registration-block {
        padding: 12px;
    }
    
    .form-field-item {
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .form-field-item input {
        min-width: 100%;
        order: 2;
    }
    
    .remove-field-btn {
        order: 1;
        width: 32px;
        height: 32px;
    }
    
    .btn-add-field {
        width: 100%;
        justify-content: center;
    }
    
    .event-page-type-options {
        padding: 12px;
    }
    
    .event-page-block-item {
        padding: 12px;
        min-width: 0;
        overflow-x: hidden;
    }
}

@media screen and (max-width: 480px) {
    .event-page-block {
        gap: 16px;
    }
    
    .event-page-type-options {
        gap: 8px;
    }
    
    .event-page-block-item label {
        font-size: 18px;
    }
}

@media screen and (max-width: 480px) {
    .event-registration-block {
        gap: 16px;
    }
    
    .registration-type-options {
        gap: 8px;
    }
    
    .radio-label {
        font-size: 14px;
    }
    
    .form-fields-label {
        font-size: 14px;
    }
    
    .form-field-item {
        gap: 8px;
        padding: 8px;
    }
    
    .form-field-item input {
        font-size: 14px;
        padding: 8px 10px;
    }
}
/* Keep the Sportevis name beside the mark on compact screens. */
@media screen and (max-width: 600px) {
    header .logo.n { gap: 6px; flex-wrap: nowrap; }
    header .logo.n img { width: 32px; height: 32px; object-fit: cover; margin-right: 0; flex-shrink: 0; }
    header .logo.n h1 { font-size: 16px; line-height: 1.2; }
}

/* Desktop icon rail: expand above the feed on hover or keyboard focus. */
@media screen and (min-width: 1101px) {
    aside.aside-nav-shell {
        width: 76px;
        padding: 0 12px 20px;
        height: calc(100dvh - 70px);
        left: 0;
        top: 70px;
        z-index: 2000;
        overflow-x: hidden;
        background: var(--theme-bg-primary);
        border-right: 1px solid var(--theme-border, rgba(0,0,0,.06));
    }
    aside.aside-nav-shell:is(:hover, :focus-within) {
        width: 265px;
        box-shadow: 12px 0 28px rgba(0,0,0,.06);
        overflow-y: auto;
    }
    aside.aside-nav-shell nav { width: 241px; }
    aside.aside-nav-shell nav menu { gap: 12px; }
    aside.aside-nav-shell nav menu a {
        width: 52px;
        height: 48px;
        box-sizing: border-box;
        padding: 12px 14px;
        gap: 14px;
        border-radius: 14px;
        background: transparent;
        box-shadow: none;
        white-space: nowrap;
    }
    aside.aside-nav-shell nav menu a img { width: 24px; height: 24px; }
    aside.aside-nav-shell nav menu a:is(:hover, [aria-current="page"], .is-active) { background: var(--theme-nav-bg); }
    aside.aside-nav-shell nav menu a .nav-link-text,
    aside.aside-nav-shell nav menu a .club-name { opacity: 0; flex: 0 0 175px; transition: opacity .15s ease; }
    aside.aside-nav-shell:is(:hover, :focus-within) nav menu a { width: 241px; }
    aside.aside-nav-shell:is(:hover, :focus-within) nav menu a .nav-link-text,
    aside.aside-nav-shell:is(:hover, :focus-within) nav menu a .club-name { opacity: 1; flex: 1 1 auto; }
    aside.aside-nav-shell nav .club-aside h1 { height: 1px; margin: 4px 14px; overflow: hidden; font-size: 18px; opacity: 0; }
    aside.aside-nav-shell:is(:hover, :focus-within) nav .club-aside h1 { height: auto; margin: 4px 14px 8px; opacity: 1; }
    aside.aside-nav-shell .aside-legal { width: 225px; opacity: 0; visibility: hidden; }
    aside.aside-nav-shell:is(:hover, :focus-within) .aside-legal { opacity: 1; visibility: visible; }
    main { padding-left: 96px; padding-right: 96px; }
}
@media (prefers-reduced-motion: reduce) {
    aside.aside-nav-shell nav menu a .nav-link-text,
    aside.aside-nav-shell nav menu a .club-name { transition: none; }
}

/* Clean desktop navigation without panel or item surfaces. */
@media screen and (min-width: 1101px) {
    aside.aside-nav-shell,
    aside.aside-nav-shell:is(:hover, :focus-within) {
        background: transparent;
        border: 0;
        box-shadow: none;
    }
    aside.aside-nav-shell nav menu a,
    aside.aside-nav-shell nav menu a:is(:hover, :focus-visible, [aria-current="page"], .is-active) {
        background: transparent;
        border: 0;
        box-shadow: none;
    }
    aside.aside-nav-shell nav menu a:is(:hover, [aria-current="page"], .is-active) {
        color: var(--theme-text-primary, #202124);
    }
}

/* Collapse the header wordmark together with the desktop rail. */
@media screen and (min-width: 1101px) {
    body:has(aside.aside-nav-shell) header > .logo.n h1 {
        max-width: 0;
        opacity: 0;
        overflow: hidden;
        white-space: nowrap;
        margin: 0;
        transition: opacity .15s ease;
    }
    body:has(aside.aside-nav-shell:is(:hover, :focus-within)) header > .logo.n h1,
    body:has(aside.aside-nav-shell) header > .logo.n:hover h1 {
        max-width: 200px;
        opacity: 1;
    }
}
@media (prefers-reduced-motion: reduce) {
    body:has(aside.aside-nav-shell) header > .logo.n h1 { transition: none; }
}

/* Align the brand mark with the 24px navigation icons (rail center: 38px). */
@media screen and (min-width: 1101px) {
    body:has(aside.aside-nav-shell) header > .logo.n {
        left: 22px;
        gap: 14px;
        align-items: center;
        flex-wrap: nowrap;
    }
    body:has(aside.aside-nav-shell) header > .logo.n > img {
        width: 32px;
        height: 32px;
        object-fit: contain;
        margin: 0;
        flex: 0 0 32px;
    }
}

@media screen and (min-width: 1101px) {
    aside.aside-nav-shell nav menu a:is(:hover, :focus-visible) {
        background: var(--theme-nav-bg, #fff);
        border-radius: 14px;
    }
}

@media screen and (min-width: 1101px) {
    aside.aside-nav-shell nav .club-aside h1,
    aside.aside-nav-shell:is(:hover, :focus-within) nav .club-aside h1 {
        margin-left: 0;
        padding-left: 0;
    }
}

@media screen and (min-width: 1101px) {
    aside.aside-nav-shell nav .club-aside h1,
    aside.aside-nav-shell:is(:hover, :focus-within) nav .club-aside h1 {
        margin-left: 14px;
        padding-left: 0;
    }
}

@media screen and (min-width: 1101px) {
    body:has(aside.aside-nav-shell) header > .logo.n { left: 8px; }
    body:has(aside.aside-nav-shell) header > .logo.n > img {
        width: 60px;
        height: 40px;
        flex: 0 0 60px;
    }
}

@media screen and (min-width: 1101px) {
    aside.aside-nav-shell nav menu a {
        height: 42px;
        padding-top: 9px;
        padding-bottom: 9px;
        border-radius: 9px;
    }
    aside.aside-nav-shell nav menu a:is(:hover, :focus-visible) {
        background: rgba(128, 128, 128, .13);
        border-radius: 9px;
    }
}

@media screen and (min-width: 1101px) {
    aside.aside-nav-shell > nav {
        display: flex;
        flex-direction: column;
        flex: 1 0 auto;
        min-height: calc(100dvh - 110px);
    }
    aside.aside-nav-shell > nav > menu:last-child {
        margin-top: auto;
        padding-bottom: 0;
    }
}

@media screen and (min-width: 1101px) {
    body:has(aside.aside-nav-shell) header > .logo.n { gap: 0; }
    body:has(aside.aside-nav-shell) header > .logo.n h1 { margin-left: -4px; }
}

@media screen and (min-width: 1101px) {
    aside.aside-nav-shell { scrollbar-width: none; -ms-overflow-style: none; }
    aside.aside-nav-shell::-webkit-scrollbar { display: none; width: 0; height: 0; }
}

/* Navigation loading mirrors the actual icon rail and account visibility. */
html[data-js="1"] .nav-overlay-skeleton .nav-skeleton-row { display: flex; align-items: center; gap: 14px; height: 42px; padding: 9px 14px; box-sizing: border-box; }
html[data-js="1"] .nav-overlay-skeleton .nav-skeleton-icon { display: block; flex: 0 0 24px; height: 24px; border-radius: 7px; }
html[data-js="1"] .nav-overlay-skeleton .nav-skeleton-text { width: 130px; height: 14px; border-radius: 5px; }
html[data-js="1"] .nav-skeleton-group,
html[data-js="1"] .nav-skeleton-organizations,
html[data-js="1"] .nav-skeleton-footer { display: grid; gap: 12px; }
html[data-js="1"] .nav-skeleton-heading { width: 110px; height: 16px; margin: 4px 14px 8px; border-radius: 5px; }
@media screen and (min-width: 1101px) {
    html[data-js="1"] .nav-overlay-skeleton--aside {
        display: flex; flex-direction: column; gap: 20px;
        width: 100%; max-width: none; padding: 20px 12px;
        background: transparent; overflow: hidden;
    }
    html[data-js="1"] .nav-overlay-skeleton--aside .nav-skeleton-footer { margin-top: auto; }
    html[data-js="1"] .nav-overlay-skeleton--aside .nav-skeleton-text { opacity: 0; }
    html[data-js="1"] .nav-overlay-skeleton--aside .nav-skeleton-heading { height: 1px; margin-bottom: 4px; opacity: 0; }
    html[data-js="1"] aside:is(:hover, :focus-within) .nav-skeleton-text { opacity: 1; }
    html[data-js="1"] aside:is(:hover, :focus-within) .nav-skeleton-heading { height: 16px; margin-bottom: 8px; opacity: 1; }
}

/* Brand and navigation share one hover and keyboard-focus region. */
.desktop-nav-brand { display: none; }
@media screen and (min-width: 1101px) {
    body:has(aside.aside-nav-shell) header > .logo.n { display: none; }
    aside.aside-nav-shell { top: 0; height: 100dvh; padding-top: 70px; }
    aside.aside-nav-shell .desktop-nav-brand {
        position: absolute; top: 15px; left: 8px; height: 40px;
        display: flex; align-items: center; gap: 0;
        color: var(--theme-text-primary, #333); text-decoration: none; white-space: nowrap;
    }
    aside.aside-nav-shell .desktop-nav-brand img { width: 60px; height: 40px; object-fit: contain; flex: 0 0 60px; }
    aside.aside-nav-shell .desktop-nav-brand span { margin-left: -4px; font-size: 24px; font-weight: 600; opacity: 0; max-width: 0; overflow: hidden; }
    aside.aside-nav-shell:is(:hover, :focus-within) .desktop-nav-brand span { max-width: 200px; opacity: 1; }
    html[data-js="1"] .nav-overlay-skeleton--aside { top: 70px; }
}

/* Reserve the organization heading slot so expanding does not move links. */
@media screen and (min-width: 1101px) {
    aside.aside-nav-shell nav .club-aside h1,
    aside.aside-nav-shell:is(:hover, :focus-within) nav .club-aside h1 {
        height: 24px;
        line-height: 24px;
        margin: 4px 14px 8px;
        padding: 0;
        white-space: nowrap;
    }
    html[data-js="1"] .nav-overlay-skeleton--aside .nav-skeleton-heading,
    html[data-js="1"] aside:is(:hover, :focus-within) .nav-skeleton-heading {
        height: 16px;
        margin: 4px 14px 16px;
    }
}

@media screen and (min-width: 1101px) {
    aside.aside-nav-shell .desktop-nav-brand > .brand-wordmark { font-weight: 700; letter-spacing: -.7px; }
}

/* Search field corners match the sign-in button. */
header .search input[type="search"],
header .search .header-search-skeleton__desktop-field { border-radius: 10px; }
@media screen and (max-width: 1100px) {
    body.search-open header .search,
    body.auth-visible header .search:focus-within,
    body.exit-visible header .search:focus-within,
    header .search:focus-within { border-radius: 10px; }
}

@media screen and (min-width: 1101px) { aside.aside-nav-shell .desktop-nav-brand > .brand-wordmark { font-family: "Clear Sans Infanity", "Moderustic-Regular", sans-serif; font-weight: 700; letter-spacing: 0; } }

@media screen and (min-width: 1101px) {
    aside.aside-nav-shell { display: flex; }
    header .sidePanel { display: none; }
}

.mobile-bottom-nav { display: none; }
@media screen and (max-width: 1100px) {
    .mobile-bottom-nav {
        display: flex; align-items: center; justify-content: space-around;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 3000;
        height: 58px; padding: 0 8px env(safe-area-inset-bottom); box-sizing: content-box;
        background: var(--theme-bg-primary, #fff); border-top: 1px solid rgba(128,128,128,.18);
    }
    .mobile-bottom-nav a { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 9px; color: var(--theme-text-primary, #25282c); }
    .mobile-bottom-nav a:active { background: rgba(128,128,128,.13); }
    .mobile-bottom-nav img, .mobile-bottom-nav svg { width: 24px; height: 24px; object-fit: contain; }
    .mobile-bottom-nav .mobile-bottom-nav__avatar { border-radius: 50%; object-fit: cover; }
    header .sidePanel { display: none; }
    header .logo { left: 16px; }
    body > main { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
}


/* Mobile search lives in a full-screen white dialog, opened from the bottom bar. */
@media screen and (max-width: 1100px) {
    header .search { display: none !important; }
}
.mobile-search-dialog { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: max(16px, env(safe-area-inset-top)) 16px 16px; border: 0; border-radius: 0; box-sizing: border-box; background: #fff; color: #25282c; }
.mobile-search-dialog::backdrop { background: #fff; }
.mobile-search-top { display: flex; align-items: center; gap: 8px; }
.mobile-search-top form { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; height: 46px; padding: 0 12px; background: #f2f3f4; border-radius: 10px; box-sizing: border-box; }
.mobile-search-top svg { width: 20px; height: 20px; flex: 0 0 20px; }
.mobile-search-top input[type=search] { width: 100%; min-width: 0; flex: 1; padding: 0; height: 44px; border: 0; outline: 0; background: transparent; box-shadow: none; color: #25282c; font: inherit; }
.mobile-search-top form button { border: 0; background: transparent; color: #d95200; font: inherit; padding: 8px 0; cursor: pointer; }
.mobile-search-close { display: flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 44px; border: 0; background: transparent; color: #25282c; font-size: 30px; cursor: pointer; border-radius: 10px; }

.organizations-directory { position: fixed; inset: 0; margin: 0; padding: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; border: 0; border-radius: 0; background: #fff; color: #25282c; box-sizing: border-box; }
.organizations-directory::backdrop { background: #fff; }
.organizations-directory__header { position: sticky; top: 0; background: #fff; display: flex; align-items: center; height: 62px; padding: env(safe-area-inset-top) 16px 0; gap: 12px; z-index: 1; }
.organizations-directory__header button { display: grid; place-items: center; width: 40px; height: 40px; padding: 8px; background: transparent; border: 0; color: inherit; border-radius: 9px; cursor: pointer; }
.organizations-directory__header svg { width: 24px; height: 24px; }
.organizations-directory__header h2 { margin: 0; font-size: 18px; font-weight: 600; }
.organizations-directory__list { padding: 12px 16px max(24px, env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.organization-directory-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; text-decoration: none; color: inherit; }
.organization-directory-row > img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #f2f3f4; }
.organization-directory-row > span { display: grid; gap: 4px; min-width: 0; flex: 1; }
.organization-directory-row strong { font-size: 16px; overflow-wrap: anywhere; }
.organization-directory-row small { color: #777b82; font-size: 13px; }
.organization-directory-row > svg { width: 20px; height: 20px; color: #8a8e94; }
.organization-directory-row:hover { color: #e95b00; }
.organizations-directory__empty { text-align: center; padding: 20vh 16px 32px; }
.organizations-directory__empty img { opacity: .5; }
.organizations-directory__empty h3 { font-size: 18px; margin: 18px 0 8px; }
.organizations-directory__empty p { font-size: 15px; color: #777b82; }

/* Reuse the site search controls inside the mobile search dialog. */
.mobile-search-top .mobile-search-form { position: static; display: flex; width: auto; max-width: none; height: 47px; padding: 0; gap: 12px; background: transparent; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.mobile-search-top .mobile-search-form .search-icon { flex: 0 0 47px; width: 47px; height: 47px; padding: 12px; border: 3px solid #fff; border-radius: 50%; background-color: var(--theme-input-bg, #fff); box-shadow: 0 0 8px var(--theme-shadow); }
.mobile-search-top .mobile-search-form input[type=search] { height: 47px; padding: 9px 18px; border: 3px solid transparent; border-radius: 10px; background: var(--theme-input-bg, #fff); color: var(--theme-text-primary, #25282c); box-shadow: 0 0 8px var(--theme-shadow); font-size: 18px; }
.mobile-search-top .mobile-search-form input[type=search]:focus { border-color: rgba(58,58,58,.35); }

/* Keep the mobile brand full size; compact both sides only when space is tight. */
@media screen and (max-width: 1100px) {
    header > .logo, header > .logo.n { left: 16px; gap: 8px; display: flex; align-items: center; flex-wrap: nowrap; }
    header > .logo img, header > .logo.n img { width: 60px; height: 40px; object-fit: contain; flex: 0 0 60px; margin: 0; }
    header > .logo h1, header > .logo.n h1 { font-size: 24px; line-height: 1.15; margin: 0; white-space: nowrap; }
    header #btnAuth { font-size: 18px; padding: 12px 24px; }
}
@media screen and (max-width: 400px) {
    header > .logo, header > .logo.n { left: 12px; gap: 6px; }
    header > .logo img, header > .logo.n img { width: 51px; height: 34px; flex-basis: 51px; }
    header > .logo h1, header > .logo.n h1 { font-size: 21px; }
    header #btnAuth { font-size: 16px; padding: 10px 18px; }
}
@media screen and (max-width: 340px) {
    header > .logo, header > .logo.n { left: 8px; gap: 4px; }
    header > .logo img, header > .logo.n img { width: 45px; height: 30px; flex-basis: 45px; }
    header > .logo h1, header > .logo.n h1 { font-size: 18px; }
    header #btnAuth { font-size: 14px; padding: 9px 14px; }
}

.mobile-search-top .mobile-search-form .search-icon { background-image: none; color: #25282c; display: grid; place-items: center; padding: 10px; }
.mobile-search-top .mobile-search-form .search-icon svg { display: block; width: 20px; height: 20px; }
.mobile-search-top .mobile-search-form input[type=search],
.mobile-search-top .mobile-search-form input[type=search]:hover,
.mobile-search-top .mobile-search-form input[type=search]:focus { border: 3px solid #bcbcbc; }

.mobile-search-dialog { z-index: 2999; height: calc(100dvh - 58px - env(safe-area-inset-bottom)); bottom: calc(58px + env(safe-area-inset-bottom)); }

.mobile-search-top .mobile-search-form .search-icon { background-color: #f56600; border-color: #f56600; color: #fff; }
.mobile-search-top .mobile-search-form .search-icon:hover { background-color: #df5900; border-color: #df5900; }

.mobile-search-top .mobile-search-form .search-icon svg,
.mobile-search-top .mobile-search-form .search-icon svg * { color: #fff; stroke: #fff; }

.mobile-search-dialog .mobile-search-top { width: 100%; }
.mobile-search-dialog .mobile-search-form { flex: 1 1 100%; min-width: 0; }
.mobile-search-dialog .mobile-search-form input[type="search"] { display: block; visibility: visible; opacity: 1; flex: 1 1 0%; width: 0; min-width: 0; box-sizing: border-box; border: 3px solid #bcbcbc; border-radius: 10px; background: #fff; }

.mobile-search-dialog { padding-top: env(safe-area-inset-top, 0px); }
.mobile-search-heading { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; min-height: 56px; margin-bottom: 12px; }
.mobile-search-heading h2 { margin: 0; font-size: 18px; font-weight: 600; text-align: center; }
.mobile-search-back { width: 40px; height: 40px; display: grid; place-items: center; padding: 8px; border: 0; border-radius: 9px; background: transparent; color: #25282c; cursor: pointer; }
.mobile-search-back svg { width: 24px; height: 24px; }

.mobile-search-form input[type="search"]::-webkit-search-cancel-button,
.mobile-search-form input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.mobile-search-form input[type="search"]::-ms-clear { display: none; width: 0; height: 0; }

.organizations-directory__header { display: grid; grid-template-columns: 40px 1fr 40px; gap: 0; }
.organizations-directory__header h2 { text-align: center; }
@media screen and (max-width: 1100px) {
    .organizations-directory { z-index: 2999; height: calc(100dvh - 58px - env(safe-area-inset-bottom)); bottom: calc(58px + env(safe-area-inset-bottom)); }
}

.organizations-directory__list:has(.organizations-directory__empty) { min-height: calc(100% - 62px); box-sizing: border-box; display: flex; align-items: center; justify-content: center; }
.organizations-directory__empty { width: 100%; max-width: 600px; padding: 20px 0; }
.organizations-directory__empty img { width: clamp(160px, 22vw, 240px); height: auto; opacity: 1; display: block; margin: 0 auto 20px; object-fit: contain; }
.organizations-directory__empty h3 { font-size: clamp(20px, 2vw, 24px); line-height: 1.35; font-weight: 600; margin: 0 0 10px; }
.organizations-directory__empty p { max-width: 460px; margin: 0 auto; font-size: 16px; line-height: 1.6; color: #777b82; }

/* Tighter spacing between the mascot and wordmark. */
@media screen and (max-width: 1100px) {
    header > .logo, header > .logo.n { gap: 2px; }
    header > .logo h1, header > .logo.n h1 { margin-left: -6px; }
}
@media screen and (min-width: 1101px) {
    aside.aside-nav-shell .desktop-nav-brand > .brand-wordmark { margin-left: -10px; }
}

/* Mobile navigation stays transparent on tap and sticky touch hover. */
@media screen and (max-width: 1100px) {
    .mobile-bottom-nav a,
    .mobile-bottom-nav a:is(:hover, :active, :focus, :focus-visible) { background: transparent; box-shadow: none; -webkit-tap-highlight-color: transparent; }
}

@media screen and (max-width: 1100px) {
    body > header { position: fixed; top: 0; left: 0; width: 100%; z-index: 2500; box-sizing: border-box; border-bottom: 1px solid rgba(128,128,128,.2); transform: translateY(0); transition: transform .22s ease; }
    body.mobile-header-hidden > header { transform: translateY(-100%); }
}
@media screen and (max-width: 1100px) and (prefers-reduced-motion: reduce) { body > header { transition: none; } }

@media screen and (max-width: 1100px) {
    body > header, body.mobile-header-hidden > header { transform: translate3d(0, 0, 0); transition: none; }
}

@media screen and (max-width: 1100px) { body > header { will-change: transform; } }

.mobile-bottom-nav img.mobile-bottom-nav__avatar { width: 28px; height: 28px; border-radius: 50%; border: 0; outline: 0; box-shadow: none; object-fit: cover; }
.mobile-bottom-nav img.mobile-bottom-nav__avatar--fallback { box-sizing: border-box; padding: 4px; background: #dfe2e5; object-fit: contain; }

/* Visible circular background for the user placeholder in both navigation layouts. */
.mobile-bottom-nav img.mobile-bottom-nav__avatar--fallback,
aside.aside-nav-shell nav menu a img[src*="navigation/profile.svg"],
.sidePanel nav menu a img[src*="navigation/profile.svg"] {
    width: 28px; height: 28px; flex: 0 0 28px; box-sizing: border-box; padding: 4px; border-radius: 50%; background-color: #c9cdd2; border: 0; outline: 0; box-shadow: none; object-fit: contain;
}

/* Back transparent avatar images with the same circular surface. */
.mobile-bottom-nav img.mobile-bottom-nav__avatar { background-color: #c9cdd2; border-radius: 50%; border: 0; box-shadow: none; }

/* Larger mobile navigation symbols and profile avatar. */
@media screen and (max-width: 1100px) {
    .mobile-bottom-nav img, .mobile-bottom-nav svg { width: 28px; height: 28px; }
    .mobile-bottom-nav img.mobile-bottom-nav__avatar { width: 34px; height: 34px; flex-basis: 34px; }
    .mobile-bottom-nav img.mobile-bottom-nav__avatar--fallback { padding: 4px; }
}

@media screen and (max-width: 1100px) {
    body.page-profile > header { display: none; }
    body.page-profile > main { padding-top: 0; }
}

/* Mobile editing is a standalone screen with persistent header and save action. */
@media screen and (max-width: 1100px) {
    body.page-profile:has(.profileEdit) .mobile-bottom-nav { display: none; }
    body.page-profile:has(.profileEdit) > main { padding: 0; }
    body.page-profile .profileEdit { padding: calc(72px + env(safe-area-inset-top)) 12px calc(92px + env(safe-area-inset-bottom)); }
    body.page-profile .profileEdit .profile-editor-heading {
        position: fixed; top: 0; left: 0; right: 0; z-index: 2500;
        box-sizing: border-box; height: calc(60px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) 12px 0; margin: 0; background: #fff;
    }
    body.page-profile .profileEdit .profile-save-all {
        position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
        width: calc(100% - 24px); margin: 0; z-index: 2500; height: 48px;
    }
    body.page-profile .profileEdit::after {
        content: ''; position: fixed; left: 0; right: 0; bottom: 0;
        height: calc(72px + env(safe-area-inset-bottom)); background: #fff;
        z-index: 2499; pointer-events: none;
    }
}

.mobile-bottom-nav img.mobile-bottom-nav__avatar--fallback { padding: 0; background-color: #cdd3da; }

@media screen and (min-width: 1101px) { .settings.profile-menu > .profile-mobile-help { display: none; } }

@media screen and (min-width: 1101px) { .profile-menu-heading > a { visibility: hidden; pointer-events: none; } }

@media screen and (min-width: 1101px) {
    body.page-profile > main { padding-top: 24px; }
    body.page-profile .settings.profile-menu { margin-top: 0; }
}

/* Profile has no header controls; do not overlay its content with an empty header. */
body.page-profile > header { display: none; }

.feedback-screen-back { display: none; }
@media (max-width: 1100px) {
    #feedback-modal { padding: 0; background: #fff; align-items: stretch; }
    #feedback-modal .feedback-modal-overlay { background: #fff; }
    #feedback-modal .feedback-modal-content { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; border-radius: 0; box-shadow: none; padding: calc(76px + env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom)); overflow-y: auto; animation: none; }
    #feedback-modal .feedback-screen-heading { position: fixed; top: 0; left: 0; right: 0; z-index: 2; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; height: calc(60px + env(safe-area-inset-top)); box-sizing: border-box; padding: env(safe-area-inset-top) 12px 0; background: #fff; }
    #feedback-modal .feedback-screen-heading h2 { margin: 0; text-align: center; font-size: 18px; }
    #feedback-modal .feedback-screen-back { display: grid; place-items: center; width: 40px; height: 40px; padding: 8px; border: 0; background: transparent; color: #25282c; }
    .feedback-screen-back svg { width: 24px; height: 24px; }
    #feedback-modal .feedback-modal-close { display: none; }
    #feedback-modal .feedback-submit-btn { position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); left: 16px; width: calc(100% - 32px); z-index: 2; margin: 0; }
    #feedback-modal .feedback-modal-content::after { content: ''; position: fixed; bottom: 0; left: 0; right: 0; height: calc(72px + env(safe-area-inset-bottom)); background: #fff; z-index: 1; pointer-events: none; }
}

@media (min-width: 1101px) { aside.aside-nav-shell nav menu a { gap: 8px; } }

/* Navigation uses the page surface at both breakpoints. */
.mobile-bottom-nav, aside.aside-nav-shell, aside.aside-nav-shell:is(:hover, :focus-within) { background-color: var(--theme-bg-primary, #edeef0); }

/* Profile legal links sit at the page bottom, outside the content card. */
body.page-profile > main:has(> .settings.profile-menu) { min-height: 100dvh; box-sizing: border-box; }
body.page-profile > main > .profile-footer { margin-top: auto; width: min(100%, 900px); box-sizing: border-box; padding-top: 32px; padding-bottom: 20px; }
body.page-profile:has(.profileEdit) .profile-footer { display: none; }
@media (max-width: 1100px) { body.page-profile > main > .profile-footer { padding-bottom: calc(76px + env(safe-area-inset-bottom)); } }

@media (min-width: 1101px) {
    body.page-profile .profileEdit { background: var(--theme-article-bg, #fff); border-radius: 16px; padding: 24px; box-sizing: border-box; margin-top: 0; }
}

/* Skeleton spacing matches the actual section padding at each breakpoint. */
body.page-profile .profileEdit .profile-edit-overlay-skeleton { padding: 24px; box-sizing: border-box; }
body.page-profile .profileEdit .editor-skeleton-heading { margin: 0 0 24px; }
body.page-profile .profileEdit .editor-skeleton-group { gap: 0; margin: 0 0 20px; }
body.page-profile .profileEdit .editor-skeleton-section { margin: 0 16px 12px; }
body.page-profile .profileEdit .editor-skeleton-field { padding: 0 16px; gap: 6px; margin: 0 0 18px; }
body.page-profile .profileEdit .editor-skeleton-field:last-child { margin-bottom: 0; }
body.page-profile .profileEdit .editor-skeleton-input { height: 48px; }
.settings.profile-menu .settings-identity-skeleton .settings-overlay-skeleton__identity { gap: 16px; }
.settings.profile-menu .settings-identity-skeleton .settings-overlay-skeleton__title-wrap { display: grid; gap: 4px; }
.settings.profile-menu .settings-identity-skeleton .settings-overlay-skeleton__title { height: 18px; margin: 0; }
.settings.profile-menu .settings-identity-skeleton .settings-overlay-skeleton__meta { height: 14px; margin: 0; }
.settings.profile-menu .profile-table-skeleton { padding: 16px; }
.settings.profile-menu .profile-social-skeleton { padding: 12px; }
body.page-profile .eventsStatistics .stats-skeleton-current { padding: 24px; }
@media (max-width: 1100px) {
    body.page-profile .profileEdit .profile-edit-overlay-skeleton { padding: calc(72px + env(safe-area-inset-top)) 12px calc(92px + env(safe-area-inset-bottom)); border-radius: 0; }
    body.page-profile .profileEdit .editor-skeleton-heading { position: fixed; top: 0; left: 0; right: 0; height: calc(60px + env(safe-area-inset-top)); box-sizing: border-box; padding: env(safe-area-inset-top) 12px 0; margin: 0; background: #fff; }
    body.page-profile .profileEdit .editor-skeleton-save { left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: calc(100% - 24px); height: 48px; }
    .settings.profile-menu .profile-table-skeleton { padding: 14px 12px; }
    body.page-profile .eventsStatistics .stats-skeleton-current { padding: 18px 12px; }
}

/* Statistics uses the same screen shell as other profile sections. */
body.page-profile .eventsStatistics { background: #fff; padding: 24px; border-radius: 16px; }
.profile-statistics-heading { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; margin: 0 0 24px; min-height: 40px; }
.profile-statistics-heading h1 { font-size: 18px; font-weight: 600; text-align: center; margin: 0; }
.profile-statistics-heading .backBtn { display: grid; place-items: center; width: 40px; height: 40px; margin: 0; padding: 8px; border: 0; border-radius: 0; background: transparent; color: #30343a; box-shadow: none; }
.profile-statistics-heading svg { width: 24px; height: 24px; }
@media (max-width: 1100px) {
 body.page-profile:has(.eventsStatistics) { background: #fff; }
 body.page-profile .eventsStatistics { padding: calc(76px + env(safe-area-inset-top)) 16px 80px; border-radius: 0; }
 .profile-statistics-heading { position: fixed; top: 0; left: 0; right: 0; z-index: 2500; height: calc(60px + env(safe-area-inset-top)); box-sizing: border-box; padding: env(safe-area-inset-top) 12px 0; margin: 0; background: #fff; }
}

.mobile-search-dialog .search-suggestions { margin:20px 0 0; padding:0; }
.search-suggestions[hidden] { display:none; }
.search-suggestion { display:flex; flex-direction:column; gap:5px; padding:14px 12px; color:#30343a; text-decoration:none; border-radius:10px; }
.search-suggestion strong { font-size:15px; font-weight:500; line-height:1.4; }
.search-suggestion small { font-size:12px; color:#8a919b; }
.search-suggestion:hover, .search-suggestion[aria-selected=true] { background:#f4f5f6; }
.search-suggestions-status { margin:20px 12px; color:#8a919b; font-size:14px; line-height:1.5; }
.search-suggestions-status:empty { display:none; }

/* Unified mobile screen headings: 60px bar, 12px gutter, 40px back target. */
@media (max-width:1100px) {
 body :is(.profile-menu-heading,.profile-editor-heading,.profile-statistics-heading,.admin-profile-heading,.publication-page-heading,.mobile-search-heading,.organizations-directory__header,.feedback-screen-heading,.report-screen-heading,.organization-message-heading) { display:grid !important; grid-template-columns:40px minmax(0,1fr) 40px !important; align-items:center !important; gap:0 !important; height:calc(60px + env(safe-area-inset-top)) !important; min-height:calc(60px + env(safe-area-inset-top)) !important; box-sizing:border-box !important; padding:env(safe-area-inset-top) 12px 0 !important; }
 body :is(.profile-menu-heading,.profile-editor-heading,.profile-statistics-heading,.admin-profile-heading,.publication-page-heading,.mobile-search-heading,.organizations-directory__header,.feedback-screen-heading,.report-screen-heading) > :is(a,button) { display:grid !important; place-items:center !important; width:40px !important; height:40px !important; padding:8px !important; margin:0 !important; border:0 !important; background:transparent !important; box-shadow:none !important; color:#30343a !important; }
 body :is(.profile-menu-heading,.profile-editor-heading,.profile-statistics-heading,.admin-profile-heading,.publication-page-heading,.mobile-search-heading,.organizations-directory__header,.feedback-screen-heading,.report-screen-heading) :is(h1,h2,.profileEditTitle) { margin:0 !important; padding:0 !important; font-size:18px !important; line-height:24px !important; font-weight:600 !important; text-align:center !important; }
 body :is(.profile-menu-heading,.profile-editor-heading,.profile-statistics-heading,.admin-profile-heading,.publication-page-heading,.mobile-search-heading,.organizations-directory__header,.feedback-screen-heading,.report-screen-heading) > :is(a,button) svg { width:24px !important; height:24px !important; }
 body.page-profile .profile-menu-heading { margin:-16px -16px 16px !important; width:calc(100% + 32px); }
 body.page-publication .publication-page-heading { margin:-16px -16px 20px !important; width:calc(100% + 32px); }
 body .mobile-search-heading { margin:-16px -16px 12px !important; width:calc(100% + 32px); }
}
/* Navigation clearance belongs to main, not both main and footer. */
@media (max-width:1100px) {
 body.page-profile > main > .profile-footer { padding-bottom:16px !important; }
 body.page-profile > main:has(> .settings.profile-menu) { padding-bottom:calc(58px + env(safe-area-inset-bottom)) !important; }
}
