/* ============================================================
 * Chat Argomulyo — Complete Design System
 * Override AJAX-Chat UI jadi modern Android-style PWA
 * ============================================================
 * Author: Hermes Agent untuk Pak Rendi
 * Tanggal: 2026-08-19
 * Color palette: dark slate navy + primary green (konsisten dengan dashboard PAJAK)
 * ============================================================ */

/* ----- DESIGN TOKENS ----- */
:root {
    /* Brand colors */
    --gov-dark: #0d2137;
    --gov-mid: #14304a;
    --gov-light: #1f4068;
    --gov-soft: #2d5a8c;

    /* Primary (green) */
    --primary-50: #ecfdf5;
    --primary-100: #d1fae5;
    --primary-200: #a7f3d0;
    --primary-300: #6ee7b7;
    --primary-400: #34d399;
    --primary-500: #10b981;
    --primary-600: #059669;
    --primary-700: #047857;
    --primary-800: #065f46;
    --primary-900: #064e3b;

    /* Neutrals */
    --bg: #f1f5f9;
    --bg-soft: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Text */
    --text: #0f172a;
    --text-2: #334155;
    --text-muted: #64748b;
    --text-faint: #94a3b8;

    /* Semantic */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Elevation */
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.25);

    /* Radius */
    --r-sm: 6px;
    --r: 10px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-full: 9999px;

    /* Spacing scale */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-8: 32px;
    --s-10: 40px;
    --s-12: 48px;

    /* Typography */
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Menlo', monospace;

    /* Layout */
    --topbar-h: 56px;
    --sidebar-w: 280px;
}

/* ----- GLOBAL RESETS ----- */
* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
}
body.ajax-chat {
    background: linear-gradient(135deg, #f1f5f9 0%, #e0f2fe 100%) !important;
    min-height: 100vh;
}

/* Hide AJAX-Chat default header/footer/old structure */
#header, #footer, #content, #loginContent, #loginHeadline,
#chatList, #onlineListContainer, #inputFieldContainer, #submitButtonContainer,
#helpButtonContainer, #colorButtonContainer, #bbCodeButtonContainer,
#optionsButtonContainer, #channelSelectContainer,
#logoutButtonContainer, #emoticonsContainer, #audioButtonContainer,
#styleSelectContainer, #langSelectContainer, #errorContainer,
#contentTitle, #debug {
    all: revert;
}

/* Better approach: hide completely and recreate */
#header, #footer { display: none !important; }

/* ============================================================
   SPLASHSCREEN — full screen, auto-hide setelah 2.2s
   ============================================================ */
#chat-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, var(--gov-dark) 0%, var(--gov-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#chat-splash.fade-out {
    opacity: 0;
    visibility: hidden;
}
.splash-logo {
    width: 96px;
    height: 96px;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    box-shadow: 0 20px 40px rgba(16,185,129,0.4);
    animation: splashLogo 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes splashLogo {
    0% { transform: scale(0.3) rotate(-15deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.splash-brand {
    margin-top: 24px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    animation: splashText 0.6s 0.3s both ease-out;
}
.splash-tagline {
    margin-top: 8px;
    font-size: 14px;
    color: var(--primary-200);
    font-weight: 400;
    letter-spacing: 0.5px;
    animation: splashText 0.6s 0.5s both ease-out;
}
@keyframes splashText {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
.splash-loader {
    margin-top: 56px;
    display: flex;
    gap: 8px;
    animation: splashText 0.6s 0.7s both ease-out;
}
.splash-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-400);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}
.splash-dot:nth-child(2) { animation-delay: 0.16s; }
.splash-dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}
.splash-footer {
    position: absolute;
    bottom: 32px;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    animation: splashText 0.6s 0.9s both ease-out;
}

/* ============================================================
   LOGIN PAGE — split-pane desktop, stacked card mobile
   ============================================================ */
/* Hide AJAX-Chat default login form, we use custom */
#loginForm { display: none !important; }

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--bg-soft);
}
@media (min-width: 900px) {
    .login-shell {
        grid-template-columns: 1.1fr 1fr;
    }
}

/* Left brand panel */
.login-brand {
    display: none;
    background: linear-gradient(135deg, var(--gov-dark) 0%, var(--gov-light) 100%);
    color: white;
    padding: 56px;
    position: relative;
    overflow: hidden;
}
@media (min-width: 900px) {
    .login-brand { display: flex; flex-direction: column; justify-content: space-between; }
}
.login-brand::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.login-brand::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -100px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(45,90,140,0.4) 0%, transparent 70%);
    border-radius: 50%;
}
.login-brand-top {
    position: relative;
    z-index: 1;
}
.login-brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.login-brand-logo-mark {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 8px 16px rgba(16,185,129,0.3);
}
.login-brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.login-brand-tagline {
    font-size: 11px;
    color: var(--primary-300);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 2px;
}
.login-brand-headline {
    position: relative;
    z-index: 1;
    margin-top: 80px;
}
.login-brand-headline h1 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin: 0 0 16px 0;
}
.login-brand-headline p {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255,255,255,0.7);
    max-width: 420px;
    margin: 0;
}
.login-brand-features {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}
.login-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.login-feature-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    background: rgba(16,185,129,0.15);
    color: var(--primary-300);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.login-feature-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}
