/* Base styles from chat.html */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fef9f0;
    height: 100vh;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
    margin: 0;
    padding: 0;
}

.mailbox-page {
    background: #fef9f0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.mailbox-module {
    display: flex;
    background: #fef9f0;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.hidden { display: none !important; }

#loading { 
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 10000;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007AFF;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#app { 
    opacity: 0; 
    transition: opacity 0.3s ease;
    height: 100vh;
    height: 100dvh;
    display: flex;
    min-height: 0;
}

#app.is-visible {
    opacity: 1;
}

#chat-container { 
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: white;
    min-height: 0;
}

#chat-container.is-visible {
    opacity: 1;
}

/* Mailbox scrollable container - same layout as chat */
.mailbox-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    background: white;
    min-height: 0;
}

#chat-header {
    background: linear-gradient(135deg, #fef9f0, #fef9f0);
    color: black;
    padding: calc(15px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) 15px calc(20px + env(safe-area-inset-left));
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #fef9f0;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 900;
    font-family: "Segoe UI", "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

#chat-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

#chat-header .header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

#chat-header .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action-btn {
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 8px;
    padding: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.header-action-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

#mobile-menu-toggle {
    background: linear-gradient(135deg, var(--dashboard-item-primary-start, #f59e0b), var(--dashboard-item-primary-end, #d97706));
    color: black;
    border: 1px solid var(--dashboard-item-border, #b45309);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
}

@media (min-width: 769px) {
    #mobile-menu-toggle {
        color: black;
        font-size: 16px;
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        padding: 0;
        border-radius: 8px;
    }
}

#chat-header h1 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    margin: 0;
    display: flex;
    align-items: center;
    font-family: inherit;
}

#chat-header h1 .header-title-icon {
    color: #5cc0ff;
    font-size: 18px;
}

#chat-header h1 span {
    line-height: 1;
}

#chat-header button,
#chat-header select {
    font-family: inherit;
}

#chat-header .header-icon-btn {
    background: linear-gradient(135deg, var(--dashboard-item-primary-start, #fef9f0), var(--dashboard-item-primary-end, #fef9f0));
    color: white;
    border: 1px solid var(--dashboard-item-border, #fef9f0);
    border-radius: 8px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

#chat-header .header-icon-btn:hover {
    filter: brightness(1.07);
    border-color: rgba(255, 255, 255, 0.35);
}

#chat-header .header-icon-btn i {
    font-size: 16px;
}

#vip-room-create-btn {
    background: #1f1710;
    color: #ffd88a;
    border: 1px solid #5a4b2e;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 6px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

#vip-room-create-btn:hover {
    background: #2c2116;
    border-color: #7a6536;
}

#vip-room-create-btn i {
    font-size: 13px;
}

/* Header overflow collapse: controls relocated into the hamburger drawer */
.chat-header-controls-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-header-controls-section #room-selector {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* VIP room + user-list buttons: render as regular hamburger menu items.
   The !important flags override the header-only #user-list-toggle styles
   (which themselves use !important) when the button is moved into the drawer. */
.chat-header-controls-section #vip-room-create-btn,
.chat-header-controls-section #user-list-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0;
    padding: 10px 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    background: rgba(254, 249, 240, 0.83) !important;
    color: #92400e !important;
    font-weight: 400;
    font-size: 14px !important;
    font-family: inherit;
    justify-content: flex-start !important;
    cursor: pointer;
    box-sizing: border-box;
}

.chat-header-controls-section #vip-room-create-btn:hover,
.chat-header-controls-section #user-list-toggle:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    filter: none;
}

#room-selector {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #555;
    background: #fef9f0;
    color: #92400e;
    font-size: 16px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#room-selector:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mailbox-partner-select {
    background: #fef9f0;
    color: #92400e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#messages {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    background: #f8f9fa;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

@media (max-width: 768px) {
    #chat-container {
        max-width: 100%;
        width: 100%;
    }

    #messages {
        max-width: 100vw;
        width: 100%;
        overflow-x: hidden;
    }

    #message-input:focus {
        min-height: 150px;
        max-height: 150px;
    }
    
    #user-list-toggle {
        display: inline-flex !important;
    }

}

@media (min-width: 769px) {
    #chat-container {
        box-sizing: border-box;
    }

    #app {
        max-width: 1460px;
        margin: 0 auto;
    }

    #user-list-toggle {
        display: none !important;
    }
}

.message {
    /*margin-bottom: 15px;*/
    padding: 10px;
    border-radius: 12px;
    max-width: 70%;
    animation: messageAppear 0.3s ease;
}

.message-action-wrapper {
    position: relative;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
}

.message-action-open-btn {
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 999px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 0;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
}

.message-action-open-btn:active,
.message-action-open-btn:focus {
    outline: none;
    background: #f1f1f1;
}

.message-action-popup {
    border: 1px solid #ccc;
    background: #fef9f0;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #92400e;
}

.message-action-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fef9f0;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.14);
    color: #92400e;
    z-index: 1000;
    min-width: 160px;
    overflow: hidden;
    padding: 4px 0;
}

.message-action-item {
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
}

.message-action-item:hover {
    background: #f6f6f6;
}

#message-context-menu {
    position: absolute;
    background: #fef9f0;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
    z-index: 10010;
    min-width: 180px;
}

#message-context-menu button {
    width: 100%;
    text-align: left;
    padding: 7px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
}

#message-context-menu button:hover {
    background: #f8f8f8;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.own,
