/* ============================================================
   DESKTOP-VIEW.CSS — Строитель PRO
   ПК-версия: полноценный интерфейс для десктопа.
   Активируется только на ПК (body:not(.mobile-device)).
   Мобильная версия не затрагивается.
   Подключать после style.css и organizer-apple.css.
   ============================================================ */

/* ==================================================== */
/* БАЗОВАЯ РАСКЛАДКА ПК-ПРИЛОЖЕНИЯ                       */
/* ==================================================== */

body:not(.mobile-device) {
    display: block;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-color);
}

body:not(.mobile-device) .mobile-header,
body:not(.mobile-device) .mobile-dashboard,
body:not(.mobile-device) .bottom-nav,
body:not(.mobile-device) .community-menu-overlay,
body:not(.mobile-device) #community-menu-overlay,
body:not(.mobile-device) #services-menu-overlay {
    display: none !important;
}

body:not(.mobile-device) .main-content {
    display: none;
    position: relative;
    height: 100vh;
    overflow-y: auto;
    padding: 88px 32px 40px 32px;
    background: transparent;
    z-index: 10;
}

body:not(.mobile-device).section-open .main-content {
    display: block;
}

body:not(.mobile-device) .section-content {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

body:not(.mobile-device) .section-content.active {
    display: block;
    animation: pageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Кнопка возврата на главный экран ПК */
body:not(.mobile-device).section-open .fullscreen-close-btn {
    display: inline-flex !important;
    position: fixed !important;
    z-index: 20;
}

/* ==================================================== */
/* ВЕРХНЯЯ ШАПКА ПК                                      */
/* ==================================================== */

body:not(.mobile-device) .header-top-modern {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 1400px;
    z-index: 1000;
    margin: 0;
    height: 64px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid var(--border);
    border-radius: 100px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-sizing: border-box;
}

body.dark-theme:not(.mobile-device) .header-top-modern {
    background: rgba(28, 28, 30, 0.75);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Левая группа: логотип + слайд-блоки */
body:not(.mobile-device) .header-left-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
}

body:not(.mobile-device) .logo-block-modern {
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    padding: 0;
    position: relative;
    transition: background 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body:not(.mobile-device) .logo-block-modern:hover {
    background: rgba(0, 113, 227, 0.1);
    transform: scale(1.05);
}

body.dark-theme:not(.mobile-device) .logo-block-modern {
    background: #2c2c2e;
}

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

/* Слайд-блоки (органайзер + смета) */
body:not(.mobile-device) .slide-blocks {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    transition: max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s ease;
    white-space: nowrap;
}

body:not(.mobile-device) .slide-blocks.open {
    max-width: 600px;
    opacity: 1;
}

body:not(.mobile-device) .slide-block-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    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;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

body:not(.mobile-device) .slide-block-btn:hover {
    background: rgba(0, 113, 227, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

body:not(.mobile-device) .slide-block-btn.open {
    background: rgba(0, 113, 227, 0.12);
    border-color: var(--primary);
    color: var(--primary);
}

body.dark-theme:not(.mobile-device) .slide-block-btn {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

body:not(.mobile-device) .slide-block-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

body:not(.mobile-device) .slide-block-count {
    display: inline-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;
}

body:not(.mobile-device) .slide-block-chevron {
    transition: transform 0.2s;
    color: currentColor;
    opacity: 0.6;
}

body:not(.mobile-device) .slide-block-btn.open .slide-block-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Правая группа: сегментированный контрол */
body:not(.mobile-device) .actions-segmented {
    display: flex;
    align-items: stretch;
    height: 44px;
    border-radius: 100px;
    background: var(--bg-color);
    border: 1px solid var(--hairline);
    overflow: hidden;
    flex-shrink: 0;
}

body.dark-theme:not(.mobile-device) .actions-segmented {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
}

body:not(.mobile-device) .segmented-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    height: 100%;
    border-right: 1px solid var(--hairline);
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    position: relative;
}

body:not(.mobile-device) .segmented-item:last-child {
    border-right: none;
}

body:not(.mobile-device) .segmented-item:hover {
    background: rgba(0, 113, 227, 0.06);
}

body.dark-theme:not(.mobile-device) .segmented-item {
    border-right-color: rgba(255, 255, 255, 0.06);
}

/* Язык */
body:not(.mobile-device) .lang-block {
    position: relative;
    padding: 0 16px;
    gap: 6px;
}

body:not(.mobile-device) .lang-display-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

body:not(.mobile-device) .lang-chevron {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

body:not(.mobile-device) .lang-block.open .lang-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Обратная связь */
body:not(.mobile-device) .feedback-block {
    padding: 0 18px;
}

/* Профиль */
body:not(.mobile-device) .profile-block {
    padding: 0 14px 0 12px;
    gap: 10px;
    min-width: 130px;
    max-width: 200px;
}

body:not(.mobile-device) .profile-avatar {
    width: 28px;
    height: 28px;
    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;
}

body:not(.mobile-device) .profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body:not(.mobile-device) .profile-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

body:not(.mobile-device) .profile-chevron {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

body:not(.mobile-device) .profile-block.open .profile-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

/* ==================================================== */
/* ПАНЕЛИ (Органайзер + Смета)                          */
/* ==================================================== */

body:not(.mobile-device) .organizer-panel,
body:not(.mobile-device) .estimate-panel {
    position: fixed;
    top: 84px;
    left: auto;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    max-height: 70vh;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    padding: 16px;
    z-index: 2147483646;
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.dark-theme:not(.mobile-device) .organizer-panel,
body.dark-theme:not(.mobile-device) .estimate-panel {
    background: rgba(28, 28, 30, 0.94);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

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

/* ==================================================== */
/* ДАШБОРД (главная ПК)                                  */
/* ==================================================== */

body:not(.mobile-device) .dashboard-screen {
    position: fixed;
    inset: 0;
    padding: 96px 32px 32px 32px;
    overflow: hidden;
    background: transparent;
    z-index: 5;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

body:not(.mobile-device) .dashboard-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.98);
}

body:not(.mobile-device) .dashboard-grid-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(360px, 1.15fr);
    gap: 22px;
    flex: 1;
    min-height: 0;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    align-items: stretch;
}

body:not(.mobile-device) .dashboard-card {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-radius: 26px;
    padding: 26px;
    border: 1px solid var(--border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

body.dark-theme:not(.mobile-device) .dashboard-card {
    background: rgba(28, 28, 30, 0.55);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

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

body:not(.mobile-device) .dashboard-tile-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: max-content;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 4px 4px 2px;
    align-content: start;
}

body:not(.mobile-device) .dashboard-tile-list::-webkit-scrollbar {
    width: 6px;
}

body:not(.mobile-device) .dashboard-tile-list::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 128, 0.2);
    border-radius: 3px;
}

/* Плитка инструмента */
body:not(.mobile-device) .dash-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 8px 12px;
    min-height: 96px;
    background: rgba(255, 255, 255, 0.7);
    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: center;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    box-sizing: border-box;
}

body.dark-theme:not(.mobile-device) .dash-tile {
    background: rgba(44, 44, 46, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
}

body:not(.mobile-device) .dash-tile:hover {
    background: rgba(232, 242, 255, 0.9);
    border-color: var(--primary);
    box-shadow: 0 8px 22px rgba(0, 113, 227, 0.18);
    color: var(--primary);
}

body.dark-theme:not(.mobile-device) .dash-tile:hover {
    background: rgba(0, 113, 227, 0.22);
}

body:not(.mobile-device) .dash-tile:active {
    transform: scale(0.96);
}

body:not(.mobile-device) .dash-tile-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

body:not(.mobile-device) .dash-tile-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    display: block;
}

body:not(.mobile-device) .dash-tile-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    text-align: center;
    color: inherit;
}

/* Широкие плитки сообщества */
body:not(.mobile-device) .dashboard-tile-list.community-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 auto;
    overflow-y: auto;
    padding-right: 4px;
}

body:not(.mobile-device) .dash-tile.wide {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    min-height: 64px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: left;
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

body:not(.mobile-device) .dash-tile.wide:hover {
    background: rgba(232, 242, 255, 0.9);
    border-color: var(--primary);
    color: var(--text-main);
}

body.dark-theme:not(.mobile-device) .dash-tile.wide:hover {
    background: rgba(0, 113, 227, 0.22);
}

body:not(.mobile-device) .dash-tile.wide .dash-tile-label {
    font-size: 14px;
    text-align: left;
    flex: 1;
}

body:not(.mobile-device) .dash-tile.wide .dash-tile-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

/* Feature-плитки */
body:not(.mobile-device) .dash-tile-featured {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    min-height: 78px;
    background: rgba(255, 255, 255, 0.7);
    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: 18px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-main);
    text-align: left;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme:not(.mobile-device) .dash-tile-featured {
    background: rgba(44, 44, 46, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
}

body:not(.mobile-device) .dash-tile-featured:hover {
    background: rgba(232, 242, 255, 0.9);
    border-color: var(--primary);
    box-shadow: 0 8px 22px rgba(0, 113, 227, 0.18);
}

body.dark-theme:not(.mobile-device) .dash-tile-featured:hover {
    background: rgba(0, 113, 227, 0.22);
}

body:not(.mobile-device) .dash-tile-featured:active {
    transform: scale(0.985);
}

body:not(.mobile-device) .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);
}

body:not(.mobile-device) .dash-tile-featured-body {
    flex: 1;
    min-width: 0;
}

body:not(.mobile-device) .dash-tile-featured-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.015em;
    line-height: 1.2;
    margin-bottom: 3px;
}

body:not(.mobile-device) .dash-tile-featured-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.3;
}

body:not(.mobile-device) .dash-tile-featured-arrow {
    font-size: 22px;
    font-weight: 300;
    color: var(--text-muted);
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity 0.2s, color 0.2s, transform 0.2s;
}

body:not(.mobile-device) .dash-tile-featured:hover .dash-tile-featured-arrow {
    opacity: 1;
    color: var(--primary);
    transform: translateX(3px);
}

body:not(.mobile-device) .dashboard-card-subtitle {
    margin-top: 20px !important;
    margin-bottom: 14px !important;
}

/* ==================================================== */
/* СООБЩЕНИЯ НА ДАШБОРДЕ                                */
/* ==================================================== */

body:not(.mobile-device) #dashboard-messages-card {
    padding: 0 !important;
    overflow: hidden !important;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body:not(.mobile-device) .dashboard-messages-pages {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

body:not(.mobile-device) .dashboard-messages-page {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.25s ease, visibility 0s linear;
    box-sizing: border-box;
    overflow: hidden;
}

body:not(.mobile-device) .dashboard-messages-page-list {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
    padding: 26px;
}

body:not(.mobile-device) .dashboard-messages-page-chat {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    z-index: 3;
    padding: 0;
}

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

body:not(.mobile-device) #dashboard-messages-card.chat-open .dashboard-messages-page-chat {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

body:not(.mobile-device) .dashboard-chat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

body:not(.mobile-device) .dashboard-chat-list::-webkit-scrollbar {
    width: 6px;
}

body:not(.mobile-device) .dashboard-chat-list::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 128, 0.2);
    border-radius: 3px;
}

body:not(.mobile-device) .dashboard-chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

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

body:not(.mobile-device) .dashboard-chat-item:hover {
    background: rgba(232, 242, 255, 0.9);
    border-color: var(--primary);
    transform: translateX(2px);
}

body:not(.mobile-device) .dashboard-chat-item:active {
    transform: scale(0.99);
}

body:not(.mobile-device) .dashboard-chat-item .avatar {
    width: 42px;
    height: 42px;
    font-size: 17px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

body:not(.mobile-device) .dashboard-chat-info {
    flex: 1;
    min-width: 0;
}

body:not(.mobile-device) .dashboard-chat-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

body:not(.mobile-device) .dashboard-chat-badge {
    background: #ff3b30;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Внутри чата */
body:not(.mobile-device) .dashboard-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

body:not(.mobile-device) .dashboard-chat-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
    flex-shrink: 0;
}

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

body:not(.mobile-device) .dashboard-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #5a9bff);
    color: #fff;
    font-weight: 700;
}

body:not(.mobile-device) .dashboard-chat-header-info {
    flex: 1;
    min-width: 0;
}

body:not(.mobile-device) .dashboard-chat-header-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

body:not(.mobile-device) .dashboard-chat-header-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

body:not(.mobile-device) #dashboard-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 20px 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-color);
    scroll-behavior: smooth;
}

