/*
 * HarmonyDrop Chat Bar — demodrop theme
 * Palette adapted:  accent #e30d7f  |  bg #1d2729  |  bg2 #252d2f
 */

/* =============================================
   Portal / z-index base
   ============================================= */
#hd-chat-portal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 2147483647;
    background: transparent;
    overflow: visible;
}

/* =============================================
   Chat Bar (right sidebar)
   ============================================= */
.hd-chat-bar {
    position: fixed;
    right: 0;
    bottom: 96px; /* sopra il player */
    width: 250px;
    height: 480px;
    max-height: calc(100vh - 150px);
    background: #1d2729;
    border-left: 1px solid rgba(255,255,255,.1);
    border-top: 1px solid rgba(255,255,255,.1);
    border-radius: 10px 0 0 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: height .3s cubic-bezier(.4,0,.2,1), bottom .3s cubic-bezier(.4,0,.2,1);
    pointer-events: all;
}

body.no-player .hd-chat-bar { bottom: 0; max-height: calc(100vh - 70px); }

.hd-chat-bar-collapsed .hd-chat-user-list,
.hd-chat-bar-collapsed .hd-chat-search,
.hd-chat-bar-collapsed .hd-chat-offline-banner {
    display: none !important;
}

.hd-chat-bar-collapsed {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    right: 20px !important;
    bottom: 110px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

body.no-player .hd-chat-bar-collapsed {
    bottom: 20px !important;
}

/* Hide text and extra buttons when collapsed */
.hd-chat-bar-collapsed .hd-chat-bar-header {
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    justify-content: center !important;
    border-bottom: none !important;
}

.hd-chat-bar-collapsed .hd-chat-bar-title {
    gap: 0 !important;
    width: 100% !important;
    height: 100% !important;
    justify-content: center !important;
}

.hd-chat-bar-collapsed .hd-chat-bar-title > span:not(.hd-chat-bar-count) {
    display: none !important;
}

.hd-chat-bar-collapsed .hd-chat-bar-actions {
    display: none !important;
}

/* Unread badge position on circular button */
.hd-chat-bar-collapsed .hd-chat-bar-count {
    position: absolute;
    top: -5px;
    right: -5px;
    z-index: 10;
}

/* Header */
.hd-chat-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    cursor: pointer;
    user-select: none;
    min-height: 44px;
    flex-shrink: 0;
}

.hd-chat-bar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
}

.hd-chat-bar-title svg {
    color: #e30d7f;
}

.hd-chat-bar-count {
    background: #e30d7f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    display: none;
}

.hd-chat-bar-actions {
    display: flex;
    gap: 4px;
}

.hd-chat-bar-btn {
    background: none;
    border: none;
    color: #888;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hd-chat-bar-btn:hover {
    background: rgba(255,255,255,.08);
    color: #e30d7f;
}

.hd-chat-bar-btn.hd-chat-status-off {
    color: #d9534f;
}

/* Search */
.hd-chat-search {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.hd-chat-search input {
    width: 100%;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 18px;
    padding: 7px 14px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}

.hd-chat-search input:focus {
    border-color: #e30d7f;
}

.hd-chat-search input::placeholder {
    color: #666;
}

.hd-chat-search-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.hd-chat-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #ccc;
    transition: background .15s;
}

.hd-chat-search-item:hover {
    background: rgba(255,255,255,.06);
}

.hd-chat-search-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* Offline Banner */
.hd-chat-offline-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(217,83,79,.1);
    border-bottom: 1px solid rgba(217,83,79,.2);
    font-size: 12px;
    color: #d9534f;
    flex-shrink: 0;
}

.hd-chat-turn-on {
    margin-left: auto;
    background: #e30d7f;
    color: #fff;
    border: none;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.hd-chat-turn-on:hover {
    background: #c00a6e;
}

/* User List */
.hd-chat-user-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
}

.hd-chat-user-list::-webkit-scrollbar { width: 4px; }
.hd-chat-user-list::-webkit-scrollbar-track { background: transparent; }
.hd-chat-user-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Section titles */
.hd-chat-section-title {
    padding: 8px 14px 5px;
    font-size: 10px;
    font-weight: 700;
    color: #555;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #1d2729;
    border-bottom: 1px solid rgba(255,255,255,.04);
}