.message-container.message.own {
    background: #007AFF;
    color: white;
    margin-left: auto;
    align-self: flex-end;
}

.message.other,
.message-container.message.other {
    background: #e1e1e1;
    color: #333;
    margin-right: auto;
    align-self: flex-start;
}

/* Own voice message styling */
.message-container.voice-message.message.own {
    background: #007AFF;
    color: white;
}

.message-container.voice-message.message.own .voice-play-btn {
    color: white;
}

.message-container.voice-message.message.own .message-header strong {
    color: white;
}

.message.private-message {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border: 1px solid #ffd54f;
    color: #5d4037;
    cursor: pointer;
}

.message.private-message.own,
.message.private-message.other {
    color: #5d4037;
}

.message.own.image-message .image-container {
    margin-left: auto;
    margin-right: 0;
}

.message.other.image-message .image-container {
    margin-left: 0;
    margin-right: auto;
}

.message.system {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    text-align: center;
    max-width: 90%;
    margin: 10px auto;
    font-size: 0.9em;
}

#chat-input {
    border-top: 1px solid #e1e1e1;
    padding: 15px 20px;
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
    background: white;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mailbox-status {
    flex-shrink: 0;
    padding: 10px 20px;
    background: white;
    font-size: 0.85rem;
    color: #999;
    border-top: 1px solid #e1e1e1;
}

.mailbox-message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.mailbox-action-btn {
    border: 1px solid #bbb;
    background: #fff;
    color: #222;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 0.8rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mailbox-action-btn:hover {
    background-color: #f4f4f4;
    border-color: #999;
}

.mailbox-action-btn:active {
    background-color: #e8e8e8;
}

#mailbox-context-menu {
    position: absolute;
    min-width: 180px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 10005;
}

.mailbox-context-menu-item {
    width: 100%;
    text-align: left;
    padding: 6px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
}

.mailbox-context-menu-item:hover {
    background: #f0f0f0;
}

.mailbox-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #999;
    text-align: center;
}

#message-input {
    width: 100%;
    min-height: 50px;
    max-height: 150px;
    padding: 12px 58px 12px 16px;
    border: 2px solid #e1e1e1;
    /*border-radius: 999px;*/
    resize: none;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s;
}

#message-input:focus {
    min-height: 200px;
    max-height: 200px;
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

#message-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.chat-input-composer {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

.private-chat-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff3cd;
    border: 1px solid #ffd54f;
    color: #7a5a00;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    order: 1;
}

/* Public profile popup (avatar + displayname) */
.profile-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10050;
    padding: 16px;
}

.profile-popup-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px 20px 18px;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.23);
    position: relative;
}

.profile-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
}

.profile-popup-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.profile-popup-avatar {
   /*width: 170px;*/
    height: 170px;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid #e2e8f0;
}

.profile-popup-displayname {
    margin-top: 16px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.profile-popup-pm {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
    background: #ffffff;
    cursor: pointer;
    font-weight: 600;
}

.profile-popup-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}


.profile-popup-pm:hover {
    background: #f3f4f6;
}

.profile-popup-block {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
    background: #ffffff;
    cursor: pointer;
    font-weight: 600;
}

.profile-popup-block:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

/* ── Csoport-tagság blokk a profil-popupban (konferencia / üzleti környezet) ──
   A párkeresés kártya helyén ez mutatja, melyik kérdőív-válaszok alapján nyert
   csoportba tartozik a megnyitott résztvevő. */
.profile-popup-group {
    margin-top: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #eef6ff 0%, #f8fafc 100%);
    border: 1px solid #cfe3f7;
    border-radius: 12px;
    text-align: left;
    font-size: 0.9rem;
    color: #374151;
}

.profile-popup-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 8px;
}

.profile-popup-group-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

.profile-popup-group-meta {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ── Compatibility card inside profile popup ── */
.profile-popup-compatibility {
    margin-top: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0f4ff 0%, #f9fafb 100%);
    border: 1px solid #dbeafe;
    border-radius: 12px;
    text-align: left;
    font-size: 0.88rem;
    color: #374151;
}

.compat-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 10px;
}

.compat-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.compat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #3730a3;
}

.compat-badge.trust {
    background: #fef3c7;
    color: #92400e;
}

.compat-bar-track {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.compat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .4s ease;
}

.compat-details-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #6366f1;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 6px;
}

.compat-details-toggle:hover {
    text-decoration: underline;
}

.compat-details-toggle .arrow {
    display: inline-block;
    transition: transform .2s;
    font-size: 0.7rem;
}

.compat-details-toggle.open .arrow {
    transform: rotate(90deg);
}

.compat-details {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding-top: 6px;
}

.compat-details.open {
    display: flex;
}

.compat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    border-bottom: 1px dotted #e5e7eb;
    font-size: 0.82rem;
}

.compat-row:last-child {
    border-bottom: none;
}

.compat-row .label {
    color: #6b7280;
    flex-shrink: 0;
}

.compat-row .value {
    font-weight: 600;
    color: #111827;
    text-align: right;
}

/*.compat-section {
    max-height: 140px;
}*/

.compat-section-title {
    font-weight: 700;
    font-size: 0.82rem;
    color: #4338ca;
    margin-top: 8px;
    margin-bottom: 2px;
}

.compat-issues {
    margin-top: 4px;
    padding: 6px 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #991b1b;
}

.private-chat-indicator[hidden] {
    display: none !important;
}

.private-chat-label {
    font-weight: 600;
}

.private-chat-recipient {
    font-weight: 600;
}