body:not(.mobile-device) #dashboard-chat-messages::-webkit-scrollbar {
    width: 6px;
}

body:not(.mobile-device) #dashboard-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 128, 0.2);
    border-radius: 3px;
}

body:not(.mobile-device) #dashboard-chat-messages .chat-msg {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
}

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

body:not(.mobile-device) #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;
}

body.dark-theme:not(.mobile-device) #dashboard-chat-messages .chat-msg.received {
    background: #2c2c2e;
}

body:not(.mobile-device) .dashboard-chat-input-area {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    align-items: flex-end;
}

body:not(.mobile-device) .dashboard-chat-input {
    flex: 1;
    min-height: 42px;
    max-height: 140px;
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: 21px;
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    line-height: 1.4;
    transition: border-color 0.2s, box-shadow 0.2s;
}

body:not(.mobile-device) .dashboard-chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

body.dark-theme:not(.mobile-device) .dashboard-chat-input {
    background: #2c2c2e;
}

body:not(.mobile-device) .dashboard-chat-send {
    width: 42px;
    height: 42px;
    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;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
    transition: transform 0.2s, background 0.2s;
}

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

body:not(.mobile-device) .dashboard-chat-send:active {
    transform: scale(0.94);
}

/* ==================================================== */
/* СЕКЦИИ (полноэкранные)                                */
/* ==================================================== */

body:not(.mobile-device) .section-content.active {
    padding-bottom: 40px;
}

body:not(.mobile-device) .card {
    max-width: 100%;
}

/* Органайзер: сетка проектов на ПК */
body:not(.mobile-device) #organizer-projects-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
    gap: 18px !important;
}

body:not(.mobile-device) .org-card {
    padding: 22px 22px 20px;
    border-radius: 22px;
}

body:not(.mobile-device) .org-card-title {
    font-size: 20px;
}

/* Хаб органайзера */
body:not(.mobile-device) #organizer-hub-view {
    max-width: 1000px;
    margin: 0 auto;
}

