:root {
    --primary: #0071e3;
    --primary-hover: #0077ed;
    --primary-light: #e8f2ff;
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --border: rgba(0, 0, 0, 0.08);
    --hairline: rgba(0, 0, 0, 0.06);
    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 26px;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    color-scheme: light;
}

/* Тёмная тема — на <html>, сработает ДО рендера body */
html.dark-theme {
    --bg-color: #000000;
    --card-bg: #1c1c1e;
    --text-main: #f5f5f7;
    --text-muted: #98989d;
    --border: rgba(255, 255, 255, 0.1);
    --primary-light: #0a2a52;
    color-scheme: dark;
}

/* ==================================================== */
/* FOCUS-RING — APPLE ДВОЙНОЕ КОЛЬЦО                    */
/* ==================================================== */
*:focus {
    outline: none;
}

input#dashboard-messages-search-input:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14) !important;
    -webkit-box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14) !important;
    border-radius: 100px !important;
    outline: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable",
        "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================================================== */
/* FIX #1: СКРОЛЛ ПО ВСЕЙ ПЛОЩАДИ, А НЕ ПО БОКАМ         */
/* html + body = жёсткий вьюпорт, скролл живёт в .main-content */
/* ==================================================== */

html {
    background: transparent;
    height: 100%;
    overflow: hidden;
    /* FIX #1: html не скроллится вообще */
    overscroll-behavior: none;
    /* FIX #1: убираем «резиновые» края */
}

body {
    background-color: transparent;
    color: var(--text-main);
    display: flex;
    flex-direction: row;
    height: 100vh;
    /* FIX #1: жёсткая высота вместо position: fixed */
    min-height: 100vh;
    overflow: hidden;
    /* FIX #1: body не скроллится */
    overscroll-behavior: none;
    /* FIX #1: ни один жест не «просочится» наружу */
    transition: background-color 0.4s var(--ease-smooth), color 0.4s var(--ease-smooth);
}

/* ==================================================== */
/* ТЕМНАЯ ТЕМА                                          */
/* ==================================================== */
body.dark-theme {
    color-scheme: dark;
}

body.dark-theme .form-control {
    background-color: #2c2c2e;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .price-box {
    background: linear-gradient(135deg, #0a2a52 0%, #061a33 100%);
    border-color: rgba(0, 113, 227, 0.4);
}

body.dark-theme .concrete-row {
    background-color: #2c2c2e;
}

body.dark-theme .feed-card,
body.dark-theme .profile-header-card,
body.dark-theme .market-card {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .market-img {
    background: #2c2c2e !important;
}

body.dark-theme .auth-card {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .filter-btn {
    border-color: rgba(255, 255, 255, 0.12);
    color: #98989d;
    background: #1c1c1e;
}

body.dark-theme .filter-btn:hover,
body.dark-theme .filter-btn.active {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
}

body.dark-theme .element-btn {
    border-color: rgba(255, 255, 255, 0.12);
    color: #98989d;
    background: #1c1c1e;
}

body.dark-theme .cabinet-sidebar,
body.dark-theme .cabinet-content {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .cabinet-item {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .cabinet-reviews-summary {
    background: #2c2c2e;
}

body.dark-theme .chat-msg.received {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .loc-dropdown-panel {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

body.dark-theme .profile-btn {
    border-color: rgba(255, 255, 255, 0.12);
    color: #98989d;
    background: #1c1c1e;
}

body.dark-theme .dashboard-card {
    background: rgba(28, 28, 30, 0.55);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.dark-theme .fullscreen-close-btn {
    background: #1c1c1e;
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.1);
}
/* ==================================================== */
/* ТЕМА — СЛАЙДЕР В ШАПКЕ (ПК)                          */
/* ==================================================== */

body:not(.mobile-device) .theme-pill {
    position: relative;
    overflow: visible;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    min-width: 76px;
}

/* Скрываем чекбокс визуально, но не display:none, чтобы работали события */
body:not(.mobile-device) .theme-pill input#theme-toggle-mobile {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

body:not(.mobile-device) .theme-track {
    display: block;
    width: 52px;
    height: 28px;
    border-radius: 20px;
    background: rgba(120, 120, 128, 0.18);
    position: relative;
    transition: background-color 0.48s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s ease;
    overflow: hidden;
    pointer-events: none;
    flex-shrink: 0;
}

html.dark-theme body:not(.mobile-device) .theme-track {
    background: rgba(120, 120, 128, 0.32);
}

body:not(.mobile-device) .theme-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #ffffff;
    color: #1d1d1f;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.15),
        0 0 0 0.5px rgba(0, 0, 0, 0.04);
    transform: translateX(0) scale(1);
    transition:
        transform 0.48s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 0.36s ease,
        box-shadow 0.36s ease;
    z-index: 2;
    pointer-events: none;
    will-change: transform;
}

html.dark-theme body:not(.mobile-device) .theme-slider {
    transform: translate3d(24px, 0, 0);
    background: #f5f5f7;
    color: #1d1d1f;
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.3),
        0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

body:not(.mobile-device) .theme-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
    text-align: center;
    user-select: none;
    pointer-events: none;
    color: inherit;
}

/* Активное нажатие */
body:not(.mobile-device) .theme-pill:active .theme-slider {
    transform: translateX(0) scale(0.9);
}

html.dark-theme body:not(.mobile-device) .theme-pill:active .theme-slider {
    transform: translate3d(24px, 0, 0) scale(0.92);
}
body:not(.mobile-device) .theme-track {
    transition: background-color 0.48s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s ease;
}
body:not(.mobile-device) .theme-slider {
    transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.36s ease, box-shadow 0.36s ease;
}
@media (prefers-reduced-motion: reduce) {
    body:not(.mobile-device) .theme-track,
    body:not(.mobile-device) .theme-slider {
        transition-duration: 1ms;
    }
}

body:not(.mobile-device) .theme-track {
    transition: background-color 0.48s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s ease;
}

body:not(.mobile-device) .theme-slider {
    transition:
        transform 0.48s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 0.36s ease,
        box-shadow 0.36s ease;
}

html.dark-theme body:not(.mobile-device) .theme-slider {
    transform: translate3d(24px, 0, 0);
}

body:not(.mobile-device) .theme-icon {
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
    transform: translateY(-0.5px);
}

body:not(.mobile-device) .theme-pill:active .theme-slider {
    transform: translate3d(0, 0, 0) scale(0.92);
}

html.dark-theme body:not(.mobile-device) .theme-pill:active .theme-slider {
    transform: translate3d(24px, 0, 0) scale(0.92);
}

@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 420ms;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 1ms;
    }

    body:not(.mobile-device) .theme-track,
    body:not(.mobile-device) .theme-slider {
        transition-duration: 1ms;
    }
}

body:not(.mobile-device) .theme-track {
    transition: background-color 0.48s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s ease;
}

body:not(.mobile-device) .theme-slider {
    transition:
        transform 0.48s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 0.36s ease,
        box-shadow 0.36s ease;
}

html.dark-theme body:not(.mobile-device) .theme-slider {
    transform: translate3d(24px, 0, 0);
}

body:not(.mobile-device) .theme-icon {
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
    transform: translateY(-0.5px);
}

body:not(.mobile-device) .theme-pill:active .theme-slider {
    transform: translate3d(0, 0, 0) scale(0.92);
}

html.dark-theme body:not(.mobile-device) .theme-pill:active .theme-slider {
    transform: translate3d(24px, 0, 0) scale(0.92);
}

@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 420ms;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 1ms;
    }

    body:not(.mobile-device) .theme-track,
    body:not(.mobile-device) .theme-slider {
        transition-duration: 1ms;
    }
}

body:not(.mobile-device) .theme-track {
    transition: background-color 0.48s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s ease;
}

body:not(.mobile-device) .theme-slider {
    transition:
        transform 0.48s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 0.36s ease,
        box-shadow 0.36s ease;
}

html.dark-theme body:not(.mobile-device) .theme-slider {
    transform: translate3d(24px, 0, 0);
}

body:not(.mobile-device) .theme-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
    transform: translateY(-0.5px);
}

body:not(.mobile-device) .theme-pill:active .theme-slider {
    transform: translate3d(0, 0, 0) scale(0.92);
}

html.dark-theme body:not(.mobile-device) .theme-pill:active .theme-slider {
    transform: translate3d(24px, 0, 0) scale(0.92);
}

@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 420ms;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 1ms;
    }

    body:not(.mobile-device) .theme-track,
    body:not(.mobile-device) .theme-slider {
        transition-duration: 1ms;
    }
}

/* Выделяем сохранение расчёта как основное действие. */
body:not(.mobile-device) .save-estimate-btn {
    border-color: transparent;
    background: linear-gradient(135deg, #0071e3, #1688ff);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.24);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.2s ease;
}

body:not(.mobile-device) .save-estimate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 113, 227, 0.32);
    filter: saturate(1.08);
}

body:not(.mobile-device) .save-estimate-btn:active {
    transform: scale(0.98);
}

body:not(.mobile-device) .calc-action-btn[onclick*="openSaveToProjectSheet"] {
    background: linear-gradient(135deg, #0071e3, #1688ff);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.26);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.2s ease;
}

body:not(.mobile-device) .calc-action-btn[onclick*="openSaveToProjectSheet"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 113, 227, 0.32);
}

body:not(.mobile-device) .calc-action-btn[onclick*="openSaveToProjectSheet"]:active {
    transform: scale(0.98);
}

body:not(.mobile-device) .calc-action-btn[onclick*="openSaveToProjectSheet"]:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

body.dark-theme:not(.mobile-device) .save-estimate-btn,
body.dark-theme:not(.mobile-device) .save-estimate-btn:hover {
    color: #fff;
}

.org-hub-header .org-hub-subtitle {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    min-height: 32px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: linear-gradient(135deg, #0071e3, #1688ff);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.24);
}

body.dark-theme .org-hub-header .org-hub-subtitle {
    background: linear-gradient(135deg, #0066cc, #1688ff);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.24);
}

body:not(.mobile-device) .company-card {
    min-height: 0;
    height: auto;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(20, 35, 55, 0.06);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

body:not(.mobile-device) .company-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 113, 227, 0.22);
    box-shadow: 0 12px 28px rgba(20, 35, 55, 0.1);
}

body.dark-theme:not(.mobile-device) .company-card:hover {
    border-color: rgba(74, 158, 255, 0.32);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

body:not(.mobile-device) .company-card-desc {
    color: var(--text-main);
    opacity: 0.78;
}

body:not(.mobile-device) .company-card-footer {
    margin-top: auto;
    padding-top: 14px;
}

body:not(.mobile-device) .company-card-btn-site {
    min-height: 40px;
    border: 0;
    background: linear-gradient(135deg, #0071e3, #1688ff);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.2);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.2s ease;
}

body.dark-theme:not(.mobile-device) .company-card-btn-site,
body.dark-theme:not(.mobile-device) .company-card-btn-site:hover {
    color: #fff;
}

body:not(.mobile-device) .company-card-btn-site:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(0, 113, 227, 0.28);
}

body:not(.mobile-device) .company-card-btn-site:active {
    transform: scale(0.98);
}

.calc-validation-message {
    display: block;
    margin-top: 6px;
    color: #d93025;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.calc-input-invalid {
    border-color: #d93025 !important;
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.12) !important;
}

.calc-action-btn:disabled,
.save-estimate-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    body:not(.mobile-device) .save-estimate-btn,
    body:not(.mobile-device) .calc-action-btn[onclick*="openSaveToProjectSheet"],
    body:not(.mobile-device) .company-card,
    body:not(.mobile-device) .company-card-btn-site {
        transition: none;
    }

    body:not(.mobile-device) .save-estimate-btn:hover,
    body:not(.mobile-device) .calc-action-btn[onclick*="openSaveToProjectSheet"]:hover,
    body:not(.mobile-device) .company-card:hover,
    body:not(.mobile-device) .company-card-btn-site:hover {
        transform: none;
    }

    body:not(.mobile-device) #organizer .org-card,
    body:not(.mobile-device) #organizer .org-btn-primary,
    body:not(.mobile-device) #organizer .org-back-btn,
    body:not(.mobile-device) #organizer .org-back-btn svg {
        transition: none !important;
    }

    body:not(.mobile-device) #organizer .org-card:hover,
    body:not(.mobile-device) #organizer .org-btn-primary:hover,
    body:not(.mobile-device) #organizer .org-back-btn:hover {
        transform: none !important;
    }

    body:not(.mobile-device) #organizer .org-back-btn:hover svg {
        transform: none !important;
    }
}


/* ==================================================== */
/* БАЗОВЫЕ ЭЛЕМЕНТЫ И ПОЛЯ ВВОДА                        */
/* ==================================================== */
input,
select,
textarea {
    font-size: 16px !important;
    font-family: inherit;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.input-group {
    margin-bottom: 16px;
    flex: 1;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    height: 44px;
    outline: none;
    transition: transform 0.2s var(--ease-spring), border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
    color: var(--text-main);
    background: var(--card-bg);
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
    transform: translateY(-1px);
}

textarea.form-control {
    padding: 12px 16px;
    height: auto;
    min-height: 80px;
    line-height: 1.4;
    resize: vertical;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%2386868b" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    padding-right: 36px;
}

/* ==================================================== */
/* FIX #2: ПЛИТКИ ДАШБОРДА — БЕЗ ДЁРГАНЬЯ ПРИ HOVER      */
/* Убираем backdrop-filter в hover, убираем overshoot    */
/* ==================================================== */

.dash-tile:focus,
.dash-tile:focus-visible,
.dash-tile.wide:focus,
.dash-tile.wide:focus-visible {
    outline: none !important;
    box-shadow: inset 0 0 0 2px var(--primary) !important;
    border-color: var(--primary) !important;
    border-radius: 12px;
}

.dash-tile:focus:not(:focus-visible),
.dash-tile.wide:focus:not(:focus-visible) {
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

body.dark-theme .dash-tile:focus:not(:focus-visible),
body.dark-theme .dash-tile.wide:focus:not(:focus-visible) {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.store-sync {
    border: 1px solid var(--border) !important;
    font-weight: 600 !important;
    background: var(--card-bg) !important;
    height: 44px;
}

.store-sync:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12) !important;
}

/* ==================================================== */
/* СТАТУС-БАР                                           */
/* ==================================================== */
.header-top-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    gap: 10px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid var(--border);
    border-radius: 100px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    height: 60px;
    box-sizing: border-box;
    /* FIX #1: blur не пересчитывается при скролле — изолируем слой */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

body.dark-theme .header-top-modern {
    background: rgba(28, 28, 30, 0.55);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.5),
        0 1px 3px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.header-top-modern .header-right-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.header-top-modern .header-left-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
}

.header-top-modern .logo-block-modern {
    position: relative;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background 0.25s var(--ease-out), transform 0.25s var(--ease-out);
    width: 40px;
    height: 40px;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-top-modern .logo-block-modern:hover {
    background: rgba(0, 113, 227, 0.1);
}

.header-top-modern .logo-block-modern.active {
    background: rgba(0, 113, 227, 0.15);
    transform: scale(1.05);
}

body.dark-theme .header-top-modern .logo-block-modern {
    background: #2c2c2e;
}

.logo-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card-bg);
    box-sizing: content-box;
}

body.dark-theme .logo-badge {
    border-color: #1c1c1e;
}

.header-top-modern .slide-blocks {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.4s var(--ease-out), opacity 0.3s var(--ease-out), margin-left 0.3s var(--ease-out);
    margin-left: 0;
    white-space: nowrap;
}

.header-top-modern .slide-blocks.open {
    max-width: 500px;
    opacity: 1;
    margin-left: 4px;
}

.slide-block-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    flex-shrink: 0;
    font-family: inherit;
    color: var(--text-main);
    white-space: nowrap;
}

.slide-block-btn:hover {
    background: rgba(0, 113, 227, 0.06);
    border-color: var(--primary);
}

.slide-block-btn.open {
    background: rgba(0, 113, 227, 0.08);
    border-color: var(--primary);
}

body.dark-theme .slide-block-btn {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .slide-block-btn:hover {
    background: rgba(0, 113, 227, 0.15);
    border-color: var(--primary);
}

.slide-block-icon {
    color: var(--primary);
    display: flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
}

.slide-block-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1;
}

.slide-block-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.slide-block-chevron {
    color: var(--text-muted);
    transition: transform 0.3s var(--ease-out);
    flex-shrink: 0;
}

.slide-block-btn.open .slide-block-chevron {
    transform: rotate(180deg);
}

.header-top-modern .actions-segmented {
    display: flex;
    align-items: stretch;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 100px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    flex: 0 0 auto;
    max-width: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    margin: 0;
    padding: 0;
}

body.dark-theme .header-top-modern .actions-segmented {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.header-top-modern .download-apps-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.header-top-modern .download-apps-trigger:hover,
.header-top-modern .download-apps-trigger[aria-expanded="true"] {
    background: rgba(0, 113, 227, 0.1);
    border-color: rgba(0, 113, 227, 0.22);
    color: var(--primary);
}

.header-top-modern .download-apps-trigger:active {
    transform: scale(0.94);
}

.header-top-modern .download-apps-trigger:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.3);
    outline-offset: 2px;
}

body.dark-theme .header-top-modern .download-apps-trigger {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.download-apps-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.download-apps-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 10px);
    left: 50%;
    width: 220px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    background: rgba(250, 250, 252, 0.84);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    transform: translateX(-50%);
    transform-origin: top center;
    animation: downloadAppsExpand 0.2s var(--ease-out);
}

body.dark-theme .download-apps-menu {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(40, 40, 43, 0.88);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.download-apps-menu[hidden] {
    display: none;
}

.download-apps-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 12px;
    border-radius: 12px;
    color: #007aff;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.18s ease;
}

.download-apps-option + .download-apps-option {
    border-top: 1px solid rgba(60, 60, 67, 0.12);
}

body.dark-theme .download-apps-option + .download-apps-option {
    border-top-color: rgba(235, 235, 245, 0.16);
}

.download-apps-option:hover,
.download-apps-option:focus-visible {
    background: rgba(0, 122, 255, 0.1);
    outline: none;
}

.download-apps-option-icon {
    width: 19px;
    height: 19px;
    color: #8e8e93;
    flex: 0 0 auto;
}

@keyframes downloadAppsExpand {
    from {
        opacity: 0;
        transform: translate(-50%, -5px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

body.mobile-device .download-apps-trigger,
body.mobile-device .download-apps-menu {
    display: none !important;
}

.header-top-modern .segmented-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 14px;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background 0.2s;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
    white-space: nowrap;
    flex: 0 0 auto;
    position: static;
    line-height: 1;
}

body.dark-theme .header-top-modern .segmented-item {
    border-right-color: rgba(255, 255, 255, 0.07);
}

.header-top-modern .segmented-item:last-child {
    border-right: none;
}

.header-top-modern .segmented-item:hover {
    background: rgba(0, 113, 227, 0.06);
}

.header-top-modern .theme-pill {
    min-width: 44px;
    padding: 0 10px;
    font-size: 16px;
    cursor: pointer;
}

.header-top-modern .lang-block {
    gap: 4px;
    padding: 0 14px;
}

.header-top-modern .lang-display-text {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
    color: var(--text-main);
    line-height: 1;
}

.header-top-modern .lang-chevron {
    color: var(--text-muted);
    width: 12px;
    height: 12px;
    transition: transform 0.3s;
}

.header-top-modern .lang-block.open .lang-chevron {
    transform: rotate(180deg);
}

.header-top-modern .feedback-block {
    min-width: 44px;
    padding: 0 12px;
    font-size: 16px;
    line-height: 1;
}

.header-top-modern .feedback-block span {
    line-height: 1;
    display: inline-block;
}

.header-top-modern .profile-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0 14px 0 10px;
    min-width: 0;
}

.header-top-modern .profile-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
    border: none;
    line-height: 1;
}

.header-top-modern .profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-top-modern .profile-name {
    font-size: 13px;
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-main);
    text-align: left;
    line-height: 1;
}

/* ==================================================== */
/* ПАНЕЛИ (Органайзер + Смета)                           */
/* ==================================================== */
.organizer-panel,
.estimate-panel {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 380px;
    max-width: calc(100vw - 24px);
    max-height: 480px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 14px;
    z-index: 2147483646;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.22s var(--ease-out), transform 0.3s var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: 10px;
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
}

body.dark-theme .organizer-panel,
body.dark-theme .estimate-panel {
    background: rgba(28, 28, 30, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
}

.organizer-panel.open,
.estimate-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.estimate-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 4px 8px;
    border-bottom: 1px solid var(--border);
}

.estimate-panel-count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.estimate-panel-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    min-height: 40px;
    overscroll-behavior: contain;
}

.estimate-panel-empty {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.estimate-item {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    transition: background 0.2s var(--ease-out);
}

body.dark-theme .estimate-item {
    background: #2c2c2e;
}

.estimate-item:hover {
    background: var(--primary-light);
}

.estimate-item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    padding-right: 26px;
    line-height: 1.2;
}

.estimate-item-source {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

.estimate-item-details {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.3;
    white-space: pre-line;
}

.estimate-item-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 2px;
}

.estimate-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.estimate-item-delete:hover {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
    transform: scale(1.15);
}

.estimate-panel-clear {
    width: 100%;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    flex-shrink: 0;
}

.estimate-panel-clear:hover {
    color: #ff3b30;
    border-color: #ff3b30;
}



/* ==================================================== */
/* FIX #1: ДАШБОРД — НЕ СКРОЛЛИТСЯ (его колонки скроллятся) */
/* ==================================================== */
.dashboard-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow: hidden;
    background: transparent;
    z-index: 100;
    transition: transform 0.5s var(--ease-out), opacity 0.3s var(--ease-out);
}

body.fullscreen-active .dashboard-screen {
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    pointer-events: none;
}

.dashboard-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    align-items: stretch;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    position: relative;
    /* FIX #1: изолируем blur-слой, чтобы не пересчитывался при скролле внутри */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

.dashboard-card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 18px;
    flex-shrink: 0;
}

/* ==================================================== */
/* FIX #2: СПИСОК ПЛИТОК — БЕЗ ДЁРГАНЬЯ                 */
/* Добавлен contain, убран лишний padding-right         */
/* ==================================================== */
.dashboard-tile-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: max-content;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 4px 4px 2px;
    align-content: start;
    /* FIX #1: плавный скролл без баунса */
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.dashboard-tile-list::-webkit-scrollbar {
    width: 4px;
}

.dashboard-tile-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ==================================================== */
/* FIX #2: ПЛИТКИ — УБИРАЕМ ДЁРГАНЬЕ ПРИ HOVER           */
/* 1. Убран backdrop-filter из hover (не пересчитывается) */
/* 2. Заменена пружинная анимация на ease-out            */
/* 3. box-shadow через transform-friendly transition     */
/* ==================================================== */
.dash-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 4px 8px;
    aspect-ratio: 1 / 1;
    width: 100%;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-main);
    text-align: center;
    overflow: hidden;
    /* FIX #2: изолируем слой и убираем пружинную анимацию */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    transition:
        background 0.2s var(--ease-out),
        border-color 0.2s var(--ease-out),
        box-shadow 0.2s var(--ease-out);
    /* transform НЕ анимируем — это вызывает дёрганье */
}

.dash-tile:hover {
    background: rgba(232, 242, 255, 0.85);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.15);
    /* Без transform — плитка не «прыгает» */
}

.dash-tile:active {
    transform: translateZ(0) scale(0.94);
    filter: brightness(0.94);
    transition-duration: 0.1s;
    z-index: 2;
}

.dash-tile.wide:active {
    filter: brightness(0.94);
    transition-duration: 0.1s;
}

body.dark-theme .dash-tile {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
}

body.dark-theme .dash-tile:hover {
    background: rgba(0, 113, 227, 0.25);
    border-color: var(--primary);
}

.dash-tile-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    flex-shrink: 0;
    transition: transform 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.dash-tile-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    display: block;
}

.dash-tile:hover .dash-tile-icon {
    transform: scale(1.1);
    color: var(--primary);
}

.dash-tile-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-main);
    transition: color 0.2s var(--ease-out);
    line-height: 1.15;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

.dash-tile:hover .dash-tile-label {
    color: var(--primary);
}

.dashboard-tile-list.community-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.dash-tile.wide {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    min-height: 64px;
    aspect-ratio: auto;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 14px;
    text-align: left;
    width: 100%;
    flex-shrink: 0;
    /* FIX #2: без transform при hover */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    transition:
        background 0.2s var(--ease-out),
        border-color 0.2s var(--ease-out),
        box-shadow 0.2s var(--ease-out);
}

.dash-tile.wide .dash-tile-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.dash-tile.wide .dash-tile-label {
    font-size: 14px;
    text-align: left;
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.dash-tile.wide:hover {
    background: rgba(232, 242, 255, 0.85);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.15);
    /* Без translateX — не дёргается */
}

body.dark-theme .dash-tile.wide {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .dash-tile.wide:hover {
    background: rgba(0, 113, 227, 0.25);
    border-color: var(--primary);
}

/* ==================================================== */
/* СООБЩЕНИЯ НА ДАШБОРДЕ                                */
/* ==================================================== */
#dashboard-messages-card {
    padding: 0 !important;
    overflow: hidden !important;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dashboard-messages-pages {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.dashboard-messages-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: transparent;
    transition: transform 0.32s var(--ease-out), opacity 0.24s var(--ease-out), visibility 0s linear;
    box-sizing: border-box;
    overflow: hidden;
    /* FIX #1: убран will-change — он заставлял Safari пересчитывать слои */
}

.dashboard-messages-page-list {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.dashboard-messages-page-list .dashboard-card-title {
    flex-shrink: 0;
    margin-bottom: 18px;
}

.dashboard-messages-page-list #dashboard-chat-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.dashboard-messages-page-chat {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    padding: 0;
    display: flex;
    flex-direction: column;
    visibility: hidden;
}

#dashboard-messages-card.chat-open .dashboard-messages-page-list {
    transform: translateX(-30%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

#dashboard-messages-card.chat-open .dashboard-messages-page-chat {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ==================================================== */
/* СПИСОК ЧАТОВ (внутри карточки)                       */
/* ==================================================== */
.dashboard-chat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.dashboard-chat-list::-webkit-scrollbar {
    width: 4px;
}

.dashboard-chat-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.dashboard-chat-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    flex-shrink: 0;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.dashboard-chat-item:hover {
    background: rgba(232, 242, 255, 0.85);
    border-color: var(--primary);
}

body.dark-theme .dashboard-chat-item {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .dashboard-chat-item:hover {
    background: rgba(0, 113, 227, 0.25);
    border-color: var(--primary);
}

.dashboard-chat-item .avatar {
    width: 38px;
    height: 38px;
    font-size: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dashboard-chat-info {
    flex: 1;
    min-width: 0;
}

.dashboard-chat-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-chat-last {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-chat-badge {
    background: #ff3b30;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ==================================================== */
/* ЧАТ ВНУТРИ КАРТОЧКИ                                  */
/* ==================================================== */
.dashboard-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.dashboard-chat-back {
    background: transparent;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    flex-shrink: 0;
    padding: 0;
}

.dashboard-chat-back:hover {
    background: var(--primary-light);
}

.dashboard-chat-back:active {
    transform: scale(0.9);
}

body.dark-theme .dashboard-chat-back:hover {
    background: rgba(0, 113, 227, 0.2);
}

.dashboard-chat-avatar {
    width: 38px;
    height: 38px;
    font-size: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dashboard-chat-header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dashboard-chat-header-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.dashboard-chat-header-status {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
}

#dashboard-chat-messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 16px 16px 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-color);
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.dark-theme #dashboard-chat-messages {
    background: rgba(28, 28, 30, 0.6);
}

#dashboard-chat-messages::-webkit-scrollbar {
    width: 4px;
}

#dashboard-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

#dashboard-chat-messages .chat-msg {
    max-width: 80%;
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.4;
    word-wrap: break-word;
    animation: slideInMsg 0.3s var(--ease-out);
}

#dashboard-chat-messages .chat-msg.sent {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 113, 227, 0.22);
}

#dashboard-chat-messages .chat-msg.received {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: var(--shadow-xs);
}

body.dark-theme #dashboard-chat-messages .chat-msg.received {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

#dashboard-chat-messages .chat-msg-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 3px;
    text-align: right;
}

.dashboard-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    align-items: center;
}