.private-chat-clear {
    border: none;
    background: transparent;
    color: #7a5a00;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.private-chat-clear:hover {
    background: rgba(122, 90, 0, 0.1);
}

.private-reply-action {
    margin-left: 8px;
    font-size: 0.75em;
    padding: 4px 8px;
    border-radius: 10px;
    border: 1px solid #ffd54f;
    background: #fff8e1;
    color: #7a5a00;
    cursor: pointer;
}

.private-reply-action:hover {
    background: #ffecb3;
}

#send-button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #007AFF;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#send-button i,
#voice-button i,
#upload-button i,
#chat-header button i {
    pointer-events: none;
}

#send-button:hover:not(:disabled) {
    background: #0056CC;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

#send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

#voice-button,
#upload-button {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #007AFF;
    color: #fff;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

#voice-button {
    order: 4;
}

#upload-button {
    order: 5;
}

#voice-button:hover:not(:disabled),
#upload-button:hover:not(:disabled) {
    background: #0056CC;
    transform: translateY(-1px);
}

#voice-button:disabled,
#upload-button:disabled {
    background: #ccc;
    color: #f2f2f2;
    cursor: not-allowed;
    transform: none;
}

/* Phase 3: Media preview styles */
.media-preview-container {
    /*width: 100%;*/
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid #e1e1e1;
    margin-bottom: 6px;
    flex-wrap: wrap;
    order: 2;
    flex: 0 0 100%;
    width: 100%;
}

.media-preview-container[hidden] {
    display: none !important;
}

.image-preview-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 8px;
    gap: 8px;
}

.image-preview-item[hidden] {
    display: none !important;
}

.preview-image {
    max-width: 120px;
    max-height: 120px;
    border-radius: 6px;
    object-fit: cover;
    cursor: zoom-in;
}

.voice-preview-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 8px 12px;
}

.voice-preview-item[hidden] {
    display: none !important;
}

.voice-preview-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-play-btn {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #007AFF;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.voice-duration {
    font-size: 14px;
    color: #666;
    min-width: 40px;
}

.preview-remove-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #ff3b30;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.preview-remove-btn:hover {
    background: #cc2d26;
}

#typing-indicators {
    padding: 5px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e1e1;
    font-size: 13px;
    color: #666;
    min-height: 30px;
}

#user-list {
    position: fixed;
    top: 60px;
    right: 0;
    bottom: 0;
    width: 260px;
    background: #f8f9fa;
    border-left: 1px solid #e1e1e1;
    padding: 20px;
    overflow-y: auto;
    font-size: 16px;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.2s ease;
    z-index: 800;
    display: flex;
    flex-direction: column;
    gap: 10px;
}


#user-list:focus,
#user-list:focus-within,
#user-list.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

#user-list-toggle {
    background: #111 !important;
    color: white !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Desktop: user list always visible as flex sibling, toggle hidden */
@media (min-width: 769px) {
    #user-list {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        width: 260px;
        flex-shrink: 0;
        transform: none;
        opacity: 1;
        pointer-events: auto;
        z-index: auto;
        border-left: 1px solid #e1e1e1;
        padding: 0;
        height: 100vh;
        height: 100dvh;
    }

    /* Match chat-header height and style */
    .user-list-header {
        background: #000;
        color:black;
        padding: calc(15px + env(safe-area-inset-top)) 15px 15px 15px;
        border-bottom: 1px solid #333;
        margin-bottom: 0;
        font-size: 16px;
        flex-shrink: 0;
    }

    .user-list-header h3 {
        color: white;
    }

    .user-count-badge {
        background: #007AFF;
    }

    /* Items fill the remaining space */
    .user-list-items {
        flex: 1;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
    }

    #user-list-toggle {
        display: none;
    }
}

#private-message-area {
    margin-top: auto;
    background: #f8f9fa;
    border-top: 1px solid #e1e1e1;
    padding: 12px 0 0;
}

#private-message-input {
    width: 100%;
    min-height: 40px;
    max-height: 100px;
    border-radius: 8px;
    border: 1.5px solid #e1e1e1;
    padding: 8px 12px;
    font-size: 16px;
    resize: vertical;
}

#private-message-send {
    margin-top: 8px;
    width: 100%;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.user-item {
    padding: 0 8px 0 8px;
    margin-bottom: 0;
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.user-item.current-user {
    background: #e3f2fd !important;
    border-color: #007AFF !important;
}

.user-item.offline .user-status {
    background: #ccc !important;
    border-color: #999 !important;
}

.user-item.offline .user-name {
    color: #999 !important;
}

.user-item:hover {
    background: #f5f5f5 !important;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

#refresh-user-list {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    font-size: 16px;
}

#refresh-user-list:hover {
    background: rgba(0,0,0,0.1);
    color: #007AFF;
}

/* Mobile menu styles are now in hamburger-menu.css */

/* Responsive styles */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }

/*    .compat-section {
        max-height: 140px;
    }*/

    #user-list {
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        height: 45vh;
        padding-top: calc(32px + env(safe-area-inset-top));
        border-left: none;
        border-bottom: 1px solid #e1e1e1;
        transform: translateY(-100%);
        font-size: 16px;
    }
    
    #user-list:focus,
    #user-list:focus-within,
    #user-list.active {
        transform: translateY(0);
    }

    .mailbox-partner-select {
        max-width: calc(100vw - 140px);
        font-size: 14px;
    }
    
    .message {
        max-width: 85%;
    }

    #mobile-menu-toggle {
        color: black;
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
    }

    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    button, input, textarea, select {
        -webkit-appearance: none;
        appearance: none;
        border-radius: 8px;
    }

    #message-input {
        min-height: 44px;
        font-size: 16px;
        padding: 10px 52px 10px 14px;
    }

    #chat-input {
        padding: 10px 15px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .private-chat-indicator {
        font-size: 16px;
        padding: 7px 9px;
        flex: 0 0 100%;
        width: 100%;
        order: 1;
    }

    .media-preview-container {
        order: 2;
    }

    .chat-input-composer {
        order: 3;
    }

    #voice-button {
        order: 4;
    }

    #upload-button {
        order: 5;
    }

    #send-button {
        width: 34px;
        height: 34px;
        right: 5px;
        font-size: 16px;
    }

    #upload-button,
    #voice-button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    #messages {
        padding: 12px;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .message {
        max-width: 90%;
        padding: 10px 12px;
        font-size: 15px;
    }

    #chat-header {
        padding: calc(12px + env(safe-area-inset-top)) 15px 12px 15px;
    }

    #chat-header h1 {
        font-size: 18px;
    }

    /* Mobile: hide the chatroom icon for non-VIP users so it doesn't overlap
       with the VIP room and user-list icons in the header. */
    #chat-header .header-title h1 .fa-comments {
        display: none;
    }

    body.is-vip-user #chat-header .header-title h1 .fa-comments {
        display: inline-block;
    }

    #room-selector {
        font-size: 14px;
        padding: 6px;
        min-height: 40px;
        max-width: 150px;
    }

    #user-list {
        max-height: 250px;
    }

    .user-item {
        padding: 12px;
        min-height: 50px;
        font-size: 16px;
    }

    .user-item button {
        min-height: 44px;
        min-width: 44px;
        font-size: 16px;
    }

    #chat-container {
        height: 100dvh;
    }

    .message-image {
        max-width: 100%;
        max-height: 300px;
    }

    /* Phase 3: Mobile preview styles */
    #chat-input {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .media-preview-container {
        flex: 0 0 100%;
        /*width: 100%;*/
        justify-content: center;
    }

    .image-preview-item,
    .voice-preview-item {
        width: 100%;
        justify-content: space-between;
    }

    .preview-image {
        max-width: 120px;
        max-height: 120px;
    }
}

@media (max-width: 480px) {
/*    .compat-section {
        max-height: 140px;
    }*/

    #message-input {
        min-height: 40px;
        font-size: 16px;
        padding: 9px 48px 9px 12px;
    }

    #private-message-input {
        font-size: 16px;
    }

    #chat-input {
        gap: 6px;
        padding: 8px 10px;
        flex-wrap: wrap;
    }

    .private-chat-indicator {
        font-size: 16px;
        padding: 6px 8px;
        flex: 0 0 100%;
        width: 100%;
        order: 1;
    }

    .media-preview-container {
        order: 2;
    }

    .chat-input-composer {
        order: 3;
    }

    #voice-button {
        order: 4;
    }

    #upload-button {
        order: 5;
    }

    #send-button {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    #upload-button,
    #voice-button {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .message {
        max-width: 95%;
        font-size: 14px;
    }

    #chat-header h1 {
        font-size: 16px;
    }

    #chat-header {
        padding: calc(12px + env(safe-area-inset-top)) 10px 10px 10px;
    }

    #room-selector {
        font-size: 13px;
        min-width: 80px;
        max-width: 120px;
    }
}

/* Touch-device safeguard: keep private indicator above composer even on wider mobile/tablet viewports */
@media (hover: none) and (pointer: coarse) {
    #chat-input {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .private-chat-indicator {
        order: 1;
        width: 100%;
        flex: 0 0 100%;
        display: flex;
        align-items: center;
        padding: 5px 8px;
        font-size: 14px;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
    }

    #chat-input .private-chat-indicator[hidden] {
        display: none !important;
    }

    .private-chat-label {
        display: none;
    }

    .private-chat-clear {
        flex: 0 0 auto;
    }

    .private-chat-recipient {
        display: block;
        min-width: 0;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .media-preview-container {
        order: 2;
        flex: 0 0 100%;
    }

    .chat-input-composer {
        order: 3;
        flex: 1 1 auto;
        min-width: 0;
    }

    #voice-button {
        order: 4;
        flex: 0 0 auto;
    }

    #upload-button {
        order: 5;
        flex: 0 0 auto;
    }
}

/* iOS WebKit hard override (Safari/Chrome/Firefox/DuckDuckGo on iPhone) */
@supports (-webkit-touch-callout: none) {
    #chat-input {
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    #chat-input .private-chat-indicator {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 4px 8px !important;
        min-height: 26px !important;
        max-height: 30px !important;
        border-radius: 12px !important;
        font-size: 13px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    #chat-input .private-chat-indicator[hidden] {
        display: none !important;
    }

    #chat-input .private-chat-label {
        display: none !important;
    }

    #chat-input .private-chat-clear {
        flex: 0 0 auto !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
        padding: 0 !important;
        font-size: 13px !important;
        line-height: 1 !important;
    }

    #chat-input .private-chat-recipient {
        flex: 1 1 auto !important;
        display: block !important;
        min-width: 0 !important;
        font-weight: 600 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    #chat-input .media-preview-container {
        order: 2 !important;
        flex: 0 0 100% !important;
    }

    #chat-input .chat-input-composer {
        order: 3 !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    #chat-input #voice-button {
        order: 4 !important;
        flex: 0 0 auto !important;
    }

    #chat-input #upload-button {
        order: 5 !important;
        flex: 0 0 auto !important;
    }
}