body:not(.mobile-device) .org-hub-grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

body:not(.mobile-device) .org-hub-recent-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Проект — чат и вкладки (ПК) */
body:not(.mobile-device) #organizer-project-view {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 8px;
    height: calc(100vh - 160px);
    min-height: 560px;
    max-height: calc(100vh - 160px);
    overflow: hidden;
    display: block;
}

body:not(.mobile-device) .project-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: stretch;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

body:not(.mobile-device) .project-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
    min-height: 0;
}

body:not(.mobile-device) .project-menu::-webkit-scrollbar {
    width: 6px;
}

body:not(.mobile-device) .project-menu::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 128, 0.2);
    border-radius: 3px;
}

body:not(.mobile-device) .project-content {
    min-width: 0;
    min-height: 0;
    height: 100%;
    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);
    display: flex;
    flex-direction: column;
}

body:not(.mobile-device) .project-content-pane {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
}

body:not(.mobile-device) .project-content-pane.active {
    display: flex;
}

body:not(.mobile-device) .project-content-pane:not(.project-content-pane--chat) {
    overflow-y: auto;
    padding: 24px;
}

body:not(.mobile-device) #project-chat-view {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

/* Органайзер: детали проекта - статус-бар */
body:not(.mobile-device) .org-detail-mini {
    max-width: 1400px;
    margin: 0 auto 16px;
}

/* ==================================================== */
/* БАРАХОЛКА / НЕДВИЖИМОСТЬ / ПОДРЯДЧИКИ                */
/* ==================================================== */

body:not(.mobile-device) #market .flex-row,
body:not(.mobile-device) #jobs .flex-row {
    max-width: 1400px;
    margin: 0 auto 22px;
    padding: 16px;
    border-radius: 22px;
}

body:not(.mobile-device) #market-grid.grid-3col {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 20px !important;
    max-width: 1400px;
    margin: 0 auto 22px;
}

body:not(.mobile-device) #jobs-grid.grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
    gap: 20px !important;
    max-width: 1400px;
    margin: 0 auto 22px;
}

body:not(.mobile-device) #properties-page-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 20px !important;
    max-width: 1400px;
    margin: 0 auto;
}

body:not(.mobile-device) #companies-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 18px !important;
    max-width: 1400px;
    margin: 0 auto;
}

body:not(.mobile-device) #companies.section-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 32px 48px;
}

body:not(.mobile-device) .companies-page-heading {
    max-width: 1400px;
    margin: 0 auto 24px;
}

body:not(.mobile-device) .companies-page-kicker {
    display: inline-flex;
    margin-bottom: 10px;
    color: #d97706;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body:not(.mobile-device) .companies-page-heading h1 {
    margin: 0;
    color: var(--text-main);
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 760;
    letter-spacing: -0.045em;
    line-height: 1.12;
}

body:not(.mobile-device) .companies-page-heading p {
    max-width: 680px;
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}

body:not(.mobile-device) #companies .ratings-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

body:not(.mobile-device) #companies .ratings-search-bar .form-control {
    min-width: 0;
    min-height: 48px;
    flex: 1;
    padding: 0 16px;
    border-radius: 12px;
}

body:not(.mobile-device) #companies .companies-add-btn {
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #ea7900);
    box-shadow: 0 7px 18px rgba(234, 121, 0, 0.22);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

body:not(.mobile-device) #companies .companies-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(234, 121, 0, 0.3);
    filter: saturate(1.08);
}

body:not(.mobile-device) #companies .company-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 0;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    background: var(--card-bg);
    box-shadow: 0 6px 24px rgba(20, 35, 55, 0.06);
    overflow: hidden;
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
        border-color 220ms ease, box-shadow 220ms ease;
}

body:not(.mobile-device) #companies .company-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 113, 227, 0.2);
    box-shadow: 0 14px 36px rgba(20, 35, 55, 0.11);
}

body.dark-theme:not(.mobile-device) #companies .company-card {
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

body.dark-theme:not(.mobile-device) #companies .company-card:hover {
    border-color: rgba(74, 158, 255, 0.34);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
}

body:not(.mobile-device) #companies .company-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

body:not(.mobile-device) #companies .company-card-actions {
    position: static;
    flex-shrink: 0;
    margin-left: auto;
}

body:not(.mobile-device) #companies .company-card-art {
    display: grid;
    place-items: center;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0 0 12px;
    border-radius: 17px;
    overflow: hidden;
    background: #f2f2f7;
}

body.dark-theme:not(.mobile-device) #companies .company-card-art {
    background: #2c2c2e;
}

body:not(.mobile-device) #companies .company-card-art > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body:not(.mobile-device) #companies .company-card-image-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #8e8e93;
    background:
        radial-gradient(circle at 50% 40%, rgba(0, 113, 227, 0.09), transparent 48%),
        #f2f2f7;
}

body:not(.mobile-device) #companies .company-card-image-placeholder span {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 1px solid rgba(0, 113, 227, 0.13);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    color: #0071e3;
    font-size: 30px;
    font-weight: 700;
}

body.dark-theme:not(.mobile-device) #companies .company-card-image-placeholder {
    background: radial-gradient(circle at 50% 40%, rgba(0, 113, 227, 0.2), transparent 48%), #2c2c2e;
}

body.dark-theme:not(.mobile-device) #companies .company-card-image-placeholder span {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.12);
    color: #78b5ff;
}

body:not(.mobile-device) #companies .company-card-logo {
    display: none;
}

body:not(.mobile-device) #companies .company-card-name {
    font-size: 19px;
    line-height: 1.2;
}

body:not(.mobile-device) #companies .company-card-specs {
    white-space: normal;
}

body:not(.mobile-device) #companies .company-card-desc {
    max-width: 100%;
    margin: 7px 0 0;
    padding: 0;
    font-size: 13.5px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body:not(.mobile-device) #companies .company-card-footer {
    display: flex;
    align-items: center;
    justify-content: stretch;
    min-width: 0;
    margin: 10px 0 0;
    padding: 0;
    border-top: 0;
    border-left: 0;
}

body:not(.mobile-device) #companies .company-card-btn-site {
    width: 100%;
    min-height: 42px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #1677e8, #3689f5);
    color: #fff;
    font-size: 13px;
    box-shadow: 0 5px 14px rgba(22, 119, 232, 0.18);
}

body:not(.mobile-device) #companies .company-card-btn-site:hover {
    background: linear-gradient(135deg, #0867d6, #2479e7);
    box-shadow: 0 8px 18px rgba(22, 119, 232, 0.26);
}

body:not(.mobile-device) #companies .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);
}

body:not(.mobile-device) #companies .company-card-image-preview:empty {
    display: none;
}

body:not(.mobile-device) #companies .company-card-image-preview-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body:not(.mobile-device) #companies .company-card-owner-label {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.08);
    color: var(--primary);
    font-size: 12px;
    font-weight: 650;
}

body.dark-theme:not(.mobile-device) #companies .company-card-owner-label {
    background: rgba(74, 158, 255, 0.14);
    color: #78b5ff;
}

body.dark-theme:not(.mobile-device) #companies .companies-add-btn {
    color: #fff;
}

