/* Visitor widget + staff inbox (live support) */

/* ---------- Floating widget ---------- */

.support-chat-launcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    font-family: "Inter", system-ui, sans-serif;
}

.support-chat-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem 0.65rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(135deg, rgba(74, 125, 255, 0.95), rgba(0, 194, 255, 0.88));
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 12px 40px rgba(0, 10, 40, 0.45);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.support-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 48px rgba(0, 10, 40, 0.55);
}

.support-chat-toggle:focus-visible {
    outline: 2px solid var(--accent-2, #00c2ff);
    outline-offset: 3px;
}

.support-chat-panel {
    width: min(100vw - 28px, 380px);
    /* Fixed height so flex:1 on .support-chat-messages gets real space (otherwise area collapses to 0). */
    height: min(72vh, 520px);
    max-height: min(72vh, 520px);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius, 14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 14, 39, 0.96);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-2, 0 20px 60px rgba(0, 8, 40, 0.55));
    overflow: hidden;
}

.support-chat-panel[hidden] {
    display: none !important;
}

.support-chat-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text, #e6ebff);
}

.support-chat-panel-head button {
    background: transparent;
    border: none;
    color: var(--text-dim, #a3afd9);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
}

.support-chat-panel-head button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.support-chat-status {
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    color: var(--text-mute, #6b7aa8);
    min-height: 1.4rem;
}

.support-chat-messages {
    flex: 1 1 auto;
    min-height: 160px;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.support-chat-messages .support-chat-placeholder {
    font-size: 0.82rem;
    color: var(--text-mute, #6b7aa8);
    line-height: 1.45;
    margin: 0.25rem 0 0;
}

.support-chat-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 92%;
}

.support-chat-row--agent {
    align-self: flex-end;
    align-items: flex-end;
}

.support-chat-meta {
    font-size: 0.68rem;
    color: var(--text-mute, #6b7aa8);
    margin-bottom: 0.15rem;
}

.support-chat-bubble {
    padding: 0.45rem 0.65rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text, #e6ebff);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.support-chat-row--agent .support-chat-bubble {
    background: rgba(74, 125, 255, 0.22);
    border-color: rgba(74, 125, 255, 0.35);
}

.support-chat-compose {
    display: flex;
    gap: 0.45rem;
    padding: 0.55rem 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.support-chat-compose input {
    flex: 1;
    min-width: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(7, 11, 34, 0.85);
    color: var(--text, #e6ebff);
    padding: 0.45rem 0.6rem;
    font-size: 0.88rem;
}

.support-chat-compose button {
    border-radius: 10px;
    border: none;
    padding: 0.45rem 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #4a7dff, #00c2ff);
    color: #fff;
}

.support-chat-compose button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.support-chat-name {
    padding: 0.35rem 0.75rem 0;
    font-size: 0.78rem;
    color: var(--text-dim, #a3afd9);
}

.support-chat-name input {
    width: 100%;
    margin-top: 0.25rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(7, 11, 34, 0.75);
    color: var(--text, #e6ebff);
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

/* ---------- Staff inbox ---------- */

.support-inbox-hero {
    padding: 2rem 0 1rem;
    text-align: center;
}

.support-connect-steps {
    text-align: left;
    max-width: 40rem;
    margin: 0 auto 1rem;
    padding-left: 1.25rem;
    color: var(--text-dim, #a3afd9);
    font-size: 0.92rem;
    line-height: 1.55;
}

.support-connect-steps li {
    margin-bottom: 0.45rem;
}

.support-dev-callout {
    max-width: 44rem;
    margin: 0 auto 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm, 10px);
    border: 1px solid rgba(0, 194, 255, 0.35);
    background: rgba(0, 194, 255, 0.08);
    color: var(--text, #e6ebff);
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: left;
}

.support-dev-callout--warn {
    border-color: rgba(255, 179, 0, 0.45);
    background: rgba(255, 179, 0, 0.1);
}

.support-empty-hint {
    padding: 0.65rem 0.75rem 0.85rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-dim, #a3afd9);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.support-empty-hint a {
    font-weight: 600;
}

.support-inbox-shell {
    padding-bottom: 4rem;
}

.support-inbox-connect {
    max-width: 420px;
    margin: 0 auto 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.support-field span {
    display: block;
    font-size: 0.82rem;
    color: var(--text-dim, #a3afd9);
    margin-bottom: 0.25rem;
}

.support-field input {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(7, 11, 34, 0.75);
    color: var(--text, #e6ebff);
    padding: 0.55rem 0.65rem;
    font-size: 0.92rem;
}

.support-inbox-hint {
    font-size: 0.85rem;
    color: var(--text-mute, #6b7aa8);
    margin: 0;
}

.support-inbox-grid {
    display: grid;
    grid-template-columns: minmax(200px, 280px) 1fr;
    gap: 0;
    min-height: 480px;
    border-radius: var(--radius, 14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    background: rgba(10, 14, 39, 0.55);
}

@media (max-width: 820px) {
    .support-inbox-grid {
        grid-template-columns: 1fr;
        min-height: unset;
    }
}

.support-inbox-list-wrap {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 480px;
    max-height: 70vh;
}

.support-inbox-list-head {
    padding: 0.65rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-dim, #a3afd9);
}

.support-inbox-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.support-inbox-list li {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text, #e6ebff);
}

.support-inbox-list li:hover {
    background: rgba(255, 255, 255, 0.04);
}

.support-inbox-list li.is-active {
    background: rgba(74, 125, 255, 0.12);
    border-left: 3px solid var(--accent, #4a7dff);
}

.support-inbox-list li.support-inbox-list-empty {
    cursor: default;
}

.support-inbox-list li.support-inbox-list-empty:hover {
    background: transparent;
}

.support-inbox-list .conv-preview {
    display: block;
    font-size: 0.72rem;
    color: var(--text-mute, #6b7aa8);
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.support-inbox-main {
    display: flex;
    flex-direction: column;
    height: min(78vh, 880px);
    min-height: 520px;
    max-height: 78vh;
    min-width: 0;
}

.support-feed-block {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 200px;
    max-height: 38vh;
}

.support-feed-scroll {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 180px;
    max-height: 34vh;
    padding: 0.35rem 0.45rem 0.5rem;
}

.support-feed-empty {
    padding: 0.85rem;
    font-size: 0.85rem;
    color: var(--text-mute, #6b7aa8);
}

.support-feed-row {
    display: block;
    width: 100%;
    text-align: left;
    margin: 0 0 0.35rem;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(7, 11, 34, 0.45);
    color: var(--text, #e6ebff);
    cursor: pointer;
    font: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.support-feed-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.support-feed-row--active {
    border-color: rgba(74, 125, 255, 0.55);
    background: rgba(74, 125, 255, 0.1);
}

.support-feed-chip {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-2, #00c2ff);
    margin-right: 0.5rem;
}

.support-feed-time {
    font-size: 0.68rem;
    color: var(--text-mute, #6b7aa8);
}

.support-feed-text {
    margin-top: 0.25rem;
    font-size: 0.84rem;
    line-height: 1.45;
    word-break: break-word;
    color: var(--text-dim, #a3afd9);
}

.support-selected-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.support-reply-target {
    margin: 0;
    padding: 0.35rem 0.85rem 0.25rem;
    font-size: 0.82rem;
    color: var(--accent, #4a7dff);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.support-inbox-messages--thread {
    flex: 1;
    min-height: 140px;
    max-height: none;
}

.support-inbox-thread-head {
    padding: 0.65rem 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text, #e6ebff);
}

.support-inbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.support-inbox-compose {
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.support-inbox-compose input {
    flex: 1;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(7, 11, 34, 0.75);
    color: var(--text, #e6ebff);
    padding: 0.5rem 0.65rem;
}