/* Component styles from JavaScript extraction */
.session-conflict-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.session-conflict-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
}

.session-conflict-title {
    color: #d9534f;
    margin-bottom: 20px;
}

.session-conflict-text {
    margin-bottom: 20px;
    line-height: 1.5;
    color: #333;
}

.session-conflict-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.session-conflict-btn {
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    flex: 1;
    color: white;
}

.session-conflict-btn--primary {
    background: #4a6fa5;
}

.session-conflict-btn--danger {
    background: #dc3545;
}

.message-time {
    font-size: 11px;
    color: #888;
    margin-left: 8px;
    opacity: 0.7;
}

.message-animate {
    animation: messageAppear 0.3s ease;
}

.online-count-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 10px;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.info {
    background: #007AFF;
}

.toast.success {
    background: #34C759;
}

.toast.error {
    background: #FF3B30;
}

.typing-indicator {
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 15px;
    margin: 5px 10px;
    font-style: italic;
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: typingPulse 1.5s infinite;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.typing-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #888;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@keyframes typingPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.user-list-header {
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e1e1;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-count-badge {
    background: #007AFF;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.user-list-empty {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-top: 20px;
    padding: 10px;
    font-size: 14px;
}

.user-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4CAF50;
    border: 1px solid #2E7D32;
    flex-shrink: 0;
}

.user-status.online {
    background: #4CAF50;
    border-color: #2E7D32;
}

.user-status.away {
    background: #FFC107;
    border-color: #FFA000;
}

.user-status.offline {
    background: #ccc;
    border-color: #999;
}

.user-item.offline .user-status {
    background: #ccc;
    border: 1px solid #999;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.user-item.current-user .user-name {
    font-weight: bold;
    color: #007AFF;
}

.user-item.offline .user-name {
    color: #999;
}

.user-you-badge {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.user-last-seen {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.private-message-btn {
    margin-left: 8px;
    background: #f0f0f0;
    border: none;
    border-radius: 5px;
    padding: 4px 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 30px;
    min-width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.private-message-btn:hover {
    background: #e0e0e0;
}

.block-user-btn {
    border: 0px;
}

.scroll-to-bottom-btn {
    position: fixed;
    bottom: 100px;
    right: 15px;
    background: #4a6fa5;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 12px;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.scroll-to-bottom-btn.visible {
    display: block;
}

.message-text {
    word-break: break-word;
    overflow-wrap: break-word;
}

.status {
    display: none;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
}

.status.visible {
    display: block;
}

.status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============================================
   ÚJ: Vármegyei chatszoba stílusok
   ============================================ */

/* Room selector optgroups */
#room-selector optgroup {
    font-weight: bold;
    font-style: normal;
    padding: 5px 0;
}

#room-selector option {
    padding: 8px 12px;
    font-size: 14px;
}

/* Room indicators (🪙, 🎁, ⭐, 🏠) */
.room-option-indicator {
    margin-left: 5px;
    font-size: 12px;
}

.room-indicator-coin {
    color: #FFD700;
}

.room-indicator-sponsored {
    color: #4CAF50;
    font-weight: bold;
}

.room-indicator-favorite {
    color: #FF6B6B;
}

.room-indicator-home {
    color: #007AFF;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
}

/* Status bar improvements */
#chat-status-bar {
    position: fixed;
    top: 60px;
    right: 10px;
    max-width: 300px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

body.freeuse-active #chat-status-bar {
    top: 88px; /* 60px + 28px banner */
}

body.freeuse-active #chat-container {
    padding: 0 0 28px 0;
}

#chat-status-bar.visible {
    opacity: 1;
    transform: translateY(0);
}

#chat-status-bar.status-info {
    background: #007AFF;
    color: white;
}

#chat-status-bar.status-success {
    background: #34C759;
    color: white;
}

#chat-status-bar.status-error {
    background: #FF3B30;
    color: white;
}

#chat-status-bar.status-warning {
    background: #FF9500;
    color: white;
}

/* Image preview (file upload) */
.image-preview {
    position: relative;
    margin: 10px 0;
    padding: 10px;
    border: 2px dashed #007AFF;
    border-radius: 8px;
    background: #f5f5f7;
}

.preview-container {
    position: relative;
    display: inline-block;
}

.preview-container img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 4px;
    display: block;
}

.preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #FF3B30;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.preview-size {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Drag and drop overlay */
.drag-over {
    background: rgba(0, 122, 255, 0.1);
    border: 2px dashed #007AFF;
}

/* User list improvements */
.user-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e5e5e7;
    background: #f5f5f7;
}