.dashboard-chat-input {
    flex: 1;
    height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s var(--ease-out);
    min-width: 0;
}

.dashboard-chat-input:focus {
    border-color: var(--primary);
}

body.dark-theme .dashboard-chat-input {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.1);
}

.dashboard-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: transform 0.2s var(--ease-out), background 0.2s var(--ease-out);
    box-shadow: 0 4px 10px rgba(0, 113, 227, 0.3);
}

.dashboard-chat-send:hover {
    background: var(--primary-hover);
    transform: scale(1.06);
}

.dashboard-chat-send:active {
    transform: scale(0.92);
}

/* ==================================================== */
/* КНОПКА «НАЗАД»                                       */
/* ==================================================== */
.fullscreen-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px 10px 14px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.25s var(--ease-out),
        transform 0.25s var(--ease-out),
        background 0.2s var(--ease-out),
        border-color 0.2s var(--ease-out),
        box-shadow 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    margin-bottom: 20px;
    width: fit-content;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.fullscreen-close-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s var(--ease-out);
}

.fullscreen-close-btn span {
    line-height: 1;
}

body.fullscreen-active .fullscreen-close-btn {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.fullscreen-close-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 113, 227, 0.35);
}

.fullscreen-close-btn:hover svg {
    transform: translateX(-3px);
}

.fullscreen-close-btn:active {
    transform: translateY(0) scale(0.96);
}

body.dark-theme .fullscreen-close-btn {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .fullscreen-close-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}



@keyframes fullscreenIn {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(12px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.section-content {
    display: none;
}

.section-content.active {
    display: block;
    animation: pageIn 0.35s var(--ease-out);
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================================================== */
/* КАРТОЧКИ И ЛЕЙАУТЫ                                   */
/* ==================================================== */
.layout-2col {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.col-left {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.col-right {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sticky-card {
    position: sticky;
    top: 24px;
}

.grid-3col-custom {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.1fr;
    gap: 14px;
    align-items: stretch;
}

.h-100 {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.concrete-results-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 22px;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.grid-2col .input-group,
.grid-3col .input-group {
    margin-bottom: 0;
}

.align-bottom {
    align-items: flex-end;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
    width: 100%;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 113, 227, 0.15);
}

body.dark-theme .card:hover {
    border-color: rgba(0, 113, 227, 0.25);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mt-15 {
    margin-top: 10px;
}

.mb-15 {
    margin-bottom: 10px;
}

.flex-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
}

.flex-row .form-control {
    width: auto;
    flex: 1 1 auto;
    height: 44px;
    margin-bottom: 0;
}

.flex-row>.btn-primary,
.flex-row>.btn-primary-large,
.flex-row>.btn-outline {
    height: 44px !important;
    min-height: 44px;
    padding: 0 20px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    box-sizing: border-box;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 12px !important;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

.btn-primary-large {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
    margin-top: 15px;
}

.btn-primary-large:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
}

.btn-primary-large:active {
    transform: scale(0.96);
    filter: brightness(0.92);
    transition-duration: 0.1s;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 9px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.btn-outline:hover,
.btn-outline.active {
    background: var(--primary-light);
}

.btn-outline:active {
    transform: scale(0.96);
    filter: brightness(0.94);
    transition-duration: 0.1s;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

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

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 9px 18px;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    border-radius: 100px;
    font-weight: 500;
    font-size: 13px;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.filter-btn:active {
    filter: brightness(0.93);
    transition-duration: 0.1s;
}

.element-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding-bottom: 6px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
    padding-bottom: 6px;
}

.element-btn,
.profile-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    min-height: 52px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    font-family: inherit;
}

.element-btn span,
.profile-btn span {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.2px;
}

.element-btn svg,
.profile-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s var(--ease-out);
    stroke: var(--text-muted);
}

.element-btn:hover,
.profile-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.element-btn.active,
.profile-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.15);
}

.element-btn.active svg,
.profile-btn.active svg {
    stroke: var(--primary);
}

.concrete-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    min-height: 34px;
    background: var(--bg-color);
    border-radius: 8px;
    font-weight: 500;
    font-size: 12.5px;
    margin-bottom: 0;
    transition: background 0.2s var(--ease-out);
}

.concrete-row:hover {
    background: var(--primary-light);
}

.concrete-row span {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.concrete-row strong {
    color: var(--text-main);
    font-weight: 600;
    font-size: 12.5px;
    flex: 1;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-box {
    border: 1px solid rgba(0, 113, 227, 0.18);
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border-radius: 12px;
    padding: 16px 18px;
    text-align: center;
    margin-top: 12px;
}

.price-box>div:first-child {
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
    color: var(--text-muted);
}

.price-box>div:nth-child(2) {
    font-size: 24px !important;
    font-weight: 800 !important;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 4px !important;
    color: var(--primary) !important;
}

.price-box>div:nth-child(3) {
    font-size: 12px !important;
    color: var(--text-muted);
    font-weight: 600;
}

/* ==================================================== */
/* МОДАЛЬНЫЕ ОКНА                                       */
/* ==================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    transition: opacity 0.25s var(--ease-out);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.auth-card {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-radius: 28px;
    padding: 38px 32px 32px;
    width: 92%;
    max-width: 440px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.22),
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 2px 6px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: scale(0.94) translateY(16px);
    opacity: 0;
    transition:
        transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1),
        opacity 0.28s ease;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.auth-card::-webkit-scrollbar {
    display: none;
}

body.dark-theme .auth-card {
    background: rgba(28, 28, 30, 0.82);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.7),
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 2px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.modal-overlay.active .auth-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ==================================================== */
/* APPLE STYLE AUTH MODAL — карточка входа/регистрации   */
/* ==================================================== */

/* Заголовок с иконкой */
#auth-modal .auth-card>div:first-of-type {
    text-align: center;
    margin-bottom: 26px;
}

#auth-modal .auth-card h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-main);
    margin: 0;
}

/* Иконка-эмблема сверху */
#auth-modal .auth-card>div:first-of-type>div[data-icon] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 22px;
    background: linear-gradient(135deg, #0071e3 0%, #5a9bff 100%);
    color: #fff !important;
    margin: 0 auto 18px !important;
    box-shadow:
        0 14px 32px rgba(0, 113, 227, 0.4),
        0 4px 12px rgba(0, 113, 227, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

#auth-modal .auth-card>div:first-of-type>div[data-icon] svg {
    width: 32px;
    height: 32px;
    stroke: #fff;
    fill: none;
    display: block;
}

/* Поля ввода */
#auth-modal .input-group {
    margin-bottom: 14px;
}

#auth-modal .input-group input.form-control {
    height: 52px;
    padding: 0 18px;
    font-size: 16px !important;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background: rgba(120, 120, 128, 0.1);
    color: var(--text-main);
    transition:
        background 0.2s ease,
        border-color 0.25s ease,
        box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.2s ease;
}

body.dark-theme #auth-modal .input-group input.form-control {
    background: rgba(120, 120, 128, 0.18);
}

#auth-modal .input-group input.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    font-weight: 500;
}

#auth-modal .input-group input.form-control:focus {
    background: var(--card-bg);
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(0, 113, 227, 0.14),
        0 4px 12px rgba(0, 113, 227, 0.12);
    transform: translateY(-1px);
    outline: none;
}

body.dark-theme #auth-modal .input-group input.form-control:focus {
    background: #2c2c2e;
    box-shadow:
        0 0 0 4px rgba(0, 113, 227, 0.32),
        0 4px 12px rgba(0, 113, 227, 0.25);
}

/* Чекбокс «Запомнить меня» — Apple-стиль, но квадратный на ПК */
#auth-modal .input-group:has(#auth-remember),
#auth-modal .input-group:has(#reg-remember) {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 22px;
    padding: 2px 4px;
}

#auth-modal #auth-remember,
#auth-modal #reg-remember {
    appearance: none;
    -webkit-appearance: none;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    border-radius: 6px;
    border: 2px solid rgba(120, 120, 128, 0.4);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    padding: 0;
    margin: 0;
}

#auth-modal #auth-remember:hover,
#auth-modal #reg-remember:hover {
    border-color: var(--primary);
}

#auth-modal #auth-remember:checked,
#auth-modal #reg-remember:checked {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
}

#auth-modal #auth-remember::after,
#auth-modal #reg-remember::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
}

#auth-modal #auth-remember:checked::after,
#auth-modal #reg-remember:checked::after {
    transform: rotate(45deg) scale(1);
    opacity: 1;
}

#auth-modal #auth-remember:active,
#auth-modal #reg-remember:active {
    transform: scale(0.9);
}

#auth-modal .input-group:has(#auth-remember) label,
#auth-modal .input-group:has(#reg-remember) label {
    margin: 0 !important;
    cursor: pointer;
    color: var(--text-main) !important;
    font-size: 14.5px !important;
    font-weight: 500;
    user-select: none;
}

/* Кнопка «Войти» */
#auth-modal .btn-primary-large {
    height: 54px;
    border-radius: 16px;
    font-size: 16.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    color: #fff;
    border: none;
    margin-top: 8px;
    box-shadow:
        0 8px 22px rgba(0, 113, 227, 0.35),
        0 2px 6px rgba(0, 113, 227, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition:
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.15s ease;
}

#auth-modal .btn-primary-large:hover {
    box-shadow:
        0 12px 28px rgba(0, 113, 227, 0.45),
        0 4px 10px rgba(0, 113, 227, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

#auth-modal .btn-primary-large:active {
    transform: scale(0.97) translateY(0);
    filter: brightness(0.94);
    box-shadow:
        0 3px 10px rgba(0, 113, 227, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition-duration: 0.1s;
}

/* Кнопка «Зарегистрироваться» — зелёный градиент */
#auth-modal #register-form .btn-primary-large {
    background: linear-gradient(135deg, #198754 0%, #20a866 100%);
    box-shadow:
        0 8px 22px rgba(25, 135, 84, 0.35),
        0 2px 6px rgba(25, 135, 84, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#auth-modal #register-form .btn-primary-large:hover {
    box-shadow:
        0 12px 28px rgba(25, 135, 84, 0.45),
        0 4px 10px rgba(25, 135, 84, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Ссылки «Забыли пароль?» / «Создать аккаунт» / «Уже есть аккаунт?» */
#auth-modal #login-form>p,
#auth-modal #register-form>p {
    font-size: 14px !important;
    margin-top: 14px !important;
    line-height: 1.4;
}

#auth-modal #login-form>p:first-of-type a,
#auth-modal #register-form>p a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 10px;
    display: inline-block;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

#auth-modal #login-form>p:first-of-type a:hover,
#auth-modal #register-form>p a:hover {
    background: rgba(0, 113, 227, 0.08);
}

#auth-modal #login-form>p:first-of-type a:active,
#auth-modal #register-form>p a:active {
    transform: scale(0.96);
}

#auth-modal #login-form>p:last-child,
#auth-modal #register-form>p:last-child {
    color: var(--text-muted) !important;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 12px;
    display: inline-block;
    width: 100%;
    margin-left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    transition: background 0.2s ease;
}

#auth-modal #login-form>p:last-child:hover,
#auth-modal #register-form>p:last-child:hover {
    background: rgba(120, 120, 128, 0.08);
}

#auth-modal #login-form>p:last-child:active,
#auth-modal #register-form>p:last-child:active {
    background: rgba(120, 120, 128, 0.14);
}

#auth-modal #login-form>p:last-child span,
#auth-modal #register-form>p:last-child span {
    color: var(--primary);
    font-weight: 700;
}

/* Кнопка закрытия */
#auth-modal .close-modal {
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    background: rgba(120, 120, 128, 0.14);
    color: var(--text-muted);
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#auth-modal .close-modal:hover,
#auth-modal .close-modal:focus-visible {
    background: #ff3b30;
    color: #fff;
    transform: rotate(90deg) scale(1.08);
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35);
    outline: none;
}

#auth-modal .close-modal:active {
    transform: rotate(90deg) scale(0.9);
    background: #e0342b;
    transition-duration: 0.15s;
}

/* Секция регистрации — плавное появление */
#auth-modal #register-form {
    animation: authFormSlide 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes authFormSlide {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Модалки восстановления пароля и смены email — тот же стиль */
#modal-forgot-password .input-group input.form-control,
#modal-change-email .input-group input.form-control {
    height: 52px;
    padding: 0 18px;
    font-size: 16px !important;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background: rgba(120, 120, 128, 0.1);
    color: var(--text-main);
    transition:
        background 0.2s ease,
        border-color 0.25s ease,
        box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-theme #modal-forgot-password .input-group input.form-control,
body.dark-theme #modal-change-email .input-group input.form-control {
    background: rgba(120, 120, 128, 0.18);
}

#modal-forgot-password .input-group input.form-control:focus,
#modal-change-email .input-group input.form-control:focus {
    background: var(--card-bg);
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(0, 113, 227, 0.14),
        0 4px 12px rgba(0, 113, 227, 0.12);
    outline: none;
}

#modal-forgot-password .btn-primary-large,
#modal-change-email .btn-primary-large {
    height: 54px;
    border-radius: 16px;
    font-size: 16.5px;
    font-weight: 700;
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    box-shadow:
        0 8px 22px rgba(0, 113, 227, 0.35),
        0 2px 6px rgba(0, 113, 227, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#modal-forgot-password .btn-primary-large:active,
#modal-change-email .btn-primary-large:active {
    transform: scale(0.97);
    box-shadow:
        0 3px 10px rgba(0, 113, 227, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ==================================================== */
/* КРЕСТИКИ ЗАКРЫТИЯ                                    */
/* ==================================================== */
.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-color);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 15px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.25s var(--ease-out);
    z-index: 9999;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

#modal-view-profile .close-modal {
    z-index: 10000;
}

.close-modal span,
.close-modal svg {
    transition: transform 0.25s var(--ease-out);
    pointer-events: none;
}

.close-modal:hover,
.close-modal:focus-visible {
    background: #ff3b30;
    color: #ffffff;
    transform: rotate(90deg) scale(1.08);
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35);
    outline: none;
}

.close-modal:active {
    transform: rotate(90deg) scale(0.9);
    background: #e0342b;
    transition-duration: 0.15s;
}

body.dark-theme .close-modal {
    background: #2c2c2e;
}

body.dark-theme .close-modal:hover,
body.dark-theme .close-modal:focus-visible {
    background: #ff453a;
    color: #ffffff;
}

.feed-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.feed-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #5a9bff);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    text-transform: uppercase;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.large-avatar {
    width: 72px;
    height: 72px;
    font-size: 30px;
}

.author-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
    cursor: pointer;
    transition: color 0.2s var(--ease-out);
    display: flex;
    align-items: center;
}

.author-name:hover {
    color: var(--primary);
}

.feed-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.price-tag {
    font-size: 18px;
    font-weight: 700;
    color: #34c759;
    letter-spacing: -0.02em;
}

.market-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.market-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 113, 227, 0.2);
}

.market-img {
    height: 170px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
}

.market-info {
    padding: 16px;
}

.market-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.market-title {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 10px;
    font-weight: 500;
}

.market-loc {
    font-size: 12px;
    color: var(--text-muted);
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    border-radius: 14px;
    cursor: pointer;
    background: var(--card-bg);
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.rating-row:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.blueprint-placeholder {
    height: 120px;
    background: var(--bg-color);
    border: 2px dashed var(--border);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
    overflow: hidden;
    padding: 6px;
}

.blueprint-placeholder svg {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
}

/* ==================================================== */
/* ЛИЧНЫЙ КАБИНЕТ                                       */
/* ==================================================== */
.cabinet-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
    align-items: start;
    min-height: 600px;
}

.cabinet-sidebar {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 24px;
    box-shadow: var(--shadow-sm);
}

.cabinet-avatar-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.cabinet-avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0071e3 0%, #5a9bff 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(0, 113, 227, 0.35);
    position: relative;
    cursor: pointer;
    transition: transform 0.25s var(--ease-out);
    overflow: hidden;
}

.screed-estimate-note {
    grid-column: 1 / -1;
    padding: 5px 8px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.4;
}

.cabinet-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cabinet-avatar #cab-avatar-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    padding-top: 22px;
}

.cabinet-avatar-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cabinet-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.cabinet-role {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cabinet-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cabinet-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
    text-align: left;
    font-family: inherit;
    width: 100%;
}

.cabinet-nav-btn:hover {
    background: var(--bg-color);
    color: var(--text-main);
}

.cabinet-nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.3);
}

.cabinet-nav-btn:active {
    filter: brightness(0.94);
    transition-duration: 0.1s;
}

.cabinet-nav-icon {
    font-size: 18px;
    width: 22px;
    display: flex;
    justify-content: center;
}

.cabinet-nav-label {
    flex: 1;
}

.cabinet-nav-count {
    background: var(--bg-color);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.cabinet-nav-danger {
    margin-top: 15px;
    color: #ff3b30 !important;
    border-top: 1px solid var(--border);
    padding-top: 15px;
    border-radius: 0;
}

.cabinet-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 32px;
    min-height: 500px;
    box-shadow: var(--shadow-sm);
}

.cabinet-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.cabinet-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 26px;
}

.cabinet-pane {
    display: none;
}

.cabinet-pane.active {
    display: block;
    animation: pageIn 0.35s var(--ease-out);
}

.cabinet-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cabinet-empty {
    padding: 44px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
}

.cabinet-item {
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: border-color 0.2s var(--ease-out);
    min-width: 0;
    overflow: hidden;
}

.cabinet-item:hover {
    border-color: rgba(0, 113, 227, 0.3);
}

.cabinet-item-info {
    flex: 1;
    min-width: 0;
}

.cabinet-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cabinet-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.cabinet-item-price {
    font-weight: 700;
    color: #34c759;
    font-size: 15px;
    white-space: nowrap;
}

.cabinet-reviews-summary {
    display: flex;
    justify-content: center;
    padding: 28px;
    background: var(--bg-color);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.cabinet-rating-box {
    text-align: center;
}

.cabinet-rating-value {
    font-size: 52px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -0.04em;
}

.cabinet-rating-stars {
    font-size: 20px;
    margin: 10px 0;
    letter-spacing: 3px;
}

.cabinet-rating-count {
    font-size: 13px;
    color: var(--text-muted);
}

.cab-item-delete {
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s var(--ease-out);
}

.cab-item-delete:hover {
    background: #e0342b;
}

.cabinet-item-job {
    align-items: flex-start !important;
}

/* ==================================================== */
/* ЧАТЫ И СООБЩЕНИЯ (секция messages)                   */
/* ==================================================== */
.chat-fab {
    display: none !important;
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff3b30;
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.chat-list-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s var(--ease-out);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
}

.chat-list-item:hover {
    background: var(--bg-color);
}

.chat-list-item.active {
    background: var(--primary-light);
}

.chat-list-item .chat-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.chat-list-item .chat-last {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.chat-msg {
    max-width: 75%;
    padding: 11px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    position: relative;
    word-wrap: break-word;
    animation: slideInMsg 0.3s var(--ease-out);
}

.chat-msg.sent {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

.chat-msg.received {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow-xs);
}

.chat-msg-time {
    font-size: 10px;
    opacity: 0.65;
    margin-top: 5px;
    text-align: right;
}

#chat-messages {
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

@keyframes slideInMsg {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.msg-status {
    font-size: 10px;
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.6);
}

.msg-status.read {
    color: #ffffff;
    font-weight: bold;
}

.unread-badge {
    background: #ff3b30;
    color: white;
    border-radius: 50%;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
}

/* ==================================================== */
/* ДРОПДАУН ЛОКАЦИЙ                                     */
/* ==================================================== */
.loc-dropdown {
    position: relative;
    display: inline-block;
    width: 260px;
    max-width: 100%;
}

.loc-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 0 16px;
    height: 44px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    font-family: inherit;
    text-align: left;
}

.loc-dropdown-toggle:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.12);
}

.loc-dropdown.open .loc-dropdown-toggle {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.2);
}

.loc-icon {
    flex-shrink: 0;
    font-size: 14px;
    width: 18px;
    text-align: center;
}

.loc-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loc-chevron {
    flex-shrink: 0;
    transition: transform 0.25s var(--ease-out);
    opacity: 0.6;
}

.loc-dropdown.open .loc-chevron {
    transform: rotate(180deg);
}

.loc-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 240px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 500;
    transition: max-height 0.3s var(--ease-out), opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
    pointer-events: none;
    overscroll-behavior: contain;
}

.loc-dropdown.open .loc-dropdown-panel {
    max-height: 500px;
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    padding: 8px 0;
}

.loc-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 18px 6px;
    letter-spacing: 0.6px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.loc-group-title:first-child {
    border-top: none;
    margin-top: 0;
}

.loc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-main);
    transition: background 0.15s var(--ease-out);
    user-select: none;
    position: relative;
}

.loc-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.loc-item.active::before {
    content: '✓';
    position: absolute;
    right: 18px;
    font-weight: bold;
    color: var(--primary);
}

.loc-item:hover {
    background: var(--bg-color);
}

/* ==================================================== */
/* UI-SELECT                                            */
/* ==================================================== */
.ui-select {
    position: relative;
    width: 100%;
}

.ui-select select.custom-select.ui-enhanced {
    background-image: none !important;
    cursor: pointer;
    padding-right: 38px;
}

.ui-select-chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    transition: transform 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.ui-select-chevron svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ui-select.open .ui-select-chevron {
    transform: translateY(-50%) rotate(180deg);
    color: var(--primary);
}

.ui-select-panel {
    position: fixed;
    z-index: 100000;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top center;
    pointer-events: none;
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.ui-select-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.ui-select-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 14px 6px;
    letter-spacing: 0.5px;
}

.ui-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.15s var(--ease-out);
    user-select: none;
}

.ui-select-option:hover {
    background: var(--bg-color);
}

.ui-select-option.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.ui-select-option .ui-select-check {
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
}

.ui-select-option.active .ui-select-check {
    opacity: 1;
    transform: scale(1);
}

/* ==================================================== */
/* БЛОК НЕДВИЖИМОСТИ / ТОП СПЕЦИАЛИСТОВ                 */
/* ==================================================== */
.dashboard-property-block {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 14px 16px;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    max-width: 1400px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    transition: box-shadow 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-theme .dashboard-property-block {
    background: rgba(28, 28, 30, 0.55);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.property-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.property-header .dashboard-card-title {
    margin-bottom: 0;
    font-size: 11px;
}

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

.property-add-btn {
    height: 34px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px;
    font-size: 12px !important;
    border-radius: 10px !important;
    flex-shrink: 0;
}

.property-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--bg-color);
    border: 1.5px solid transparent;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

body.dark-theme .property-view-all-btn {
    background: #2c2c2e;
}

.property-view-all-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.property-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.property-filter-btn {
    background: var(--bg-color);
    border: 1.5px solid transparent;
    color: var(--text-muted);
    padding: 5px 12px;
    cursor: pointer;
    border-radius: 100px;
    font-weight: 600;
    font-size: 12px;
    font-family: inherit;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    white-space: nowrap;
}

body.dark-theme .property-filter-btn {
    background: #2c2c2e;
}

.property-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.property-filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 3px 8px rgba(0, 113, 227, 0.25);
}

/* ==================================================== */
/* КАРУСЕЛЬ                                             */
/* ==================================================== */
.property-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    width: 100%;
}

.property-carousel .property-grid,
.top-specialists-grid {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 8px 2px;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.top-specialists-grid::-webkit-scrollbar,
.property-carousel .property-grid::-webkit-scrollbar {
    height: 0;
    display: none;
}

.property-carousel-nav {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    box-shadow: var(--shadow-xs);
    z-index: 2;
}

.property-carousel-nav:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.3);
}

.property-carousel-nav:active {
    transform: scale(0.95);
}

.property-carousel-nav:disabled,
.property-carousel-nav.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

body.dark-theme .property-carousel-nav {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .property-carousel-nav:hover {
    background: var(--primary);
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .property-carousel-nav {
        display: none;
    }
}

.property-empty {
    padding: 24px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    width: 100%;
}

/* ==================================================== */
/* ТОП СПЕЦИАЛИСТОВ                                     */
/* ==================================================== */
.top-roles-bar {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 4px 4px 4px 16px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    box-shadow: var(--shadow-xs);
    min-height: 40px;
    box-sizing: border-box;
}

body.dark-theme .top-roles-bar {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.1);
}

.top-roles-bar-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    padding-right: 12px;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-roles-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    background: var(--bg-color);
    color: var(--text-main);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

body.dark-theme .top-roles-bar-btn {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.1);
}

.top-roles-bar-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.top-roles-bar-btn.open {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

.top-roles-bar-chevron {
    flex-shrink: 0;
    transition: transform 0.2s var(--ease-out);
    color: currentColor;
    opacity: 0.7;
}

.top-roles-bar-btn.open .top-roles-bar-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.top-specialists-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    width: 100%;
}

.top-specialist-card {
    flex: 0 0 168px;
    min-width: 168px;
    max-width: 168px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    text-align: left;
    position: relative;
    height: 92px;
    box-sizing: border-box;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-theme .top-specialist-card {
    background: #2c2c2e;
}

.top-specialist-card:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.15);
}

.top-specialist-rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 7px;
    background: rgba(255, 149, 0, 0.12);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #ff9500;
    line-height: 1;
}

.top-specialist-rating-badge .star {
    font-size: 12px;
    line-height: 1;
}

.top-specialist-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 52px);
    line-height: 1.2;
    padding-right: 4px;
}

.top-specialist-role {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

.top-specialist-phone {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
    margin-top: auto;
    font-weight: 500;
}

/* ==================================================== */
/* UI-ALERT КНОПКИ                                       */
/* ==================================================== */
#ui-modal .auth-card>div:last-child {
    display: flex !important;
    gap: 12px !important;
    margin-top: 20px !important;
    width: 100% !important;
    align-items: stretch !important;
}

#ui-modal #ui-modal-cancel,
#ui-modal #ui-modal-ok {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    height: 48px !important;
    max-height: 48px !important;
    min-height: 48px !important;
    border-radius: 14px !important;
    padding: 0 20px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    margin: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}

#ui-modal #ui-modal-cancel {
    background: var(--bg-color) !important;
    color: var(--text-main) !important;
    border: none !important;
}

#ui-modal #ui-modal-cancel:hover {
    background: var(--border) !important;
}

#ui-modal #ui-modal-ok {
    background: var(--primary) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25) !important;
}

#ui-modal #ui-modal-ok:hover {
    background: var(--primary-hover) !important;
}

#ui-modal #ui-modal-cancel[style*="display: none"],
#ui-modal #ui-modal-cancel[style*="display:none"] {
    display: none !important;
    width: 0 !important;
    flex: 0 0 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    min-width: 0 !important;
}

#ui-modal #ui-modal-cancel[style*="display: none"]+#ui-modal-ok,
#ui-modal #ui-modal-cancel[style*="display:none"]+#ui-modal-ok {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* ==================================================== */
/* МОДАЛКА НЕДВИЖИМОСТИ                                  */
/* ==================================================== */
.property-modal {
    max-width: 520px !important;
    padding: 28px 24px 24px 24px !important;
    border-radius: 24px !important;
}

.property-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.property-modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0071e3 0%, #5a9bff 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.3);
}

.property-modal-icon svg {
    width: 26px;
    height: 26px;
    stroke: #fff;
}

.property-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px 0;
    line-height: 1.15;
}

