* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

body {
    height: 100vh;
    overflow: hidden;
    background: #d7e8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== PHONE CONTAINER ===== */
.phone-container {
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

@media (min-width: 500px) {
    .phone-container {
        height: 92vh;
        max-height: 860px;
        border-radius: 24px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    }
}

/* ===== MOBILE APP ===== */
.mobile-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #edf6ff;
}

.chat-screen,
.conversation-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.conversation-screen.hidden,
.chat-screen.hidden { display: none; }

.list-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 12px;
    background: linear-gradient(135deg, #008dff 0%, #10b7f5 100%);
    color: #fff;
    flex-shrink: 0;
}

.search-pill {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 18px;
    background: rgba(255,255,255,0.22);
    font-size: 14px;
    font-weight: 600;
}

.list-header-actions {
    display: flex;
    gap: 18px;
    font-size: 18px;
}

.notify-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: #e7f5ff;
    color: #0874d1;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #d6ecff;
}

.chat-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #edf1f6;
}

.chat-tabs button {
    border: none;
    background: #eef6ff;
    color: #475569;
    border-radius: 16px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
}

.chat-tabs button.active {
    background: #dff1ff;
    color: #008dff;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    background: #fff;
}

.zalo-footer {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    height: 72px;
    padding: 6px 6px 8px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.zalo-footer-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #8b8b8b;
    font-size: 11px;
    font-weight: 700;
}

.zalo-footer-item i {
    font-size: 22px;
    line-height: 1;
}

.zalo-footer-item.active {
    color: #008dff;
}

.zalo-footer-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.zalo-footer-badge {
    position: absolute;
    top: -9px;
    right: -18px;
    min-width: 28px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff3b4a;
    color: #fff;
    border: 2px solid #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zalo-footer-badge.small {
    right: -14px;
    min-width: 20px;
    width: 20px;
    height: 20px;
    font-size: 11px;
    line-height: 16px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 12px;
    border-bottom: 1px solid #eef2f7;
    cursor: pointer;
}

.conversation-item.active { background: #f4fbff; }

.conversation-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.conversation-main { flex: 1; min-width: 0; }
.conversation-title {
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-preview {
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
}
.conversation-meta b {
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== HEADER ===== */
.mobile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #008dff 0%, #10b7f5 100%);
    border-bottom: 1px solid rgba(255,255,255,0.18);
    flex-shrink: 0;
}

.mobile-header-back {
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.mobile-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.mobile-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

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

.mobile-header-meta {
    font-size: 11px;
    color: rgba(255,255,255,0.88);
    margin-top: 1px;
}

.mobile-header-actions {
    display: flex;
    gap: 16px;
    color: #fff;
    font-size: 16px;
}

.mobile-header-actions i {
    cursor: pointer;
    padding: 4px;
}

/* ===== SCENARIO PICKER ===== */
.scenario-picker {
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid #e8eaed;
}

.scenario-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: #e7f5ff;
    color: #0076d7;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.scenario-toggle-btn:hover {
    background: #d9efff;
}

.scenario-toggle-btn i:first-child {
    font-size: 16px;
}

#scenarioChevron {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.25s;
}

#scenarioChevron.open {
    transform: rotate(180deg);
}

.scenario-dropdown {
    display: none;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px 10px 10px;
    background: #f9fafb;
    border-top: 1px solid #e8eaed;
}

.scenario-dropdown.open {
    display: block;
    animation: dropIn 0.2s ease;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.scenario-category-label {
    font-size: 11px;
    font-weight: 700;
    color: #0068FF;
    text-transform: uppercase;
    padding: 8px 4px 4px;
    letter-spacing: 0.3px;
}

.scenario-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
    color: #333;
}

.scenario-item:hover {
    background: #e8f2ff;
}

.scenario-item:active {
    background: #d0e7ff;
}

.scenario-item i {
    font-size: 15px;
    color: #0068FF;
    width: 20px;
    text-align: center;
}

/* ===== MESSAGES ===== */
.mobile-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #eaf3fb;
}

.chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    gap: 10px;
    text-align: center;
    padding: 20px;
}

.chat-placeholder i {
    font-size: 40px;
    color: #bbb;
}

.chat-placeholder p {
    font-size: 13px;
    line-height: 1.5;
}