.user-list-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.close-user-list {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-list-items {
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

.user-list-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.user-list-item:hover {
    background: #f5f5f7;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007AFF;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

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

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-location {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-action-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.user-action-btn:hover {
    background: #007AFF;
    border-color: #007AFF;
    transform: scale(1.1);
}

.user-action-btn.message-btn:hover {
    background: #34C759;
    border-color: #34C759;
}

.unread-badge {
    background: #FF3B30;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 8px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 13px;
    color: #999;
}

/* User list skeleton loader */
.user-skeleton {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 12px;
}

.user-skeleton::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.user-skeleton::after {
    content: '';
    display: block;
    flex: 1;
    height: 20px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Help Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1d1d1f;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f5f5f7;
    color: #1d1d1f;
}

.modal-body {
    padding: 25px;
}

.shortcut-section {
    margin-bottom: 25px;
}

.shortcut-section:last-child {
    margin-bottom: 0;
}

.shortcut-section h3 {
    font-size: 16px;
    color: #1d1d1f;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f7;
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item span {
    color: #666;
    font-size: 14px;
    flex: 1;
    text-align: right;
}

/* Onboarding modal styles */
.onboarding-modal {
    max-width: 560px;
}

.onboarding-progress {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.onboarding-lead {
    font-size: 16px;
    margin-bottom: 12px;
    color: #1d1d1f;
}

.onboarding-list {
    padding-left: 18px;
    margin: 0;
    color: #333;
}

.onboarding-list li {
    margin-bottom: 8px;
}

.onboarding-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 25px 22px;
    border-top: 1px solid #e0e0e0;
}

.room-payment-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(4px);
    z-index: 11020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.room-payment-modal {
    width: min(460px, 100%);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(2, 6, 23, 0.35);
    overflow: hidden;
}

.room-payment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.room-payment-modal-title {
    margin: 0;
    font-size: 1.03rem;
    color: #0f172a;
}

.room-payment-modal-close {
    border: none;
    background: transparent;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    color: #334155;
}

.room-payment-modal-close:hover {
    background: #f1f5f9;
}

.room-payment-modal-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.room-payment-modal-line {
    color: #1e293b;
    font-size: 0.96rem;
}

.room-payment-modal-warning {
    margin-top: 4px;
    padding: 8px 10px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
}

.room-payment-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid #e2e8f0;
}

.room-payment-btn {
    border: none;
    border-radius: 9px;
    padding: 9px 13px;
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
}

.room-payment-btn-secondary {
    background: #f1f5f9;
    color: #334155;
}

.room-payment-btn-secondary:hover {
    background: #e2e8f0;
}

.room-payment-btn-primary {
    background: #0ea5e9;
    color: #fff;
}

.room-payment-btn-primary:hover {
    background: #0284c7;
}

.onboarding-primary,
.onboarding-secondary,
.onboarding-skip {
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
}

.onboarding-primary {
    background: #007aff;
    color: #fff;
}

.onboarding-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.onboarding-secondary {
    background: #f5f5f7;
    color: #1d1d1f;
    border-color: #d1d1d6;
}

.onboarding-skip {
    background: transparent;
    color: #666;
}

.onboarding-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d1d1d6;
    margin-top: 8px;
    font-size: 14px;
}

.onboarding-status {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.onboarding-link {
    display: inline-flex;
    margin-top: 12px;
    color: #007aff;
    text-decoration: none;
    font-weight: 600;
}

.onboarding-link:hover {
    text-decoration: underline;
}

kbd {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #1d1d1f;
    background: #f5f5f7;
    border: 1px solid #d1d1d6;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 0 4px;
    min-width: 28px;
    text-align: center;
}

/* Mobile responsive help modal */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        width: 95%;
    }
    
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .shortcut-item span {
        text-align: left;
    }
}

/* Message actions (edit, delete, report) */
.message-actions {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    gap: 4px;
}

.message:hover .message-actions {
    display: flex;
}

.message-action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.message-action-btn:hover {
    background: #007AFF;
    border-color: #007AFF;
    transform: scale(1.1);
}

.message-action-btn.delete-btn:hover {
    background: #FF3B30;
    border-color: #FF3B30;
}

/* Shared image message card (chat + mailbox) */
.message-media-card {
    background: #eef3f8;
    border: 1px solid #dde6ef;
    border-radius: 10px;
    padding: 6px;
    margin: 6px 0 4px;
    display: inline-block;
    max-width: 100%;
}

/* Embedded images in messages */
.embedded-image {
    max-width: 100%;
    max-height: 320px;
    border-radius: 8px;
    margin: 0;
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.embedded-image:hover {
    transform: scale(1.02);
}

.chat-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(15, 23, 42, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.chat-image-lightbox.visible {
    display: flex;
}

.chat-image-lightbox-content {
    position: relative;
    max-width: min(96vw, 1200px);
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-image-lightbox-img {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    object-fit: contain;
}

.chat-image-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

/* Typing indicators */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #f5f5f7;
    border-radius: 16px;
    margin: 5px 10px;
    font-size: 13px;
    color: #666;
}

.typing-indicator .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #666;
    animation: typing-bounce 1.4s infinite;
}

.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* Room loading indicator */
.room-loading {
    display: inline-block;
    margin-left: 8px;
    font-size: 16px;
    animation: spin 1s linear infinite;
}

/* Critical error styling */
.critical-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ea 100%);
    text-align: center;
}

.error-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.critical-error h2 {
    font-size: 28px;
    color: #1d1d1f;
    margin-bottom: 15px;
}

.error-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
    max-width: 500px;
}

.error-details {
    margin: 20px 0;
    text-align: left;
    max-width: 600px;
}

.error-details summary {
    cursor: pointer;
    color: #007AFF;
    font-weight: 500;
    margin-bottom: 10px;
}

.error-details pre {
    background: #f5f5f7;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    color: #666;
    max-height: 300px;
}

.error-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007AFF;
    color: white;
}

.btn-primary:hover {
    background: #0051D5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-secondary {
    background: #f5f5f7;
    color: #1d1d1f;
}