.property-modal-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.property-modal-section {
    margin: 0 0 24px 0;
}

.property-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin: 0 0 12px 0;
    display: block;
}

.property-modal .input-group {
    margin: 0 0 12px 0 !important;
}

.property-modal .form-control,
.property-modal .custom-select {
    height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    background: var(--bg-color);
    border: 1.5px solid transparent;
    font-size: 15px;
    color: var(--text-main);
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.property-modal .form-control:hover,
.property-modal .custom-select:hover {
    background: color-mix(in srgb, var(--bg-color) 85%, var(--primary) 15%);
}

.property-modal .form-control:focus,
.property-modal .custom-select:focus {
    background: var(--card-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
    transform: none;
}

body.dark-theme .property-modal .form-control,
body.dark-theme .property-modal .custom-select {
    background: #2c2c2e;
    border-color: transparent;
}

.property-modal textarea.form-control {
    height: 96px !important;
    min-height: 96px !important;
    padding: 14px 16px !important;
    resize: none;
}

.property-modal .grid-2col {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin: 0 0 12px 0 !important;
}

.property-modal .grid-2col .input-group {
    margin-bottom: 0 !important;
}

.property-photo-uploader {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-color);
    border: 2px dashed var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s var(--ease-out);
    height: 76px;
}

body.dark-theme .property-photo-uploader {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.1);
}

.property-photo-uploader:hover {
    border-color: var(--primary);
}

.property-photo-uploader-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}

body.dark-theme .property-photo-uploader-icon {
    background: #1c1c1e;
}

.property-photo-uploader-icon svg {
    width: 22px;
    height: 22px;
}

.property-photo-uploader-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.property-photo-uploader-text strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.property-photo-uploader-text span {
    font-size: 12px;
    color: var(--text-muted);
}

.property-submit-btn {
    margin: 0 !important;
    width: 100%;
    height: 50px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.3);
    color: #fff;
    border: none;
    cursor: pointer;
    gap: 8px;
    transition: box-shadow 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.property-submit-btn:hover {
    box-shadow: 0 12px 28px rgba(0, 113, 227, 0.4);
}

.property-photos-preview {
    margin: 12px 0 0 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.property-photo-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid var(--border);
    animation: photoPop 0.25s var(--ease-out);
}

@keyframes photoPop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.property-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.property-photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background 0.2s var(--ease-out);
}

.property-photo-remove:hover {
    background: #ff3b30;
}

/* ==================================================== */
/* ПРОСМОТР НЕДВИЖИМОСТИ                                */
/* ==================================================== */
.property-view-modal {
    max-width: 600px !important;
    padding: 24px !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

body.dark-theme .property-view-modal {
    background: rgba(28, 28, 30, 0.82) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.property-view-gallery {
    position: relative;
    width: 100%;
    height: 340px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.06) 0%, rgba(90, 155, 255, 0.1) 100%);
    margin-bottom: 12px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

body.dark-theme .property-view-gallery {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.15) 0%, rgba(90, 155, 255, 0.08) 100%);
    border-color: rgba(255, 255, 255, 0.06);
}

.property-view-photo-placeholder {
    color: var(--primary);
    opacity: 0.35;
}

.property-view-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-view-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.property-view-photo-placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.property-view-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    z-index: 2;
}

.property-view-nav:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: translateY(-50%) scale(1.08);
}

.property-view-nav.prev {
    left: 12px;
}

.property-view-nav.next {
    right: 12px;
}

.property-view-indicator {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.property-view-thumbs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.property-view-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s var(--ease-out);
}

.property-view-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.property-view-thumb.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

.property-view-info {
    display: flex;
    flex-direction: column;
}

.property-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.property-view-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
}

.property-view-deal {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    background: #0071e3;
}

.property-view-deal.sale {
    background: #ff3b30;
}

.property-view-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.property-view-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 16px 0;
    white-space: pre-wrap;
}

.property-view-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.property-view-spec {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

body.dark-theme .property-view-spec {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.06);
}

.property-view-owner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: background 0.2s var(--ease-out);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.dark-theme .property-view-owner {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.property-view-owner:hover {
    background: color-mix(in srgb, var(--bg-color) 90%, var(--primary) 10%);
}

.property-view-owner-info {
    flex: 1;
    min-width: 0;
}

.property-view-owner-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.property-view-owner-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.property-view-owner-phone {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 2px;
}

.property-view-owner-loc {
    font-size: 12px;
    color: var(--text-muted);
}

.property-view-owner-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.2s var(--ease-out), color 0.2s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-view-owner:hover .property-view-owner-arrow {
    opacity: 1;
    color: var(--primary);
}

.property-view-contact-btn {
    height: 50px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.3);
    color: #fff;
    border: none;
    cursor: pointer;
    gap: 8px;
    transition: box-shadow 0.2s var(--ease-out);
}

.property-view-contact-btn:hover {
    box-shadow: 0 12px 28px rgba(0, 113, 227, 0.4);
}

.property-view-close {
    display: none !important;
}

.property-view-own-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.property-view-btn-close,
.property-view-btn-delete {
    flex: 1;
    height: 50px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: box-shadow 0.2s var(--ease-out);
}

.property-view-btn-close {
    background: var(--bg-color);
    color: var(--text-main);
    border: 1.5px solid var(--border);
}

body.dark-theme .property-view-btn-close {
    background: #2c2c2e;
}

.property-view-btn-delete {
    background: #ff3b30;
    color: #fff;
}

/* ==================================================== */
/* ПРОФИЛЬ                                              */
/* ==================================================== */
.profile-view-modal {
    max-width: 820px !important;
    width: 92% !important;
    padding: 28px 24px 24px 24px !important;
    border-radius: 24px !important;
    max-height: 92vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    overscroll-behavior: contain;
}

body.dark-theme .profile-view-modal {
    background: rgba(28, 28, 30, 0.78) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.profile-view-modal::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

.profile-view-modal {
    display: flex;
    flex-direction: column;
}

.profile-view-modal .profile-view-header,
.profile-view-modal .profile-view-contacts,
.profile-view-modal .profile-view-about,
.profile-view-modal .profile-view-votes,
.profile-view-modal .profile-view-actions {
    max-width: 100%;
}

.profile-view-ads-section,
.profile-view-reviews-section {
    margin-bottom: 18px;
}

.profile-view-ads-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.profile-view-ads-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.profile-view-ads-list:empty::before {
    content: 'Объявлений пока нет';
    display: block;
    grid-column: 1 / -1;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--bg-color);
    border-radius: 12px;
}

body.dark-theme .profile-view-ads-list:empty::before {
    background: #2c2c2e;
}

.profile-ad-item {
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.dark-theme .profile-ad-item {
    background: #2c2c2e;
}

.profile-ad-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.12);
}

.profile-ad-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.profile-ad-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--primary-light);
    color: var(--primary);
}

body.dark-theme .profile-ad-badge {
    background: rgba(0, 113, 227, 0.2);
}

.profile-ad-price {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
}

.profile-ad-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}

.profile-ad-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

.profile-view-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.profile-view-avatar {
    width: 88px !important;
    height: 88px !important;
    font-size: 36px !important;
    flex-shrink: 0;
}

.profile-view-header-info {
    flex: 1;
    min-width: 0;
}

.profile-view-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 4px 0;
}

.profile-view-role {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.profile-view-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.profile-view-stars {
    color: #ffcc00;
    font-size: 15px;
    letter-spacing: 1px;
}

.profile-view-rating-num {
    font-weight: 700;
    color: var(--text-main);
}

.profile-view-rating-count {
    color: var(--text-muted);
}

.profile-view-contacts {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

body.dark-theme .profile-view-contacts {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.profile-view-contact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s var(--ease-out);
}

.profile-view-contact-row[href]:hover {
    background: rgba(0, 113, 227, 0.08);
    cursor: pointer;
}

.profile-view-contact-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.profile-view-contact-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-view-contact-arrow {
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 300;
    opacity: 0.5;
}

.profile-view-about {
    margin-bottom: 16px;
}

.profile-view-about-text {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.5;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    white-space: pre-wrap;
    margin: 0;
}

body.dark-theme .profile-view-about-text {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.06);
}

.profile-view-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-view-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.profile-view-votes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.profile-view-vote-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

body.dark-theme .profile-view-vote-item {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.06);
}

.profile-view-vote-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.profile-view-vote-info {
    flex: 1;
    min-width: 0;
}

.profile-view-vote-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.profile-view-vote-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.profile-view-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.profile-view-action-btn {
    flex: 1;
    height: 48px;
    border-radius: 14px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: box-shadow 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.profile-view-action-btn.primary {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.3);
}

.profile-view-action-btn.primary:hover {
    box-shadow: 0 10px 22px rgba(0, 113, 227, 0.4);
}

.profile-view-action-btn.secondary {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    color: var(--text-main);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-theme .profile-view-action-btn.secondary {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

.profile-view-reviews-section {
    margin-bottom: 18px;
}

.profile-view-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.profile-view-reviews-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.profile-view-reviews-list:empty::before {
    content: 'Пока нет отзывов';
    display: block;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--bg-color);
    border-radius: 12px;
}

body.dark-theme .profile-view-reviews-list:empty::before {
    background: #2c2c2e;
}

.profile-review-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

body.dark-theme .profile-review-item {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.06);
}

.profile-review-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 15px !important;
    flex-shrink: 0;
}

.profile-review-body {
    flex: 1;
    min-width: 0;
}

.profile-review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.profile-review-author {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
}

.profile-review-author:hover {
    color: var(--primary);
}

.profile-review-stars {
    font-size: 12px;
    color: #ffcc00;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.profile-review-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
}

.profile-review-date {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 4px;
}

.profile-view-add-review {
    margin-top: 6px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.profile-view-vote-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.profile-view-vote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    border-radius: 12px;
    background: var(--bg-color);
    border: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

body.dark-theme .profile-view-vote-btn {
    background: #2c2c2e;
}

.profile-view-vote-btn.like.active {
    background: rgba(25, 135, 84, 0.15);
    border-color: #198754;
    color: #198754;
}

.profile-view-vote-btn.dislike.active {
    background: rgba(255, 59, 48, 0.15);
    border-color: #ff3b30;
    color: #ff3b30;
}

.profile-view-review-textarea {
    height: 90px !important;
    min-height: 90px !important;
    padding: 12px 14px !important;
    background: var(--bg-color);
    border-radius: 12px;
    resize: none;
}

body.dark-theme .profile-view-review-textarea {
    background: #2c2c2e;
}

.profile-view-self {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.profile-view-self-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ==================================================== */
/* ПОЛНОЭКРАННАЯ НЕДВИЖИМОСТЬ                           */
/* ==================================================== */
.properties-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.properties-page-title-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.properties-page-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.1;
}

.properties-page-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.properties-page-filters.flex-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-theme .properties-page-filters.flex-row {
    background: rgba(28, 28, 30, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.properties-page-filters .properties-page-search {
    position: relative;
    flex: 1 1 240px;
    min-width: 0;
    display: flex;
    align-items: center;
}

.properties-page-filters .properties-page-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 18px;
    height: 18px;
    opacity: 0.7;
    z-index: 2;
}

.properties-page-filters .properties-page-search-input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 44px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-main);
    font-size: 14.5px;
    font-family: inherit;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

body.dark-theme .properties-page-filters .properties-page-search-input {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.properties-page-filters .properties-page-search-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 113, 227, 0.4);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15), 0 4px 14px rgba(0, 113, 227, 0.15);
}

body.dark-theme .properties-page-filters .properties-page-search-input:focus {
    background: rgba(44, 44, 46, 0.95);
}

.properties-page-filters .properties-page-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.75;
}

.properties-page-filters .properties-page-filter-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.properties-page-filters .properties-page-filter-btn {
    height: 40px;
    padding: 0 18px;
    border-radius: 100px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme .properties-page-filters .properties-page-filter-btn {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.properties-page-filters .properties-page-filter-btn:hover {
    border-color: rgba(0, 113, 227, 0.4);
    color: var(--primary);
}

.properties-page-filters .properties-page-filter-btn.active {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.properties-page-filters>.btn-primary {
    height: 40px;
    padding: 0 20px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%) !important;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
    transition: box-shadow 0.2s var(--ease-out);
    white-space: nowrap;
    flex: 0 0 auto;
    color: #fff;
    border: none;
}

.properties-page-filters>.btn-primary:hover {
    box-shadow: 0 10px 24px rgba(0, 113, 227, 0.45);
}

.properties-page-filters>.btn-primary:active {
    transform: scale(0.96);
}

body.mobile-device .properties-page-filters.flex-row,
body.mobile-device .properties-page-filters .properties-page-search-input,
body.mobile-device .properties-page-filters .properties-page-filter-btn {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.mobile-device .properties-page-filters.flex-row {
    background: var(--card-bg) !important;
}

body.mobile-device .properties-page-filters .properties-page-search-input,
body.mobile-device .properties-page-filters .properties-page-filter-btn {
    background: var(--bg-color) !important;
}

.properties-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.properties-page-grid .property-card {
    background: var(--bg-color);
    border: 1.5px solid transparent;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    position: relative;
}

body.dark-theme .properties-page-grid .property-card {
    background: #2c2c2e;
}

.properties-page-grid .property-card:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.15);
}

.properties-page-grid .property-card-image {
    height: 150px;
    min-height: 150px;
    max-height: 150px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    width: 100%;
}

.properties-page-grid .property-card-skeleton {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(120, 120, 128, 0.10) 25%,
            rgba(120, 120, 128, 0.25) 50%,
            rgba(120, 120, 128, 0.10) 75%);
    background-size: 400px 100%;
    animation: propertyShimmer 1.4s infinite linear;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

body.dark-theme .properties-page-grid .property-card-skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.06) 25%,
            rgba(255, 255, 255, 0.22) 50%,
            rgba(255, 255, 255, 0.06) 75%);
    background-size: 400px 100%;
    animation: propertyShimmer 1.4s infinite linear;
}

.properties-page-grid .property-card-skeleton-icon {
    color: var(--text-muted);
    opacity: 0.5;
    animation: propertySkeletonPulse 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

@keyframes propertyShimmer {
    0% {
        background-position: -400px 0;
    }

    100% {
        background-position: 400px 0;
    }
}

@keyframes propertySkeletonPulse {

    0%,
    100% {
        opacity: 0.35;
    }

    50% {
        opacity: 0.7;
    }
}

.properties-page-grid .property-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.properties-page-grid .property-card-info {
    padding: 12px 14px;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.properties-page-grid .property-card-price {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-bottom: 4px;
}

.properties-page-grid .property-card-title {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

.property-card-deal-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-block;
    width: auto;
    max-width: calc(100% - 16px);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    z-index: 2;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.property-card-deal-badge.sale {
    background: #ff3b30;
}

.property-card-deal-badge.rent {
    background: #0071e3;
}

.properties-page-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
}

/* ==================================================== */
/* ПИКЕР РОЛЕЙ — ВЫЕЗЖАЮЩИЙ АККОРДЕОН                  */
/* ==================================================== */

.roles-picker {
    position: relative;
    width: 100%;
}

.roles-trigger {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

body.dark-theme .roles-trigger {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

.roles-trigger:hover {
    border-color: var(--primary);
}

.roles-trigger.open {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.roles-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

.roles-trigger-text.placeholder {
    color: var(--text-muted);
}

.roles-trigger-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(0, 113, 227, 0.12);
    padding: 2px 8px;
    border-radius: 100px;
    flex-shrink: 0;
}

.roles-trigger-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s var(--ease-out);
    display: flex;
}

.roles-trigger.open .roles-trigger-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.roles-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: max-height 0.3s var(--ease-out),
        opacity 0.25s ease,
        transform 0.25s var(--ease-out);
}

body.dark-theme .roles-panel {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.roles-panel.open {
    max-height: 60vh;
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    padding: 12px;
    overscroll-behavior: contain;
}

.roles-panel::-webkit-scrollbar {
    width: 6px;
}

.roles-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.roles-search {
    position: relative;
    margin-bottom: 12px;
    padding: 4px 8px 8px;
}

.roles-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    border: none;
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 14.5px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

body.dark-theme .roles-search input {
    background: #2c2c2e;
}

.roles-search input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.roles-search input:focus {
    background: var(--card-bg);
    box-shadow: inset 0 0 0 1.5px var(--primary);
}

body.dark-theme .roles-search input:focus {
    background: #1c1c1e;
    box-shadow: inset 0 0 0 1.5px var(--primary);
}

.roles-search input:focus-visible {
    outline: none;
}

.roles-search svg {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    opacity: 0.6;
    pointer-events: none;
}

.roles-selected {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.roles-selected-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-left: 4px;
}

.roles-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.roles-chips-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding-left: 4px;
    font-style: italic;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px 5px 12px;
    background: var(--primary);
    color: #fff;
    border-radius: 100px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    animation: chipIn 0.2s var(--ease-out);
}

.role-chip-remove {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 9px;
    line-height: 1;
    transition: background 0.15s;
}

.role-chip-remove:hover {
    background: rgba(255, 255, 255, 0.4);
}

@keyframes chipIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.roles-group {
    margin-bottom: 16px;
}

.roles-group:last-child {
    margin-bottom: 0;
}

.roles-group-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 8px 6px;
}

.roles-list {
    display: flex;
    flex-direction: column;
}

.role-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    position: relative;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
    min-height: 40px;
    box-sizing: border-box;
}

.role-row:hover {
    background: var(--bg-color);
}

body.dark-theme .role-row:hover {
    background: #2c2c2e;
}

.role-row:has(input:checked) {
    background: var(--primary-light);
}

.role-row:has(input:checked):hover {
    background: var(--primary-light);
}

body.dark-theme .role-row:has(input:checked) {
    background: rgba(0, 113, 227, 0.18);
}

body.dark-theme .role-row:has(input:checked):hover {
    background: rgba(0, 113, 227, 0.25);
}

.role-row:has(input:checked) .role-row-label {
    color: var(--primary);
    font-weight: 500;
}

body.dark-theme .role-row:has(input:checked) .role-row-label {
    color: #4a9eff;
}

.role-row-icon {
    font-size: 18px;
    line-height: 1;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.role-row-label {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-main);
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-row-check {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s, transform 0.2s var(--ease-out);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.role-row-check svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.role-row:has(input:checked) .role-row-check {
    opacity: 1;
    transform: scale(1);
}

body.dark-theme .role-row-check {
    color: #4a9eff;
}

.role-row.hidden {
    display: none;
}

.roles-group.hidden {
    display: none;
}

/* ==================================================== */
/* КНОПКА ИЗБРАННОГО                                    */
/* ==================================================== */
.fav-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    flex-shrink: 0;
    font-family: inherit;
}

.fav-btn:hover {
    border-color: #ff3b30;
    color: #ff3b30;
}

.fav-btn.active {
    background: rgba(255, 59, 48, 0.1);
    border-color: #ff3b30;
    color: #ff3b30;
}

.fav-btn:active {
    transform: scale(0.92);
}

.fav-btn-market {
    position: absolute !important;
    top: 10px;
    left: 10px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(8px);
}

.feed-card .fav-btn-market {
    left: auto !important;
    right: 12px !important;
    top: 12px !important;
    z-index: 10 !important;
}

body.dark-theme .fav-btn-market {
    background: rgba(0, 0, 0, 0.55) !important;
    color: #fff;
}

body.dark-theme .feed-card .fav-btn-market {
    background: rgba(0, 0, 0, 0.55) !important;
    color: #fff;
}

body.dark-theme .fav-btn-market {
    background: rgba(0, 0, 0, 0.55) !important;
    color: #fff;
}

.fav-btn-property {
    position: absolute !important;
    top: 8px;
    right: 8px;
    z-index: 5;
    width: 30px;
    height: 30px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(8px);
}

body.dark-theme .fav-btn-property {
    background: rgba(0, 0, 0, 0.55) !important;
    color: #fff;
}

/* ==================================================== */
/* ПАНЕЛЬ ИЗБРАННОГО                                    */
/* ==================================================== */
.favorites-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.favorites-tab {
    padding: 9px 18px;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.favorites-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.favorites-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

/* ==================================================== */
/* ИЗБРАННОЕ — КАРТОЧКИ В СТИЛЕ APPLE (GLASSMORPHISM)  */
/* ==================================================== */

.favorite-item {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 18px 20px 16px 20px !important;

    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;

    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 20px !important;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;

    transition:
        box-shadow 0.25s var(--ease-out),
        border-color 0.25s ease !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-theme .favorite-item {
    background: rgba(28, 28, 30, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.favorite-item:hover {
    border-color: rgba(0, 113, 227, 0.3) !important;
    box-shadow:
        0 8px 28px rgba(0, 113, 227, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

body.dark-theme .favorite-item:hover {
    border-color: rgba(0, 113, 227, 0.4) !important;
    box-shadow:
        0 8px 28px rgba(0, 113, 227, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.favorite-item-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 12px !important;
    gap: 10px !important;
}

.favorite-kind-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 5px 12px !important;
    border-radius: 100px !important;
    background: rgba(0, 113, 227, 0.1) !important;
    color: var(--primary) !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    line-height: 1.2 !important;
}

body.dark-theme .favorite-kind-badge {
    background: rgba(0, 113, 227, 0.22) !important;
    color: #4a9eff !important;
}

.favorite-remove-btn {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    border: none !important;
    background: rgba(120, 120, 128, 0.14) !important;
    color: var(--text-muted) !important;
    font-size: 13px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease !important;
    -webkit-tap-highlight-color: transparent;
}

.favorite-remove-btn:hover,
.favorite-remove-btn:focus-visible {
    background: #ff3b30 !important;
    color: #ffffff !important;
    transform: rotate(90deg) scale(1.08) !important;
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35) !important;
    outline: none !important;
}

body.dark-theme .favorite-remove-btn:hover,
body.dark-theme .favorite-remove-btn:focus-visible {
    background: #ff453a !important;
    color: #ffffff !important;
}

.favorite-remove-btn:active {
    transform: rotate(90deg) scale(0.92) !important;
    background: #e0342b !important;
}

.favorite-item .cabinet-item-info {
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
}

.favorite-item .cabinet-item-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    letter-spacing: -0.01em !important;
    line-height: 1.3 !important;
    margin-bottom: 6px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.favorite-item .cabinet-item-desc {
    font-size: 13px !important;
    color: var(--text-muted) !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    display: flex;
    align-items: center;
    gap: 4px;
}

.favorite-item>div:last-child {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 16px !important;
    padding-top: 14px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    gap: 10px !important;
}

body.dark-theme .favorite-item>div:last-child {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

.favorite-item .cabinet-item-price {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #34c759 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.2 !important;
}

.favorite-item .btn-outline {
    padding: 8px 18px !important;
    border-radius: 100px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    background: rgba(0, 113, 227, 0.1) !important;
    color: var(--primary) !important;
    border: none !important;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease !important;
}

body.dark-theme .favorite-item .btn-outline {
    background: rgba(0, 113, 227, 0.22) !important;
    color: #4a9eff !important;
}

.favorite-item .btn-outline:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.35) !important;
}

/* ==================================================== */
/* ФОНОВЫЙ СЛОЙ                                         */
/* ==================================================== */
.app-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: linear-gradient(135deg, #eaf1fb 0%, #f5f8fd 45%, #ffffff 100%);
    transition: background 0.5s var(--ease-smooth);
}

body.dark-theme .app-background {
    background: linear-gradient(135deg, #050a18 0%, #0a1428 45%, #020509 100%);
}

.bg-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.7;
}

.bg-sphere-left {
    width: 520px;
    height: 520px;
    left: -180px;
    top: -140px;
    background: radial-gradient(circle at 35% 35%, #b8d4f5 0%, #d8e7f8 45%, transparent 75%);
}

.bg-sphere-right {
    width: 620px;
    height: 620px;
    right: -220px;
    bottom: -220px;
    background: radial-gradient(circle at 60% 40%, #a8ccf0 0%, #cfe0f5 50%, transparent 78%);
    opacity: 0.6;
}

body.dark-theme .bg-sphere-left {
    background: radial-gradient(circle at 35% 35%, #0a3a78 0%, #052045 45%, transparent 75%);
    opacity: 0.9;
}

body.dark-theme .bg-sphere-right {
    background: radial-gradient(circle at 60% 40%, #0d4a94 0%, #05214a 50%, transparent 78%);
    opacity: 0.75;
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    background: radial-gradient(circle, #6ea8ff 0%, transparent 70%);
}

.bg-glow-tl {
    width: 380px;
    height: 380px;
    left: -100px;
    top: -80px;
}

.bg-glow-bl {
    width: 460px;
    height: 460px;
    left: -140px;
    bottom: -160px;
    opacity: 0.45;
}

.bg-glow-tr {
    width: 340px;
    height: 340px;
    right: -80px;
    top: -60px;
    opacity: 0.35;
}

body.dark-theme .bg-glow {
    background: radial-gradient(circle, #1a5fd4 0%, transparent 70%);
    opacity: 0.75;
}

.bg-arc {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-top-color: rgba(110, 168, 255, 0.55);
    border-right-color: rgba(110, 168, 255, 0.15);
    pointer-events: none;
}

.bg-arc-1 {
    width: 1400px;
    height: 1400px;
    left: -400px;
    top: 20%;
    transform: rotate(-15deg);
}

.bg-arc-2 {
    width: 1800px;
    height: 1800px;
    left: -600px;
    top: 10%;
    border-top-color: rgba(110, 168, 255, 0.35);
    border-right-color: transparent;
    transform: rotate(-22deg);
}

.bg-arc-3 {
    width: 1000px;
    height: 1000px;
    right: -300px;
    bottom: -200px;
    border-top-color: rgba(110, 168, 255, 0.4);
    transform: rotate(35deg);
}

body.dark-theme .bg-arc {
    border-top-color: rgba(74, 145, 255, 0.7);
    border-right-color: rgba(74, 145, 255, 0.15);
}

.bg-building {
    position: absolute;
    right: 4%;
    bottom: 6%;
    width: 320px;
    height: 420px;
    opacity: 0.28;
    background:
        linear-gradient(to top, transparent 0, transparent 100%),
        linear-gradient(135deg, transparent 0 49.6%, rgba(110, 168, 255, 0.9) 49.6% 50%, transparent 50%);
    border-left: 1.5px solid rgba(110, 168, 255, 0.85);
    border-top: 1.5px solid rgba(110, 168, 255, 0.85);
    border-right: 1.5px solid rgba(110, 168, 255, 0.55);
    clip-path: polygon(0 20%, 50% 0, 100% 20%, 100% 100%, 0 100%);
    transform: skewY(-6deg);
}

.bg-building::before {
    content: '';
    position: absolute;
    inset: 25% 12% 12% 12%;
    background-image:
        linear-gradient(to right, rgba(110, 168, 255, 0.55) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(110, 168, 255, 0.55) 1px, transparent 1px);
    background-size: 36px 32px;
}

body.dark-theme .bg-building {
    opacity: 0.5;
    border-color: rgba(90, 165, 255, 0.9);
}

@media (max-width: 768px) {
    .bg-sphere-left {
        width: 300px;
        height: 300px;
        left: -120px;
        top: -100px;
    }

    .bg-sphere-right {
        width: 380px;
        height: 380px;
        right: -160px;
        bottom: -160px;
    }

    .bg-glow-tl,
    .bg-glow-tr {
        width: 260px;
        height: 260px;
    }

    .bg-glow-bl {
        width: 300px;
        height: 300px;
    }

    .bg-arc-1 {
        width: 800px;
        height: 800px;
        left: -260px;
    }

    .bg-arc-2 {
        width: 1000px;
        height: 1000px;
        left: -340px;
    }

    .bg-arc-3 {
        width: 600px;
        height: 600px;
        right: -200px;
    }

    .bg-building {
        width: 180px;
        height: 240px;
        right: 2%;
        bottom: 8%;
        opacity: 0.18;
    }

    body.dark-theme .bg-building {
        opacity: 0.32;
    }
}

@media (prefers-reduced-motion: reduce) {

    .bg-sphere,
    .bg-glow {
        filter: blur(40px);
    }
}

@media (prefers-reduced-transparency: reduce) {

    .dashboard-card,
    .dashboard-property-block,
    .dash-tile,
    .dash-tile.wide,
    .dashboard-chat-item {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--card-bg);
    }
}

/* ==================================================== */
/* ЯЗЫКОВОЙ АККОРДЕОН                                   */
/* ==================================================== */
.segmented-item.lang-block {
    position: relative;
    gap: 6px;
    padding: 0 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s var(--ease-out);
}

.segmented-item.lang-block:hover {
    background: rgba(0, 113, 227, 0.06);
}

.lang-display-text {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
    color: var(--text-main);
}

.lang-chevron {
    transition: transform 0.2s var(--ease-out);
    color: var(--text-muted);
    flex-shrink: 0;
}

.segmented-item.lang-block.open .lang-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.lang-select-invisible {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.lang-panel {
    position: fixed;
    top: -9999px;
    left: -9999px;
    min-width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 2147483647;
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
}

body.dark-theme .lang-panel {
    background: rgba(28, 28, 30, 0.97);
    border-color: rgba(255, 255, 255, 0.1);
}

.lang-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s var(--ease-out);
    font-size: 14px;
    color: var(--text-main);
}

.lang-option:hover {
    background: var(--bg-color);
}

body.dark-theme .lang-option:hover {
    background: #2c2c2e;
}

.lang-option.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

body.dark-theme .lang-option.active {
    background: rgba(0, 113, 227, 0.2);
}

.lang-option-flag {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.lang-option-label {
    flex: 1;
    font-size: 14px;
}

.lang-option-code {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--bg-color);
    flex-shrink: 0;
}

body.dark-theme .lang-option-code {
    background: #2c2c2e;
}

.lang-option.active .lang-option-code {
    background: rgba(0, 113, 227, 0.15);
    color: var(--primary);
}

.lang-option-check {
    color: var(--primary);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    flex-shrink: 0;
}

.lang-option.active .lang-option-check {
    opacity: 1;
    transform: scale(1);
}

/* ==================================================== */
/* КОНВЕРТЕР                                            */
/* ==================================================== */
#converter-content {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#converter-content .card {
    padding: 20px 22px;
}

#converter-result {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 18px !important;
    text-align: center;
    letter-spacing: -0.02em;
    border: 1.5px solid rgba(0, 113, 227, 0.2);
}

body.dark-theme #converter-result {
    background: #0a2a52;
    border-color: rgba(0, 113, 227, 0.4);
}

/* ==================================================== */
/* ГЕОМЕТРИЯ                                            */
/* ==================================================== */
#geometry-content {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#geometry-content .grid-2col {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    #geometry-content .grid-2col {
        grid-template-columns: 1fr;
    }
}

#geometry-content .card {
    padding: 16px 18px;
    margin-bottom: 14px !important;
}

#geometry-content .card-title {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--primary);
}

#geometry-content .concrete-results-grid {
    margin-top: 12px;
    gap: 4px;
}

/* ==================================================== */
/* БЛОК ДОПУЩЕНИЙ                                       */
/* ==================================================== */
.assumptions-block {
    padding: 10px 12px;
    background: rgba(255, 149, 0, 0.08);
    border-left: 3px solid #ff9500;
    border-radius: 8px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.assumptions-block strong {
    font-size: 11px;
    color: #ff9500;
    font-weight: 700;
}

/* ==================================================== */
/* БИРЖА ПОДРЯДОВ                                       */
/* ==================================================== */
.job-meta-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.job-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
    letter-spacing: 0.2px;
}

body.dark-theme .job-type-badge {
    background: rgba(0, 113, 227, 0.2);
}

.job-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.job-status-badge.active {
    background: rgba(0, 113, 227, 0.12);
}

.job-status-badge.done {
    background: rgba(25, 135, 84, 0.12);
}

.job-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

#modal-job-comments .auth-card {
    max-width: 560px;
}

#jc-list::-webkit-scrollbar {
    width: 6px;
}