/* Active conversation helpers */
.hd-chat-conv-info {
    flex-direction: column !important;
    gap: 2px;
    overflow: hidden;
}

.hd-chat-user-name-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
}

.hd-chat-last-msg {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.hd-chat-last-msg.hd-unread-msg {
    color: #aaa;
    font-weight: 600;
}

.hd-chat-last-time {
    font-size: 10px;
    color: #555;
    white-space: nowrap;
    flex-shrink: 0;
}

.hd-chat-offline-dot {
    position: absolute;
    bottom: 1px; right: 1px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #444;
    border: 2px solid #1d2729;
}

/* Load more button */
.hd-load-more-btn {
    display: block;
    width: calc(100% - 28px);
    margin: 6px 14px 10px;
    padding: 6px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 6px;
    color: #777;
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    transition: background .15s, color .15s;
}

.hd-load-more-btn:hover {
    background: rgba(255,255,255,.09);
    color: #bbb;
}

/* User items */
.hd-chat-user-item {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    cursor: pointer;
    transition: background .15s;
    position: relative;
}

.hd-chat-user-item:hover {
    background: rgba(255,255,255,.04);
}

.hd-chat-user-avatar {
    position: relative;
    flex-shrink: 0;
    width: 36px; height: 36px;
    margin-right: 10px;
}

.hd-chat-user-avatar img {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.hd-chat-group-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(227,13,127,.15);
    border-radius: 50%;
    color: #e30d7f;
}

.hd-chat-online-dot {
    position: absolute;
    bottom: 1px; right: 1px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #5a975c;
    border: 2px solid #1d2729;
    animation: hd-online-pulse 2s infinite;
}

.hd-chat-online-dot-sm {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #5a975c;
    margin-left: auto;
}

@keyframes hd-online-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(90,151,92,.4); }
    70%  { box-shadow: 0 0 0 6px rgba(90,151,92,0); }
    100% { box-shadow: 0 0 0 0 rgba(90,151,92,0); }
}

.hd-chat-user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.hd-chat-user-name {
    font-size: 13px;
    font-weight: 500;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-chat-last-seen {
    font-size: 11px;
    color: #666;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-chat-unread {
    background: #e30d7f;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
    margin-left: 6px;
}

.hd-chat-empty,
.hd-chat-empty-sm {
    padding: 12px 14px;
    font-size: 12px;
    color: #555;
    text-align: center;
}

.hd-chat-empty-sm { padding: 8px 10px; }

/* =============================================
   Floating Chat Windows
   ============================================= */
.hd-chat-windows {
    position: fixed;
    bottom: 0; right: 0;
    z-index: 998;
    pointer-events: none;
}

.hd-chat-window {
    position: fixed;
    bottom: 96px;
    width: 330px;
    height: 420px;
    background: #1d2729;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -2px 20px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    pointer-events: all;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s, bottom .3s cubic-bezier(.4,0,.2,1);
    opacity: 0;
}

body.no-player .hd-chat-window { bottom: 0; }

.hd-chat-window.hd-cw-visible {
    transform: translateY(0);
    opacity: 1;
}

.hd-chat-window.hd-cw-minimized {
    height: 44px;
    overflow: hidden;
}

.hd-chat-window.hd-cw-minimized .hd-cw-body,
.hd-chat-window.hd-cw-minimized .hd-cw-footer {
    display: none;
}

/* Window Header */
.hd-cw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #252d2f;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    border-top: 3px solid var(--hd-chat-color, #e30d7f);
    min-height: 44px;
    cursor: pointer;
    flex-shrink: 0;
}

