/* ============================================================
   ПУБЛИЧНАЯ PWA-ЧАСТЬ 73h.ru (CLEAN & FIXED)
   ============================================================ */

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border: #e2e8f0;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-hover: 0 12px 40px rgba(0,0,0,0.10);
    --radius: 16px;
    --header-height: 60px;
}

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

body.public-page {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ===== ХЕДЕР ===== */
.public-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: #1a2332;
    color: white;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
}

.public-header-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    height: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.public-header-left,
.public-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-logo {
    color: white;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.public-nav {
    display: flex;
    gap: 16px;
    margin-left: 24px;
}

.public-nav a {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.public-nav a:hover { color: white; }

/* Гамбургер */
.public-sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

.public-sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
}

/* Иконки и бейджи в шапке */
.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e0;
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.header-icon:hover { color: white; background: rgba(255,255,255,0.1); }

.header-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    display: block;
}

.header-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    border: 2px solid #1a2332;
}

/* Аватарка */
.user-menu-wrapper { position: relative; display: inline-block; }

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 20px;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4F46E5;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}
.user-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    padding: 8px 0;
    z-index: 1001;
}

.user-menu-dropdown.active { display: block; }

.user-menu-info {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.user-menu-name { font-weight: 600; color: var(--text); font-size: 14px; }
.user-menu-email { color: var(--text-muted); font-size: 12px; }

.user-menu-item {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.user-menu-item:hover { background: var(--bg); }
.user-menu-divider { height: 1px; background: var(--border); margin: 8px 0; }
.user-menu-logout { color: #ef4444 !important; font-weight: 500; }

/* Кнопки для гостей */
.btn-login {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--primary);
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-login:hover { background: var(--primary-dark); }

.btn-register {
    color: #9aa8b8;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    white-space: nowrap;
}
.btn-register:hover { color: white; border-color: rgba(255,255,255,0.3); }

/* Основной контент */
.public-main {
    min-height: calc(100dvh - var(--header-height) - 100px);
    padding-top: 0;
}

.public-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Футер */
.public-footer {
    background: #1a2332;
    color: #9aa8b8;
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 40px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.public-footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.public-footer a { color: #9aa8b8; text-decoration: none; }
.public-footer a:hover { color: white; }
.public-footer-links { margin-top: 8px; font-size: 12px; color: #718096; }

/* Кнопка-звездочка */
.btn-fav-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: 2px solid #e2e8f0 !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
    padding: 0 !important;
    color: #94a3b8 !important;
    font-size: 20px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    -webkit-tap-highlight-color: transparent !important;
}
.btn-fav-icon:hover { border-color: #ef4444 !important; color: #ef4444 !important; background: #fef2f2 !important; }
.btn-fav-icon.active { background: #fef2f2 !important; border-color: #ef4444 !important; color: #ef4444 !important; }
.btn-fav-icon .fav-icon { line-height: 1 !important; display: block !important; font-family: Arial, sans-serif !important; }

/* ============================================
   ЧАТ — ЕДИНЫЙ БЛОК (БЕЗ ДУБЛЕЙ)
   ============================================ */
.chat-container {
    display: flex;
    height: calc(100dvh - 60px - 80px);
    max-width: 1200px;
    margin: 0 auto;
    background: #f8f9fa;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.chat-sidebar {
    width: 340px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    flex-shrink: 0;
}

.chat-sidebar-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: #1a2332; }
.chat-sidebar-close { display: none; background: none; border: none; font-size: 20px; color: #7a8a9a; cursor: pointer; }

.conversations-list { flex: 1; overflow-y: auto; }

.conversation-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f2f5;
}

.conversation-item:hover { background: #f8f9fa; }
.conversation-item.active { background: #eef2ff; border-left: 3px solid #4F46E5; }

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: white;
    margin-right: 14px;
    flex-shrink: 0;
}

.conversation-info { flex: 1; min-width: 0; }
.conversation-name { font-weight: 600; color: #1a2332; font-size: 15px; margin-bottom: 2px; }
.conversation-last-message { font-size: 13px; color: #7a8a9a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.unread-badge {
    background: #4F46E5;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    min-width: 0;
    min-height: 0;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.chat-back { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: #4F46E5; padding: 4px; }
.chat-user-info { font-weight: 700; color: #1a2332; font-size: 17px; flex: 1; }
.chat-status { font-size: 13px; color: #7a8a9a; }

.chat-clear {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #a0aec0;
    padding: 4px;
}
.chat-clear:hover { color: #ef4444; }

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message { display: flex; max-width: 75%; gap: 10px; align-items: flex-end; }
.message.sent { align-self: flex-end; flex-direction: row-reverse; }
.message.received { align-self: flex-start; }

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #4F46E5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.message.sent .message-avatar { background: #7C3AED; }

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 15px;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.message.sent .message-bubble {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border-bottom-right-radius: 4px;
}
.message.received .message-bubble {
    background: #fff;
    color: #1a2332;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.message-time { font-size: 11px; color: #a0aec0; margin-top: 4px; display: block; }

.date-divider {
    text-align: center;
    font-size: 12px;
    color: #a0aec0;
    margin: 16px 0;
    position: relative;
}
.date-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 1;
}
.date-divider span { background: #f8f9fa; padding: 0 12px; position: relative; z-index: 2; }

.no-messages { text-align: center; color: #a0aec0; padding: 60px 20px; font-size: 16px; }

.chat-input-container {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-input-container textarea {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    min-height: 48px;
    max-height: 120px;
    background: #f8f9fa;
    outline: none;
    transition: border-color 0.2s;
}
.chat-input-container textarea:focus { border-color: #4F46E5; background: #fff; }

#sendButton {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}
#sendButton:hover { transform: scale(1.05); }
#sendButton:disabled { background: #cbd5e0; cursor: not-allowed; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; display: block; margin-bottom: 12px; }

/* ============================================
   МОБИЛЬНАЯ ВЕРСИЯ (ЕДИНСТВЕННЫЙ БЛОК)
   ============================================ */
@media (max-width: 768px) {
    .chat-container {
        display: flex !important;
        flex-direction: column !important;
        height: calc(100dvh - 56px) !important;
        border-radius: 0 !important;
        overflow: hidden !important;
    }

    .chat-sidebar {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: 30vh !important;
        flex: 0 0 auto !important;
        border-right: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
        overflow-y: auto !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .chat-sidebar-header {
        display: flex !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        flex-shrink: 0 !important;
    }

    .chat-sidebar-header h3 { font-size: 16px !important; }

    .conversations-list {
        flex: 1 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow-y: auto !important;
    }

    .conversation-item {
        padding: 12px 16px !important;
        border-bottom: 1px solid #f0f2f5 !important;
    }

    .conversation-item:last-child { border-bottom: none !important; }

    .chat-main {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .chat-back { display: none !important; }

    .chat-header {
        display: flex !important;
        padding: 10px 16px !important;
        min-height: 56px !important;
        flex-shrink: 0 !important;
    }

    .chat-user-info { font-size: 15px !important; }

    .chat-clear {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 38px !important;
        height: 38px !important;
        background: #f0f2f5 !important;
        border-radius: 50% !important;
        font-size: 18px !important;
        color: #7a8a9a !important;
        flex-shrink: 0 !important;
    }

    .chat-clear:hover {
        background: #fee2e2 !important;
        color: #ef4444 !important;
    }

    .chat-messages {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 16px !important;
    }

    .message { max-width: 90% !important; }

    .chat-input-container {
        padding: 10px 16px !important;
        flex-shrink: 0 !important;
    }
}

/* ============================================
   НОВЫЙ ЧАТ — ПОЛНОСТЬЮ С НУЛЯ (ПОБЕДИТ ВСЕ СТАРЫЕ)
   ============================================ */
.chat-page {
    display: flex;
    height: calc(100vh - var(--header-height) - 48px) !important;
    height: calc(100dvh - var(--header-height) - 48px) !important;
    max-height: none !important;
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}
.chat-page .chat-sidebar {
    width: 320px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-page .chat-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.chat-page .chat-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a2332;
}

.chat-page .conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.chat-page .conversation-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s;
}

.chat-page .conversation-item:hover {
    background: #f8f9fa;
}

.chat-page .conversation-item.active {
    background: #eef2ff;
    border-left: 3px solid #4F46E5;
}

.chat-page .conversation-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    margin-right: 12px;
    flex-shrink: 0;
}

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

.chat-page .conversation-name {
    font-weight: 600;
    color: #1a2332;
    font-size: 14px;
    margin-bottom: 2px;
}

.chat-page .conversation-last-message {
    font-size: 12px;
    color: #7a8a9a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-page .unread-badge {
    background: #4F46E5;
    color: #fff;
    border-radius: 10px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.chat-page .chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    min-width: 0;
    overflow: hidden;
}

.chat-page .chat-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chat-page .chat-user-info {
    font-weight: 700;
    color: #1a2332;
    font-size: 16px;
    flex: 1;
}

.chat-page .chat-status {
    font-size: 12px;
    color: #7a8a9a;
}

.chat-page .chat-clear {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #a0aec0;
    padding: 4px;
    border-radius: 50%;
}

.chat-page .chat-clear:hover {
    color: #ef4444;
    background: #fee2e2;
}

.chat-page .chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-page .message {
    display: flex;
    max-width: 75%;
    gap: 8px;
    align-items: flex-end;
}

.chat-page .message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-page .message.received {
    align-self: flex-start;
}

.chat-page .message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4F46E5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.chat-page .message.sent .message-avatar {
    background: #7C3AED;
}

.chat-page .message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 14px;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-page .message.sent .message-bubble {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-page .message.received .message-bubble {
    background: #fff;
    color: #1a2332;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.chat-page .message-time {
    font-size: 10px;
    color: #a0aec0;
    margin-top: 3px;
    display: block;
}

.chat-page .date-divider {
    text-align: center;
    font-size: 11px;
    color: #a0aec0;
    margin: 12px 0;
    position: relative;
}

.chat-page .date-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 1;
}

.chat-page .date-divider span {
    background: #f8f9fa;
    padding: 0 10px;
    position: relative;
    z-index: 2;
}

.chat-page .no-messages {
    text-align: center;
    color: #a0aec0;
    padding: 40px 20px;
    font-size: 15px;
}

.chat-page .chat-input-container {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-page .chat-input-container textarea {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 22px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    min-height: 44px;
    max-height: 100px;
    background: #f8f9fa;
    outline: none;
}

.chat-page .chat-input-container textarea:focus {
    border-color: #4F46E5;
    background: #fff;
}

.chat-page #sendButton {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-page .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #7a8a9a;
}

.chat-page .empty-state .icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

/* ============================================
   МОБИЛЬНАЯ ВЕРСИЯ (ЕДИНСТВЕННЫЙ БЛОК)
   ============================================ */
@media (max-width: 768px) {
    .chat-page {
        display: flex;
        flex-direction: column;
        height: calc(100dvh - 56px);
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .chat-page .chat-sidebar {
        width: 100%;
        max-height: 35vh;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        flex-shrink: 0;
    }

    .chat-page .chat-sidebar-header {
        display: none;
    }

    .chat-page .conversations-list {
        overflow-y: auto;
    }

    .chat-page .conversation-item {
        padding: 10px 14px;
    }

    .chat-page .conversation-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
        margin-right: 10px;
    }

    .chat-page .conversation-name {
        font-size: 13px;
    }

    .chat-page .conversation-last-message {
        font-size: 11px;
    }

    .chat-page .chat-main {
        flex: 1;
        min-height: 0;
    }

    .chat-page .chat-header {
        padding: 10px 14px;
        min-height: 52px;
    }

    .chat-page .chat-user-info {
        font-size: 14px;
    }

    .chat-page .chat-status {
        font-size: 11px;
    }

    .chat-page .chat-clear {
        width: 34px;
        height: 34px;
        font-size: 16px;
        background: #f0f2f5;
        border-radius: 50%;
    }

    .chat-page .chat-messages {
        padding: 14px;
    }

    .chat-page .message {
        max-width: 90%;
    }

    .chat-page .chat-input-container {
        padding: 8px 14px;
    }

    .chat-page .chat-input-container textarea {
        min-height: 40px;
        font-size: 14px;
    }

    .chat-page #sendButton {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   ВОССТАНАВЛИВАЕМ ШАПКУ (PUBLIC HEADER)
   ============================================ */
.public-header {
    position: sticky;
    top: 0;
    height: 60px;
    background: #1a2332;
    color: white;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
}

.public-header-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    height: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.public-header-left,
.public-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-logo {
    color: white;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.public-nav {
    display: flex;
    gap: 16px;
    margin-left: 24px;
}

.public-nav a {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.public-nav a:hover { color: white; }

.public-sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

.public-sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
}

/* Мобильное меню — СКРЫТО по умолчанию */
.public-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
}
.public-mobile-overlay.active { display: block; }

.public-mobile-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100dvh;
    background: #1a2332;
    z-index: 1501;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}
.public-mobile-menu.active { left: 0; }

.public-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: white;
    font-weight: 600;
}
.public-mobile-close {
    background: transparent;
    border: none;
    color: #9aa8b8;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}
.public-mobile-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.public-mobile-nav a {
    display: block;
    padding: 14px 24px;
    color: #9aa8b8;
    text-decoration: none;
    font-size: 15px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.public-mobile-nav a:hover,
.public-mobile-nav a:active {
    background: rgba(255,255,255,0.05);
    color: white;
}
.public-mobile-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 8px 20px; }
.public-mobile-login { color: #818CF8 !important; }
.public-mobile-logout { color: #EF4444 !important; }

/* На мобильных — показываем бургер, скрываем десктопную навигацию */
@media (max-width: 768px) {
    .public-sidebar-toggle {
        display: flex;
    }

    .public-nav {
        display: none;
    }

    .btn-register {
        display: none;
    }

    .btn-login {
        padding: 6px 12px;
        font-size: 13px;
    }

    .public-header-inner {
        padding: 0 12px;
    }
}

/* === Модалка отклика (respond-modal) === */
.respond-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.respond-modal[style*="display: flex"],
.respond-modal[style*="display:flex"] {
    display: flex !important;
}
.respond-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 36, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.respond-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
}
.respond-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eef0f2;
}
.respond-modal-header h2 { margin: 0; font-size: 18px; font-weight: 700; color: #1a2332; }
.respond-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #7a8a9a;
    padding: 4px 8px;
    border-radius: 8px;
    line-height: 1;
}
.respond-modal-close:hover { background: #f0f2f5; color: #1a2332; }
.respond-modal-body { padding: 20px 24px; }
.respond-vacancy-info { margin-bottom: 16px; font-size: 14px; color: #4a5568; }
.respond-vacancy-info strong { color: #1a2332; }
.respond-company { display: block; margin-top: 4px; font-size: 13px; color: #7a8a9a; }
.respond-form-group { margin-bottom: 16px; }
.respond-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 6px;
}
.respond-select,
.respond-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #eef0f2;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    background: #fafbfc;
    outline: none;
    transition: border-color 0.2s;
}
.respond-select:focus,
.respond-textarea:focus { border-color: #4F46E5; background: #fff; }
.respond-textarea { resize: vertical; min-height: 100px; }
.respond-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #eef0f2;
    background: #fafbfc;
    border-radius: 0 0 16px 16px;
}
.respond-alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.respond-alert.success { background: #e8f8ee; color: #1a8a4a; border: 1px solid #c3e6cb; }
.respond-alert.error { background: #fde8e8; color: #b33a3a; border: 1px solid #f5c6cb; }
@media (max-width: 640px) {
    .respond-modal-content { max-height: 95vh; border-radius: 14px; }
    .respond-modal-header { padding: 16px 18px; }
    .respond-modal-body { padding: 16px 18px; }
    .respond-modal-footer {
        flex-direction: column-reverse;
        padding: 14px 18px;
    }
    .respond-modal-footer .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   HOME FILTERS — блок фильтров на главной
   ============================================================ */
.home-filters {
    max-width: 760px;
    margin: 24px auto 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.home-filters-form { display: flex; flex-direction: column; gap: 12px; }
.home-filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}
.home-filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.home-filter-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.home-filter-group label svg { flex-shrink: 0; }
.home-filter-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: #1a2332;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.home-filter-group input:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}
.home-city-wrap { position: relative; display: flex; gap: 6px; }
.home-city-wrap input { flex: 1; }
.home-city-detect {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0 12px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}
.home-city-detect:hover { background: rgba(255, 255, 255, 0.2); }
.home-filter-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    font-family: inherit;
    height: 40px;
}
.home-filter-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}
.home-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.home-chips-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    margin-right: 4px;
}
.home-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.home-chip:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(124, 143, 255, 0.4);
}
.home-chip svg { flex-shrink: 0; }

@media (max-width: 768px) {
    .home-filters { padding: 12px; margin: 20px auto 0; }
    .home-filters-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .home-filter-submit { height: 42px; }
    .home-chips-label { display: none; }
    .home-chip { font-size: 11px; padding: 5px 10px; }
}
.articles-page { max-width: 1200px; margin: 0 auto; padding: 32px 20px 60px; }
.articles-header { margin-bottom: 28px; text-align: center; }
.articles-header h1 { font-size: 32px; color: #1a2332; margin: 0 0 8px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; }
.articles-header h1 svg { color: #4F46E5; }
.articles-header p { color: #7a8a9a; font-size: 15px; margin: 0; }
.cats-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; justify-content: center; }
.cat-chip { background: white; border: 1px solid #eef0f2; padding: 8px 16px; border-radius: 20px; color: #5a6a7a; font-size: 13px; font-weight: 500; text-decoration: none; transition: all 0.15s; box-shadow: 0 2px 4px rgba(0,0,0,0.04); }
.cat-chip:hover { border-color: #4F46E5; color: #4F46E5; }
.cat-chip.active { background: #4F46E5; color: white; border-color: #4F46E5; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25); }
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 32px; }
.article-card { display: flex; flex-direction: column; background: white; border: 1px solid #eef0f2; border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; transition: all 0.15s; }
.article-card:hover { transform: translateY(-3px); border-color: #4F46E5; box-shadow: 0 12px 28px rgba(79,70,229,0.1); }
.article-cover { height: 100px; background: linear-gradient(135deg, #4F46E5 0%, #7c3aed 100%); display: flex; align-items: center; justify-content: center; color: white; }
.article-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.article-cat { display: inline-block; background: #e8f0fe; color: #4F46E5; padding: 4px 12px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 12px; width: fit-content; }
.article-body h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: #1a2332; line-height: 1.35; }
.article-body .excerpt { margin: 0 0 16px; font-size: 14px; color: #7a8a9a; line-height: 1.6; flex: 1; }
.article-body .stats { display: flex; justify-content: space-between; font-size: 13px; color: #64748b; padding-top: 12px; border-top: 1px solid #e2e8f0; }
.article-body .stats span { display: inline-flex; align-items: center; gap: 4px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; background: white; border: 1px solid #e1e4e8; border-radius: 10px; color: #4a5568; text-decoration: none; font-weight: 600; font-size: 14px; transition: all 0.15s; }
.pagination a:hover { border-color: #4F46E5; color: #4F46E5; }
.pagination .active { background: #4F46E5; border-color: #4F46E5; color: white; }
.pagination .dots { border: none; background: none; }
.empty-block { background: white; border: 2px dashed #eef0f2; border-radius: 16px; padding: 60px 20px; text-align: center; color: #7a8a9a; }
.empty-block .icon { display: flex; justify-content: center; margin-bottom: 12px; }
@media (max-width: 768px) {
    .articles-page { padding: 20px 16px 40px; }
    .articles-header h1 { font-size: 22px; }
    .articles-header p { font-size: 13px; }
    .articles-grid { grid-template-columns: 1fr; gap: 14px; }
    .article-cover { height: 80px; }
    .article-body { padding: 20px; }
    .article-body h3 { font-size: 16px; }
    .pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; font-size: 13px; }
}