#jc-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

#jc-list>div {
    transition: background 0.2s var(--ease-out);
}

#jc-list>div:hover {
    background: var(--primary-light);
}

body.dark-theme #jc-list>div:hover {
    background: rgba(0, 113, 227, 0.1);
}

#jc-input {
    font-size: 14px !important;
}

/* ==================================================== */
/* КОНВЕРТЕР — ПЛИТКИ                                    */
/* ==================================================== */
.converter-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding: 4px;
}

.converter-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 8px;
    min-height: 90px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-main);
    transition: background 0.2s var(--ease-out),
        border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.converter-tile:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.15);
}

.converter-tile:active {
    transform: scale(0.95);
}

.converter-tile.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
}

body.dark-theme .converter-tile {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .converter-tile:hover {
    background: rgba(0, 113, 227, 0.2);
    border-color: var(--primary);
}

body.dark-theme .converter-tile.active {
    background: var(--primary);
    color: #fff;
}

.converter-tile-icon {
    font-size: 26px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s var(--ease-out);
}

.converter-tile:hover .converter-tile-icon {
    transform: scale(1.12);
}

.converter-tile-label {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: inherit;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

.converter-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.converter-panel .card {
    padding: 18px 20px;
}

@media (max-width: 560px) {
    .converter-tiles-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .converter-tile {
        min-height: 78px;
        padding: 10px 4px;
        border-radius: 12px;
    }

    .converter-tile-icon {
        font-size: 22px;
    }

    .converter-tile-label {
        font-size: 10.5px;
    }
}

/* ==================================================== */
/* ГЕОМЕТРИЯ — ПЛИТКИ                                    */
/* ==================================================== */
.geometry-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.geometry-group-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin: 0;
    padding: 0 4px;
}

.geometry-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 4px;
}

.geometry-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 8px;
    min-height: 88px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-main);
    transition: background 0.2s var(--ease-out),
        border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.geometry-tile:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.15);
}

.geometry-tile:active {
    transform: scale(0.95);
}

.geometry-tile.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
}

body.dark-theme .geometry-tile {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .geometry-tile:hover {
    background: rgba(0, 113, 227, 0.2);
    border-color: var(--primary);
}

body.dark-theme .geometry-tile.active {
    background: var(--primary);
    color: #fff;
}

.geometry-tile-icon {
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s var(--ease-out);
}

.geometry-tile:hover .geometry-tile-icon {
    transform: scale(1.12);
}

.geometry-tile-label {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: inherit;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

.geometry-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.geometry-panel .card {
    padding: 18px 20px;
}

@media (max-width: 560px) {
    .geometry-tiles-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .geometry-tile {
        min-height: 78px;
        padding: 10px 4px;
        border-radius: 12px;
    }

    .geometry-tile-icon {
        font-size: 24px;
    }

    .geometry-tile-label {
        font-size: 10.5px;
    }
}

/* ==================================================== */
/* ОРГАНАЙЗЕР                                           */
/* ==================================================== */
.organizer-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.organizer-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.organizer-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--card-bg);
}

.organizer-empty h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.organizer-project-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    cursor: pointer;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    box-shadow: var(--shadow-sm);
    touch-action: manipulation;
}

.organizer-project-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 113, 227, 0.15);
}

body.dark-theme .organizer-project-card {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}

.organizer-project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.organizer-project-number {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.organizer-project-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 9px;
    border-radius: 8px;
}

.organizer-project-status.active {
    background: rgba(0, 113, 227, 0.12);
    color: var(--primary);
}

.organizer-project-status.done {
    background: rgba(25, 135, 84, 0.12);
    color: #198754;
}

.organizer-project-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-project-address {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-project-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.organizer-project-progress {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.organizer-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.organizer-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #0080ff 100%);
    border-radius: 3px;
    transition: width 0.4s var(--ease-out);
}

.organizer-progress-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.organizer-detail-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

#organizer-detail-actions-slot {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.organizer-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px 0 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--primary);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.organizer-back-btn svg {
    display: block;
    flex-shrink: 0;
    transition: transform 0.2s var(--ease-out);
}

.organizer-back-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.15);
}

.organizer-back-btn:hover svg {
    transform: translateX(-2px);
}

.organizer-back-btn:active {
    transform: scale(0.96);
    filter: brightness(0.95);
}

body.dark-theme .organizer-back-btn {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .organizer-back-btn:hover {
    background: rgba(0, 113, 227, 0.2);
    border-color: var(--primary);
}

.organizer-detail-status-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px 0 14px;
    border-radius: 100px;
    border: 1px solid var(--hairline);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    line-height: 1;
}

body.dark-theme .organizer-detail-status-btn {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

.organizer-detail-status-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.15);
}

.organizer-detail-status-btn:active {
    transform: scale(0.96);
}

.organizer-detail-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

body.dark-theme .organizer-detail-status-dot {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.organizer-detail-status-label {
    line-height: 1;
    letter-spacing: -0.01em;
}

.organizer-detail-delete-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.25s var(--ease-out), box-shadow 0.2s var(--ease-out);
    box-shadow: 0 1px 3px rgba(255, 59, 48, 0.1), 0 2px 8px rgba(255, 59, 48, 0.06);
}

body.dark-theme .organizer-detail-delete-btn {
    background: rgba(255, 69, 58, 0.16);
    color: #ff453a;
}

.organizer-detail-delete-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    pointer-events: none;
    stroke: currentColor;
}

.organizer-detail-delete-btn:hover,
.organizer-detail-delete-btn:focus-visible {
    background: #ff3b30;
    color: #ffffff;
    transform: rotate(90deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(255, 59, 48, 0.4);
    outline: none;
}

.organizer-detail-delete-btn:active {
    transform: rotate(90deg) scale(0.92);
    background: #e0342b;
    transition-duration: 0.15s;
}

.organizer-detail-title-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.organizer-detail-number {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.organizer-detail-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.1;
}

.organizer-detail-address {
    font-size: 14px;
    color: var(--text-muted);
}

.organizer-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.organizer-tabs::-webkit-scrollbar {
    display: none;
}

.organizer-tab-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 100px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.organizer-tab-btn svg,
.organizer-tab-btn span[data-icon] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.organizer-tab-btn span[data-icon] svg {
    width: 14px;
    height: 14px;
    display: block;
    stroke: currentColor;
}

.organizer-tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.organizer-tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

.organizer-tab-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.organizer-empty-small {
    padding: 40px 20px;
    text-align: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.organizer-empty-small p {
    font-size: 14px;
    color: var(--text-muted);
}

.organizer-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.organizer-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.organizer-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.organizer-danger-zone {
    border-color: rgba(255, 59, 48, 0.3);
    background: rgba(255, 59, 48, 0.03);
}

.organizer-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.organizer-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
    transition: border-color 0.2s var(--ease-out);
}

.organizer-stat-card:hover {
    border-color: rgba(0, 113, 227, 0.3);
}

.organizer-stat-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.organizer-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.organizer-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    line-height: 1.2;
}

.organizer-stages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.organizer-stage-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s var(--ease-out);
    position: relative;
}

.organizer-stage-card.status-planned {
    border-left: 4px solid #86868b;
}

.organizer-stage-card.status-active {
    border-left: 4px solid var(--primary);
}

.organizer-stage-card.status-done {
    border-left: 4px solid #198754;
    opacity: 0.85;
}

.organizer-stage-card:hover {
    border-color: rgba(0, 113, 227, 0.3);
}

.organizer-stage-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.organizer-stage-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
    min-width: 0;
}

.organizer-stage-status {
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.organizer-stage-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.organizer-stage-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.organizer-stage-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.organizer-stage-actions .btn-outline {
    padding: 6px 12px;
    font-size: 12px;
}

.organizer-table-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.organizer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.organizer-table thead {
    background: var(--bg-color);
}

.organizer-table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.organizer-table td {
    padding: 12px 14px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
}

.organizer-table tbody tr:last-child td {
    border-bottom: none;
}

.organizer-table tbody tr:hover {
    background: var(--bg-color);
}

.organizer-table td:last-child {
    white-space: nowrap;
    text-align: right;
}

.organizer-purchases-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.organizer-purchase-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: border-color 0.2s var(--ease-out);
}

.organizer-purchase-card:hover {
    border-color: rgba(0, 113, 227, 0.3);
}

.organizer-purchase-info {
    flex: 1;
    min-width: 0;
}

.organizer-purchase-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.organizer-purchase-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.organizer-purchase-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.organizer-purchase-price {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    white-space: nowrap;
}

.organizer-purchase-status {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.organizer-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--primary-light);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 8px;
}

.organizer-total-row strong {
    color: var(--primary);
    font-size: 18px;
}

.organizer-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.organizer-file-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s var(--ease-out);
}

.organizer-file-card:hover {
    border-color: var(--primary);
}

.organizer-file-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    background: var(--bg-color);
}

.organizer-file-icon {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: var(--bg-color);
}

.organizer-file-name {
    padding: 8px 10px;
    font-size: 11.5px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.organizer-file-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease-out);
}

.organizer-file-delete:hover {
    background: #ff3b30;
}

.organizer-budget-block {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.organizer-budget-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.organizer-budget-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.organizer-budget-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.organizer-budget-progress-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.organizer-budget-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}

.organizer-budget-progress-label strong {
    color: var(--text-main);
    font-size: 15px;
}

.organizer-budget-bar {
    width: 100%;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.organizer-budget-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #0080ff 100%);
    border-radius: 5px;
    transition: width 0.4s var(--ease-out), background 0.2s var(--ease-out);
}

.organizer-team-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.organizer-member-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: border-color 0.2s var(--ease-out);
}

.organizer-member-card:hover {
    border-color: rgba(0, 113, 227, 0.3);
}

.organizer-member-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #5a9bff 100%);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.organizer-member-info {
    flex: 1;
    min-width: 0;
}

.organizer-member-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.organizer-member-role {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 2px;
}

.organizer-member-phone {
    font-size: 11.5px;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .organizer-projects-grid {
        grid-template-columns: 1fr;
    }

    .organizer-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .organizer-detail-title {
        font-size: 22px;
    }

    .organizer-tabs {
        gap: 4px;
    }

    .organizer-tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .organizer-budget-block {
        grid-template-columns: 1fr;
    }
}

.organizer-project-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
    border: none;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 50;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    opacity: 0.75;
    touch-action: manipulation;
    pointer-events: auto;
}

.organizer-project-delete:hover {
    background: #ff3b30;
    color: #fff;
    opacity: 1;
    transform: scale(1.1);
}

.organizer-project-delete:active {
    transform: scale(0.92);
}

.organizer-project-status-row {
    display: flex;
    justify-content: flex-start;
    margin-top: -2px;
    margin-bottom: 4px;
    padding-right: 40px;
}

.organizer-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 46px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    flex-shrink: 0;
    position: relative;
    margin-right: 10px;
}

body.dark-theme .organizer-dropdown {
    background: rgba(28, 28, 30, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.organizer-dropdown:hover {
    border-color: var(--primary);
}

.organizer-dropdown.open {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.2);
}

.organizer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.organizer-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

.organizer-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.organizer-chevron {
    transition: transform 0.2s var(--ease-out);
    color: var(--text-muted);
    flex-shrink: 0;
}

.organizer-dropdown.open .organizer-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.organizer-panel {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 340px;
    max-width: calc(100vw - 16px);
    max-height: 480px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 14px;
    z-index: 2147483646;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: 10px;
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
}

body.dark-theme .organizer-panel {
    background: rgba(28, 28, 30, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
}

.organizer-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.organizer-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 4px 8px;
    border-bottom: 1px solid var(--border);
}

.organizer-panel-count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.organizer-panel-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    min-height: 40px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.organizer-panel-empty {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.organizer-panel-item {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--bg-color);
    cursor: pointer;
    transition: background 0.2s var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

body.dark-theme .organizer-panel-item {
    background: #2c2c2e;
}

.organizer-panel-item:hover {
    background: var(--primary-light);
}

.organizer-panel-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.organizer-panel-item-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.organizer-panel-item-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.organizer-panel-item-status {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.organizer-panel-item-status.active {
    background: rgba(0, 113, 227, 0.12);
    color: var(--primary);
}

.organizer-panel-item-status.done {
    background: rgba(25, 135, 84, 0.12);
    color: #198754;
}

body.dark-theme .organizer-panel-item-status.active {
    background: rgba(0, 113, 227, 0.2);
    color: #4a9eff;
}

body.dark-theme .organizer-panel-item-status.done {
    background: rgba(25, 135, 84, 0.2);
    color: #4cd964;
}

.organizer-panel-item-number {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.organizer-panel-item-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.organizer-panel-item-bar {
    flex: 1;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.organizer-panel-item-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #0080ff);
    border-radius: 3px;
    transition: width 0.4s var(--ease-out);
}

.organizer-panel-item-percent {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 34px;
    text-align: right;
}

.organizer-panel-add {
    width: 100%;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s var(--ease-out);
    flex-shrink: 0;
}

.organizer-panel-add:hover {
    background: var(--primary-hover);
}

@media (max-width: 900px) {
    .organizer-label {
        display: none;
    }

    .organizer-dropdown {
        padding: 0 10px;
        gap: 4px;
    }
}

.organizer-detail-title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    flex-wrap: nowrap;
}

.organizer-detail-title-row .organizer-detail-title {
    margin: 0;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-detail-title-row .organizer-detail-delete-btn {
    flex-shrink: 0;
}

.organizer-panel-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.organizer-panel-item-action {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    color: var(--text-muted);
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.organizer-panel-item-action.finish:hover {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
}

.organizer-panel-item-action.delete:hover {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
}

.organizer-panel-item-action:active {
    transform: scale(0.9);
}

body.dark-theme .organizer-panel-item-action {
    color: #98989d;
}

.profile-view-ads-panel-close,
.organizer-file-delete,
.favorite-remove-btn,
.property-photo-remove,
.estimate-item-delete,
.property-view-close {
    transition:
        background-color 0.2s var(--ease-out),
        color 0.2s var(--ease-out),
        transform 0.25s var(--ease-out),
        box-shadow 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.profile-view-ads-panel-close:hover,
.profile-view-ads-panel-close:focus-visible,
.organizer-file-delete:hover,
.organizer-file-delete:focus-visible,
.favorite-remove-btn:hover,
.favorite-remove-btn:focus-visible,
.property-photo-remove:hover,
.property-photo-remove:focus-visible,
.estimate-item-delete:hover,
.estimate-item-delete:focus-visible,
.property-view-close:hover,
.property-view-close:focus-visible {
    background: #ff3b30 !important;
    color: #ffffff !important;
    transform: rotate(90deg) scale(1.08);
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35);
    outline: none;
}

.profile-view-ads-panel-close:active,
.organizer-file-delete:active,
.favorite-remove-btn:active,
.property-photo-remove:active,
.estimate-item-delete:active,
.property-view-close:active {
    transform: rotate(90deg) scale(0.9);
    background: #e0342b !important;
    transition-duration: 0.15s;
}

.input-error {
    border: 2px solid #dc3545 !important;
    background: rgba(220, 53, 69, 0.08) !important;
    animation: shake 0.3s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

.header-top-modern .slide-blocks {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    margin-left: 0;
    transform: translateX(-16px);
    transition:
        max-width 0.4s var(--ease-out),
        opacity 0.3s var(--ease-out),
        transform 0.35s var(--ease-out),
        margin-left 0.3s var(--ease-out),
        gap 0.3s var(--ease-out);
    white-space: nowrap;
    will-change: max-width, opacity, transform;
}

.header-top-modern .slide-blocks.open {
    max-width: 500px;
    opacity: 1;
    margin-left: 6px;
    gap: 8px;
    transform: translateX(0);
}

.header-top-modern .slide-block-btn {
    opacity: 0;
    transform: translateX(-12px) scale(0.9);
    transition:
        opacity 0.3s var(--ease-out),
        transform 0.35s var(--ease-out),
        background 0.2s ease,
        border-color 0.2s ease;
}

.header-top-modern .slide-blocks.open .slide-block-btn {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.header-top-modern .slide-blocks.open .slide-block-btn:nth-child(1) {
    transition-delay: 0.05s, 0.05s, 0s, 0s;
}

.header-top-modern .slide-blocks.open .slide-block-btn:nth-child(2) {
    transition-delay: 0.10s, 0.10s, 0s, 0s;
}

.header-top-modern .slide-blocks:not(.open) .slide-block-btn {
    transition-delay: 0s;
}

.header-top-modern .logo-block-modern {
    transition:
        background 0.2s var(--ease-out),
        transform 0.25s var(--ease-out),
        box-shadow 0.2s var(--ease-out);
}

.header-top-modern .logo-block-modern.active {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.header-top-modern .logo-block-modern svg {
    transition: transform 0.25s var(--ease-out);
}

.header-top-modern .logo-block-modern.active svg {
    transform: rotate(-8deg) scale(1.05);
}

.header-top-modern .slide-blocks:not(.open) {
    pointer-events: none;
}

.header-top-modern .slide-blocks.open {
    pointer-events: auto;
}

.organizer-panel,
.estimate-panel {
    transform-origin: top center;
    transition:
        opacity 0.2s var(--ease-out),
        transform 0.25s var(--ease-out);
}

.organizer-panel {
    transform: translateY(-12px) scale(0.96);
}

.organizer-panel.open {
    transform: translateY(0) scale(1);
}

.estimate-panel {
    transform: translateY(-12px) scale(0.96);
}

.estimate-panel.open {
    transform: translateY(0) scale(1);
}

.save-estimate-btn {
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.save-estimate-btn:active {
    transform: scale(0.95);
}

@keyframes badgePop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.35);
    }

    100% {
        transform: scale(1);
    }
}

.logo-badge.pop,
.slide-block-count.pop {
    animation: badgePop 0.35s var(--ease-out);
}

@keyframes estimateItemIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.estimate-item {
    animation: estimateItemIn 0.25s var(--ease-out);
}

@keyframes estimateItemOut {
    to {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
    }
}

.header-top-modern {
    height: 66px !important;
    padding: 12px 16px !important;
}

.header-top-modern .actions-segmented {
    height: 48px !important;
}

.header-top-modern .segmented-item {
    padding: 0 18px !important;
}


.header-top-modern .theme-pill .theme-icon {
    display: inline !important;
    font-size: 15px !important;
    line-height: 1 !important;
}


.header-top-modern .lang-block {
    padding: 0 18px !important;
    gap: 6px !important;
}

.header-top-modern .feedback-block {
    padding: 0 16px !important;
    min-width: 50px !important;
}

.header-top-modern .profile-block {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 0 16px !important;
    min-width: 100px !important;
    height: 100% !important;
}

.header-top-modern .profile-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
}

.header-top-modern .profile-name {
    flex: 1 !important;
    font-size: 13px !important;
    text-align: center !important;
    max-width: none !important;
}

.header-top-modern .logo-block-modern {
    width: 44px !important;
    height: 44px !important;
}

.header-top-modern .slide-block-btn {
    height: 44px !important;
}

.header-top-modern .slide-blocks.open {
    margin-left: 10px !important;
    gap: 10px !important;
}

.header-top-modern .actions-segmented {
    height: 48px !important;
    min-width: 480px !important;
    flex: 0 0 auto !important;
}

.header-top-modern .actions-segmented .segmented-item {
    flex: 1 1 auto !important;
    padding: 0 20px !important;
    justify-content: center !important;
}

.header-top-modern .actions-segmented .profile-block {
    flex: 1.3 1 auto !important;
    min-width: 130px !important;
}

.header-top-modern .actions-segmented .theme-pill {
    flex: 0 0 auto !important;
    min-width: 90px !important;
}

.header-top-modern .actions-segmented .lang-block {
    flex: 0 0 auto !important;
    min-width: 90px !important;
}

.header-top-modern .actions-segmented .feedback-block {
    flex: 0 0 auto !important;
    min-width: 70px !important;
}

.header-top-modern .logo-block-modern {
    animation: logoHint 2.4s ease-in-out infinite;
}

.header-top-modern .logo-block-modern::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(0, 113, 227, 0.35);
    opacity: 0;
    animation: logoHintRing 2.4s ease-in-out infinite;
    pointer-events: none;
}

.header-top-modern .logo-block-modern::before {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--card-bg);
    box-sizing: content-box;
    opacity: 0.85;
    transition: opacity 0.2s;
}

body.dark-theme .header-top-modern .logo-block-modern::before {
    border-color: #1c1c1e;
}

.header-top-modern .logo-block-modern:has(.logo-badge[style*="flex"])::before {
    background: #ff3b30;
}

@keyframes logoHint {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 113, 227, 0);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(0, 113, 227, 0.08);
    }
}

@keyframes logoHintRing {

    0% {
        opacity: 0;
        transform: scale(0.85);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.15);
    }
}

.header-top-modern .logo-block-modern.active {
    animation: none;
}

.header-top-modern .logo-block-modern.active::after {
    animation: none;
    opacity: 0;
}

.header-top-modern .profile-wrapper {
    position: relative;
    flex: 1.3 1 auto;
    min-width: 130px;
    height: 100%;
    display: flex;
    align-items: stretch;
}

.header-top-modern .profile-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 16px;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-main);
    transition: background 0.2s ease;
}

.header-top-modern .profile-block:hover {
    background: rgba(0, 113, 227, 0.06);
}

.header-top-modern .profile-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.header-top-modern .profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-top-modern .profile-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.header-top-modern .profile-chevron {
    color: var(--text-muted);
    transition: transform 0.2s var(--ease-out);
    flex-shrink: 0;
    margin-left: auto;
}

.header-top-modern .profile-wrapper.open .profile-chevron {
    transform: rotate(180deg);
}

.profile-menu {
    position: fixed;
    top: -9999px;
    left: -9999px;
    min-width: 240px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 2147483647;
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
}

body.dark-theme .profile-menu {
    background: rgba(28, 28, 30, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
}

.profile-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: 10px;
    text-align: left;
    transition: background 0.15s var(--ease-out);
}

.profile-menu-item:hover {
    background: var(--bg-color);
}

body.dark-theme .profile-menu-item:hover {
    background: #2c2c2e;
}

.profile-menu-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.profile-menu-label {
    flex: 1;
}

.profile-wrapper.guest .profile-menu {
    display: none;
}

.segmented-item.profile-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease;
    position: relative;
    flex: 1.3 1 auto;
    min-width: 130px;
    height: 100%;
}

.segmented-item.profile-block:hover {
    background: rgba(0, 113, 227, 0.06);
}

.profile-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 13px;
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    color: var(--text-main);
}

.profile-chevron {
    color: var(--text-muted);
    transition: transform 0.2s var(--ease-out);
    flex-shrink: 0;
}

.segmented-item.profile-block.open .profile-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

#profile-panel {
    min-width: 260px;
}

#profile-panel .lang-option {
    cursor: pointer;
    transition: background 0.15s var(--ease-out);
}

#profile-panel .lang-option:hover {
    background: var(--bg-color);
}

body.dark-theme #profile-panel .lang-option:hover {
    background: #2c2c2e;
}

#profile-panel .lang-option-check {
    opacity: 0;
    transform: scale(0.5);
}

#profile-panel .lang-option.active {
    background: transparent;
    color: var(--text-main);
    font-weight: 500;
}

.chat-header-avatar {
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.chat-header-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

.chat-header-name:hover {
    color: var(--primary);
}

#dashboard-chat-header-avatar[data-open-profile] {
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

#dashboard-chat-header-avatar[data-open-profile]:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

#dashboard-chat-header-name[data-open-profile]:hover {
    color: var(--primary);
}