.btn-secondary:hover {
    background: #e8e8ea;
    transform: translateY(-2px);
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    .toast {
        bottom: 90px;
        max-width: 90%;
    }
    
    #chat-status-bar {
        top: auto;
        bottom: 80px;
        right: 50%;
        transform: translateX(50%);
        max-width: 90%;
    }
    
    #chat-status-bar.visible {
        transform: translateX(50%) translateY(0);
    }
    
    .user-list-item {
        padding: 10px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .user-action-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}
/* Voice Recording Modal Styles */
.voice-recording-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.voice-recording-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.voice-recording-header {
    text-align: center;
    margin-bottom: 20px;
}

.voice-recording-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.voice-waveform-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.voice-waveform-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.voice-timer {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.voice-timer-display {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 36px;
    font-weight: 600;
    color: #007AFF;
    letter-spacing: 2px;
}

.voice-recording-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.voice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.btn-icon {
    font-size: 20px;
    line-height: 1;
}

.btn-text {
    font-size: 12px;
    display: block;
}

.voice-pause-btn {
    background: #f0f0f0;
    color: #333;
}

.voice-pause-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.voice-cancel-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e1e1e1;
}

.voice-cancel-btn:hover {
    background: #e1e1e1;
    transform: scale(1.05);
}

.voice-send-btn {
    background: #007AFF;
    color: white;
}

.voice-send-btn:hover {
    background: #0051D5;
    transform: scale(1.05);
}

.voice-play-btn:hover:not(:disabled) {
    background: #0051D5;
    transform: scale(1.1);
}

.voice-play-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Voice timeline slider */
.voice-timeline {
    flex: 1;
    height: 4px;
    border: none;
    border-radius: 2px;
    background: #ddd;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.voice-timeline::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #007AFF;
    cursor: pointer;
}

.voice-timeline::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #007AFF;
    cursor: pointer;
    border: none;
}

/* Hidden audio element */
.voice-audio-element {
    display: none;
}

/* Voice duration display */
.voice-duration {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    min-width: 45px;
    text-align: center;
    white-space: nowrap;
}

/* Voice caption text */
.voice-caption {
    font-size: 14px;
    color: #333;
    margin-top: 8px;
    padding: 8px;
    background: white;
    border-radius: 4px;
}

/* Responsive voice recording modal */
@media (max-width: 480px) {
    .voice-recording-container {
        width: 95%;
        padding: 20px;
    }

    .voice-recording-header h2 {
        font-size: 18px;
    }

    .voice-timer-display {
        font-size: 28px;
    }
}

/* Voice Message Display & Playback Styles */
.voice-message {
    margin: 5px 0;
}

.voice-message-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    /*background: #f0f0f0;*/
    border-radius: 8px;
}

.voice-player-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.voice-play-btn-mailbox {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #007AFF;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.voice-play-btn-mailbox:hover:not(:disabled) {
    background: #0051D5;
    transform: scale(1.1);
}

.voice-play-btn-mailbox:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.voice-duration {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    min-width: 45px;
    text-align: center;
}

.voice-timeline {
    flex: 1;
    height: 4px;
    border: none;
    border-radius: 2px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.voice-timeline::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #007AFF;
    cursor: pointer;
}

.voice-timeline::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #007AFF;
    cursor: pointer;
    border: none;
}

.voice-caption {
    margin-top: 8px;
    font-size: 14px;
    color: #333;
}

.voice-body {
    padding: 10px 0;
}

/* Chat.html voice message display */
.message-container.voice-message {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 5px 0;
}

.message-container.voice-message .message-header {
    /*margin-bottom: 8px;*/
}

.message-container.voice-message .voice-body {
    display: flex;
    flex-direction: column;
    /*gap: 10px;*/
}

.message-body.voice-body {
    display: flex;
    flex-direction: column;
    /*gap: 10px;*/
}

/* Responsive voice message styles */
@media (max-width: 480px) {
    .voice-play-btn-mailbox {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .voice-duration {
        font-size: 12px;
        min-width: 40px;
    }

    .voice-timeline {
        height: 3px;
    }

    .voice-timeline::-webkit-slider-thumb {
        width: 10px;
        height: 10px;
    }

    .voice-timeline::-moz-range-thumb {
        width: 10px;
        height: 10px;
    }

    .voice-caption {
        font-size: 13px;
    }
}

/* === Loading older messages indicator === */
.loading-older-messages {
    text-align: center;
    padding: 10px;
    color: #666;
    font-size: 13px;
}

.loading-older-messages .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Upgrade prompt banner === */
.upgrade-prompt {
    text-align: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    margin: 10px 20px;
    font-size: 13px;
}

.upgrade-prompt a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

/* ── Invitation card (profile photo + name) in mailbox ── */
.invitation-message {
    margin-bottom: 12px;
}

.invitation-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px !important;
    background: var(--msg-bg, #f8f9fa);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e0e0e0);
}

.message.own .invitation-card {
    background: var(--msg-own-bg, #e3f2fd);
}

.invitation-message.boosted {
    background: #EEE8AA !important;
}

.invitation-card.boosted {
    background: #EEE8AA !important;
}

.invitation-profile-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.invitation-profile-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color, #e0e0e0);
}

.invitation-profile-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg-secondary, #e9ecef);
    color: var(--text-muted, #6c757d);
}

.invitation-profile-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.invitation-profile-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary, #212529);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.invitation-profile-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary, #6c757d);
}



/* ── Invitation Profile Card (compact, in Meghívók thread) ── */
.invitation-profile-card {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border-color, #e0e0e0);
    margin: 8px 0;
    max-width: 340px;
}