/* Message bubbles */
.message {
    display: flex;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

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

.message-avatar {
    flex-shrink: 0;
}

.message-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.message-content {
    background: #fff;
    border-radius: 12px;
    border-top-left-radius: 4px;
    padding: 8px 11px;
    max-width: 82%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.message-sender {
    font-size: 11px;
    font-weight: 600;
    color: #0068FF;
    margin-bottom: 3px;
}

.message-time {
    font-weight: 400;
    color: #999;
    font-size: 10px;
    margin-left: 4px;
}

.message-text {
    font-size: 13px;
    color: #111827;
    font-weight: 600;
    line-height: 1.5;
    white-space: pre-line;
    word-break: break-word;
}

/* Outgoing */
.message-outgoing {
    flex-direction: row-reverse;
}

.message-outgoing .message-content {
    background: #d9f6ff;
    border: 1px solid #7ed8ff;
    border-radius: 12px;
    border-top-right-radius: 4px;
}

.message-outgoing .message-text {
    color: #111827;
}

.message-outgoing .message-time {
    color: #5b8fa8;
    text-align: right;
    margin-top: 3px;
    display: block;
}

/* Action buttons inside messages */
.message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.message-actions button {
    border: 1px solid #cde7dd;
    background: #ecfff7;
    color: #087a5a;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.message-actions button:hover {
    background: #00a884;
    border-color: #00a884;
    color: #fff;
}

/* Group summary bar */
.group-summary-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px;
    background: rgba(229, 231, 235, 0.96);
    border-radius: 8px;
    margin-bottom: 4px;
}

.group-summary-bar button {
    border: none;
    border-radius: 999px;
    background: #0068FF;
    color: #fff;
    padding: 6px 10px;
    font-size: 11px;
    cursor: pointer;
}

.group-summary-bar button:hover {
    background: #0055d4;
}

/* ===== INPUT ===== */
.mobile-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid #d6dbe1;
    background: #fff;
    flex-shrink: 0;
}

.mobile-input-actions {
    display: flex;
    gap: 10px;
    color: #666;
    font-size: 18px;
}

.mobile-input-actions i {
    cursor: pointer;
    padding: 2px;
}

.mobile-input input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    padding: 8px 4px;
    background: transparent;
}

.mobile-send-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #0068FF;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.mobile-send-btn:hover {
    background: #0055d4;
}

/* ===== OVERLAY PANEL ===== */
.overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 999;
    display: none; align-items: flex-end; justify-content: center;
}
.overlay.show { display: flex; }
.panel {
    background: #fff; border-radius: 16px 16px 0 0; width: 100%; max-width: 420px;
    max-height: 80vh; display: flex; flex-direction: column;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.2); animation: sheetUp 0.25s ease;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid #e8eaed;
}
.panel-head h3 { font-size: 15px; color: #333; }
.panel-head button {
    background: none; border: none; font-size: 22px; cursor: pointer;
    color: #999; line-height: 1;
}
.panel-head button:hover { color: #333; }
.panel-body { padding: 14px 16px; overflow-y: auto; flex: 1; }
.panel-body label { display: block; font-size: 13px; color: #666; margin: 10px 0 4px; }
.panel-input {
    width: 100%; padding: 10px 12px; border: 1px solid #d6dbe1; border-radius: 8px;
    font-size: 14px; outline: none; margin-bottom: 8px; background: #f9fafb;
}
.panel-input:focus { border-color: #0068FF; background: #fff; }
.panel-row {
    display: block; width: 100%; text-align: left; padding: 12px 14px;
    border: none; background: #f9fafb; border-radius: 8px; cursor: pointer;
    font-size: 14px; color: #333; margin-bottom: 6px; transition: background 0.15s;
}
.panel-row:hover { background: #e8f2ff; }
.panel-row.danger { color: #c62828; }
.panel-row.danger:hover { background: #fce4ec; }
button.primary {
    background: #0068FF; color: #fff; border: none; border-radius: 8px;
    padding: 10px 20px; font-size: 14px; cursor: pointer; margin-top: 8px; width: 100%;
}
button.primary:hover { background: #0055d4; }
button.danger {
    background: #c62828; color: #fff; border: none; border-radius: 8px;
    padding: 10px 20px; font-size: 14px; cursor: pointer; margin-top: 8px;
}
button.danger:hover { background: #a11b1b; }
.muted { color: #999; font-size: 13px; padding: 8px 0; }
.panel-result { padding: 8px 10px; background: #f4f6f8; border-radius: 6px; margin-bottom: 4px; font-size: 13px; color: #333; }

/* ===== EMOJI ===== */
.emoji-btn {
    font-size: 28px; background: none; border: none; cursor: pointer;
    padding: 8px; border-radius: 8px; transition: background 0.15s;
}
.emoji-btn:hover { background: #e8f2ff; }

/* ===== CALL BOX ===== */
.call-box {
    display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 0;
}
.call-box i { font-size: 48px; color: #0068FF; }
.call-box h3 { font-size: 16px; color: #333; text-align: center; }
.call-box p { color: #666; font-size: 14px; }
.call-box button {
    padding: 10px 24px; border: 1px solid #d6dbe1; border-radius: 8px;
    background: #f9fafb; cursor: pointer; font-size: 14px; margin: 4px;
}
.call-box button:hover { background: #e8f2ff; }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #333; color: #fff; padding: 10px 24px; border-radius: 20px;
    font-size: 13px; z-index: 9999; opacity: 0; transition: all 0.3s;
    pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== SCROLLBAR ===== */
.mobile-messages::-webkit-scrollbar,
.scenario-dropdown::-webkit-scrollbar {
    width: 3px;
}
.mobile-messages::-webkit-scrollbar-thumb,
.scenario-dropdown::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}