body:not(.mobile-device) .ratings-search-bar {
    max-width: 1400px;
    margin: 0 auto 20px;
}

body:not(.mobile-device) #ratings-segmented {
    max-width: 1400px;
    margin: 0 auto 20px;
}

body:not(.mobile-device) #default-ratings-view {
    max-width: 1400px;
    margin: 0 auto;
}

/* ==================================================== */
/* СООБЩЕНИЯ (полноэкранный раздел)                      */
/* ==================================================== */

body:not(.mobile-device) #messages.section-content.active {
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 200px);
}

body:not(.mobile-device) #messages .chat-container {
    height: 100% !important;
    max-height: calc(100vh - 200px);
}

/* ==================================================== */
/* ПРОФИЛЬ (личный кабинет)                              */
/* ==================================================== */

body:not(.mobile-device) #profile.section-content.active {
    max-width: 1200px;
    margin: 0 auto;
}

body:not(.mobile-device) #profile-auth .cabinet-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
    min-height: 600px;
}

body:not(.mobile-device) .profile-tabs {
    display: none !important; /* на ПК работают боковые вкладки */
}

/* ==================================================== */
/* ЧАТЫ СООБЩЕСТВА — ПК-ВЕРСИЯ                           */
/* ==================================================== */

body:not(.mobile-device) .community-chat-wrap {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100vh - 200px);
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
}

body.dark-theme:not(.mobile-device) .community-chat-wrap {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}

body:not(.mobile-device) .community-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-color);
}

body:not(.mobile-device) .community-chat-messages::-webkit-scrollbar {
    width: 8px;
}

body:not(.mobile-device) .community-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 128, 0.25);
    border-radius: 4px;
}

body:not(.mobile-device) .community-chat-input-wrap {
    flex-shrink: 0;
    padding: 14px 18px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
}

body:not(.mobile-device) .community-chat-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
}

body:not(.mobile-device) .community-chat-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-color);
    color: var(--primary);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

body:not(.mobile-device) .community-chat-attach-btn:hover {
    background: var(--primary-light);
    transform: scale(1.04);
}