.login-feature-text span {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}
.login-brand-footer {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

/* Right form panel */
.login-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-soft);
    min-height: 100vh;
}
@media (min-width: 900px) {
    .login-form-wrap {
        padding: 56px;
        background: linear-gradient(135deg, #f1f5f9 0%, #e0f2fe 100%);
    }
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}
@media (max-width: 480px) {
    .login-card { padding: 24px 20px; box-shadow: none; border: none; }
}
.login-card-mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
@media (min-width: 900px) {
    .login-card-mobile-brand { display: none; }
}
.login-card-mobile-brand .login-brand-logo-mark {
    width: 40px;
    height: 40px;
    font-size: 22px;
}
.login-card-mobile-brand .login-brand-name {
    font-size: 16px;
}
.login-card h2 {
    margin: 0 0 4px 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.login-card-subtitle {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: var(--text-muted);
}
.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: var(--r);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}
.login-error.show { display: block; }

.login-field {
    margin-bottom: 16px;
}
.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}
.login-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.login-field-wrap .login-icon {
    position: absolute;
    left: 14px;
    color: var(--text-faint);
    font-size: 18px;
    pointer-events: none;
}
.login-field input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    font-size: 15px;
    font-family: var(--font);
    color: var(--text);
    transition: all 0.15s;
    background: var(--surface);
}
.login-field input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(16,185,129,0.12);
}
.login-field input::placeholder { color: var(--text-faint); }
.login-toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
}
.login-toggle-pw:hover { color: var(--text-2); }

.login-submit {
    width: 100%;
    padding: 13px 20px;
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: var(--r);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.login-submit:hover {
    background: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(16,185,129,0.3);
}
.login-submit:active { transform: translateY(0); }
.login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.login-submit .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-hint {
    margin-top: 20px;
    padding: 12px 14px;
    background: var(--primary-50);
    border-radius: var(--r);
    border-left: 3px solid var(--primary-500);
    font-size: 12px;
    color: var(--text-2);
}
.login-hint strong { color: var(--primary-700); }
.login-hint code {
    background: white;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    border: 1px solid var(--border);
}

.login-bottom-link {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.login-bottom-link a {
    color: var(--primary-600);
    font-weight: 600;
    text-decoration: none;
}
.login-bottom-link a:hover { text-decoration: underline; }

/* ============================================================
   CHAT INTERFACE — setelah login
   ============================================================ */
.chat-shell {
    position: relative;
    height: 100vh;
    width: 100%;
    display: grid;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-columns: 1fr;
    background: var(--bg-soft);
    overflow: hidden;
}
@media (min-width: 900px) {
    .chat-shell {
        grid-template-columns: var(--sidebar-w) 1fr;
        grid-template-rows: var(--topbar-h) 1fr;
        grid-template-areas:
            "topbar topbar"
            "sidebar main";
    }
}

/* Topbar */
.chat-topbar {
    grid-area: topbar;
    grid-row: 1;
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--gov-dark) 0%, var(--gov-light) 100%);
    color: white;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    min-height: var(--topbar-h);
}
.chat-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.chat-sidebar-toggle {
    display: none;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    align-items: center;
    justify-content: center;
}
@media (max-width: 899px) {
    .chat-sidebar-toggle { display: flex; }
}
.chat-topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-topbar-logo-mark {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.chat-topbar-title {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
}
.chat-topbar-tagline {
    display: none;
    font-size: 11px;
    color: var(--primary-300);
    margin-left: 4px;
}
@media (min-width: 600px) {
    .chat-topbar-tagline { display: inline; }
}

.chat-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-topbar-user {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--r-full);
    font-size: 13px;
}
@media (min-width: 600px) {
    .chat-topbar-user { display: flex; }
}
.chat-topbar-avatar {
    width: 28px;
    height: 28px;
    background: var(--primary-500);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}
.chat-topbar-icon-btn {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.chat-topbar-icon-btn:hover { background: rgba(255,255,255,0.2); }

/* Sidebar (online users + channels)
   Mobile: position fixed, slides over content (outside grid)
   Desktop: position relative, part of grid layout */
.chat-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    z-index: 60;
    display: block;
    grid-area: auto;
}
.chat-sidebar.open { transform: translateX(0); }
.chat-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0,0,0,0.5);
    z-index: 50;
}
.chat-sidebar-backdrop.open { display: block; }
@media (min-width: 900px) {
    .chat-sidebar {
        position: relative;
        top: auto;
        left: auto;
        bottom: auto;
        transform: none;
        transition: none;
        z-index: auto;
        grid-area: sidebar;
    }
    .chat-sidebar-backdrop { display: none !important; }
}
@media (min-width: 900px) {
    .chat-sidebar-backdrop { display: none !important; }
}

