
/* ZAI Account Selector v3 - Prominent Button + Dropdown */
#zai-account-panel {
    position: fixed;
    bottom: 70px;
    right: 16px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    direction: ltr;
}
.zai-acc-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(108,92,231,0.9), rgba(162,155,254,0.9));
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(108,92,231,0.4);
    transition: all 0.2s ease;
    user-select: none;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    line-height: 1;
    white-space: nowrap;
}
.zai-acc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(108,92,231,0.6);
}
.zai-acc-btn-open {
    border-radius: 20px 20px 4px 4px;
}
.zai-acc-icon {
    font-size: 16px;
    line-height: 1;
}
.zai-acc-label {
    font-size: 12px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.zai-acc-body {
    background: rgba(18,18,24,0.97);
    border-radius: 10px 10px 12px 12px;
    margin-top: 4px;
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    min-width: 220px;
    max-width: 85vw;
    max-height: 55vh;
    overflow-y: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(108,92,231,0.3);
}
.zai-acc-header {
    padding: 8px 12px 6px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(162,155,254,0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 4px;
}
.zai-acc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
    margin-bottom: 2px;
}
.zai-acc-item:hover {
    background: rgba(108,92,231,0.15);
}
.zai-acc-active {
    background: rgba(108,92,231,0.2);
    border: 1px solid rgba(108,92,231,0.3);
}
.zai-acc-radio {
    font-size: 12px;
    color: #6c5ce7;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}
.zai-acc-name {
    font-weight: 600;
    color: #e0e0e8;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}
.zai-acc-email {
    color: #666;
    font-size: 10px;
    margin-left: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}
@media (max-width: 767px) {
    #zai-account-panel {
        bottom: 60px;
        right: 10px;
    }
    .zai-acc-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    .zai-acc-icon {
        font-size: 14px;
    }
    .zai-acc-label {
        display: none;
    }
    .zai-acc-body {
        min-width: 180px;
    }
    .zai-acc-email {
        display: none;
    }
}
@media (min-width: 768px) {
    .zai-acc-btn {
        padding: 10px 18px;
    }
    .zai-acc-body {
        min-width: 280px;
        padding: 6px;
    }
    .zai-acc-item {
        padding: 10px 14px;
    }
}
/* v6: Samsung Galaxy Tab landscape fix — prevent page cut-off + keyboard popup */
/* Galaxy Tab common: 1280x800, 1920x1200, 2000x1200 — landscape height is 800-1200px */
@media (orientation: landscape) and (max-height: 900px) and (pointer: coarse) {
    /* v7f: Only set html/body height. DO NOT override overflow or min-height on
       broad selectors — that broke the sidebar (chat history area) on Samsung
       Galaxy Tab. chat.z.ai's own internal layout handles scrolling. */
    html, body {
        height: 100vh !important;
        height: 100dvh !important;
    }
    /* Shrink account panel in landscape to save space */
    #zai-account-panel {
        bottom: 8px !important;
        right: 8px !important;
    }
    .zai-acc-btn {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }
    /* v6: Move X button lower in landscape to avoid overlap with top bar */
    #zai-close-x {
        top: 48px !important;
        right: 4px !important;
    }
}
/* v6: Extra-short landscape (phone landscape, not tablet) */
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
    /* Even more compact for phone landscape */
    #zai-close-x {
        top: 4px !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }
    #zai-acc-btn2 {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
    }
}
/* v6: Tablet (iPad/Galaxy Tab) general improvements */
@media (min-width: 768px) and (max-width: 1366px) {
    /* Prevent input zoom on iOS */
    input[type="text"], input[type="search"], textarea, select {
        font-size: 16px !important;
    }
}
/* v6: Auto-expand Archived Chats in sidebar so tasks are visible */
/* This targets the collapsed archived section and makes it auto-expand */
