* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

/* Header */
.support-header {
    background: #020617;
    border-bottom: 1px solid #1e293b;
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
}

.brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.back-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: #ff9800;
}

/* Main */
.support-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 16px 100px;
}

.support-intro {
    text-align: center;
    margin-bottom: 28px;
}

.support-icon-large {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.support-intro h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.support-intro p {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Chat Panel */
.chat-panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 520px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.chat-header {
    padding: 14px 16px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ff9800;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.chat-header-left strong {
    display: block;
    font-size: 0.95rem;
}

.status {
    font-size: 0.75rem;
    color: #94a3b8;
}

.status.online::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 5px;
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
}

.message.bot,
.message.admin {
    align-self: flex-start;
    background: #334155;
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.message.customer {
    align-self: flex-end;
    background: #ff9800;
    color: #0f172a;
    border-bottom-right-radius: 4px;
}

.message .msg-text {
    margin-bottom: 2px;
}

.message .meta {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-image {
    display: block;
    max-width: 220px;
    max-height: 220px;
    width: 100%;
    border-radius: 10px;
    margin-top: 6px;
    object-fit: cover;
    cursor: pointer;
}

/* Email gate */
.email-gate {
    padding: 20px 16px;
    border-top: 1px solid #334155;
    background: #0f172a;
}

.email-gate p {
    font-size: 0.88rem;
    color: #94a3b8;
    margin-bottom: 12px;
}

.email-gate input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.95rem;
    margin-bottom: 10px;
    outline: none;
}

.email-gate input:focus {
    border-color: #ff9800;
}

.email-gate button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #ff9800;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.email-gate button:hover {
    background: #fb8c00;
}

/* Input area */
.chat-input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #334155;
    background: #0f172a;
}

.chat-input-area.hidden {
    display: none;
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.chat-input-row input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.95rem;
    outline: none;
}

.chat-input-row input[type="text"]:focus {
    border-color: #ff9800;
}

.attach-btn {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 10px;
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.attach-btn:hover {
    background: #ff9800;
    border-color: #ff9800;
    color: #0f172a;
}

#sendBtn {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 10px;
    background: #ff9800;
    color: #0f172a;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sendBtn:hover {
    background: #fb8c00;
}

/* Image preview before send */
.image-preview {
    position: relative;
    display: inline-block;
    padding: 4px 0 0 4px;
}

.image-preview.hidden {
    display: none !important;
}

.image-preview img {
    max-width: 110px;
    max-height: 110px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    border: 1px solid #334155;
}

.remove-image-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.remove-image-btn:hover {
    background: #dc2626;
}

/* Floating button */
.floating-support-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: #ff9800;
    color: #0f172a;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.floating-support-btn:hover {
    transform: scale(1.08);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-badge.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

/* Mobile */
@media (max-width: 480px) {
    .chat-panel {
        height: 70vh;
    }

    .floating-support-btn {
        bottom: 18px;
        right: 18px;
    }

    .chat-image {
        max-width: 180px;
        max-height: 180px;
    }
}