body:not(.mobile-device) .community-chat-input {
    flex: 1;
    height: 44px;
    padding: 0 18px;
    border: 1.5px solid var(--border);
    border-radius: 22px;
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

body:not(.mobile-device) .community-chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

body:not(.mobile-device) .community-chat-send-btn {
    height: 44px;
    padding: 0 24px;
    border-radius: 22px;
    background: linear-gradient(135deg, #0071e3 0%, #0080ff 100%);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

body:not(.mobile-device) .community-chat-send-btn:hover {
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
}

body:not(.mobile-device) .community-chat-send-btn:active {
    transform: scale(0.96);
}

/* Барахолка / Недвижимость / Специалисты — секция чата */
body:not(.mobile-device) #market.section-content.active,
body:not(.mobile-device) #properties.section-content.active,
body:not(.mobile-device) #ratings.section-content.active {
    display: flex !important;
    flex-direction: column !important;
    max-width: 1000px;
    margin: 0 auto;
    height: calc(100vh - 180px);
    min-height: 360px;
    padding: 0 !important;
    gap: 0 !important;
}

body:not(.mobile-device) .desktop-community-chat-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1000px;
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
}

body:not(.mobile-device) .desktop-community-chat-header {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 0 0 auto;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

body:not(.mobile-device) .desktop-community-chat-header h2 {
    color: var(--text-main);
    font-size: 18px;
    font-weight: 700;
}

body:not(.mobile-device) .desktop-community-chat-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

body:not(.mobile-device) .community-chat-post-ad-btn {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, #f59e0b, #ea7900);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(234, 121, 0, 0.2);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

body:not(.mobile-device) .community-chat-post-ad-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 16px rgba(234, 121, 0, 0.28);
    filter: saturate(1.08);
}

body:not(.mobile-device) .community-chat-post-ad-btn:active {
    transform: scale(0.97);
}

body:not(.mobile-device) .desktop-community-chat-actions .community-chat-popout-btn {
    margin-left: 0;
}

body:not(.mobile-device) .simple-ad-modal {
    max-height: min(90vh, 820px);
    overflow-y: auto;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-messages {
    width: 100%;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 180px;
    color: var(--text-muted);
    text-align: center;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 82%;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-msg.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-bubble {
    min-width: 100px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 16px 16px 16px 5px;
    background: var(--card-bg);
    color: var(--text-main);
    overflow-wrap: anywhere;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-msg.mine .community-chat-bubble {
    border-color: rgba(0, 113, 227, 0.18);
    border-radius: 16px 16px 5px 16px;
    background: var(--primary-light);
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-author {
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-text {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.45;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 11px;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-photo img {
    display: block;
    max-width: min(420px, 100%);
    max-height: 340px;
    margin-top: 8px;
    border-radius: 10px;
    object-fit: contain;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-input-wrap {
    display: block;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-no-access {
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 62px;
    padding: 12px 18px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

body:not(.mobile-device) #market.section-content.active > :not(.desktop-community-chat-panel),
body:not(.mobile-device) #properties.section-content.active > :not(.desktop-community-chat-panel),
body:not(.mobile-device) #ratings.section-content.active > :not(.desktop-community-chat-panel) {
    display: none !important;
}

body:not(.mobile-device) #market.section-content.active .desktop-community-chat-panel,
body:not(.mobile-device) #properties.section-content.active .desktop-community-chat-panel,
body:not(.mobile-device) #ratings.section-content.active .desktop-community-chat-panel {
    display: flex;
}

/* ==================================================== */
/* МОДАЛЬНЫЕ ОКНА — ПК-версия                            */
/* ==================================================== */

body:not(.mobile-device) .modal-overlay {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

body:not(.mobile-device) .auth-card {
    max-width: 480px;
    padding: 38px 34px 32px;
}

body:not(.mobile-device) .property-modal {
    max-width: 560px !important;
}

body:not(.mobile-device) .property-view-modal {
    max-width: 720px !important;
}

body:not(.mobile-device) .profile-view-modal {
    max-width: 820px !important;
}

body:not(.mobile-device) .profile-view-modal.ads-open,
body:not(.mobile-device) .profile-view-modal.reviews-open {
    max-width: 1200px !important;
}

/* ==================================================== */
/* ФОНОВЫЙ СЛОЙ                                          */
/* ==================================================== */

body:not(.mobile-device) .app-background {
    position: fixed;
    inset: 0;
    z-index: 0;
}

/* ==================================================== */
/* РАЗНОЕ                                                */
/* ==================================================== */

/* Кнопка «Назад» в органайзере / калькуляторах */
body:not(.mobile-device) .organizer-back-btn,
body:not(.mobile-device) .project-pane-back-btn,
body:not(.mobile-device) #fullscreen-close-btn {
    display: inline-flex;
}

/* Топ специалистов на ПК */
body:not(.mobile-device) .top-specialists-carousel {
    max-width: 100%;
}

/* Скелетоны (карточки недвижимости) */
body:not(.mobile-device) .property-card-skeleton-card {
    background: var(--card-bg);
}

/* Отключаем все мобильные «высоты» в 100dvh */
body:not(.mobile-device) [style*="100dvh"] {
    /* не трогаем inline, но оставляем как есть */
}

/* Заметки — на ПК сетка из 2 колонок */
body:not(.mobile-device) #organizer-notes-view .notes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

body:not(.mobile-device) #organizer-notes-view .note-editor-textarea {
    width: 100%;
    min-height: 400px;
    padding: 20px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

body:not(.mobile-device) #organizer-notes-view .note-editor-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

/* Заметки: список на ПК */
body:not(.mobile-device) #organizer-notes-view .org-page-header {
    max-width: 1200px;
    margin: 0 auto 20px;
}

/* КОНВЕРТЕР / ГЕОМЕТРИЯ */
body:not(.mobile-device) #converter-content,
body:not(.mobile-device) #geometry-content {
    max-width: 1100px;
    margin: 0 auto;
}

/* ==================================================== */
/* АДАПТАЦИЯ: планшеты                                   */
/* ==================================================== */

@media (max-width: 1200px) {
    body:not(.mobile-device) .dashboard-grid-layout {
        grid-template-columns: 1fr 1fr;
    }
    body:not(.mobile-device) #dashboard-messages-card {
        grid-column: 1 / -1;
        min-height: 380px;
    }
}

@media (max-width: 1000px) {
    body:not(.mobile-device) .dashboard-grid-layout {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
    body:not(.mobile-device) #dashboard-messages-card {
        min-height: 400px;
    }
    body:not(.mobile-device) .dashboard-screen {
        overflow-y: auto;
    }
}

/* Единая визуальная система Apple для ПК */
:root {
    --primary: #007aff;
    --primary-hover: #006ee6;
    --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: 24px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.12);
}

html:has(body:not(.mobile-device)) {
    background: var(--bg-color);
}

body:not(.mobile-device) {
    color: var(--text-main);
    background: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

body.dark-theme:not(.mobile-device) {
    --bg-color: #000000;
    --card-bg: #1c1c1e;
    --text-main: #f5f5f7;
    --text-muted: #98989d;
    --border: rgba(255, 255, 255, 0.1);
    --hairline: rgba(255, 255, 255, 0.08);
    --primary-light: #0a2a52;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.18);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.32);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.42);
}

body:not(.mobile-device) .dashboard-card,
body:not(.mobile-device) .section-content > .card,
body:not(.mobile-device) .section-content > .feed-card,
body:not(.mobile-device) .section-content > .property-card,
body:not(.mobile-device) .section-content > .properties-page-empty {
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

body:not(.mobile-device) .dash-tile,
body:not(.mobile-device) .dash-tile.wide {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: var(--shadow-xs);
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease,
        transform 0.18s ease;
}

body:not(.mobile-device) .dash-tile:hover,
body:not(.mobile-device) .dash-tile.wide:hover {
    border-color: rgba(0, 122, 255, 0.24);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

body:not(.mobile-device) .form-control,
body:not(.mobile-device) .custom-select {
    border: 1px solid var(--border);
    border-radius: 12px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow-xs);
}

body:not(.mobile-device) .form-control:focus,
body:not(.mobile-device) .custom-select:focus {
    border-color: rgba(0, 122, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.14);
    transform: none;
}

body:not(.mobile-device) .btn-primary,
body:not(.mobile-device) .btn-primary-large,
body:not(.mobile-device) .org-btn-primary {
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.18);
    transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body:not(.mobile-device) .btn-primary:hover,
body:not(.mobile-device) .btn-primary-large:hover,
body:not(.mobile-device) .org-btn-primary:hover {
    box-shadow: 0 5px 14px rgba(0, 122, 255, 0.24);
    transform: translateY(-1px);
}

body:not(.mobile-device) .filter-btn,
body:not(.mobile-device) .favorites-tab,
body:not(.mobile-device) .segmented-item {
    border-radius: 10px;
}

body:not(.mobile-device) .auth-card,
body:not(.mobile-device) .modal-content {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
}

body:not(.mobile-device) .header-top-modern {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(255, 255, 255, 0.65);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body.dark-theme:not(.mobile-device) .header-top-modern {
    background: rgba(28, 28, 30, 0.82);
    border-color: rgba(255, 255, 255, 0.1);
}

@media (prefers-reduced-motion: reduce) {
    body:not(.mobile-device) *,
    body:not(.mobile-device) *::before,
    body:not(.mobile-device) *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ПК: согласованная система интерфейса в духе Apple */
body:not(.mobile-device) {
    --primary: #007aff;
    --primary-hover: #006ee6;
    --primary-light: #e8f2ff;
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-main: #1d1d1f;
    --text-muted: #6e6e73;
    --border: rgba(0, 0, 0, 0.08);
    --hairline: rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.14);
    color: var(--text-main);
    background: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

body.dark-theme:not(.mobile-device) {
    --primary-light: #0a2a52;
    --bg-color: #000000;
    --card-bg: #1c1c1e;
    --text-main: #f5f5f7;
    --text-muted: #98989d;
    --border: rgba(255, 255, 255, 0.1);
    --hairline: rgba(255, 255, 255, 0.08);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.48);
}

body:not(.mobile-device) .main-content {
    padding: 100px clamp(24px, 3vw, 48px) 40px;
    scrollbar-gutter: stable;
}

body:not(.mobile-device) .section-content {
    max-width: 1440px;
}

body:not(.mobile-device) .section-content.active {
    animation: pageIn 0.24s ease-out;
}

body:not(.mobile-device) .header-top-modern {
    top: 14px;
    width: calc(100% - 64px);
    max-width: 1440px;
    height: 60px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    background: rgba(250, 250, 252, 0.84);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.075), inset 0 1px 0 rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
}

body.dark-theme:not(.mobile-device) .header-top-modern {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(28, 28, 30, 0.84);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body:not(.mobile-device) .logo-block-modern,
body:not(.mobile-device) .profile-block,
body:not(.mobile-device) .feedback-block,
body:not(.mobile-device) .lang-block {
    border-radius: 12px;
}

body:not(.mobile-device) .header-top-modern .actions-segmented .theme-pill {
    flex: 0 0 64px !important;
    min-width: 64px !important;
    padding: 0 6px !important;
    border-radius: 0;
}

body:not(.mobile-device) .header-top-modern .actions-segmented .theme-pill .theme-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    line-height: 1 !important;
    transform: none !important;
}

body:not(.mobile-device) .header-top-modern .actions-segmented .theme-icon-svg {
    display: block;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

body:not(.mobile-device) .theme-icon-moon,
html.dark-theme body:not(.mobile-device) .theme-icon-sun {
    display: none;
}

html.dark-theme body:not(.mobile-device) .theme-icon-moon {
    display: inline;
}

body:not(.mobile-device) .fullscreen-close-btn {
    position: fixed;
    top: 88px;
    left: max(24px, calc((100vw - 1440px) / 2));
    z-index: 1002;
    min-height: 36px;
    padding: 0 13px;
    width: max-content;
    max-width: none;
    margin: 0;
    transform: translateY(-10px);
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

body:not(.mobile-device) .fullscreen-close-btn:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-sm);
    transform: none;
}

body:not(.mobile-device).section-open .fullscreen-close-btn {
    transform: none;
}

body:not(.mobile-device).section-open .fullscreen-close-btn:hover {
    transform: none;
}

body:not(.mobile-device) .dashboard-screen {
    padding: 96px clamp(24px, 3vw, 48px) 32px;
    overflow-y: auto;
}

body:not(.mobile-device) .dashboard-grid-layout {
    grid-template-columns: minmax(280px, 0.92fr) minmax(300px, 0.98fr) minmax(340px, 1.1fr);
    gap: 18px;
    max-width: 1440px;
}

body:not(.mobile-device) .dashboard-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
    will-change: auto;
}

body.dark-theme:not(.mobile-device) .dashboard-card {
    background: #1c1c1e;
    box-shadow: var(--shadow-sm);
}

body:not(.mobile-device) .dashboard-card-title {
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.07em;
}

body:not(.mobile-device) .dashboard-tile-list {
    gap: 10px;
}

body:not(.mobile-device) .dash-tile,
body:not(.mobile-device) .dash-tile.wide,
body:not(.mobile-device) .dash-tile-featured {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card-bg);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

body.dark-theme:not(.mobile-device) .dash-tile,
body.dark-theme:not(.mobile-device) .dash-tile.wide,
body.dark-theme:not(.mobile-device) .dash-tile-featured {
    background: #2c2c2e;
}

body:not(.mobile-device) .dash-tile:hover,
body:not(.mobile-device) .dash-tile.wide:hover,
body:not(.mobile-device) .dash-tile-featured:hover {
    border-color: rgba(0, 122, 255, 0.35);
    background: var(--primary-light);
    box-shadow: var(--shadow-xs);
    color: var(--text-main);
    transform: none;
}

body:not(.mobile-device) .dash-tile:active,
body:not(.mobile-device) .dash-tile-featured:active {
    transform: scale(0.985);
}

body:not(.mobile-device) .dash-tile-icon {
    color: var(--primary);
}

body:not(.mobile-device) .dash-tile-featured-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    box-shadow: none;
}

body:not(.mobile-device) .dashboard-messages-header,
body:not(.mobile-device) .dashboard-chat-header {
    min-height: 56px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hairline);
    background: var(--card-bg);
}

body:not(.mobile-device) .dashboard-messages-header .dashboard-card-title {
    margin: 0;
    color: var(--text-main);
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.02em;
    text-transform: none;
}

body:not(.mobile-device) #dashboard-chat-messages,
body:not(.mobile-device) .community-chat-messages {
    background: var(--bg-color);
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 120, 128, 0.28) transparent;
}

body:not(.mobile-device) #dashboard-chat-messages .chat-msg,
body:not(.mobile-device) .community-chat-msg {
    max-width: min(76%, 680px);
    box-shadow: none;
}

body:not(.mobile-device) #dashboard-chat-messages .chat-msg.sent,
body:not(.mobile-device) .community-chat-msg.mine .community-chat-bubble {
    border: 0;
    background: #007aff;
    box-shadow: none;
}

body:not(.mobile-device) #dashboard-chat-messages .chat-msg.received,
body:not(.mobile-device) .community-chat-msg:not(.mine) .community-chat-bubble {
    border: 1px solid var(--border);
    background: #e9e9eb;
    color: #1d1d1f;
}

body.dark-theme:not(.mobile-device) #dashboard-chat-messages .chat-msg.received,
body.dark-theme:not(.mobile-device) .community-chat-msg:not(.mine) .community-chat-bubble {
    border-color: rgba(255, 255, 255, 0.08);
    background: #3a3a3c;
    color: #f5f5f7;
}

body:not(.mobile-device) .dashboard-chat-input-area,
body:not(.mobile-device) .community-chat-input-wrap {
    padding: 12px 16px;
    border-top: 1px solid var(--hairline);
    background: var(--card-bg);
}

body:not(.mobile-device) .dashboard-chat-input,
body:not(.mobile-device) .community-chat-input {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-color);
    box-shadow: none;
}

body:not(.mobile-device) .community-chat-wrap,
body:not(.mobile-device) .desktop-community-chat-panel {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

body:not(.mobile-device) .community-chat-wrap {
    height: calc(100vh - 190px);
}

body:not(.mobile-device) .desktop-community-chat-panel {
    max-width: 1080px;
}

body:not(.mobile-device) .desktop-community-chat-header {
    min-height: 60px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--hairline);
}

body:not(.mobile-device) .desktop-community-chat-header h2 {
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-messages {
    padding: 24px clamp(20px, 5vw, 64px);
    background: var(--bg-color);
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-bubble {
    border: 1px solid var(--border);
    border-radius: 18px 18px 18px 6px;
    background: #e9e9eb;
    box-shadow: none;
}

body:not(.mobile-device) .desktop-community-chat-panel .community-chat-msg.mine .community-chat-bubble {
    border: 0;
    border-radius: 18px 18px 6px 18px;
    background: #007aff;
    color: #fff;
}

body.dark-theme:not(.mobile-device) .desktop-community-chat-panel .community-chat-bubble {
    border-color: rgba(255, 255, 255, 0.08);
    background: #3a3a3c;
    color: #f5f5f7;
}

body:not(.mobile-device) .community-chat-attach-btn,
body:not(.mobile-device) .community-chat-send-btn,
body:not(.mobile-device) .dashboard-chat-send {
    border: 0;
    box-shadow: none;
}

body:not(.mobile-device) .community-chat-attach-btn {
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--primary);
}

body:not(.mobile-device) .community-chat-send-btn {
    border-radius: 12px;
    background: var(--primary);
    font-weight: 600;
}

body:not(.mobile-device) #messages.section-content.active {
    max-width: 1440px;
    height: calc(100vh - 168px);
}

body:not(.mobile-device) #messages .chat-container {
    height: 100% !important;
    max-height: none;
    min-height: 480px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

body:not(.mobile-device) #messages .chat-sidebar {
    width: min(34%, 360px) !important;
    min-width: 280px;
    border-right: 1px solid var(--hairline) !important;
    background: var(--card-bg);
}

body:not(.mobile-device) #messages .chat-sidebar > div:first-child {
    min-height: 58px;
    padding: 18px 20px !important;
    border-bottom: 1px solid var(--hairline) !important;
    background: var(--card-bg) !important;
    color: var(--text-main);
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

body:not(.mobile-device) #chat-list {
    background: var(--card-bg);
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 120, 128, 0.28) transparent;
}