.chat-header-status {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.chat-header-status.online {
    color: #34c759;
    font-weight: 600;
}

.profile-view-modal {
    max-width: 820px !important;
    width: 92% !important;
    padding: 0 !important;
    overflow: hidden !important;
    transition: max-width 0.35s var(--ease-out) !important;
}

.profile-view-modal.ads-open {
    max-width: 1200px !important;
}

.profile-view-layout {
    display: flex;
    width: 100%;
    min-height: 0;
    max-height: 92vh;
    position: relative;
}

.profile-view-main {
    flex: 1 1 100%;
    min-width: 0;
    padding: 28px 24px 24px 24px;
    overflow-y: auto;
    max-height: 92vh;
    transition: flex-basis 0.35s var(--ease-out), padding 0.25s var(--ease-out);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.profile-view-modal.ads-open .profile-view-main {
    flex: 0 0 42%;
    max-width: 42%;
    padding: 28px 20px 24px 24px;
    border-right: 1px solid var(--border);
}

.profile-view-modal.reviews-open .profile-view-main {
    flex: 0 0 42%;
    max-width: 42%;
    padding: 28px 20px 24px 24px;
    border-right: 1px solid var(--border);
}

.profile-view-ads-panel {
    flex: 0 0 0%;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    transition:
        flex-basis 0.35s var(--ease-out),
        max-width 0.35s var(--ease-out),
        opacity 0.25s var(--ease-out),
        padding 0.25s var(--ease-out);
    padding: 0;
}

.profile-view-modal.ads-open .profile-view-ads-panel {
    flex: 1 1 58%;
    max-width: 58%;
    opacity: 1;
    padding: 22px 22px 22px 22px;
}

.profile-view-modal.reviews-open .profile-view-reviews-panel {
    flex: 1 1 58%;
    max-width: 58%;
    opacity: 1;
    padding: 22px 22px 22px 22px;
}

body.dark-theme .profile-view-ads-panel {
    background: #141416;
}

.profile-view-ads-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.profile-view-ads-panel-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.profile-view-ads-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-family: inherit;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    flex-shrink: 0;
}

.profile-view-ads-panel-close:hover {
    background: #ff3b30;
    color: #fff;
    transform: rotate(90deg);
}

.profile-view-ads-panel-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.profile-view-ads-filter {
    padding: 6px 14px;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    white-space: nowrap;
}

.profile-view-ads-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.profile-view-ads-filter.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(0, 113, 227, 0.25);
}

.profile-view-ads-panel-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    padding-right: 4px;
    align-content: start;
    width: 100%;
    box-sizing: border-box;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.profile-view-ads-empty {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--card-bg);
    border-radius: 14px;
    border: 2px dashed var(--border);
}

.profile-ads-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    min-width: 0;
}

.profile-ads-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 22px rgba(0, 113, 227, 0.15);
}

.profile-ads-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.profile-ads-card-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.profile-ads-card-badge.market {
    background: rgba(0, 113, 227, 0.12);
    color: #0071e3;
}

.profile-ads-card-badge.jobs {
    background: rgba(255, 149, 0, 0.15);
    color: #ff9500;
}

.profile-ads-card-badge.properties {
    background: rgba(25, 135, 84, 0.12);
    color: #198754;
}

body.dark-theme .profile-ads-card-badge.market {
    background: rgba(0, 113, 227, 0.25);
    color: #4a9eff;
}

body.dark-theme .profile-ads-card-badge.jobs {
    background: rgba(255, 149, 0, 0.25);
    color: #ffb340;
}

body.dark-theme .profile-ads-card-badge.properties {
    background: rgba(25, 135, 84, 0.25);
    color: #4cd964;
}

.profile-ads-card-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-ads-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

.profile-ads-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.profile-ads-card-loc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: auto;
}

.profile-view-ads-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 14px;
    background: var(--bg-color);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-main);
    transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
    position: relative;
}

body.dark-theme .profile-view-ads-toggle {
    background: #2c2c2e;
}

.profile-view-ads-toggle:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

body.dark-theme .profile-view-ads-toggle:hover {
    background: rgba(0, 113, 227, 0.15);
}

.profile-view-ads-toggle-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.profile-view-ads-toggle-label {
    flex: 1;
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.profile-view-ads-toggle .profile-view-section-count {
    position: static;
    flex-shrink: 0;
}

.profile-view-ads-toggle-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s var(--ease-out);
}

.profile-view-ads-toggle.active .profile-view-ads-toggle-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.profile-view-ads-section {
    display: none !important;
}

@media (max-width: 900px) {
    .profile-view-modal.ads-open {
        max-width: 100% !important;
    }

    .profile-view-modal.ads-open .profile-view-main {
        flex: 0 0 0%;
        max-width: 0;
        padding: 0;
        overflow: hidden;
        opacity: 0;
    }

    .profile-view-modal.ads-open .profile-view-ads-panel {
        flex: 1 1 100%;
        max-width: 100%;
        padding: 22px;
    }

    .profile-view-modal.reviews-open {
        max-width: 100% !important;
    }

    .profile-view-modal.reviews-open .profile-view-main {
        flex: 0 0 0%;
        max-width: 0;
        padding: 0;
        overflow: hidden;
        opacity: 0;
    }

    .profile-view-modal.reviews-open .profile-view-reviews-panel {
        flex: 1 1 100%;
        max-width: 100%;
        padding: 22px;
    }
}

#modal-view-profile .profile-view-modal.ads-open>.close-modal {
    display: none !important;
}

#modal-view-profile .profile-view-modal.reviews-open>.close-modal {
    display: none !important;
}

.profile-view-ads-panel-close {
    position: relative;
    z-index: 100;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: rgba(0, 113, 227, 0.12);
    color: var(--primary);
    border: none;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
    vertical-align: middle;
    transition: background 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme .role-badge {
    background: rgba(0, 113, 227, 0.22);
    color: #4a9eff;
}

.role-badge:hover {
    background: rgba(0, 113, 227, 0.2);
}

body.dark-theme .role-badge:hover {
    background: rgba(0, 113, 227, 0.32);
}

.role-badge:active {
    transform: scale(0.94);
}

.role-badge-icon {
    font-size: 13px;
    line-height: 1;
}

.role-badge-count {
    font-weight: 700;
}

.role-popup {
    position: fixed;
    z-index: 2147483646;
    min-width: 220px;
    max-width: 300px;
    max-height: 340px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
    padding: 10px;
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s var(--ease-out);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    overscroll-behavior: contain;
}

body.dark-theme .role-popup {
    background: rgba(28, 28, 30, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
}

.role-popup.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.role-popup-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 4px 8px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.role-popup-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.role-popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text-main);
    line-height: 1.3;
    transition: background 0.15s ease;
}

.role-popup-item:hover {
    background: var(--bg-color);
}

body.dark-theme .role-popup-item:hover {
    background: #2c2c2e;
}

.role-popup-item-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.role-popup-item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-popup::-webkit-scrollbar {
    width: 5px;
}

.role-popup::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.ratings-search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ratings-search-bar .form-control {
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 14px;
    transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

body.dark-theme .ratings-search-bar .form-control {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.ratings-search-bar .form-control:focus {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

body.dark-theme .ratings-search-bar .form-control:focus {
    background: rgba(44, 44, 46, 0.85);
}

#ratings .card,
#ratings #default-ratings-view .card {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    border-radius: 18px !important;
    padding: 18px !important;
}

body.dark-theme #ratings .card,
body.dark-theme #ratings #default-ratings-view .card {
    background: rgba(28, 28, 30, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

body.dark-theme .rating-row {
    background: rgba(44, 44, 46, 0.5);
    border-color: rgba(255, 255, 255, 0.06);
}

.rating-row:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.12);
}

body.dark-theme .rating-row:hover {
    background: rgba(44, 44, 46, 0.75);
    border-color: var(--primary);
}

.rating-row-specialist {
    align-items: flex-start !important;
}

.rating-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rating-row-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rating-row-role {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rating-row-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    line-height: 1;
}

.rating-row-stars {
    color: #ffcc00;
    letter-spacing: 1px;
    font-size: 12px;
}

.rating-row-rating-num {
    font-weight: 700;
    color: var(--text-main);
    font-size: 13px;
    margin-left: 4px;
}

.rating-row-rating-count {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

.top-specialists-grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 4px 4px 10px 4px !important;
    scroll-behavior: smooth !important;
    align-items: stretch !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.top-specialists-grid::-webkit-scrollbar {
    display: none;
}

.top-specialist-card {
    position: relative;
    flex: 0 0 172px;
    min-width: 172px;
    max-width: 172px;
    height: auto;
    box-sizing: border-box;
    padding: 12px 14px 10px 14px;

    display: flex;
    flex-direction: column;
    gap: 4px;

    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 3px 12px rgba(0, 0, 0, 0.06);

    cursor: pointer;
    overflow: hidden;
    transition:
        box-shadow 0.2s var(--ease-out);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.top-specialist-card:hover {
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 10px 22px rgba(0, 0, 0, 0.1);
}

.top-specialist-card:active {
    transform: translateZ(0) scale(0.97);
    transition-duration: 0.15s;
}

body.dark-theme .top-specialist-card {
    background: #1c1c1e;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.4),
        0 3px 12px rgba(0, 0, 0, 0.35);
}

body.dark-theme .top-specialist-card:hover {
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 10px 22px rgba(0, 0, 0, 0.5);
}

.top-specialist-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #1d1d1f;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

body.dark-theme .top-specialist-name {
    color: #f5f5f7;
}

.top-specialist-role {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 2px 8px 2px 9px;
    background: rgba(0, 113, 227, 0.12);
    color: var(--primary);
    border: none;
    border-radius: 100px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    align-self: flex-start;
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.top-specialist-role:hover {
    background: rgba(0, 113, 227, 0.2);
}

.top-specialist-role:active {
    transform: scale(0.96);
}

body.dark-theme .top-specialist-role {
    background: rgba(0, 113, 227, 0.22);
    color: #4a9eff;
}

body.dark-theme .top-specialist-role:hover {
    background: rgba(0, 113, 227, 0.32);
}

.top-specialist-role-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.top-specialist-role-more {
    flex-shrink: 0;
    font-weight: 700;
    opacity: 0.85;
}

.top-specialist-footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 0;
}

body.dark-theme .top-specialist-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.top-specialist-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    color: #1d1d1f;
    line-height: 1;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

body.dark-theme .top-specialist-rating {
    color: #f5f5f7;
}

.top-specialist-rating svg {
    display: block;
    flex-shrink: 0;
}

.top-specialist-phone {
    font-size: 10.5px;
    font-weight: 400;
    color: #86868b;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.01em;
    text-align: right;
    min-width: 0;
}

body.dark-theme .top-specialist-phone {
    color: #98989d;
}

.ratings-segmented {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--bg-color);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    margin-bottom: 18px;
    width: fit-content;
    min-width: 340px;
    box-sizing: border-box;
}

body.dark-theme .ratings-segmented {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

.ratings-segment {
    position: relative;
    z-index: 2;
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 18px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    border-radius: 9px;
    transition: color 0.2s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.ratings-segment:active {
    transform: scale(0.97);
}

.ratings-segment.active {
    color: var(--text-main);
    font-weight: 700;
}

body.dark-theme .ratings-segment.active {
    color: #f5f5f7;
}

.ratings-segment-indicator {
    position: absolute;
    top: 3px;
    left: 0;
    height: calc(100% - 6px);
    background: var(--card-bg);
    border-radius: 9px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08),
        0 0 0 0.5px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s var(--ease-out),
        width 0.25s var(--ease-out);
    z-index: 1;
    pointer-events: none;
}

body.dark-theme .ratings-segment-indicator {
    background: #1c1c1e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5),
        0 0 0 0.5px rgba(255, 255, 255, 0.06);
}

.ratings-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ratings-list-header .card-title {
    margin: 0;
}

.ratings-show-more {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    background: var(--bg-color);
    color: var(--primary);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

body.dark-theme .ratings-show-more {
    background: #2c2c2e;
}

.ratings-show-more:hover {
    background: rgba(0, 113, 227, 0.1);
}

.ratings-show-more svg {
    transition: transform 0.2s ease;
}

.ratings-show-more:hover svg {
    transform: translateX(2px);
}

#modal-ratings-fullscreen .ratings-fullscreen-card {
    background: var(--card-bg);
    border-radius: 20px;
    width: 90%;
    max-width: 720px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 24px 22px 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: transform 0.25s var(--ease-out), opacity 0.2s ease;
}

#modal-ratings-fullscreen.active .ratings-fullscreen-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.ratings-fullscreen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-right: 40px;
}

.ratings-fullscreen-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin: 0;
}

.ratings-fullscreen-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 8px;
    border-radius: 11px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.ratings-fullscreen-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.ratings-fullscreen-search {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.ratings-fullscreen-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.ratings-fullscreen-search-input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 42px;
    background: var(--bg-color);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

body.dark-theme .ratings-fullscreen-search-input {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

.ratings-fullscreen-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.ratings-fullscreen-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    margin-right: -4px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.ratings-fullscreen-list::-webkit-scrollbar {
    width: 6px;
}

.ratings-fullscreen-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.ratings-fullscreen-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--bg-color);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
}

body.dark-theme .ratings-fullscreen-row {
    background: #2c2c2e;
}

.ratings-fullscreen-row:hover {
    background: rgba(0, 113, 227, 0.06);
    border-color: rgba(0, 113, 227, 0.2);
}

.ratings-fullscreen-row .avatar {
    width: 46px;
    height: 46px;
    font-size: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), #5a9bff);
    color: #fff;
    font-weight: 700;
}

.ratings-fullscreen-row .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.ratings-fullscreen-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ratings-fullscreen-row-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ratings-fullscreen-row-role {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.ratings-fullscreen-row-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    line-height: 1;
}

.ratings-fullscreen-row-stars {
    color: #ffcc00;
    letter-spacing: 0.5px;
}

.ratings-fullscreen-row-rating-num {
    font-weight: 700;
    color: var(--text-main);
    font-size: 13px;
    margin-left: 4px;
}

.ratings-fullscreen-row-rating-count {
    color: var(--text-muted);
    font-weight: 400;
}

.ratings-fullscreen-row-desc {
    font-size: 12.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ratings-fullscreen-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    border: 2px dashed var(--border);
    border-radius: 12px;
}

#top-roles-panel-global {
    position: fixed !important;
    top: -9999px;
    left: -9999px;
    width: 560px !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 70vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;

    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 18px !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), 0 4px 14px rgba(0, 0, 0, 0.08) !important;

    z-index: 2147483647 !important;
    pointer-events: none !important;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s var(--ease-out);
}

body.dark-theme #top-roles-panel-global {
    background: rgba(28, 28, 30, 0.94) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

#top-roles-panel-global.open {
    pointer-events: auto !important;
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

#top-roles-panel-global .top-roles-panel-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 16px 8px !important;
    border-bottom: none !important;
    flex-shrink: 0 !important;
}

#top-roles-panel-global .top-roles-panel-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: -0.01em !important;
    color: var(--text-main) !important;
}

#top-roles-panel-global .top-roles-panel-close {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: var(--bg-color) !important;
    color: var(--text-muted) !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: background 0.2s, color 0.2s, transform 0.2s !important;
}

body.dark-theme #top-roles-panel-global .top-roles-panel-close {
    background: #2c2c2e !important;
    color: #98989d !important;
}

#top-roles-panel-global .top-roles-panel-close:hover,
#top-roles-panel-global .top-roles-panel-close:active {
    background: #ff3b30 !important;
    color: #fff !important;
    transform: rotate(90deg) !important;
}

#top-roles-panel-global .top-roles-panel-search {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 12px 8px !important;
    padding: 0 !important;
    background: var(--bg-color) !important;
    border-radius: 11px !important;
    height: 36px !important;
}

body.dark-theme #top-roles-panel-global .top-roles-panel-search {
    background: #2c2c2e !important;
}

#top-roles-panel-global .top-roles-panel-search svg {
    position: absolute !important;
    left: 11px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--text-muted) !important;
    pointer-events: none !important;
    width: 15px !important;
    height: 15px !important;
    opacity: 0.7 !important;
}

#top-roles-panel-global .top-roles-panel-search-input,
#top-roles-panel-global #top-roles-search-input {
    width: 100% !important;
    height: 36px !important;
    padding: 0 12px 0 34px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 11px !important;
    font-size: 14.5px !important;
    color: var(--text-main) !important;
    font-family: inherit !important;
    outline: none !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
}

#top-roles-panel-global .top-roles-panel-search-input::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7 !important;
}

#top-roles-panel-global .top-roles-panel-search-input:focus {
    box-shadow: inset 0 0 0 1.5px var(--primary) !important;
}

#top-roles-panel-global .top-roles-panel-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 4px 6px 10px !important;
    overscroll-behavior: contain !important;
}

#top-roles-panel-global .top-roles-option-all {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 10px 12px !important;
    min-height: 40px !important;
    margin: 0 0 4px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    background: transparent !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
}

#top-roles-panel-global .top-roles-option-all:hover {
    background: var(--bg-color) !important;
}

#top-roles-panel-global .top-roles-option-all.active {
    background: rgba(0, 113, 227, 0.1) !important;
    color: var(--primary) !important;
}

body.dark-theme #top-roles-panel-global .top-roles-option-all.active {
    background: rgba(0, 113, 227, 0.22) !important;
    color: #4a9eff !important;
}

#top-roles-panel-global .top-roles-group {
    margin: 0 !important;
}

#top-roles-panel-global .top-roles-group-title {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--text-muted) !important;
    padding: 12px 12px 4px !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
}

#top-roles-panel-global .top-roles-group-rows {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2px 8px !important;
}

#top-roles-panel-global .top-roles-option {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 10px 12px !important;
    min-height: 40px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: var(--text-main) !important;
    background: transparent !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
}

#top-roles-panel-global .top-roles-option:hover {
    background: var(--bg-color) !important;
}

#top-roles-panel-global .top-roles-option.active {
    background: rgba(0, 113, 227, 0.1) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
}

body.dark-theme #top-roles-panel-global .top-roles-option.active {
    background: rgba(0, 113, 227, 0.22) !important;
    color: #4a9eff !important;
}

#top-roles-panel-global .top-roles-option-label {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#top-roles-panel-global .top-roles-option-check {
    flex-shrink: 0 !important;
    color: var(--primary) !important;
    opacity: 0 !important;
    transform: scale(0.5) !important;
    transition: opacity 0.2s, transform 0.2s var(--ease-out) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#top-roles-panel-global .top-roles-option.active .top-roles-option-check,
#top-roles-panel-global .top-roles-option-all.active .top-roles-option-check {
    opacity: 1 !important;
    transform: scale(1) !important;
}

body.dark-theme #top-roles-panel-global .top-roles-option-check {
    color: #4a9eff !important;
}

@media (max-width: 768px) {
    .close-modal {
        z-index: 100 !important;
        display: flex !important;
        position: absolute !important;
        top: 12px !important;
        left: 12px !important;
        right: auto !important;
        width: auto !important;
        height: 36px !important;
        padding: 0 14px 0 10px !important;
        background: var(--bg-color) !important;
        color: var(--primary) !important;
        border-radius: 100px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        align-items: center !important;
        gap: 6px !important;
        z-index: 1000 !important;
        transition: opacity 0.2s, transform 0.2s !important;
        transform: none !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
    }

    body.dark-theme .close-modal {
        background: rgba(28, 28, 30, 0.9) !important;
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
    }

    .close-modal:active {
        opacity: 0.6 !important;
        transform: scale(0.96) !important;
        background: var(--bg-color) !important;
        color: var(--primary) !important;
    }

    .close-modal span,
    .close-modal svg {
        display: none !important;
    }

    .close-modal::before {
        content: '';
        display: inline-block;
        width: 8px;
        height: 8px;
        border-left: 2.5px solid currentColor;
        border-bottom: 2.5px solid currentColor;
        transform: rotate(45deg);
        margin-bottom: 1px;
    }

    .close-modal::after {
        content: 'Назад';
        letter-spacing: -0.01em;
    }

    .auth-card {
        padding-top: 56px !important;
    }

    .property-view-modal {
        padding-top: 56px !important;
    }

    .profile-view-main {
        padding-top: 56px !important;
    }
}

.cabinet-pane[data-cab-pane="my-ads"]>div:first-child,
.cabinet-pane[data-cab-pane="my-ads"]>.cabinet-title+.cabinet-subtitle {
    max-width: 100%;
}

.cabinet-pane[data-cab-pane="my-ads"] .cabinet-title {
    font-size: 26px !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    margin-bottom: 6px !important;
}

.cabinet-pane[data-cab-pane="my-ads"] .cabinet-subtitle {
    font-size: 13px !important;
    color: var(--text-muted) !important;
    margin-bottom: 18px !important;
    line-height: 1.4 !important;
}

.cabinet-pane[data-cab-pane="my-ads"] .filters {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.cabinet-pane[data-cab-pane="my-ads"] .filter-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 9px 16px !important;
    border-radius: 100px !important;
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    color: var(--text-main) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease !important;
    font-family: inherit !important;
    white-space: nowrap !important;
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme .cabinet-pane[data-cab-pane="my-ads"] .filter-btn {
    background: rgba(28, 28, 30, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
    color: var(--text-main) !important;
}

.cabinet-pane[data-cab-pane="my-ads"] .filter-btn:hover {
    border-color: rgba(0, 113, 227, 0.3) !important;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.12) !important;
}

.cabinet-pane[data-cab-pane="my-ads"] .filter-btn.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35) !important;
}

body.dark-theme .cabinet-pane[data-cab-pane="my-ads"] .filter-btn.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.45) !important;
}

#my-ads-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

#my-ads-list .cabinet-item {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    padding: 16px 20px !important;

    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;

    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 18px !important;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-theme #my-ads-list .cabinet-item {
    background: rgba(28, 28, 30, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

#my-ads-list .cabinet-item:hover {
    border-color: rgba(0, 113, 227, 0.3) !important;
    box-shadow:
        0 8px 28px rgba(0, 113, 227, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

body.dark-theme #my-ads-list .cabinet-item:hover {
    border-color: rgba(0, 113, 227, 0.4) !important;
    box-shadow:
        0 8px 28px rgba(0, 113, 227, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

#my-ads-list .cabinet-item-info {
    flex: 1 !important;
    min-width: 0 !important;
    cursor: pointer;
}

#my-ads-list .cabinet-item-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    letter-spacing: -0.01em !important;
    line-height: 1.3 !important;
    margin-bottom: 5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

#my-ads-list .cabinet-item-desc {
    font-size: 13px !important;
    color: var(--text-muted) !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.4 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
}

#my-ads-list .cabinet-item>div:last-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
}

#my-ads-list .cabinet-item-price {
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #34c759 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

#my-ads-list .cab-item-delete {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: rgba(255, 59, 48, 0.12) !important;
    color: #ff3b30 !important;
    border: none !important;
    font-size: 14px !important;
    cursor: pointer !important;
    font-family: inherit !important;
    flex-shrink: 0 !important;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease !important;
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme #my-ads-list .cab-item-delete {
    background: rgba(255, 69, 58, 0.18) !important;
    color: #ff453a !important;
}

#my-ads-list .cab-item-delete:hover,
#my-ads-list .cab-item-delete:focus-visible {
    background: #ff3b30 !important;
    color: #ffffff !important;
    transform: rotate(90deg) scale(1.08) !important;
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35) !important;
    outline: none !important;
}

#my-ads-list .cab-item-delete:active {
    transform: rotate(90deg) scale(0.92) !important;
    background: #e0342b !important;
}

#my-ads-list .cabinet-empty {
    padding: 60px 20px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
    font-size: 14px !important;
    border: 2px dashed rgba(0, 0, 0, 0.08) !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
}

body.dark-theme #my-ads-list .cabinet-empty {
    background: rgba(28, 28, 30, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

#my-ads-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 4px 0 !important;
}

#my-ads-list .cabinet-item {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    gap: 16px 20px !important;
    padding: 18px 20px !important;
    margin: 0 !important;

    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;

    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 20px !important;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease !important;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-theme #my-ads-list .cabinet-item {
    background: rgba(28, 28, 30, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

#my-ads-list .cabinet-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.15) 0%,
            rgba(255, 255, 255, 0) 100%);
    border-radius: 20px 20px 0 0;
    pointer-events: none;
    z-index: 0;
}

body.dark-theme #my-ads-list .cabinet-item::before {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0) 100%);
}

#my-ads-list .cabinet-item>* {
    position: relative;
    z-index: 1;
}

#my-ads-list .cabinet-item:hover {
    border-color: rgba(0, 113, 227, 0.3) !important;
    box-shadow:
        0 12px 32px rgba(0, 113, 227, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

body.dark-theme #my-ads-list .cabinet-item:hover {
    border-color: rgba(0, 113, 227, 0.4) !important;
    box-shadow:
        0 12px 32px rgba(0, 113, 227, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

#my-ads-list .cabinet-item-info {
    flex: 1 !important;
    min-width: 0 !important;
    cursor: pointer;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

#my-ads-list .cabinet-item-title {
    font-size: 15.5px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    letter-spacing: -0.015em !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

#my-ads-list .cabinet-item-title svg {
    width: 30px;
    height: 30px;
    padding: 6px;
    background: rgba(0, 113, 227, 0.1);
    color: var(--primary);
    border-radius: 9px;
    flex-shrink: 0;
    box-sizing: border-box;
}

body.dark-theme #my-ads-list .cabinet-item-title svg {
    background: rgba(0, 113, 227, 0.22);
    color: #4a9eff;
}

#my-ads-list .cabinet-item-desc {
    font-size: 12.5px !important;
    color: var(--text-muted) !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    padding-left: 40px;
}

#my-ads-list .cabinet-item-desc svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.7;
}

#my-ads-list .cabinet-item-desc+.cabinet-item-desc {
    color: var(--text-muted) !important;
    opacity: 0.85;
    padding-left: 40px;
    margin-top: -2px;
}

#my-ads-list .cabinet-item>div:last-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    min-width: 100px;
}

#my-ads-list .cabinet-item-price {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #34c759 !important;
    letter-spacing: -0.025em !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    padding: 6px 12px !important;
    border-radius: 100px !important;
    background: rgba(52, 199, 89, 0.1) !important;
    transition: background 0.2s ease;
}

body.dark-theme #my-ads-list .cabinet-item-price {
    background: rgba(52, 199, 89, 0.15) !important;
}

#my-ads-list .cabinet-item:hover .cabinet-item-price {
    background: rgba(52, 199, 89, 0.18) !important;
}

#my-ads-list .cab-item-delete {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: rgba(255, 59, 48, 0.1) !important;
    color: #ff3b30 !important;
    border: none !important;
    font-size: 13px !important;
    cursor: pointer !important;
    font-family: inherit !important;
    flex-shrink: 0 !important;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease !important;
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme #my-ads-list .cab-item-delete {
    background: rgba(255, 69, 58, 0.16) !important;
    color: #ff453a !important;
}

#my-ads-list .cab-item-delete:hover,
#my-ads-list .cab-item-delete:focus-visible {
    background: #ff3b30 !important;
    color: #ffffff !important;
    transform: rotate(90deg) scale(1.1) !important;
    box-shadow: 0 6px 16px rgba(255, 59, 48, 0.4) !important;
    outline: none !important;
}

#my-ads-list .cab-item-delete:active {
    transform: rotate(90deg) scale(0.9) !important;
    background: #e0342b !important;
}

#my-ads-list .cabinet-empty {
    padding: 70px 20px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
    font-size: 14px !important;
    border: 2px dashed rgba(0, 0, 0, 0.08) !important;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
}

body.dark-theme #my-ads-list .cabinet-empty {
    background: rgba(28, 28, 30, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.profile-view-modal {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(50px) saturate(220%) !important;
    -webkit-backdrop-filter: blur(50px) saturate(220%) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 28px !important;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.25),
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    padding: 0 !important;
    overflow: hidden !important;
    max-width: 820px !important;
    width: 92% !important;
}