.invitation-profile-card .card-photo-section {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #1a1a2e;
    cursor: pointer;
}

/* Allow horizontal scroll when photo gallery is present (class-based, broader browser support) */
.invitation-profile-card .card-photo-section.has-gallery {
    overflow: hidden; /* keep parent clipped, gallery handles its own overflow */
}

.invitation-profile-card .card-photo-gallery {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.invitation-profile-card .card-photo-section img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #e1e1e1;
}

.invitation-profile-card.boosted .card-photo-section img {
    background: #EEE8AA;
}

.invitation-profile-card .card-photo-gallery::-webkit-scrollbar {
    display: none;
}

.invitation-profile-card .card-photo-gallery .gallery-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    height: 100%;
}

.invitation-profile-card .card-photo-gallery .gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: auto;
}

.invitation-profile-card .card-photo-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.invitation-profile-card .card-photo-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: all 0.2s;
}

.invitation-profile-card .card-photo-dots .dot.active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
}

.invitation-profile-card .card-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 12px 12px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    z-index: 5;
}

.invitation-profile-card .card-info-overlay .card-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.invitation-profile-card .card-info-overlay .card-meta {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.invitation-profile-card .card-bio {
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
    line-height: 1.4;
    max-height: 3.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.invitation-profile-card .card-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 10px 12px 14px;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.invitation-profile-card .card-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.invitation-profile-card .card-btn:hover {
    transform: scale(1.08);
}

.invitation-profile-card .card-btn:active {
    transform: scale(0.95);
}

.invitation-profile-card .card-btn.block {
    background: #f3f4f6;
    color: #6b7280;
}

.invitation-profile-card .card-btn.reject {
    background: #fef2f2;
    color: #ef4444;
}

.invitation-profile-card .card-btn.accept {
    background: #f0fdf4;
    color: #dc2626;
}

.invitation-profile-card .card-status-badge {
    padding: 6px 12px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #16a34a;
    background: #f0fdf4;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

/* ── Profile Card Message (in regular conversations) ── */
.profile-card-message {
    margin: 8px 0;
    max-width: 340px;
}

.profile-card-message .profile-card {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border-color, #e0e0e0);
}

.profile-card-message .profile-card .card-photo-section {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #1a1a2e;
    cursor: pointer;
}

/* Allow horizontal scroll when photo gallery is present (class-based) */
.profile-card-message .profile-card .card-photo-section.has-gallery {
    overflow: hidden; /* keep parent clipped, gallery handles its own overflow */
}

.profile-card-message .profile-card .card-photo-gallery {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.profile-card-message .profile-card .card-photo-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card-message .profile-card .card-photo-gallery::-webkit-scrollbar {
    display: none;
}

.profile-card-message .profile-card .card-photo-gallery .gallery-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    height: 100%;
}

.profile-card-message .profile-card .card-photo-gallery .gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: auto;
}

.profile-card-message .profile-card .card-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 12px 12px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    z-index: 5;
}

.profile-card-message .profile-card .card-info-overlay .card-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.profile-card-message .profile-card .card-info-overlay .card-meta {
    font-size: 0.85rem;
    opacity: 0.9;
}

.profile-card-message .profile-card .card-bio {
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
    line-height: 1.4;
    max-height: 3.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .invitation-profile-card,
    .profile-card-message {
        max-width: 100%;
    }
    .invitation-profile-card .card-photo-section,
    .profile-card-message .profile-card .card-photo-section {
        height: 160px;
    }
}

/* --- Event questionnaire negotiation notice (echoconference.hu team mailbox) ----- */
.event-negotiation-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    background: var(--card-bg, #ffffff);
    max-width: 520px;
}

.event-negotiation-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary, #4b5563);
    text-transform: none;
}

.event-negotiation-title i {
    color: #2563eb;
}

.event-negotiation-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}

.event-negotiation-open {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
}

.event-negotiation-open:hover,
.event-negotiation-open:focus-visible {
    background: #1d4ed8;
    color: #ffffff;
    transform: translateY(-1px);
}

.event-negotiation-open:active {
    transform: translateY(0);
}

.event-negotiation-hint {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.35;
}




/* ── Conference participant card ────────────────────────────────────────────
   The event questionnaire entry point of an invited participant
   (modules/conferenceParticipantCard.js). It sits between the header and the
   message list, so it pushes the messages down instead of covering them. */
#conferenceCardSlot {
    flex: 0 0 auto;
    padding: 8px 12px 0;
}

#conferenceCardSlot[hidden] {
    display: none;
}

.conference-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    padding: 12px 40px 12px 14px;
    margin: 0 auto;
    max-width: 1200px;
}

.conference-card-body {
    flex: 1;
    min-width: 0;
}

.conference-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.conference-card-state {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #dcfce7;
    color: #15803d;
    border-radius: 999px;
    padding: 1px 8px;
}

.conference-card-text {
    margin: 4px 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #334155;
}

.conference-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.conference-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}

.conference-card-btn:hover {
    background: #f1f5f9;
}

.conference-card-btn.primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.conference-card-btn.primary:hover {
    background: #1d4ed8;
}

.conference-card-done {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #15803d;
}

.conference-card-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.conference-card-close:hover {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

@media (max-width: 600px) {
    #conferenceCardSlot {
        padding: 6px 8px 0;
    }

    .conference-card {
        padding: 10px 34px 10px 12px;
    }

    .conference-card-text {
        font-size: 0.8rem;
    }
}