body:not(.mobile-device) .chat-list-item {
    min-height: 70px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--hairline);
    background: transparent;
    transition: background-color 0.15s ease;
}

body:not(.mobile-device) .chat-list-item:hover {
    background: rgba(120, 120, 128, 0.08);
}

body:not(.mobile-device) .chat-list-item.active {
    background: rgba(0, 122, 255, 0.1);
}

body:not(.mobile-device) #messages .chat-main,
body:not(.mobile-device) #messages #chat-header,
body:not(.mobile-device) #messages #chat-input-area {
    background: var(--card-bg) !important;
}

body:not(.mobile-device) #messages #chat-header {
    min-height: 58px;
    padding: 12px 20px !important;
    border-bottom: 1px solid var(--hairline) !important;
    font-size: 15px;
}

body:not(.mobile-device) #chat-messages {
    padding: 24px clamp(20px, 4vw, 56px) !important;
    background: var(--bg-color);
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 120, 128, 0.28) transparent;
}

body:not(.mobile-device) #chat-messages .chat-msg {
    max-width: min(72%, 680px);
    padding: 10px 14px;
    border: 0;
    border-radius: 18px;
    box-shadow: none;
}

body:not(.mobile-device) #chat-messages .chat-msg.sent {
    border-bottom-right-radius: 6px;
    background: #007aff;
}