body.dark-theme .profile-view-modal {
    background: rgba(28, 28, 30, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.7),
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.profile-view-modal.ads-open {
    max-width: 1200px !important;
}

.profile-view-modal.reviews-open {
    max-width: 1200px !important;
}

.profile-view-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.35) 0%,
            rgba(255, 255, 255, 0) 100%);
    border-radius: 28px 28px 0 0;
    pointer-events: none;
    z-index: 0;
}

body.dark-theme .profile-view-modal::before {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0) 100%);
}

.profile-view-layout {
    position: relative;
    z-index: 1;
}

.profile-view-header {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    padding: 8px 4px 20px !important;
    margin-bottom: 16px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.dark-theme .profile-view-header {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.profile-view-avatar {
    width: 88px !important;
    height: 88px !important;
    font-size: 36px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #0071e3 0%, #5a9bff 100%) !important;
    box-shadow:
        0 8px 24px rgba(0, 113, 227, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    border: 2px solid rgba(255, 255, 255, 0.6) !important;
    color: #fff !important;
    font-weight: 700 !important;
}

body.dark-theme .profile-view-avatar {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.profile-view-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}

.profile-view-header-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.profile-view-name {
    font-size: 26px !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    line-height: 1.1 !important;
    color: var(--text-main) !important;
    margin: 0 0 8px 0 !important;
}

.profile-view-role {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 12px !important;
    border-radius: 100px !important;
    background: rgba(0, 113, 227, 0.12) !important;
    color: var(--primary) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin-bottom: 10px !important;
    line-height: 1.3 !important;
}

body.dark-theme .profile-view-role {
    background: rgba(0, 113, 227, 0.22) !important;
    color: #4a9eff !important;
}

.profile-view-rating {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
}

.profile-view-stars {
    color: #ffcc00 !important;
    font-size: 16px !important;
    letter-spacing: 1px !important;
    text-shadow: 0 1px 2px rgba(255, 204, 0, 0.25);
}

.profile-view-rating-num {
    font-weight: 800 !important;
    color: var(--text-main) !important;
    font-size: 15px !important;
}

.profile-view-rating-count {
    color: var(--text-muted) !important;
    font-size: 12.5px !important;
}

.profile-view-actions {
    display: flex !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
}

.profile-view-action-btn {
    flex: 1 !important;
    height: 50px !important;
    border-radius: 16px !important;
    border: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 12px !important;
    transition:
        box-shadow 0.2s var(--ease-out),
        background 0.2s ease !important;
}

.profile-view-action-btn.primary {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%) !important;
    color: #ffffff !important;
    box-shadow:
        0 8px 22px rgba(0, 113, 227, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.profile-view-action-btn.primary:hover {
    box-shadow:
        0 12px 28px rgba(0, 113, 227, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.profile-view-action-btn.secondary {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    color: var(--text-main) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.dark-theme .profile-view-action-btn.secondary {
    background: rgba(44, 44, 46, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.profile-view-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.75) !important;
}

.profile-view-action-btn:active {
    transform: scale(0.96);
    filter: brightness(0.93);
    transition-duration: 0.1s;
}

body.dark-theme .profile-view-action-btn.secondary:hover {
    background: rgba(44, 44, 46, 0.8) !important;
}

.profile-view-contacts {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 18px !important;
    padding: 4px !important;
    margin-bottom: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    overflow: hidden !important;
}

body.dark-theme .profile-view-contacts {
    background: rgba(44, 44, 46, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.profile-view-contact-row {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 14px 16px !important;
    border-radius: 14px !important;
    text-decoration: none !important;
    color: var(--text-main) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    transition: background 0.2s ease !important;
}

.profile-view-contact-row:last-child {
    border-bottom: none !important;
}

body.dark-theme .profile-view-contact-row {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

.profile-view-contact-row[href]:hover {
    background: rgba(0, 113, 227, 0.08) !important;
    cursor: pointer !important;
}

body.dark-theme .profile-view-contact-row[href]:hover {
    background: rgba(0, 113, 227, 0.15) !important;
}

.profile-view-contact-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    background: rgba(0, 113, 227, 0.1) !important;
    color: var(--primary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    font-size: 0 !important;
}

.profile-view-contact-icon svg {
    width: 18px !important;
    height: 18px !important;
    stroke: currentColor !important;
    display: block !important;
}

body.dark-theme .profile-view-contact-icon {
    background: rgba(0, 113, 227, 0.22) !important;
    color: #4a9eff !important;
}

.profile-view-contact-text {
    flex: 1 !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.profile-view-contact-arrow {
    color: var(--text-muted) !important;
    font-size: 18px !important;
    font-weight: 300 !important;
    opacity: 0.5 !important;
    flex-shrink: 0 !important;
    transition: opacity 0.2s ease, color 0.2s ease !important;
}

.profile-view-contact-row[href]:hover .profile-view-contact-arrow {
    opacity: 1 !important;
    color: var(--primary) !important;
}

.profile-view-votes {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 18px !important;
}

.profile-view-vote-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 14px 16px !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

body.dark-theme .profile-view-vote-item {
    background: rgba(44, 44, 46, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.profile-view-vote-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    font-size: 0 !important;
}

.profile-view-vote-icon svg {
    width: 22px !important;
    height: 22px !important;
    stroke: currentColor !important;
    display: block !important;
}

.profile-view-vote-icon.like {
    background: rgba(52, 199, 89, 0.15) !important;
    color: #34c759 !important;
}

.profile-view-vote-icon.dislike {
    background: rgba(255, 59, 48, 0.15) !important;
    color: #ff3b30 !important;
}

.profile-view-vote-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.profile-view-vote-value {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
    line-height: 1 !important;
    letter-spacing: -0.02em !important;
}

.profile-view-vote-label {
    font-size: 11.5px !important;
    color: var(--text-muted) !important;
    margin-top: 4px !important;
    font-weight: 500 !important;
}

.profile-view-ads-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
    padding: 14px 18px !important;
    margin-bottom: 18px !important;
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 16px !important;
    cursor: pointer !important;
    font-family: inherit !important;
    color: var(--text-main) !important;
    transition: background 0.2s ease, border-color 0.2s ease !important;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

body.dark-theme .profile-view-ads-toggle {
    background: rgba(44, 44, 46, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.profile-view-ads-toggle:hover {
    background: rgba(0, 113, 227, 0.08) !important;
    border-color: rgba(0, 113, 227, 0.3) !important;
    box-shadow:
        0 8px 22px rgba(0, 113, 227, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

body.dark-theme .profile-view-ads-toggle:hover {
    background: rgba(0, 113, 227, 0.15) !important;
}

.profile-view-ads-toggle-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    background: rgba(0, 113, 227, 0.1) !important;
    color: var(--primary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    font-size: 0 !important;
}

.profile-view-ads-toggle-icon svg {
    width: 18px !important;
    height: 18px !important;
    stroke: currentColor !important;
    display: block !important;
}

body.dark-theme .profile-view-ads-toggle-icon {
    background: rgba(0, 113, 227, 0.22) !important;
    color: #4a9eff !important;
}

.profile-view-ads-toggle-label {
    flex: 1 !important;
    text-align: left !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
}

.profile-view-section-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 26px !important;
    height: 22px !important;
    padding: 0 8px !important;
    border-radius: 11px !important;
    background: var(--primary) !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
}

.profile-view-ads-toggle-chevron {
    color: var(--text-muted) !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease, color 0.2s ease !important;
}

.profile-view-ads-toggle:hover .profile-view-ads-toggle-chevron {
    color: var(--primary) !important;
}

.profile-view-ads-toggle.active .profile-view-ads-toggle-chevron {
    transform: rotate(180deg) !important;
    color: var(--primary) !important;
}

.profile-view-section-title {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.7px !important;
    color: var(--text-muted) !important;
    margin-bottom: 12px !important;
    margin-left: 2px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.profile-view-reviews-section {
    margin-bottom: 18px !important;
}

.profile-view-reviews-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    padding-right: 4px !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.profile-view-reviews-list::-webkit-scrollbar {
    width: 6px;
}

.profile-view-reviews-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

body.dark-theme .profile-view-reviews-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.profile-review-item {
    display: flex !important;
    gap: 12px !important;
    padding: 14px 16px !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

body.dark-theme .profile-review-item {
    background: rgba(44, 44, 46, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.profile-review-avatar {
    width: 40px !important;
    height: 40px !important;
    font-size: 15px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #0071e3, #5a9bff) !important;
    color: #fff !important;
    font-weight: 700 !important;
}

.profile-review-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}

.profile-review-body {
    flex: 1 !important;
    min-width: 0 !important;
}

.profile-review-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 4px !important;
}

.profile-review-author {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    cursor: pointer !important;
    transition: color 0.2s ease !important;
}

.profile-review-author:hover {
    color: var(--primary) !important;
}

.profile-review-stars {
    display: inline-flex !important;
    align-items: center !important;
    gap: 1px !important;
    color: #ffcc00 !important;
    font-size: 12px !important;
    letter-spacing: 1px !important;
    flex-shrink: 0 !important;
}

.profile-review-text {
    font-size: 13px !important;
    color: var(--text-muted) !important;
    line-height: 1.45 !important;
    margin: 0 !important;
    word-wrap: break-word !important;
}

.profile-review-date {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    opacity: 0.7 !important;
    margin-top: 6px !important;
}

.profile-view-add-review {
    margin-top: 6px !important;
    padding-top: 20px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.dark-theme .profile-view-add-review {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

.profile-view-vote-buttons {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
}

.profile-view-vote-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    height: 48px !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1.5px solid rgba(0, 0, 0, 0.06) !important;
    color: var(--text-muted) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.dark-theme .profile-view-vote-btn {
    background: rgba(44, 44, 46, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.profile-view-vote-btn.like.active {
    background: rgba(52, 199, 89, 0.15) !important;
    border-color: #34c759 !important;
    color: #34c759 !important;
    box-shadow: 0 4px 14px rgba(52, 199, 89, 0.25) !important;
}

.profile-view-vote-btn.dislike.active {
    background: rgba(255, 59, 48, 0.15) !important;
    border-color: #ff3b30 !important;
    color: #ff3b30 !important;
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.25) !important;
}

.profile-view-review-textarea {
    width: 100% !important;
    height: 100px !important;
    min-height: 100px !important;
    padding: 14px 16px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1.5px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 14px !important;
    resize: none !important;
    font-size: 14px !important;
    color: var(--text-main) !important;
    font-family: inherit !important;
    outline: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

body.dark-theme .profile-view-review-textarea {
    background: rgba(44, 44, 46, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-main) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.profile-view-review-textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15) !important;
}

.profile-view-self {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 16px 18px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    margin-top: 6px !important;
}

body.dark-theme .profile-view-self {
    background: rgba(44, 44, 46, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

.profile-view-self-text {
    font-size: 13px !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
}

.profile-view-ads-panel {
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
    border-left: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.dark-theme .profile-view-ads-panel {
    background: rgba(20, 20, 22, 0.7) !important;
    border-left-color: rgba(255, 255, 255, 0.06) !important;
}

.profile-view-ads-panel-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 4px 0 14px !important;
    margin-bottom: 14px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    flex-shrink: 0 !important;
}

body.dark-theme .profile-view-ads-panel-header {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.profile-view-ads-panel-title {
    font-size: 12.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.7px !important;
    color: var(--text-muted) !important;
}

.profile-view-ads-panel-close {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background: rgba(120, 120, 128, 0.14) !important;
    border: none !important;
    color: var(--text-muted) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0 !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease !important;
}

.profile-view-ads-panel-close svg {
    width: 14px !important;
    height: 14px !important;
    stroke: currentColor !important;
    display: block !important;
}

body.dark-theme .profile-view-ads-panel-close {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #98989d !important;
}

.profile-view-ads-panel-close:hover {
    background: #ff3b30 !important;
    color: #ffffff !important;
    transform: rotate(90deg) scale(1.08) !important;
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35) !important;
}

body.dark-theme .profile-view-ads-panel-close:hover {
    background: #ff453a !important;
    color: #ffffff !important;
}

.profile-view-ads-panel-filters {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-bottom: 14px !important;
    flex-shrink: 0 !important;
}

.profile-view-ads-filter {
    padding: 8px 16px !important;
    border-radius: 100px !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    color: var(--text-main) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    white-space: nowrap !important;
}

body.dark-theme .profile-view-ads-filter {
    background: rgba(44, 44, 46, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.profile-view-ads-filter:hover {
    border-color: rgba(0, 113, 227, 0.3) !important;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.12) !important;
}

.profile-view-ads-filter.active {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow:
        0 6px 18px rgba(0, 113, 227, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.profile-view-ads-panel-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 12px !important;
    align-content: start !important;
    overscroll-behavior: contain;
}

.profile-ads-card {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 16px !important;
    padding: 14px !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease !important;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    position: relative;
    overflow: hidden;
}

body.dark-theme .profile-ads-card {
    background: rgba(44, 44, 46, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.profile-ads-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.15) 0%,
            rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

body.dark-theme .profile-ads-card::before {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0) 100%);
}

.profile-ads-card:hover {
    border-color: rgba(0, 113, 227, 0.3) !important;
    box-shadow:
        0 10px 28px rgba(0, 113, 227, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

body.dark-theme .profile-ads-card:hover {
    border-color: rgba(0, 113, 227, 0.4) !important;
    box-shadow:
        0 10px 28px rgba(0, 113, 227, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.profile-ads-card>* {
    position: relative;
    z-index: 1;
}

.profile-ads-card-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
}

.profile-ads-card-badge {
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 10px !important;
    border-radius: 100px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

.profile-ads-card-badge.market {
    background: rgba(0, 113, 227, 0.12) !important;
    color: #0071e3 !important;
}

.profile-ads-card-badge.jobs {
    background: rgba(255, 149, 0, 0.15) !important;
    color: #ff9500 !important;
}

.profile-ads-card-badge.properties {
    background: rgba(52, 199, 89, 0.15) !important;
    color: #34c759 !important;
}

body.dark-theme .profile-ads-card-badge.market {
    background: rgba(0, 113, 227, 0.25) !important;
    color: #4a9eff !important;
}

body.dark-theme .profile-ads-card-badge.jobs {
    background: rgba(255, 149, 0, 0.25) !important;
    color: #ffb340 !important;
}

body.dark-theme .profile-ads-card-badge.properties {
    background: rgba(52, 199, 89, 0.25) !important;
    color: #4cd964 !important;
}

.profile-ads-card-price {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #34c759 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: -0.02em !important;
}

.profile-ads-card-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    line-height: 1.3 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    word-wrap: break-word !important;
}

.profile-ads-card-desc {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    line-height: 1.35 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

.profile-ads-card-loc {
    font-size: 11.5px !important;
    color: var(--text-muted) !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-top: auto !important;
}

.profile-ads-card-loc svg {
    width: 12px !important;
    height: 12px !important;
    opacity: 0.7 !important;
}

.profile-view-ads-empty {
    grid-column: 1 / -1 !important;
    padding: 50px 24px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
    font-size: 13px !important;
    border-radius: 18px !important;
    border: 2px dashed rgba(0, 0, 0, 0.08) !important;
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
}

body.dark-theme .profile-view-ads-empty {
    border-color: rgba(255, 255, 255, 0.08) !important;
    background: rgba(44, 44, 46, 0.35) !important;
}

.property-card-skeleton-card {
    background: var(--card-bg);
    border: 1.5px solid transparent;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    position: relative;
    pointer-events: none;
    user-select: none;
}

body.dark-theme .property-card-skeleton-card {
    background: #2c2c2e;
}

.property-card-skeleton-image {
    position: relative;
    width: 100%;
    height: 150px;
    background: rgba(120, 120, 128, 0.12);
    overflow: hidden;
}

body.dark-theme .property-card-skeleton-image {
    background: rgba(255, 255, 255, 0.05);
}

.property-card-skeleton-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.55) 50%,
            transparent 100%);
    transform: translateX(-100%);
    animation: propertyShimmerRun 1.4s infinite;
    pointer-events: none;
}

body.dark-theme .property-card-skeleton-shimmer {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.12) 50%,
            transparent 100%);
}

@keyframes propertyShimmerRun {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.property-card-skeleton-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.property-card-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: rgba(120, 120, 128, 0.15);
    position: relative;
    overflow: hidden;
}

body.dark-theme .property-card-skeleton-line {
    background: rgba(255, 255, 255, 0.08);
}

.property-card-skeleton-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.5) 50%,
            transparent 100%);
    transform: translateX(-100%);
    animation: propertyShimmerRun 1.4s infinite;
}

body.dark-theme .property-card-skeleton-line::after {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 100%);
}

.property-card-skeleton-line.short {
    width: 40%;
    height: 16px;
    margin-bottom: 2px;
}

.property-card-skeleton-line.medium {
    width: 75%;
}

.property-card-skeleton-line.long {
    width: 100%;
}

.property-card-skeleton-card:nth-child(1) .property-card-skeleton-shimmer,
.property-card-skeleton-card:nth-child(1) .property-card-skeleton-line::after {
    animation-delay: 0s;
}

.property-card-skeleton-card:nth-child(2) .property-card-skeleton-shimmer,
.property-card-skeleton-card:nth-child(2) .property-card-skeleton-line::after {
    animation-delay: 0.08s;
}

.property-card-skeleton-card:nth-child(3) .property-card-skeleton-shimmer,
.property-card-skeleton-card:nth-child(3) .property-card-skeleton-line::after {
    animation-delay: 0.16s;
}

.property-card-skeleton-card:nth-child(4) .property-card-skeleton-shimmer,
.property-card-skeleton-card:nth-child(4) .property-card-skeleton-line::after {
    animation-delay: 0.24s;
}

.property-card-skeleton-card:nth-child(5) .property-card-skeleton-shimmer,
.property-card-skeleton-card:nth-child(5) .property-card-skeleton-line::after {
    animation-delay: 0.32s;
}

.property-card-skeleton-card:nth-child(6) .property-card-skeleton-shimmer,
.property-card-skeleton-card:nth-child(6) .property-card-skeleton-line::after {
    animation-delay: 0.40s;
}

.properties-page-grid .property-card-skeleton {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(120, 120, 128, 0.12);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

body.dark-theme .properties-page-grid .property-card-skeleton {
    background: rgba(255, 255, 255, 0.05);
}

.properties-page-grid .property-card-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.55) 50%,
            transparent 100%);
    transform: translateX(-100%);
    animation: propertyShimmerRun 1.4s infinite;
}

body.dark-theme .properties-page-grid .property-card-skeleton::after {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.12) 50%,
            transparent 100%);
}

.properties-page-grid .property-card-skeleton-icon {
    color: var(--text-muted);
    opacity: 0.35;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.properties-page-grid .property-card-image img {
    animation: propertyImageFadeIn 0.3s var(--ease-out);
}

@keyframes propertyImageFadeIn {
    from {
        opacity: 0;
        transform: scale(1.02);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#properties-page-grid:has(.property-card-skeleton-card) {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 16px !important;
}

.metal-dims-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.metal-dims-grid.metal-dims-2col {
    grid-template-columns: repeat(2, 1fr);
}

.metal-dim-item {
    margin-bottom: 0;
    min-width: 0;
}

.metal-dim-item label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.metal-dim-item input {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 360px) {
    .metal-dims-grid.metal-dims-2col {
        grid-template-columns: 1fr;
    }
}

#market .flex-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-theme #market .flex-row {
    background: rgba(28, 28, 30, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#market .flex-row .filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
}

#market .flex-row .filter-btn {
    height: 40px;
    padding: 0 18px;
    border-radius: 100px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    white-space: nowrap;
}

body.dark-theme #market .flex-row .filter-btn {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#market .flex-row .filter-btn:hover {
    border-color: rgba(0, 113, 227, 0.4);
    color: var(--primary);
}

#market .flex-row .filter-btn.active {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow:
        0 6px 18px rgba(0, 113, 227, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#market .flex-row .loc-dropdown {
    flex: 0 0 auto;
    min-width: 200px;
}

#market .flex-row .loc-dropdown-toggle {
    height: 40px;
    border-radius: 100px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-size: 13px;
    padding: 0 16px;
    transition: border-color 0.2s var(--ease-out);
}

body.dark-theme #market .flex-row .loc-dropdown-toggle {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#market .flex-row .loc-dropdown-toggle:hover {
    border-color: rgba(0, 113, 227, 0.4);
}

#market .flex-row>.btn-primary {
    height: 40px;
    padding: 0 20px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #198754 0%, #20a866 100%) !important;
    box-shadow: 0 6px 18px rgba(25, 135, 84, 0.3);
    transition: box-shadow 0.2s var(--ease-out);
    white-space: nowrap;
}

#market .flex-row>.btn-primary:hover {
    box-shadow: 0 10px 24px rgba(25, 135, 84, 0.42);
}

#market .flex-row>.btn-primary:active {
    transform: scale(0.96);
}

#market-grid.grid-3col {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 16px !important;
    margin-bottom: 22px !important;
}

#market-grid .market-card {
    position: relative;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1;
    width: 100%;
    min-width: 0;
    overflow: hidden;

    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);

    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;

    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);

    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-theme #market-grid .market-card {
    background: rgba(28, 28, 30, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#market-grid .market-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.15) 0%,
            rgba(255, 255, 255, 0) 100%);
    border-radius: 20px 20px 0 0;
    pointer-events: none;
    z-index: 1;
}

body.dark-theme #market-grid .market-card::before {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0) 100%);
}

#market-grid .market-card:hover {
    border-color: rgba(0, 113, 227, 0.35);
    box-shadow:
        0 18px 48px rgba(0, 113, 227, 0.14),
        0 4px 12px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.dark-theme #market-grid .market-card:hover {
    border-color: rgba(0, 113, 227, 0.45);
    box-shadow:
        0 18px 48px rgba(0, 113, 227, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#market-grid .market-card:active {
    transform: translateZ(0) scale(0.98);
    transition-duration: 0.12s;
}

#market-grid .market-card-photo-wrap {
    position: relative;
    width: 100%;
    flex: 0 0 60%;
    overflow: hidden;
    background: rgba(120, 120, 128, 0.08);
    border-radius: 20px 20px 0 0;
    z-index: 2;
}

body.dark-theme #market-grid .market-card-photo-wrap {
    background: rgba(255, 255, 255, 0.04);
}

#market-grid .market-card-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.2s var(--ease-out);
    z-index: 2;
}

#market-grid .market-card-skeleton {
    position: absolute;
    inset: 0;
    background: rgba(120, 120, 128, 0.12);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    z-index: 1;
}

#market-grid .market-card-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.55) 50%,
            transparent 100%);
    transform: translateX(-100%);
    animation: propertyShimmerRun 1.4s infinite;
}

body.dark-theme #market-grid .market-card-skeleton {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme #market-grid .market-card-skeleton::after {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 100%);
}

#market-grid .market-card-skeleton-icon {
    opacity: 0.45;
    position: relative;
    z-index: 2;
}

#market-grid .market-card-emoji-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
            rgba(0, 113, 227, 0.08) 0%,
            rgba(90, 155, 255, 0.12) 100%);
}

body.dark-theme #market-grid .market-card-emoji-wrap {
    background: linear-gradient(135deg,
            rgba(0, 113, 227, 0.18) 0%,
            rgba(90, 155, 255, 0.08) 100%);
}

#market-grid .market-card-emoji {
    font-size: 64px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    color: var(--primary);
}

#market-grid .market-card-emoji svg {
    width: 64px;
    height: 64px;
}

#market-grid .market-card-photo-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    z-index: 3;
}

#market-grid .market-card-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 6;
    font-size: 14px;
    transition: transform 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.35);
}

#market-grid .market-card-delete:hover {
    transform: rotate(90deg) scale(1.1);
    background: #ff3b30;
}

#market-grid .market-card-delete:active {
    transform: rotate(90deg) scale(0.92);
}

#market-grid .fav-btn-market {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-size: 15px !important;
    z-index: 5 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    transition: color 0.2s var(--ease-out) !important;
}

#market-grid .market-card:has(.market-card-delete) .fav-btn-market {
    right: 52px !important;
}

body.dark-theme #market-grid .fav-btn-market {
    background: rgba(0, 0, 0, 0.55) !important;
    color: #fff !important;
}

#market-grid .fav-btn-market:hover {
    color: #ff3b30 !important;
}

#market-grid .fav-btn-market.active {
    background: rgba(255, 59, 48, 0.95) !important;
    color: #fff !important;
}

#market-grid .market-info {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    padding: 12px 14px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    overflow: hidden;
}

#market-grid .market-price {
    font-size: 16px;
    font-weight: 800;
    color: #34c759;
    letter-spacing: -0.025em;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#market-grid .market-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

#market-grid .market-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    min-width: 0;
}

#market-grid .market-card-meta .market-loc,
#market-grid .market-card-meta .market-author {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
    transition: color 0.2s ease;
}

#market-grid .market-card-meta .market-author {
    cursor: pointer;
    font-weight: 500;
}

#market-grid .market-card-meta .market-author:hover {
    color: var(--primary);
}

#market-grid .market-card-meta svg {
    width: 12px;
    height: 12px;
    opacity: 0.75;
    flex-shrink: 0;
}

#market-grid .property-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    border: 2px dashed var(--border);
    border-radius: 20px;
}

@media (max-width: 768px) {
    #market .flex-row {
        padding: 10px;
        border-radius: 18px;
        gap: 8px;
    }

    #market .flex-row .filter-btn,
    #market .flex-row .loc-dropdown-toggle,
    #market .flex-row>.btn-primary {
        height: 38px;
        font-size: 12.5px;
    }

    #market-grid.grid-3col {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
        gap: 12px !important;
    }

    #market-grid .market-card {
        border-radius: 18px;
    }

    #market-grid .market-card-photo-wrap {
        border-radius: 18px 18px 0 0;
    }

    #market-grid .market-price {
        font-size: 15px;
    }

    #market-grid .market-title {
        font-size: 12.5px;
    }

    #market-grid .market-card-meta {
        font-size: 10.5px;
    }
}

@media (max-width: 400px) {
    #market-grid.grid-3col {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    #market-grid .market-card-emoji {
        font-size: 48px;
    }

    #market-grid .market-card-emoji svg {
        width: 48px;
        height: 48px;
    }

    #market-grid .market-info {
        padding: 10px 12px 12px 12px;
    }
}

body.mobile-device #market .flex-row,
body.mobile-device #market .flex-row .filter-btn,
body.mobile-device #market .flex-row .loc-dropdown-toggle,
body.mobile-device #market-grid .market-card,
body.mobile-device #market-grid .market-card-photo-count,
body.mobile-device #market-grid .market-card-delete,
body.mobile-device #market-grid .fav-btn-market {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.mobile-device #market .flex-row {
    background: var(--card-bg) !important;
}

body.mobile-device #market .flex-row .filter-btn,
body.mobile-device #market .flex-row .loc-dropdown-toggle {
    background: var(--bg-color) !important;
}

body.mobile-device #market-grid .market-card {
    background: var(--card-bg) !important;
}

.job-card {
    padding: 20px 22px 18px 22px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    position: relative;
}

.job-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.job-card-author {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.job-card-author:hover {
    opacity: 0.85;
}

.job-card-avatar {
    width: 46px !important;
    height: 46px !important;
    font-size: 18px !important;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), #5a9bff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.job-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.job-card-author-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.job-card-author-info .author-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-card-author-info .feed-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-card-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.job-delete-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.job-delete-btn:hover {
    background: #ff3b30;
    color: #fff;
    transform: rotate(90deg) scale(1.08);
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35);
}

.job-delete-btn:active {
    transform: rotate(90deg) scale(0.92);
}

body.dark-theme .job-delete-btn {
    background: rgba(255, 69, 58, 0.16);
    color: #ff453a;
}

body.dark-theme .job-delete-btn:hover {
    background: #ff453a;
    color: #fff;
}

.fav-btn-inline {
    position: static !important;
    width: 34px !important;
    height: 34px !important;
    font-size: 15px !important;
    background: var(--bg-color) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    border-radius: 50% !important;
}