.chat-sidebar.open { transform: translateX(0); }
.chat-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0,0,0,0.5);
    z-index: 50;
}
.chat-sidebar-backdrop.open { display: block; }

.chat-sidebar-section {
    padding: 20px 16px;
}
.chat-sidebar-section + .chat-sidebar-section {
    border-top: 1px solid var(--border);
}
.chat-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 12px 8px;
}
.chat-channel-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chat-channel-item {
    padding: 10px 12px;
    border-radius: var(--r);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s;
}
.chat-channel-item:hover { background: var(--bg); }
.chat-channel-item.active {
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 600;
}
.chat-channel-item.active::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary-500);
    border-radius: 50%;
    margin-right: 4px;
}

.chat-online-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.chat-online-item {
    padding: 8px 10px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.chat-online-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-100);
    color: var(--primary-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex: 0 0 32px;
}
.chat-online-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-online-badge {
    background: var(--primary-500);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: var(--r-full);
    font-weight: 700;
}

/* Main chat area */
.chat-main {
    grid-area: auto;
    display: grid;
    grid-template-rows: 1fr auto;
    overflow: hidden;
    background: var(--bg);
    min-height: 0;
    min-width: 0;
    width: 100%;
}
@media (min-width: 900px) {
    .chat-main {
        grid-area: main;
    }
}
.chat-messages-wrap {
    overflow-y: auto;
    padding: 20px;
}
@media (max-width: 600px) {
    .chat-messages-wrap { padding: 12px; }
}
.chat-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    padding: 32px;
}
.chat-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}
.chat-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-2);
    margin: 0 0 4px 0;
}
.chat-empty p { margin: 0; font-size: 13px; }

.chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    animation: msgIn 0.25s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-100);
    color: var(--primary-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex: 0 0 36px;
}
.chat-message-body { flex: 1; min-width: 0; }
.chat-message-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}
.chat-message-author {
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
}
.chat-message-time {
    font-size: 11px;
    color: var(--text-faint);
}
.chat-message-text {
    background: var(--surface);
    padding: 10px 14px;
    border-radius: var(--r-md);
    border-top-left-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    word-wrap: break-word;
}
.chat-message.system .chat-message-text {
    background: var(--primary-50);
    color: var(--primary-800);
    font-style: italic;
    font-size: 12px;
    border: 1px dashed var(--primary-200);
    padding: 6px 10px;
}
.chat-message.mine {
    flex-direction: row-reverse;
}
.chat-message.mine .chat-message-body { display: flex; flex-direction: column; align-items: flex-end; }
.chat-message.mine .chat-message-text {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
    border-top-left-radius: var(--r-md);
    border-top-right-radius: 4px;
}
.chat-message.mine .chat-message-meta { flex-direction: row-reverse; }

/* Composer */
.chat-composer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex;
    gap: 10px;
    align-items: flex-end;
    z-index: 20;
}
@media (max-width: 600px) {
    .chat-composer { padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
.chat-composer textarea {
    flex: 1;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    resize: none;
    min-height: 42px;
    max-height: 120px;
    transition: border-color 0.15s;
    background: var(--bg-soft);
}
.chat-composer textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    background: white;
}
.chat-send-btn {
    background: var(--primary-500);
    color: white;
    border: none;
    width: 44px;
    height: 42px;
    border-radius: var(--r);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.chat-send-btn:hover { background: var(--primary-600); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   PWA INSTALL PROMPT BANNER
   ============================================================ */
#pwa-install-banner {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 100;
    animation: msgIn 0.3s ease;
    max-width: 420px;
    margin: 0 auto;
}
#pwa-install-banner.show { display: flex; }
.pwa-banner-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.pwa-banner-text { flex: 1; min-width: 0; }
.pwa-banner-text strong {
    display: block;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 2px;
}
.pwa-banner-text span {
    font-size: 12px;
    color: var(--text-muted);
}
.pwa-banner-btns { display: flex; gap: 6px; flex: 0 0 auto; }
.pwa-btn-install {
    background: var(--primary-500);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.pwa-btn-install:hover { background: var(--primary-600); }
.pwa-btn-dismiss {
    background: var(--bg);
    color: var(--text-muted);
    border: none;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    font-size: 12px;
    cursor: pointer;
}
.pwa-btn-dismiss:hover { background: var(--border); }

/* ============================================================
   UTILITY — hide original AJAX-Chat elements completely
   ============================================================ */
.ajax-chat > #content,
.ajax-chat > #header,
.ajax-chat > #footer { display: none !important; }