body:not(.mobile-device) #chat-messages .chat-msg.received {
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
    background: #e9e9eb;
    box-shadow: none;
}

body.dark-theme:not(.mobile-device) #chat-messages .chat-msg.received {
    background: #3a3a3c;
}

body:not(.mobile-device) #messages #chat-input-area {
    padding: 12px 16px !important;
    border-top: 1px solid var(--hairline) !important;
}

body:not(.mobile-device) #messages #chat-input {
    min-height: 44px !important;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-color);
    box-shadow: none;
}

body:not(.mobile-device) .card,
body:not(.mobile-device) .feed-card,
body:not(.mobile-device) .market-card,
body:not(.mobile-device) .properties-page-filters,
body:not(.mobile-device) .ratings-list-card,
body:not(.mobile-device) .cabinet-sidebar,
body:not(.mobile-device) .cabinet-content,
body:not(.mobile-device) .project-content,
body:not(.mobile-device) .org-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card-bg);
    box-shadow: var(--shadow-xs);
}

body:not(.mobile-device) .feed-card,
body:not(.mobile-device) .market-card,
body:not(.mobile-device) .properties-page-grid .property-card {
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

body:not(.mobile-device) .feed-card:hover,
body:not(.mobile-device) .market-card:hover,
body:not(.mobile-device) .properties-page-grid .property-card:hover {
    border-color: rgba(0, 122, 255, 0.22);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

body:not(.mobile-device) .form-control,
body:not(.mobile-device) .custom-select,
body:not(.mobile-device) .properties-page-search input,
body:not(.mobile-device) .ratings-search-bar .form-control {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background-color: var(--card-bg);
    color: var(--text-main);
    box-shadow: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

body:not(.mobile-device) textarea.form-control {
    min-height: 96px;
    padding: 11px 13px;
}

body:not(.mobile-device) .form-control:focus,
body:not(.mobile-device) .custom-select:focus,
body:not(.mobile-device) .properties-page-search input:focus,
body:not(.mobile-device) .ratings-search-bar .form-control:focus {
    border-color: rgba(0, 122, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.14);
    transform: none;
}

body:not(.mobile-device) .btn-primary,
body:not(.mobile-device) .btn-primary-large,
body:not(.mobile-device) .org-btn-primary,
body:not(.mobile-device) .properties-page-filters > .btn-primary {
    min-height: 40px;
    border: 0;
    border-radius: 11px;
    background: var(--primary);
    box-shadow: none;
    font-weight: 600;
    transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

body:not(.mobile-device) .btn-primary:hover,
body:not(.mobile-device) .btn-primary-large:hover,
body:not(.mobile-device) .org-btn-primary:hover,
body:not(.mobile-device) .properties-page-filters > .btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 3px 10px rgba(0, 122, 255, 0.2);
}

body:not(.mobile-device) .filter-btn,
body:not(.mobile-device) .favorites-tab,
body:not(.mobile-device) .cabinet-nav-btn {
    border-radius: 11px;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body:not(.mobile-device) .filter-btn.active,
body:not(.mobile-device) .favorites-tab.active {
    border-color: transparent;
    background: var(--primary);
    color: #fff;
    box-shadow: none;
}

body:not(.mobile-device) .cabinet-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
}

body:not(.mobile-device) .cabinet-sidebar {
    top: 100px;
    padding: 22px 18px;
}

body:not(.mobile-device) .cabinet-content {
    padding: 28px;
}

body:not(.mobile-device) .cabinet-nav-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: none;
}

body:not(.mobile-device) .auth-card,
body:not(.mobile-device) .ratings-fullscreen-card,
body:not(.mobile-device) .profile-view-modal {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
}

body:not(.mobile-device) .modal-overlay {
    background: rgba(15, 15, 18, 0.38);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}

body:not(.mobile-device) :focus-visible {
    outline: 3px solid rgba(0, 122, 255, 0.45);
    outline-offset: 2px;
    box-shadow: none !important;
}

body:not(.mobile-device) .app-background {
    background: var(--bg-color);
}

body:not(.mobile-device) .bg-sphere,
body:not(.mobile-device) .bg-glow {
    opacity: 0.16;
}

body.dark-theme:not(.mobile-device) .app-background {
    background: #000;
}

body:not(.mobile-device) .properties-page-header {
    align-items: center;
    margin-bottom: 18px;
}

body:not(.mobile-device) .properties-page-title,
body:not(.mobile-device) .org-hub-title,
body:not(.mobile-device) .org-page-title,
body:not(.mobile-device) .cabinet-title {
    color: var(--text-main);
    font-weight: 650;
    letter-spacing: -0.035em;
}

body:not(.mobile-device) .properties-page-title,
body:not(.mobile-device) .org-hub-title,
body:not(.mobile-device) .org-page-title {
    font-size: clamp(26px, 2vw, 32px);
}

body:not(.mobile-device) .properties-page-count {
    color: var(--text-muted);
}

body:not(.mobile-device) .properties-page-filters.flex-row {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: var(--shadow-xs);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
}

body:not(.mobile-device) .properties-page-filters .properties-page-search-input {
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--bg-color);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body:not(.mobile-device) .properties-page-filters .properties-page-filter-btn {
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body:not(.mobile-device) .properties-page-filters .properties-page-filter-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

body:not(.mobile-device) .properties-page-filters .properties-page-filter-btn.active {
    background: var(--primary);
    box-shadow: none;
}

body:not(.mobile-device) .ratings-segmented {
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(120, 120, 128, 0.1);
}

body:not(.mobile-device) .ratings-segment-indicator {
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: var(--shadow-xs);
}

body:not(.mobile-device) .ratings-search-bar {
    gap: 12px;
}

body:not(.mobile-device) .properties-page-empty,
body:not(.mobile-device) .cabinet-empty,
body:not(.mobile-device) .community-chat-empty {
    color: var(--text-muted);
}

body:not(.mobile-device) .properties-page-empty,
body:not(.mobile-device) .cabinet-empty {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card-bg);
}

body:not(.mobile-device) .chat-list-item .chat-last {
    max-width: 100%;
}

body:not(.mobile-device) .chat-msg-time,
body:not(.mobile-device) .community-chat-meta {
    color: var(--text-muted);
    font-size: 11px;
}

body:not(.mobile-device) .community-chat-msg.mine .community-chat-meta {
    color: rgba(255, 255, 255, 0.78);
}

body:not(.mobile-device) .community-chat-delete-btn {
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
}

body:not(.mobile-device) .community-chat-delete-btn:hover {
    background: rgba(120, 120, 128, 0.14);
}

body:not(.mobile-device) .community-chat-msg.mine .community-chat-delete-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

body:not(.mobile-device) .auth-card,
body:not(.mobile-device) .ratings-fullscreen-card,
body:not(.mobile-device) .profile-view-modal {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body:not(.mobile-device) .close-modal {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(120, 120, 128, 0.1);
    color: var(--text-muted);
    box-shadow: none;
}

body:not(.mobile-device) .close-modal:hover {
    background: rgba(120, 120, 128, 0.18);
    color: var(--text-main);
    transform: none;
}

body:not(.mobile-device) .cabinet-avatar {
    box-shadow: none;
}

body:not(.mobile-device) .cabinet-content,
body:not(.mobile-device) .cabinet-sidebar {
    box-shadow: var(--shadow-xs);
}

body:not(.mobile-device) .cabinet-nav-btn {
    color: var(--text-main);
}

body:not(.mobile-device) .cabinet-nav-btn:hover {
    background: rgba(120, 120, 128, 0.09);
}

body:not(.mobile-device) .org-hub-create-btn,
body:not(.mobile-device) .org-hub-card,
body:not(.mobile-device) .org-recent-card,
body:not(.mobile-device) .org-note-card {
    border-radius: 16px;
    box-shadow: var(--shadow-xs);
}

body:not(.mobile-device) .community-chat-popout-btn {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--bg-color);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

body:not(.mobile-device) .community-chat-popout-btn:hover {
    border-color: rgba(0, 122, 255, 0.24);
    background: var(--primary-light);
}

@media (max-width: 860px) {
    body:not(.mobile-device) .desktop-community-chat-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    body:not(.mobile-device) .desktop-community-chat-actions {
        width: 100%;
        margin-left: 0;
    }

    body:not(.mobile-device) .community-chat-post-ad-btn,
    body:not(.mobile-device) .community-chat-popout-btn {
        flex: 1 1 0;
        min-width: 0;
        white-space: normal;
        text-align: center;
    }
}

body:not(.mobile-device) .community-chat-window {
    position: fixed;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    width: 390px;
    height: min(560px, calc(100vh - 110px));
    min-width: 320px;
    min-height: 260px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 72px);
    overflow: hidden;
    resize: both;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 18px;
    background: var(--card-bg);
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: communityChatWindowIn 0.18s ease-out;
}

body.dark-theme:not(.mobile-device) .community-chat-window {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.28);
}

@keyframes communityChatWindowIn {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

body:not(.mobile-device) .community-chat-window-bar {
    display: flex;
    flex: 0 0 54px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px 0 16px;
    border-bottom: 1px solid var(--hairline);
    background: var(--card-bg);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

body:not(.mobile-device) .community-chat-window-bar:active {
    cursor: grabbing;
}

body:not(.mobile-device) .community-chat-window-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

body:not(.mobile-device) .community-chat-window-status {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

body:not(.mobile-device) .community-chat-window-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body:not(.mobile-device) .community-chat-window-controls {
    display: flex;
    align-items: center;
    gap: 7px;
}

body:not(.mobile-device) .community-chat-window-control {
    display: inline-flex;
    width: 27px;
    height: 27px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(120, 120, 128, 0.13);
    color: var(--text-main);
    font: 500 20px/1 -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

body:not(.mobile-device) .community-chat-window-control:hover {
    background: rgba(120, 120, 128, 0.22);
}

body:not(.mobile-device) .community-chat-window-control.close:hover {
    background: #ff453a;
    color: #fff;
}

body:not(.mobile-device) .community-chat-window > .desktop-community-chat-panel {
    display: flex !important;
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0 0 17px 17px;
    box-shadow: none;
    resize: none;
}

body:not(.mobile-device) .community-chat-window > .desktop-community-chat-panel > .desktop-community-chat-header {
    display: none;
}

body:not(.mobile-device) .community-chat-window .community-chat-messages {
    gap: 12px;
    padding: 18px 14px;
}

body:not(.mobile-device) .community-chat-window .community-chat-msg {
    max-width: 90%;
    gap: 7px;
}

body:not(.mobile-device) .community-chat-window .community-chat-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 11px;
}

body:not(.mobile-device) .community-chat-window .community-chat-bubble {
    min-width: 80px;
    max-width: 100%;
    padding: 9px 11px;
}

body:not(.mobile-device) .community-chat-window .community-chat-author {
    font-size: 11px;
}

body:not(.mobile-device) .community-chat-window .community-chat-text {
    font-size: 13px;
}

body:not(.mobile-device) .community-chat-window .community-chat-input-wrap {
    padding: 10px;
}

body:not(.mobile-device) .community-chat-window .community-chat-input-row {
    gap: 7px;
}

body:not(.mobile-device) .community-chat-window .community-chat-attach-btn {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
}

body:not(.mobile-device) .community-chat-window .community-chat-input {
    height: 38px;
    min-width: 0;
    padding: 0 12px;
    font-size: 13px;
}

body:not(.mobile-device) .community-chat-window .community-chat-send-btn {
    height: 36px;
    padding: 0 13px;
    font-size: 12px;
}

body:not(.mobile-device) .community-chat-window.is-minimized {
    width: 300px !important;
    height: 54px !important;
    min-width: 260px;
    min-height: 54px;
    max-height: 54px;
    resize: none;
    border-radius: 16px;
}

body:not(.mobile-device) .community-chat-window.is-minimized .community-chat-window-bar {
    flex-basis: 54px;
    border-bottom: 0;
}

body:not(.mobile-device) .community-chat-window.is-minimized > .desktop-community-chat-panel {
    display: none !important;
}

@media (max-width: 520px) {
    body:not(.mobile-device) .community-chat-window {
        width: calc(100vw - 24px);
        min-width: 0;
        height: min(560px, calc(100vh - 94px));
    }

    body:not(.mobile-device) .community-chat-window.is-minimized {
        width: min(300px, calc(100vw - 24px)) !important;
        min-width: 0;
    }

    body:not(.mobile-device) .community-chat-popout-btn {
        min-height: 32px;
        padding: 0 9px;
        font-size: 11px;
    }
}

body:not(.mobile-device) button,
body:not(.mobile-device) input,
body:not(.mobile-device) select,
body:not(.mobile-device) textarea {
    font-family: inherit;
}

body:not(.mobile-device) button {
    letter-spacing: -0.01em;
}

body:not(.mobile-device) button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    box-shadow: none;
    transform: none;
}

body:not(.mobile-device) a {
    color: var(--primary);
}

body:not(.mobile-device) ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body:not(.mobile-device) ::-webkit-scrollbar-track {
    background: transparent;
}

body:not(.mobile-device) ::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 8px;
    background: rgba(120, 120, 128, 0.24);
    background-clip: padding-box;
}

body:not(.mobile-device) ::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 128, 0.4);
    background-clip: padding-box;
}

body:not(.mobile-device) ::selection {
    background: rgba(0, 122, 255, 0.22);
}

@media (max-width: 1180px) {
    body:not(.mobile-device) .dashboard-grid-layout {
        grid-template-columns: minmax(240px, 0.9fr) minmax(260px, 1fr);
        overflow: auto;
    }

    body:not(.mobile-device) #dashboard-messages-card {
        grid-column: 1 / -1;
        min-height: 420px;
    }

    body:not(.mobile-device) .cabinet-layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    body:not(.mobile-device) .dashboard-grid-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    body:not(.mobile-device) #messages .chat-sidebar {
        width: 38% !important;
        min-width: 220px;
    }

    body:not(.mobile-device) .cabinet-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    body:not(.mobile-device) .cabinet-sidebar {
        position: static;
    }
}