body.dark-theme .fav-btn-inline {
    background: #2c2c2e !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.fav-btn-inline:hover {
    border-color: #ff3b30 !important;
    color: #ff3b30 !important;
}

.fav-btn-inline.active {
    background: rgba(255, 59, 48, 0.1) !important;
    border-color: #ff3b30 !important;
    color: #ff3b30 !important;
}

.job-card-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.job-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.015em;
    line-height: 1.3;
    margin: 0;
    word-wrap: break-word;
}

.job-card-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.job-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 14px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
}

.job-card-price {
    font-size: 18px;
    font-weight: 800;
    color: #34c759;
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
}

.job-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.job-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: 100px;
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.job-action-btn:hover {
    background: var(--primary-light);
}

.job-action-btn:active {
    transform: scale(0.96);
}

.job-action-btn.primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

.job-action-btn.primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
}

body.dark-theme .job-action-btn {
    border-color: var(--primary);
    color: #4a9eff;
}

body.dark-theme .job-action-btn:hover {
    background: rgba(0, 113, 227, 0.15);
}

body.dark-theme .job-action-btn.primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

@media (max-width: 560px) {
    .job-card {
        padding: 16px !important;
        gap: 12px !important;
    }

    .job-card-title {
        font-size: 15.5px;
    }

    .job-card-price {
        font-size: 16px;
    }

    .job-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .job-card-actions {
        width: 100%;
        justify-content: stretch;
    }

    .job-action-btn {
        flex: 1 1 0;
        justify-content: center;
        padding: 0 12px;
        font-size: 12px;
    }

    .job-card-head-actions {
        gap: 6px;
    }

    .job-delete-btn,
    .fav-btn-inline {
        width: 30px !important;
        height: 30px !important;
    }
}

#jobs .flex-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-theme #jobs .flex-row {
    background: rgba(28, 28, 30, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#jobs .flex-row #jobs-search-input {
    flex: 1 1 auto;
    height: 44px;
    padding: 0 18px;
    border-radius: 100px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    font-size: 14.5px;
    color: var(--text-main);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s var(--ease-out);
    margin: 0;
}

body.dark-theme #jobs .flex-row #jobs-search-input {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#jobs .flex-row #jobs-search-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 113, 227, 0.4);
    box-shadow:
        0 0 0 4px rgba(0, 113, 227, 0.15),
        0 4px 14px rgba(0, 113, 227, 0.15);
}

body.dark-theme #jobs .flex-row #jobs-search-input:focus {
    background: rgba(44, 44, 46, 0.95);
}

#jobs .flex-row #jobs-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.75;
}

#jobs .flex-row .loc-dropdown {
    flex: 0 0 auto;
    min-width: 200px;
}

#jobs .flex-row .loc-dropdown-toggle {
    height: 44px;
    border-radius: 100px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-size: 13.5px;
    padding: 0 16px;
    transition: border-color 0.2s var(--ease-out);
}

body.dark-theme #jobs .flex-row .loc-dropdown-toggle {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#jobs .flex-row .loc-dropdown-toggle:hover {
    border-color: rgba(0, 113, 227, 0.4);
}

#jobs .flex-row>.btn-primary {
    height: 44px;
    padding: 0 22px;
    border-radius: 100px;
    font-size: 13.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.28);
    transition: box-shadow 0.2s var(--ease-out);
}

#jobs .flex-row>.btn-primary:hover {
    box-shadow: 0 10px 24px rgba(0, 113, 227, 0.38);
}

#jobs .flex-row>.btn-primary:active {
    transform: scale(0.96);
}

#jobs .flex-row>.btn-primary[style*="198754"],
#jobs .flex-row>.btn-primary.auth-required {
    background: linear-gradient(135deg, #198754 0%, #20a866 100%) !important;
    box-shadow: 0 6px 18px rgba(25, 135, 84, 0.3);
}

#jobs .flex-row>.btn-primary[style*="198754"]:hover,
#jobs .flex-row>.btn-primary.auth-required:hover {
    box-shadow: 0 10px 24px rgba(25, 135, 84, 0.42);
}

#jobs-grid.grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    margin-bottom: 22px;
}

#jobs-grid .job-card,
#jobs-grid .feed-card {
    position: relative;
    padding: 22px 24px 18px 24px !important;

    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;

    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 22px !important;

    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-theme #jobs-grid .job-card,
body.dark-theme #jobs-grid .feed-card {
    background: rgba(28, 28, 30, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

#jobs-grid .job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.18) 0%,
            rgba(255, 255, 255, 0) 100%);
    border-radius: 22px 22px 0 0;
    pointer-events: none;
    z-index: 0;
}

body.dark-theme #jobs-grid .job-card::before {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0) 100%);
}

#jobs-grid .job-card>* {
    position: relative;
    z-index: 1;
}

#jobs-grid .job-card:hover {
    border-color: rgba(0, 113, 227, 0.3) !important;
    box-shadow:
        0 18px 48px rgba(0, 113, 227, 0.14),
        0 4px 12px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

body.dark-theme #jobs-grid .job-card:hover {
    border-color: rgba(0, 113, 227, 0.45) !important;
    box-shadow:
        0 18px 48px rgba(0, 113, 227, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

#jobs-grid .job-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

#jobs-grid .job-card-avatar {
    width: 48px !important;
    height: 48px !important;
    font-size: 18px !important;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), #5a9bff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.6);
}

body.dark-theme #jobs-grid .job-card-avatar {
    border-color: rgba(255, 255, 255, 0.12);
}

#jobs-grid .job-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#jobs-grid .job-card-author-info .author-name {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

#jobs-grid .job-card-author-info .feed-meta {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 3px;
}

#jobs-grid .job-card-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#jobs-grid .job-delete-btn,
#jobs-grid .fav-btn-inline {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    color: var(--text-muted);
    font-size: 15px;
}

body.dark-theme #jobs-grid .job-delete-btn,
body.dark-theme #jobs-grid .fav-btn-inline {
    background: rgba(44, 44, 46, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #98989d;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#jobs-grid .job-delete-btn:hover {
    background: #ff3b30 !important;
    color: #fff !important;
    border-color: #ff3b30 !important;
    transform: rotate(90deg) scale(1.08);
    box-shadow: 0 6px 16px rgba(255, 59, 48, 0.4);
}

#jobs-grid .fav-btn-inline:hover {
    border-color: #ff3b30 !important;
    color: #ff3b30 !important;
}

#jobs-grid .fav-btn-inline.active {
    background: rgba(255, 59, 48, 0.15) !important;
    border-color: #ff3b30 !important;
    color: #ff3b30 !important;
}

#jobs-grid .job-card-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

#jobs-grid .job-type-badge {
    background: rgba(0, 113, 227, 0.12) !important;
    color: var(--primary) !important;
    border-radius: 100px !important;
    padding: 5px 12px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px;
    backdrop-filter: blur(10px);
}

body.dark-theme #jobs-grid .job-type-badge {
    background: rgba(0, 113, 227, 0.25) !important;
    color: #4a9eff !important;
}

#jobs-grid .job-status-badge {
    border-radius: 100px !important;
    padding: 5px 12px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px;
    backdrop-filter: blur(10px);
}

#jobs-grid .job-status-badge.active {
    background: rgba(52, 199, 89, 0.14) !important;
    color: #34c759 !important;
}

#jobs-grid .job-status-badge.done {
    background: rgba(120, 120, 128, 0.15) !important;
    color: var(--text-muted) !important;
}

#jobs-grid .job-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

body.dark-theme #jobs-grid .job-meta-badge {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.06);
}

#jobs-grid .job-meta-badge svg {
    width: 13px;
    height: 13px;
    opacity: 0.8;
}

#jobs-grid .job-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 2px 0 0 0;
    word-wrap: break-word;
}

#jobs-grid .job-card-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

#jobs-grid .job-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 16px;
    margin-top: 2px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-theme #jobs-grid .job-card-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

#jobs-grid .job-card-price {
    font-size: 20px;
    font-weight: 800;
    color: #34c759;
    letter-spacing: -0.025em;
    line-height: 1.1;
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(52, 199, 89, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.dark-theme #jobs-grid .job-card-price {
    background: rgba(52, 199, 89, 0.15);
}

#jobs-grid .job-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

#jobs-grid .job-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    border-radius: 100px;
    border: 1px solid rgba(0, 113, 227, 0.35);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    box-shadow:
        0 2px 8px rgba(0, 113, 227, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.dark-theme #jobs-grid .job-action-btn {
    background: rgba(44, 44, 46, 0.5);
    border-color: rgba(0, 113, 227, 0.4);
    color: #4a9eff;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#jobs-grid .job-action-btn:hover {
    background: rgba(0, 113, 227, 0.1);
    border-color: var(--primary);
    box-shadow:
        0 6px 16px rgba(0, 113, 227, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.dark-theme #jobs-grid .job-action-btn:hover {
    background: rgba(0, 113, 227, 0.18);
    box-shadow:
        0 6px 16px rgba(0, 113, 227, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#jobs-grid .job-action-btn:active {
    transform: scale(0.96);
}

#jobs-grid .job-action-btn svg {
    width: 14px;
    height: 14px;
}

#jobs-grid .job-action-btn.primary {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    border-color: transparent;
    color: #fff;
    box-shadow:
        0 6px 18px rgba(0, 113, 227, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#jobs-grid .job-action-btn.primary:hover {
    box-shadow:
        0 10px 26px rgba(0, 113, 227, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.dark-theme #jobs-grid .job-action-btn.primary {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    color: #fff;
}

#jobs-grid:empty::before,
#jobs-grid:has(> :only-child:empty)::before {
    content: '';
}

@media (max-width: 768px) {
    #jobs .flex-row {
        padding: 10px;
        border-radius: 18px;
        gap: 8px;
    }

    #jobs .flex-row #jobs-search-input,
    #jobs .flex-row .loc-dropdown-toggle,
    #jobs .flex-row>.btn-primary {
        height: 42px;
    }

    #jobs .flex-row .loc-dropdown {
        min-width: 0;
        flex: 1 1 auto;
    }

    #jobs-grid .job-card {
        padding: 18px 18px 16px 18px !important;
        border-radius: 20px !important;
    }

    #jobs-grid .job-card-title {
        font-size: 16px;
    }

    #jobs-grid .job-card-price {
        font-size: 17px;
    }

    #jobs-grid .job-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    #jobs-grid .job-card-actions {
        width: 100%;
        justify-content: stretch;
    }

    #jobs-grid .job-action-btn {
        flex: 1 1 0;
        justify-content: center;
        padding: 0 12px;
        font-size: 12px;
    }
}

body.mobile-device #jobs .flex-row,
body.mobile-device #jobs .flex-row #jobs-search-input,
body.mobile-device #jobs .flex-row .loc-dropdown-toggle,
body.mobile-device #jobs-grid .job-card,
body.mobile-device #jobs-grid .job-delete-btn,
body.mobile-device #jobs-grid .fav-btn-inline,
body.mobile-device #jobs-grid .job-action-btn,
body.mobile-device #jobs-grid .job-meta-badge,
body.mobile-device #jobs-grid .job-card-price {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.mobile-device #jobs .flex-row {
    background: var(--card-bg) !important;
}

body.mobile-device #jobs .flex-row #jobs-search-input {
    background: var(--bg-color) !important;
}

body.mobile-device #jobs-grid .job-card {
    background: var(--card-bg) !important;
}

.roles-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 8px 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--hairline);
    flex-shrink: 0;
}

.roles-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.roles-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme .roles-panel-close {
    background: #2c2c2e;
    color: #98989d;
}

.roles-panel-close:hover,
.roles-panel-close:focus-visible {
    background: #ff3b30 !important;
    color: #ffffff !important;
    transform: rotate(90deg) scale(1.08);
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35);
    outline: none;
    border-color: transparent;
}

.roles-panel-close:active {
    transform: rotate(90deg) scale(0.9);
    background: #e0342b !important;
    color: #ffffff !important;
}

.roles-panel-close svg {
    pointer-events: none;
    display: block;
    stroke: currentColor;
    transition: stroke 0.2s var(--ease-out);
}

.member-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    display: none;
    margin-top: 4px;
    overscroll-behavior: contain;
}

.member-search-results.open {
    display: block;
}

.member-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.member-search-item:hover {
    background: var(--bg-color);
}

.member-search-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #5a9bff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.member-search-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-search-info {
    flex: 1;
    min-width: 0;
}

.member-search-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-search-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-search-empty {
    padding: 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.dashboard-messages-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
    min-height: 30px;
    overflow: hidden;
    flex-shrink: 0;
}

.dashboard-messages-header .dashboard-card-title {
    margin: 0;
    flex: 1;
    min-width: 0;
    transform-origin: left center;
    transition:
        opacity 0.2s var(--ease-out),
        transform 0.25s var(--ease-out);
}

.dashboard-messages-search-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition:
        background 0.2s ease,
        color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.dashboard-messages-search-btn:hover {
    background: var(--bg-color);
    color: var(--primary);
}

.dashboard-messages-search-btn:active {
    transform: scale(0.94);
}

body.dark-theme .dashboard-messages-search-btn:hover {
    background: #2c2c2e;
}

.dashboard-messages-search-wrap {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;

    opacity: 0;
    pointer-events: none;
    transform: translateX(20px) scale(0.96);
    transform-origin: right center;
    transition:
        opacity 0.2s var(--ease-out),
        transform 0.25s var(--ease-out);
}

.dashboard-messages-header.search-open .dashboard-card-title {
    opacity: 0;
    transform: translateX(-20px) scale(0.9);
    pointer-events: none;
}

.dashboard-messages-header.search-open .dashboard-messages-search-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.6);
}

.dashboard-messages-header.search-open .dashboard-messages-search-wrap {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(1);
}

.dashboard-messages-search-input {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 0 14px;
    border: 1.5px solid transparent;
    border-radius: 100px;
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.dashboard-messages-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.75;
}

.dashboard-messages-search-input:focus,
.dashboard-messages-search-input:focus-visible {
    background: var(--card-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
    outline: none !important;
    border-radius: 100px;
}

body.dark-theme .dashboard-messages-search-input {
    background: #2c2c2e;
    color: #f5f5f7;
}

body.dark-theme .dashboard-messages-search-input:focus {
    background: #1c1c1e;
}

.dashboard-messages-search-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.dashboard-messages-search-close:hover {
    background: #ff3b30;
    color: #fff;
    transform: rotate(90deg);
}

.dashboard-messages-search-close:active {
    transform: rotate(90deg) scale(0.9);
}

body.dark-theme .dashboard-messages-search-close {
    background: #2c2c2e;
}

body.dark-theme .dashboard-messages-search-close:hover {
    background: #ff453a;
}

.dashboard-messages-search-results {
    display: none;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.dashboard-messages-search-results.open {
    display: flex;
}

.dashboard-messages-search-section-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    padding: 10px 4px 4px;
}

.dashboard-messages-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme .dashboard-messages-search-item {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
}

.dashboard-messages-search-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

body.dark-theme .dashboard-messages-search-item:hover {
    background: rgba(0, 113, 227, 0.2);
}

.dashboard-messages-search-item:active {
    transform: scale(0.98);
}

.dashboard-messages-search-item .avatar {
    width: 38px;
    height: 38px;
    font-size: 15px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dashboard-messages-search-item-info {
    flex: 1;
    min-width: 0;
}

.dashboard-messages-search-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-messages-search-item-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-messages-search-empty {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

input#dashboard-messages-search-input {
    background: var(--bg-color) !important;
    border: 1.5px solid transparent !important;
    border-radius: 100px !important;
    color: var(--text-main) !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    transition: border-color 0.2s ease, background-color 0.2s ease !important;
}

input#dashboard-messages-search-input:focus,
input#dashboard-messages-search-input:focus-visible,
input#dashboard-messages-search-input:active {
    background: var(--card-bg) !important;
    border: 1.5px solid var(--primary) !important;
    outline: 0 !important;
    outline-width: 0 !important;
    outline-style: none !important;
    outline-color: transparent !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}

body.dark-theme input#dashboard-messages-search-input {
    background: #2c2c2e !important;
    color: #f5f5f7 !important;
}

body.dark-theme input#dashboard-messages-search-input:focus,
body.dark-theme input#dashboard-messages-search-input:focus-visible {
    background: #1c1c1e !important;
    border-color: var(--primary) !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}

.modal-overlay:not(.active) input[type="password"] {
    display: none !important;
}

.profile-view-reviews-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-main);
    transition: background 0.2s ease, border-color 0.2s ease;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    text-align: left;
}

body.dark-theme .profile-view-reviews-toggle {
    background: rgba(44, 44, 46, 0.5);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.profile-view-reviews-toggle:hover {
    background: rgba(255, 149, 0, 0.08);
    border-color: rgba(255, 149, 0, 0.3);
}

.profile-view-reviews-toggle-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 149, 0, 0.15);
    color: #ff9500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0;
}

.profile-view-reviews-toggle-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    display: block;
}

body.dark-theme .profile-view-reviews-toggle-icon {
    background: rgba(255, 149, 0, 0.25);
    color: #ffb340;
}

.profile-view-reviews-toggle-label {
    flex: 1;
    text-align: left;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-main);
}

.profile-view-reviews-toggle-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.profile-view-reviews-toggle:hover .profile-view-reviews-toggle-chevron {
    color: #ff9500;
}

.profile-view-reviews-toggle.active .profile-view-reviews-toggle-chevron {
    transform: rotate(180deg);
    color: #ff9500;
}

.profile-view-reviews-section {
    display: none !important;
}

.profile-view-reviews-panel {
    flex: 0 0 0%;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    transition:
        flex-basis 0.35s var(--ease-out),
        max-width 0.35s var(--ease-out),
        opacity 0.25s var(--ease-out),
        padding 0.25s var(--ease-out);
    padding: 0;
}

.profile-view-modal.reviews-open .profile-view-reviews-panel {
    flex: 1 1 58%;
    max-width: 58%;
    opacity: 1;
    padding: 22px;
}

body.dark-theme .profile-view-reviews-panel {
    background: #141416;
}

.profile-view-reviews-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.profile-view-reviews-panel-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.profile-view-reviews-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.profile-view-reviews-panel-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    display: block;
}

.profile-view-reviews-panel-close:hover {
    background: #ff3b30;
    color: #fff;
    transform: rotate(90deg);
}

.profile-view-reviews-panel-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.property-view-photo-placeholder svg {
    stroke: var(--primary);
    opacity: 0.4;
}

.calc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.calc-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    padding: 0 16px;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s var(--ease-out),
        background 0.15s ease,
        box-shadow 0.2s ease;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.calc-action-btn svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.calc-action-btn.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.28);
}

.calc-action-btn.primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
}

.calc-action-btn.primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(0, 113, 227, 0.2);
}

.calc-action-btn.secondary {
    background: var(--bg-color);
    color: var(--primary);
}

body.dark-theme .calc-action-btn.secondary {
    background: #2c2c2e;
}

.calc-action-btn.secondary:hover {
    background: rgba(0, 113, 227, 0.1);
}

.calc-action-btn.secondary:active {
    transform: scale(0.97);
}

.share-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease-out);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px;
}

.share-sheet-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.share-sheet {
    width: 100%;
    max-width: 560px;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 10px 0 16px;
    transform: translateY(60px) scale(0.96);
    transition: transform 0.3s var(--ease-out);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    margin-bottom: 0;
}

.share-sheet-overlay.open .share-sheet {
    transform: translateY(0) scale(1);
}

body.dark-theme .share-sheet {
    background: #1c1c1e;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.share-sheet-handle {
    display: none;
}

.share-sheet-header {
    padding: 16px 24px 16px;
    border-bottom: 1px solid var(--hairline);
    flex-shrink: 0;
}

body.dark-theme .share-sheet-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.share-sheet-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.share-sheet-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-sheet-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 0;
    overscroll-behavior: contain;
}

.share-sheet-body::-webkit-scrollbar {
    width: 8px;
}

.share-sheet-body::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 128, 0.3);
    border-radius: 4px;
}

.share-sheet-group {
    padding: 4px 10px;
}

.share-sheet-group+.share-sheet-group {
    border-top: 1px solid var(--hairline);
    margin-top: 4px;
    padding-top: 8px;
}

body.dark-theme .share-sheet-group+.share-sheet-group {
    border-top-color: rgba(255, 255, 255, 0.06);
}

.share-sheet-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 6px 14px 6px;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.share-option:hover {
    background: var(--bg-color);
}

body.dark-theme .share-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.share-option:active {
    background: rgba(0, 113, 227, 0.08);
}

.share-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    line-height: 1;
}

.share-option-icon svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    fill: none;
}

.share-option-icon.app {
    background: linear-gradient(135deg, #0071e3, #0080ff);
}

.share-option-icon.wa {
    background: linear-gradient(135deg, #25D366, #1ebe5b);
}

.share-option-icon.tg {
    background: linear-gradient(135deg, #2AABEE, #229ED9);
}

.share-option-icon.mail {
    background: linear-gradient(135deg, #EA4335, #c5221f);
}

.share-option-icon.copy {
    background: linear-gradient(135deg, #8e8e93, #636366);
}

.share-option-icon.pdf {
    background: linear-gradient(135deg, #FF3B30, #c92a20);
}

.share-option-icon.csv {
    background: linear-gradient(135deg, #34C759, #248A3D);
}

.share-option-icon.png {
    background: linear-gradient(135deg, #AF52DE, #7a3ba0);
}

.share-option-icon.link {
    background: linear-gradient(135deg, #0071e3, #004ba0);
}

.share-option-text {
    flex: 1;
    min-width: 0;
}

.share-option-text strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.share-option-text small {
    display: block;
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 400;
}

.share-sheet-close {
    margin: 8px 24px 0;
    height: 48px;
    border-radius: 14px;
    background: var(--bg-color);
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.share-sheet-close:hover {
    background: rgba(0, 113, 227, 0.1);
}

.share-sheet-close:active {
    background: rgba(0, 113, 227, 0.16);
}

body.dark-theme .share-sheet-close {
    background: #2c2c2e;
}

.calc-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(28, 28, 30, 0.95);
    color: #fff;
    padding: 14px 24px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    z-index: 2147483647;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    max-width: calc(100vw - 40px);
    letter-spacing: -0.01em;
}

.calc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#calc-export-container {
    position: fixed;
    left: -99999px;
    top: 0;
    width: 800px;
    background: #fff;
    color: #000;
    padding: 0;
    box-sizing: border-box;
    font-family: Georgia, 'Times New Roman', serif;
}

#chat-input,
#dashboard-chat-input {
    font-family: inherit;
    line-height: 1.4;
    transition: height 0.1s ease, border-color 0.2s ease;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

#chat-input:focus,
#dashboard-chat-input:focus {
    border-color: var(--primary);
}

#chat-input::-webkit-scrollbar,
#dashboard-chat-input::-webkit-scrollbar {
    width: 6px;
}

#chat-input::-webkit-scrollbar-thumb,
#dashboard-chat-input::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 128, 0.3);
    border-radius: 3px;
}

.chat-msg>div:first-child {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#dashboard-chat-messages .chat-msg>div:first-child {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.save-estimate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 12px;
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    height: 44px;
    min-width: 180px;
}

.save-estimate-btn:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.3);
}

.save-estimate-btn:active {
    transform: scale(0.97);
}

.save-estimate-btn svg {
    flex-shrink: 0;
}

body.dark-theme .save-estimate-btn {
    border-color: var(--primary);
    color: var(--primary);
}

body.dark-theme .save-estimate-btn:hover {
    background: var(--primary);
    color: #fff;
}

.organizer-estimate-entry {
    background: rgba(0, 113, 227, 0.06) !important;
    border: 1px solid rgba(0, 113, 227, 0.15) !important;
    margin-bottom: 0 !important;
    border-radius: 12px 12px 0 0 !important;
}

body.dark-theme .organizer-estimate-entry {
    background: rgba(0, 113, 227, 0.15) !important;
    border-color: rgba(0, 113, 227, 0.3) !important;
}

.organizer-estimate-details {
    background: var(--bg-color);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 8px 12px 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.dark-theme .organizer-estimate-details {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.06);
}

.organizer-estimate-subitem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    padding: 2px 0;
}

.organizer-estimate-subitem-name {
    color: var(--text-main);
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-estimate-subitem-qty {
    color: var(--text-muted);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-weight: 600;
}

.organizer-estimate-total {
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    text-align: right;
    font-size: 12.5px;
    color: var(--text-muted);
}

body.dark-theme .organizer-estimate-total {
    border-top-color: rgba(255, 255, 255, 0.06);
}

.organizer-estimate-total strong {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.organizer-estimate-share-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 46px;
    margin: 4px 0 14px 0;
    padding: 0 18px;
    border: 1.5px solid var(--primary);
    border-radius: 100px;
    background: transparent;
    color: var(--primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.organizer-estimate-share-all:hover,
.organizer-estimate-share-all:focus-visible {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
    outline: none;
}

.organizer-estimate-share-all:active {
    transform: scale(0.97);
    filter: brightness(0.94);
}

.organizer-estimate-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.organizer-estimate-share {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 113, 227, 0.1);
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    font-size: 12px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme .organizer-estimate-share {
    background: rgba(0, 113, 227, 0.22);
    color: #4a9eff;
}

.organizer-estimate-share:hover,
.organizer-estimate-share:focus-visible {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
    outline: none;
}

.organizer-estimate-share:active {
    transform: scale(0.92);
    background: var(--primary-hover);
}

.organizer-estimate-share svg {
    display: block;
    pointer-events: none;
}

.organizer-estimate-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-color);
    border-radius: 10px;
    margin-bottom: 6px;
    transition: background 0.15s ease;
}

body.dark-theme .organizer-estimate-row {
    background: #2c2c2e;
}

.organizer-estimate-row:hover {
    background: var(--primary-light);
}

body.dark-theme .organizer-estimate-row:hover {
    background: rgba(0, 113, 227, 0.15);
}

.organizer-estimate-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.organizer-estimate-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.organizer-estimate-qty {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.organizer-estimate-delete {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    font-size: 12px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme .organizer-estimate-delete {
    background: rgba(255, 69, 58, 0.16);
    color: #ff453a;
}

.organizer-estimate-delete:hover,
.organizer-estimate-delete:active {
    background: #ff3b30;
    color: #fff;
    transform: rotate(90deg) scale(1.08);
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35);
}

.organizer-estimate-delete svg {
    width: 14px;
    height: 14px;
    display: block;
}

.status-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease-out);
    box-sizing: border-box;
    padding: 24px;
}

.status-picker-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.status-picker-sheet {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border-radius: 22px;
    padding: 20px 18px 16px;
    transform: translateY(12px) scale(0.97);
    opacity: 0;
    transition:
        transform 0.25s var(--ease-out),
        opacity 0.2s var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

body.dark-theme .status-picker-sheet {
    background: #1c1c1e;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.status-picker-overlay.open .status-picker-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.status-picker-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 2px;
}

.status-picker-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 14px;
}

.status-picker-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 14px;
    background: var(--bg-color);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    text-align: left;
    transition:
        background 0.15s var(--ease-out),
        transform 0.15s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme .status-picker-item {
    background: #2c2c2e;
}

.status-picker-item:hover {
    background: var(--primary-light);
}

body.dark-theme .status-picker-item:hover {
    background: rgba(0, 113, 227, 0.15);
}

.status-picker-item.pressed {
    transform: scale(0.97);
    background: rgba(0, 113, 227, 0.18);
}

.status-picker-item.active {
    background: rgba(0, 113, 227, 0.12);
    color: var(--primary);
    font-weight: 700;
}

body.dark-theme .status-picker-item.active {
    background: rgba(0, 113, 227, 0.24);
    color: #4a9eff;
}

.status-picker-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

body.dark-theme .status-picker-dot {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.status-picker-label {
    flex: 1;
    min-width: 0;
}

.status-picker-check {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--primary);
}

body.dark-theme .status-picker-check {
    color: #4a9eff;
}

.status-picker-cancel {
    margin-top: 10px;
    height: 48px;
    border-radius: 14px;
    background: var(--bg-color);
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.status-picker-cancel:hover {
    background: rgba(0, 113, 227, 0.08);
}

.status-picker-cancel:active {
    transform: scale(0.97);
}

body.dark-theme .status-picker-cancel {
    background: #2c2c2e;
}

body.dark-theme .status-picker-cancel:hover {
    background: rgba(0, 113, 227, 0.15);
}

.organizer-overview-estimate-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px 18px;
    margin: 14px 0 18px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 18px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-main);
    text-align: left;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    -webkit-tap-highlight-color: transparent;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-theme .organizer-overview-estimate-btn {
    background: rgba(28, 28, 30, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.organizer-overview-estimate-btn:hover {
    border-color: rgba(0, 113, 227, 0.3);
    box-shadow:
        0 10px 26px rgba(0, 113, 227, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.organizer-overview-estimate-btn:active {
    transform: translateZ(0) scale(0.98);
    transition-duration: 0.1s;
}

.organizer-overview-estimate-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0, 113, 227, 0.12);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

body.dark-theme .organizer-overview-estimate-icon {
    background: rgba(0, 113, 227, 0.25);
    color: #4a9eff;
}

.organizer-overview-estimate-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    display: block;
    fill: none;
}

.organizer-overview-estimate-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.organizer-overview-estimate-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.organizer-overview-estimate-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.3;
}

.organizer-overview-estimate-arrow {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-muted);
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    line-height: 1;
}

.organizer-overview-estimate-btn:hover .organizer-overview-estimate-arrow {
    opacity: 1;
    color: var(--primary);
}

.organizer-detail-header {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr);
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.organizer-detail-header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.organizer-detail-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.organizer-detail-title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    min-width: 0;
    max-width: 560px;
}

.organizer-detail-number {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    line-height: 1.2;
}

.organizer-detail-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.1;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.organizer-detail-address {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.organizer-detail-topbar {
    display: none !important;
}

#organizer-detail-actions-slot {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .organizer-detail-header {
        grid-template-columns: auto 1fr auto;
        gap: 14px;
    }

    .organizer-detail-title {
        font-size: 24px;
    }
}