.hd-cw-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.hd-cw-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.hd-cw-group-icon {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(227,13,127,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e30d7f;
    flex-shrink: 0;
}

.hd-cw-header-info {
    flex: 1;
    min-width: 0;
}

.hd-cw-name {
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-cw-status {
    font-size: 11px;
    color: #888;
    display: block;
}

.hd-cw-online-text { color: #5a975c; }

.hd-cw-header-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.hd-cw-btn {
    background: none;
    border: none;
    color: #888;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hd-cw-btn:hover {
    background: rgba(255,255,255,.08);
    color: #e0e0e0;
}

.hd-cw-btn-danger:hover {
    color: #d9534f;
    background: rgba(217,83,79,.1);
}

/* Color Picker */
.hd-cw-color-picker-wrap { position: relative; }

.hd-cw-color-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 168px;
    background: #252d2f;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.08);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .15s, transform .15s, visibility .15s;
    pointer-events: none;
}

.hd-cw-color-panel.hd-cw-color-panel-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.hd-cw-color-swatch {
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    display: inline-block;
    flex-shrink: 0;
}

.hd-cw-color-swatch:hover {
    transform: scale(1.25);
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* Window Body */
.hd-cw-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
}

.hd-cw-body::-webkit-scrollbar { width: 4px; }
.hd-cw-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.hd-cw-load-more {
    text-align: center;
    padding: 6px;
    font-size: 12px;
    color: #e30d7f;
    cursor: pointer;
    transition: color .2s;
}

.hd-cw-load-more:hover { color: #ff6bb3; }

.hd-cw-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Message Bubbles */
.hd-msg {
    max-width: 80%;
    animation: hd-msg-in .2s ease;
}

@keyframes hd-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hd-msg-own   { align-self: flex-end; }
.hd-msg-other { align-self: flex-start; }

.hd-msg-bubble {
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
}

.hd-msg-own .hd-msg-bubble {
    background: var(--hd-chat-color, #e30d7f);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.hd-msg-other .hd-msg-bubble {
    background: rgba(255,255,255,.08);
    color: #e0e0e0;
    border-bottom-left-radius: 6px;
}

.hd-msg-time {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
    padding: 0 4px;
}

.hd-msg-own .hd-msg-time { text-align: right; }
.hd-msg-sending .hd-msg-bubble { opacity: .7; }

.hd-msg-sender {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #888;
    margin-bottom: 2px;
    padding-left: 4px;
}

.hd-msg-sender-avatar {
    width: 16px; height: 16px;
    border-radius: 50%;
    object-fit: cover;
}

/* Typing Indicator */
.hd-cw-typing {
    font-size: 12px;
    color: #888;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hd-typing-dots { display: inline-flex; gap: 3px; }

.hd-typing-dots span {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #888;
    animation: hd-typing-dot 1.4s infinite;
}

.hd-typing-dots span:nth-child(2) { animation-delay: .2s; }
.hd-typing-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes hd-typing-dot {
    0%, 60%, 100% { opacity: .3; transform: scale(.8); }
    30%            { opacity: 1; transform: scale(1.1); }
}

/* Seen Status */
.hd-cw-seen {
    font-size: 11px;
    color: #e30d7f;
    text-align: right;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

/* Window Footer */
.hd-cw-footer {
    padding: 8px 10px;
    border-top: 1px solid rgba(255,255,255,.06);
    background: #1d2729;
    flex-shrink: 0;
}

.hd-cw-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    background: rgba(255,255,255,.06);
    border-radius: 20px;
    padding: 4px 6px 4px 14px;
    border: 1px solid rgba(255,255,255,.08);
    transition: border-color .2s;
}

.hd-cw-input-wrap:focus-within { border-color: #e30d7f; }

.hd-cw-input {
    flex: 1;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 13px;
    resize: none;
    outline: none;
    max-height: 80px;
    padding: 4px 0;
    line-height: 1.4;
    font-family: inherit;
}

.hd-cw-input::placeholder { color: #555; }

.hd-cw-send {
    background: none;
    border: none;
    color: #e30d7f;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hd-cw-send:hover {
    color: #ff6bb3;
    background: rgba(227,13,127,.1);
}

/* Media Toolbar */
.hd-cw-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px 0;
}

.hd-cw-tool-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hd-cw-tool-btn:hover {
    color: #ff6bb3;
    background: rgba(227,13,127,.12);
}

.hd-cw-tool-btn.hd-cw-recording {
    color: #d9534f;
    animation: hd-pulse-rec 1s infinite;
}

@keyframes hd-pulse-rec {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}

/* GIF Panel */
.hd-cw-gif-panel {
    border-top: 1px solid rgba(255,255,255,.06);
    background: #161e20;
    max-height: 220px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hd-cw-gif-search-wrap { padding: 6px 8px; flex-shrink: 0; }

.hd-cw-gif-search-input {
    width: 100%;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 6px;
    color: #e0e0e0;
    padding: 5px 10px;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
}

.hd-cw-gif-search-input:focus { border-color: rgba(227,13,127,.4); }

.hd-cw-gif-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 8px 6px;
    overflow-y: auto;
    flex: 1;
}

.hd-cw-gif-grid::-webkit-scrollbar { width: 3px; }
.hd-cw-gif-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }

.hd-gif-item {
    width: calc(33.33% - 3px);
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity .2s, transform .2s;
}

.hd-gif-item:hover { opacity: .85; transform: scale(1.03); }

.hd-gif-loading,
.hd-gif-error {
    color: #666;
    font-size: 12px;
    padding: 10px;
    text-align: center;
    width: 100%;
}

/* Media messages */
.hd-msg-img {
    max-width: 200px; max-height: 200px;
    border-radius: 8px;
    display: block;
    cursor: pointer;
    margin-top: 4px;
    object-fit: cover;
}

.hd-msg-audio {
    max-width: 220px;
    height: 36px;
    margin-top: 4px;
}

.hd-msg-file-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e0e0e0;
    text-decoration: none;
    padding: 6px 8px;
    background: rgba(255,255,255,.07);
    border-radius: 8px;
    margin-top: 4px;
    font-size: 12px;
    max-width: 220px;
    transition: background .2s;
}

.hd-msg-file-link:hover { background: rgba(255,255,255,.12); color: #ff6bb3; }
.hd-msg-file-link svg { flex-shrink: 0; }
.hd-msg-file-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

/* Upload progress */
.hd-msg-upload-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: .7;
    font-size: 12px;
}

.hd-upload-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #ff6bb3;
    border-radius: 50%;
    animation: hd-spin .7s linear infinite;
}

@keyframes hd-spin { to { transform: rotate(360deg); } }

/* =============================================
   Group Create Modal
   ============================================= */
.hd-chat-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.6);
    z-index: 2147483646;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.hd-chat-modal-content {
    background: #1d2729;
    border-radius: 12px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
    border: 1px solid rgba(255,255,255,.08);
}

.hd-chat-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.hd-chat-modal-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #e0e0e0;
}

.hd-chat-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.hd-chat-modal-close:hover { color: #e0e0e0; }

.hd-chat-modal-body { padding: 18px; }

.hd-chat-input-full {
    width: 100%;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.hd-chat-input-full:focus { border-color: #e30d7f; }
.hd-chat-input-full::placeholder { color: #666; }

.hd-chat-modal-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.hd-group-search-results {
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.hd-group-selected-members {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hd-group-member-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(227,13,127,.15);
    border: 1px solid rgba(227,13,127,.3);
    border-radius: 20px;
    padding: 4px 10px 4px 4px;
    font-size: 12px;
    color: #ff6bb3;
}

.hd-group-member-tag img {
    width: 22px; height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.hd-group-member-tag button {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    margin-left: 2px;
}

.hd-group-member-tag button:hover { color: #d9534f; }

.hd-chat-modal-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,.06);
    text-align: right;
}

.hd-chat-btn-primary {
    background: linear-gradient(135deg, #e30d7f, #c00a6e);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.hd-chat-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227,13,127,.4);
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
    /* Chat nascosta sui dispositivi mobili: il portale, la barra laterale
       e le finestre di chat vengono rimossi per non occupare spazio e non
       coprire contenuti/player su schermi ridotti. */
    #hd-chat-portal,
    #hd-chat-bar,
    #hd-chat-windows,
    .hd-chat-bar,
    .hd-chat-windows,
    .hd-chat-window {
        display: none !important;
        visibility: hidden !important;
    }

    #hd-chat-portal {
        pointer-events: none !important;
    }

    /* (regole originali mantenute per coerenza se la chat venisse riattivata) */
    .hd-chat-bar {
        width: 100%;
        height: 60vh;
        bottom: 0;
        max-height: 60vh;
        border-left: none;
        border-radius: 10px 10px 0 0;
    }

    .hd-chat-bar-collapsed { height: 44px; }

    .hd-chat-window {
        width: 100%;
        height: 100%;
        border-radius: 0;
        left: 0; right: 0; bottom: 0;
    }

    .hd-cw-header { border-radius: 0; }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .hd-chat-bar  { width: 220px; }
    .hd-chat-window { width: 300px; }
}

/* Live Request dropdown items (riutilizzati nel tema) */
.noti_empty {
    padding: 24px 16px;
    text-align: center;
    opacity: .5;
    font-size: .88rem;
    list-style: none;
}