@media (max-width: 640px) {
    .organizer-detail-header {
        gap: 8px;
        padding-bottom: 16px;
        margin-bottom: 18px;
    }

    .organizer-detail-title {
        font-size: 18px;
    }

    .organizer-back-btn span {
        display: none;
    }

    .organizer-back-btn {
        padding: 0 12px;
    }
}

.organizer-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 36px 24px 32px;
    gap: 0;
}

.organizer-panel-empty-icon {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 18px;

    background:
        radial-gradient(circle at 30% 30%,
            rgba(0, 113, 227, 0.18) 0%,
            rgba(0, 113, 227, 0.08) 60%,
            rgba(0, 113, 227, 0.04) 100%);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 113, 227, 0.08),
        0 6px 20px rgba(0, 113, 227, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.04);
}

.organizer-panel-empty-icon::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(0, 113, 227, 0.10) 0%,
            rgba(0, 113, 227, 0.04) 50%,
            transparent 75%);
    pointer-events: none;
    z-index: -1;
}

body.dark-theme .organizer-panel-empty-icon {
    color: #4a9eff;
    background:
        radial-gradient(circle at 30% 30%,
            rgba(0, 113, 227, 0.28) 0%,
            rgba(0, 113, 227, 0.14) 60%,
            rgba(0, 113, 227, 0.06) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 113, 227, 0.15),
        0 6px 24px rgba(0, 113, 227, 0.28),
        0 2px 6px rgba(0, 0, 0, 0.4);
}

body.dark-theme .organizer-panel-empty-icon::before {
    background: radial-gradient(circle,
            rgba(0, 113, 227, 0.20) 0%,
            rgba(0, 113, 227, 0.08) 50%,
            transparent 75%);
}

.organizer-panel-empty-icon svg {
    width: 30px;
    height: 30px;
    display: block;
    stroke-width: 1.8;
    filter: drop-shadow(0 1px 2px rgba(0, 113, 227, 0.15));
}

.organizer-panel-empty-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    letter-spacing: -0.015em;
    max-width: 240px;
    margin-bottom: 6px;
}

.organizer-panel-empty-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.45;
    max-width: 260px;
    font-weight: 400;
    letter-spacing: -0.005em;
}

.org-card {
    position: relative;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    will-change: auto;
}

.org-card-drag-handle {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: rgba(0, 113, 227, 0.1);
    opacity: 0;
    pointer-events: none;
    cursor: grab;
    transition:
        opacity 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
    z-index: 10;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme .org-card-drag-handle {
    background: rgba(0, 113, 227, 0.22);
    color: #4a9eff;
}

body.org-sort-mode .org-card-drag-handle {
    opacity: 1;
    pointer-events: auto;
}

body.org-sort-mode .org-card {
    cursor: grab;
}

body.org-sort-mode .org-card:active {
    cursor: grabbing;
}

body.org-sort-mode .org-card:hover {
    border-color: rgba(0, 113, 227, 0.4);
    box-shadow:
        0 12px 28px rgba(0, 113, 227, 0.14),
        0 4px 12px rgba(0, 0, 0, 0.06);
}

body.dark-theme.org-sort-mode .org-card:hover {
    border-color: rgba(0, 113, 227, 0.5);
    box-shadow:
        0 12px 28px rgba(0, 113, 227, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

.org-card-drag-handle:active {
    cursor: grabbing;
    transform: scale(0.92);
}

.org-card-drag-handle:hover {
    background: var(--primary);
    color: #fff;
}

body.dark-theme .org-card-drag-handle:hover {
    background: var(--primary);
    color: #fff;
}

.org-card-dragging {
    opacity: 0.55;
    transform: translateZ(0) scale(0.98);
    box-shadow:
        0 20px 50px rgba(0, 113, 227, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.15) !important;
    border-color: rgba(0, 113, 227, 0.5) !important;
    cursor: grabbing;
    z-index: 100;
    transition: none;
}

body.dark-theme .org-card-dragging {
    box-shadow:
        0 20px 50px rgba(0, 113, 227, 0.35),
        0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

.org-page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#org-sort-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

body.dark-theme #org-sort-toggle {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}

#org-sort-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.14);
}

#org-sort-toggle:active {
    transform: scale(0.97);
}

#org-sort-toggle.active {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow:
        0 6px 18px rgba(0, 113, 227, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#org-sort-toggle.active:hover {
    box-shadow:
        0 10px 26px rgba(0, 113, 227, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#org-sort-toggle svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    transition: transform 0.2s ease;
}

#org-sort-toggle.active svg {
    transform: rotate(180deg);
}

body.mobile-device #org-sort-toggle {
    height: 40px;
    padding: 0 14px;
    font-size: 12.5px;
}

body.mobile-device .org-page-header-actions {
    gap: 8px;
}

.dash-tile-featured {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    min-height: 74px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-main);
    text-align: left;
    flex-shrink: 0;
    transition:
        background 0.2s var(--ease-out),
        border-color 0.2s var(--ease-out),
        box-shadow 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.dash-tile-featured:hover {
    background: rgba(232, 242, 255, 0.85);
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.15);
}

.dash-tile-featured:active {
    transform: translateZ(0) scale(0.98);
    filter: brightness(0.94);
    transition-duration: 0.1s;
}

body.dark-theme .dash-tile-featured {
    background: rgba(44, 44, 46, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .dash-tile-featured:hover {
    background: rgba(0, 113, 227, 0.25);
    border-color: var(--primary);
}

.dash-tile-featured-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.dash-tile-featured-icon svg {
    display: block;
    flex-shrink: 0;
}

.dash-tile-featured-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dash-tile-featured-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.015em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-tile-featured:hover .dash-tile-featured-title {
    color: var(--primary);
}

.dash-tile-featured-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-tile-featured-arrow {
    font-size: 22px;
    font-weight: 300;
    color: var(--text-muted);
    opacity: 0.5;
    flex-shrink: 0;
    line-height: 1;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.dash-tile-featured:hover .dash-tile-featured-arrow {
    opacity: 1;
    color: var(--primary);
}

.dashboard-card-subtitle {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin: 18px 0 18px 0 !important;
    flex-shrink: 0;
    position: relative;
}

.dashboard-card-subtitle::before {
    display: none !important;
}

.company-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 5;
}

.company-card-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.company-card-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    pointer-events: none;
}

.company-card-btn.edit {
    background: rgba(0, 113, 227, 0.12);
    color: var(--primary);
}

body.dark-theme .company-card-btn.edit {
    background: rgba(0, 113, 227, 0.22);
    color: #4a9eff;
}

.company-card-btn.edit:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
}

.company-card-btn.delete {
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
}

body.dark-theme .company-card-btn.delete {
    background: rgba(255, 69, 58, 0.16);
    color: #ff453a;
}

.company-card-btn.delete:hover {
    background: #ff3b30;
    color: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35);
}

.company-card-btn:active {
    transform: scale(0.92);
}

#modal-view-company .company-view-modal {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 24px !important;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    padding: 0 !important;
    overflow: hidden !important;
    max-width: 420px !important;
    width: 90% !important;
}

body.dark-theme #modal-view-company .company-view-modal {
    background: rgba(28, 28, 30, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

#modal-view-company .company-view-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0) 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
    z-index: 0;
}

body.dark-theme #modal-view-company .company-view-modal::before {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0) 100%);
}

.company-view-header {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px 20px;
    gap: 8px;
}

.company-view-logo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 8px;
    box-shadow: 0 8px 24px rgba(255, 149, 0, 0.35);
}

.company-view-logo svg {
    width: 36px;
    height: 36px;
    stroke: #fff;
    fill: none;
}

.company-view-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-main);
    line-height: 1.2;
    margin: 0;
}

.company-view-specs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}

.company-view-spec-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(0, 113, 227, 0.12);
    color: var(--primary);
}

body.dark-theme .company-view-spec-badge {
    background: rgba(0, 113, 227, 0.25);
    color: #4a9eff;
}

.company-view-contacts {
    position: relative;
    z-index: 1;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.company-view-contact-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s ease;
}

.company-view-contact-row[href]:hover {
    background: rgba(0, 113, 227, 0.08);
    cursor: pointer;
}

body.dark-theme .company-view-contact-row[href]:hover {
    background: rgba(0, 113, 227, 0.15);
}

.company-view-contact-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: rgba(0, 113, 227, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

body.dark-theme .company-view-contact-icon {
    background: rgba(0, 113, 227, 0.22);
    color: #4a9eff;
}

.company-view-contact-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    display: block;
}

.company-view-contact-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-view-contact-arrow {
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 300;
    opacity: 0.5;
    flex-shrink: 0;
}

.company-view-about {
    position: relative;
    z-index: 1;
    padding: 16px 24px 0;
}

.company-view-section-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.company-view-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
}

.company-view-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    padding: 24px 20px 20px;
}

.company-view-action-btn {
    flex: 1;
    height: 48px;
    border-radius: 14px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: box-shadow 0.2s var(--ease-out);
}

.company-view-action-btn.primary {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.3);
}

.company-view-action-btn.primary:hover {
    box-shadow: 0 10px 24px rgba(0, 113, 227, 0.4);
}

.company-view-action-btn.secondary {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-main);
}

body.dark-theme .company-view-action-btn.secondary {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

.company-view-action-btn:active {
    transform: scale(0.96);
    filter: brightness(0.94);
}

.company-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.company-card:hover {
    border-color: rgba(255, 149, 0, 0.3);
    box-shadow: 0 12px 32px rgba(255, 149, 0, 0.12);
}

body.dark-theme .company-card {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .company-card-btn-site,
body.dark-theme .company-card-btn-site:hover {
    color: #fff;
}

body.dark-theme .company-card:hover {
    border-color: rgba(255, 149, 0, 0.4);
    box-shadow: 0 12px 32px rgba(255, 149, 0, 0.2);
}

.company-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.company-card-image-preview {
    width: min(100%, 220px);
    aspect-ratio: 1;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bg-color);
}

.company-card-image-preview:empty {
    display: none;
}

.company-card-image-preview-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.company-card-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(255, 149, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

body.dark-theme .company-card-logo {
    border-color: rgba(255, 255, 255, 0.1);
}

.company-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.company-card-header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 8px;
}

.company-card-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.015em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-card-specs {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.company-card-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.company-card-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    pointer-events: none;
}

.company-card-btn.edit {
    background: rgba(0, 113, 227, 0.1);
    color: var(--primary);
}

body.dark-theme .company-card-btn.edit {
    background: rgba(0, 113, 227, 0.22);
    color: #4a9eff;
}

.company-card-btn.edit:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.4);
}

.company-card-btn.delete {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

body.dark-theme .company-card-btn.delete {
    background: rgba(255, 69, 58, 0.16);
    color: #ff453a;
}

.company-card-btn.delete:hover {
    background: #ff3b30;
    color: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.4);
}

.company-card-btn:active {
    transform: scale(0.92);
}

.company-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

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

body.dark-theme .company-card-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.company-card-phone {
    font-size: 14px;
    font-weight: 700;
    color: #34c759;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.company-card-owner-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.company-card-btn-site {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 100px;
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.company-card-btn-site svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.company-card-btn-site:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.35);
}

.company-card-btn-site:active {
    transform: scale(0.96);
}

body.dark-theme .company-card-btn-site {
    border-color: var(--primary);
    color: #4a9eff;
}

body.dark-theme .company-card-btn-site:hover {
    background: var(--primary);
    color: #fff;
}

/* ==================================================== */
/* АКЦЕНТ НА ПОЛЯХ КАЛЬКУЛЯТОРОВ                        */
/* ==================================================== */

/* Базовое поле калькулятора — заметная рамка и фон */
.calc-field-input-wrap input,
.calc-field-input-wrap select,
.card input[type="number"].custom-number,
.card input[type="number"].m-dim,
.card input[type="number"][id^="elem-"],
.card input[type="number"][id^="concrete-"],
.card input[type="number"][id^="metal-"],
.card input[type="number"][id^="arm-"],
.card input[type="number"][id^="roof-"],
.card input[type="number"][id^="log-"],
.card input[type="number"][id^="mas-"],
.card input[type="number"][id^="gkl-"],
.card input[type="number"][id^="wp-"],
.card input[type="number"][id^="tile-"],
.card input[type="number"][id^="lam-"],
.card input[type="number"][id^="screed-"] {
    position: relative;
    transition:
        border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Плейсхолдер — заметный, чтобы человек видел «0» как подсказку */
.card input[type="number"].custom-number::placeholder,
.card input[type="number"].m-dim::placeholder {
    color: var(--primary);
    opacity: 0.45;
    font-weight: 600;
}

/* Поле в фокусе — синяя рамка + мягкое свечение + подсветка фона */
.card input[type="number"].custom-number:focus,
.card input[type="number"].m-dim:focus,
.card input[type="number"][id^="elem-"]:focus,
.card input[type="number"][id^="concrete-"]:focus,
.card input[type="number"][id^="metal-"]:focus,
.card input[type="number"][id^="arm-"]:focus,
.card input[type="number"][id^="roof-"]:focus,
.card input[type="number"][id^="log-"]:focus,
.card input[type="number"][id^="mas-"]:focus,
.card input[type="number"][id^="gkl-"]:focus,
.card input[type="number"][id^="wp-"]:focus,
.card input[type="number"][id^="tile-"]:focus,
.card input[type="number"][id^="lam-"]:focus,
.card input[type="number"][id^="screed-"]:focus {
    border-color: var(--primary) !important;
    background-color: var(--card-bg) !important;
    box-shadow:
        0 0 0 4px rgba(0, 113, 227, 0.18),
        0 4px 14px rgba(0, 113, 227, 0.18) !important;
    outline: none !important;
}

body.dark-theme .card input[type="number"].custom-number:focus,
body.dark-theme .card input[type="number"].m-dim:focus,
body.dark-theme .card input[type="number"][id^="elem-"]:focus,
body.dark-theme .card input[type="number"][id^="concrete-"]:focus,
body.dark-theme .card input[type="number"][id^="metal-"]:focus,
body.dark-theme .card input[type="number"][id^="arm-"]:focus,
body.dark-theme .card input[type="number"][id^="roof-"]:focus,
body.dark-theme .card input[type="number"][id^="log-"]:focus,
body.dark-theme .card input[type="number"][id^="mas-"]:focus,
body.dark-theme .card input[type="number"][id^="gkl-"]:focus,
body.dark-theme .card input[type="number"][id^="wp-"]:focus,
body.dark-theme .card input[type="number"][id^="tile-"]:focus,
body.dark-theme .card input[type="number"][id^="lam-"]:focus,
body.dark-theme .card input[type="number"][id^="screed-"]:focus {
    background-color: #2c2c2e !important;
    box-shadow:
        0 0 0 4px rgba(0, 113, 227, 0.35),
        0 4px 14px rgba(0, 113, 227, 0.25) !important;
}

/* При наведении — лёгкая подсветка, чтобы «намекнуть», что кликабельно */
.card input[type="number"].custom-number:hover:not(:focus),
.card input[type="number"].m-dim:hover:not(:focus),
.card input[type="number"][id^="elem-"]:hover:not(:focus) {
    border-color: rgba(0, 113, 227, 0.45);
}

/* ==================================================== */
/* ПУЛЬСАЦИЯ ПУСТЫХ ПОЛЕЙ ПРИ ОТКРЫТИИ КАЛЬКУЛЯТОРА      */
/* ==================================================== */

@keyframes fieldPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.4);
        border-color: rgba(0, 113, 227, 0.5);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(0, 113, 227, 0);
        border-color: rgba(0, 113, 227, 0.8);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 113, 227, 0);
        border-color: rgba(0, 113, 227, 0.3);
    }
}

.field-needs-input {
    animation: fieldPulse 1.6s ease-out 2;
}

/* В тёмной теме — чуть ярче */
body.dark-theme .field-needs-input {
    animation: fieldPulseDark 1.6s ease-out 2;
}

@keyframes fieldPulseDark {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.6);
        border-color: rgba(0, 113, 227, 0.7);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(0, 113, 227, 0);
        border-color: rgba(0, 113, 227, 1);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 113, 227, 0);
        border-color: rgba(0, 113, 227, 0.4);
    }
}

/* Отключаем пульсацию для тех, кому важна тишина */
@media (prefers-reduced-motion: reduce) {
    .field-needs-input {
        animation: none !important;
        border-color: rgba(0, 113, 227, 0.6) !important;
    }
}

/* ==================================================== */
/* ЧАТ ПРОЕКТА — общие стили (ПК + мобилка)             */
/* ==================================================== */

#organizer-project-view {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
}

#project-chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

body.dark-theme #project-chat-view {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Шапка чата */
.project-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
    flex-shrink: 0;
    min-height: 64px;
    box-sizing: border-box;
}

body.dark-theme .project-chat-header {
    background: #1c1c1e;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.project-chat-title-block {
    flex: 1;
    min-width: 0;
}

.project-chat-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-chat-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-chat-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.project-chat-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.project-chat-icon-btn:hover {
    background: rgba(0, 113, 227, 0.12);
}

.project-chat-icon-btn:active {
    transform: scale(0.92);
}

body.dark-theme .project-chat-icon-btn {
    background: #2c2c2e;
}

/* Лента сообщений */
.project-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-color);
    scroll-behavior: smooth;
}

body.dark-theme .project-chat-messages {
    background: #000;
}

.project-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.project-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 128, 0.3);
    border-radius: 3px;
}

/* Пузырь */
.project-chat-msg {
    display: flex;
    width: 100%;
}

.project-chat-msg.mine {
    justify-content: flex-end;
}

.project-chat-msg.their {
    justify-content: flex-start;
}

.project-chat-msg-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    font-size: 14.5px;
    line-height: 1.45;
}

.project-chat-msg.mine .project-chat-msg-bubble {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    color: #fff;
    border-bottom-right-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 113, 227, 0.25);
}

.project-chat-msg.their .project-chat-msg-bubble {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-bottom-left-radius: 5px;
}

body.dark-theme .project-chat-msg.their .project-chat-msg-bubble {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

.project-chat-msg-author {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

.project-chat-msg.mine .project-chat-msg-author {
    color: rgba(255, 255, 255, 0.85);
    text-align: right;
}

.project-chat-msg-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.project-chat-msg-time {
    font-size: 10.5px;
    opacity: 0.7;
    margin-top: 3px;
    text-align: right;
    line-height: 1;
}

.project-chat-msg.mine .project-chat-msg-time {
    color: rgba(255, 255, 255, 0.85);
}

.project-chat-msg.their .project-chat-msg-time {
    color: var(--text-muted);
}

/* Пусто */
.project-chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.project-chat-empty svg {
    opacity: 0.4;
}

.project-chat-empty p {
    font-size: 14px;
    line-height: 1.4;
    max-width: 280px;
    margin: 0;
}

/* Инпут */
.project-chat-input-wrap {
    padding: 12px 14px 14px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

body.dark-theme .project-chat-input-wrap {
    background: #1c1c1e;
    border-top-color: rgba(255, 255, 255, 0.08);
}

.project-chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    box-sizing: border-box;
}

.project-chat-attach-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

body.dark-theme .project-chat-attach-btn {
    background: #2c2c2e;
}

.project-chat-attach-btn:hover {
    background: rgba(0, 113, 227, 0.12);
}

.project-chat-attach-btn:active {
    transform: scale(0.92);
}

.project-chat-input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 21px;
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.dark-theme .project-chat-input {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

.project-chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.project-chat-send-btn {
    height: 42px;
    padding: 0 22px;
    border: none;
    border-radius: 21px;
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0, 113, 227, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-chat-send-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.35);
}

.project-chat-send-btn:active {
    transform: scale(0.96);
}

/* Карточка сметы внутри чата */
.project-chat-estimate-card {
    max-width: 88% !important;
    padding: 12px 14px !important;
    background: var(--card-bg) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border) !important;
    border-radius: 18px !important;
    border-bottom-left-radius: 5px !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

body.dark-theme .project-chat-estimate-card {
    background: #2c2c2e !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.project-chat-msg.mine .project-chat-estimate-card {
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    border-bottom-right-radius: 5px !important;
    border-bottom-left-radius: 18px !important;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35) !important;
}

.project-chat-estimate-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.project-chat-estimate-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.project-chat-estimate-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-chat-estimate-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
}

body.dark-theme .project-chat-estimate-items {
    background: rgba(255, 255, 255, 0.06);
}

.project-chat-msg.mine .project-chat-estimate-items {
    background: rgba(255, 255, 255, 0.15);
}

.project-chat-estimate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    line-height: 1.3;
}

.project-chat-estimate-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.9;
}

.project-chat-estimate-item-qty {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-weight: 600;
    opacity: 0.85;
    flex-shrink: 0;
}

.project-chat-estimate-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 14px;
    font-weight: 600;
}

body.dark-theme .project-chat-estimate-total {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.project-chat-msg.mine .project-chat-estimate-total {
    border-top-color: rgba(255, 255, 255, 0.25);
}

.project-chat-estimate-total strong {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.project-chat-estimate-store {
    font-size: 11px;
    opacity: 0.7;
    text-align: center;
    padding-top: 2px;
}

/* Заглушка «нет доступа» */
.project-chat-no-access {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.project-chat-no-access svg {
    opacity: 0.4;
}

.project-chat-no-access p {
    font-size: 14px;
    line-height: 1.4;
    max-width: 280px;
    margin: 0;
}

/* ==================================================== */
/* МОДАЛКА ПРОСМОТРА СМЕТЫ ИЗ ОРГАНАЙЗЕРА               */
/* ==================================================== */
.estimate-view-modal {
    max-width: 560px !important;
    width: 92% !important;
    padding: 28px 24px 20px !important;
    border-radius: 24px !important;
    max-height: 88vh !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    overflow: hidden !important;
}

.estimate-view-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 40px;
}

.estimate-view-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}

.estimate-view-meta {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.3;
}

.estimate-view-items {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: var(--bg-color);
    border-radius: 14px;
    border: 1px solid var(--hairline);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.dark-theme .estimate-view-items {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.06);
}

.estimate-view-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px dashed rgba(120, 120, 128, 0.18);
}

body.dark-theme .estimate-view-row {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.estimate-view-row:last-child {
    border-bottom: none;
}

.estimate-view-name {
    flex: 1;
    min-width: 0;
    color: var(--text-main);
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.estimate-view-qty {
    flex-shrink: 0;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.estimate-view-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 20px 0;
    font-style: italic;
}

.estimate-view-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--primary-light);
    border-radius: 14px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

body.dark-theme .estimate-view-total {
    background: rgba(0, 113, 227, 0.18);
}

.estimate-view-total strong {
    color: var(--primary);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: none;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.estimate-view-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex-shrink: 0;
}
/* ==================================================== */
/* ТЕМА — СЛАЙДЕР В ШАПКЕ (ПК)                          */
/* Класс .dark-theme живёт на <html>.                    */
/* Клик — по всему .theme-pill (label), не по чекбоксу. */
/* ==================================================== */

body:not(.mobile-device) .theme-pill {
    position: relative;
    overflow: visible;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    min-width: 76px;
}

/* Чекбокс — визуально спрятан, но НЕ display:none,
   чтобы работали change и доступность */
body:not(.mobile-device) .theme-pill input#theme-toggle-mobile {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body:not(.mobile-device) .theme-track {
    display: block;
    width: 52px;
    height: 28px;
    border-radius: 20px;
    background: rgba(120, 120, 128, 0.18);
    position: relative;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    pointer-events: none;
    flex-shrink: 0;
}

html.dark-theme body:not(.mobile-device) .theme-track {
    background: rgba(120, 120, 128, 0.32);
}

body:not(.mobile-device) .theme-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #ffffff;
    color: #1d1d1f;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.15),
        0 0 0 0.5px rgba(0, 0, 0, 0.04);
    transform: translateX(0) scale(1);
    transition:
        transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.3s ease;
    z-index: 2;
    pointer-events: none;
    will-change: transform;
    box-sizing: border-box;
    line-height: 1;
}

html.dark-theme body:not(.mobile-device) .theme-slider {
    transform: translate3d(24px, 0, 0);
    background: #f5f5f7;
    color: #1d1d1f;
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.3),
        0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

/* Иконка — flex-центр. Только размер шрифта и цвет. */
body:not(.mobile-device) .theme-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 13px;
    line-height: 1;
    text-align: center;
    user-select: none;
    pointer-events: none;
    color: inherit;
    /* Убираем наследуемый line-height от родителя */
    align-self: center;
    transform: translateY(-0.5px);
    transform: translateY(-0.5px);
}

/* Нажатие — просто scale, без сдвига */
body:not(.mobile-device) .theme-pill:active .theme-track {
    transform: scale(0.96);
    transition: transform 0.1s ease;
}

body:not(.mobile-device) .theme-pill:active .theme-slider {
    transform: translate3d(0, 0, 0) scale(0.92);
}

html.dark-theme body:not(.mobile-device) .theme-pill:active .theme-slider {
    transform: translate3d(24px, 0, 0) scale(0.92);
}
body:not(.mobile-device) .theme-track {
    transition: background-color 0.48s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s ease;
}
body:not(.mobile-device) .theme-slider {
    transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.36s ease, box-shadow 0.36s ease;
}
body:not(.mobile-device) .theme-icon {
    font-family: Arial, sans-serif;
    transform: translateY(-0.5px);
}
@media (prefers-reduced-motion: reduce) {
    body:not(.mobile-device) .theme-track,
    body:not(.mobile-device) .theme-slider {
        transition-duration: 1ms;
    }
}
