        /* Dev / App Mode badge: Controlled dynamically by JS syncDevMockUI */
        #devMockModeBadge { display: none; }
        :root {
            --primary: #047857;
            --primary-dark: #064e3b;
            --primary-light: #ecfdf5;
            --primary-glow: rgba(16, 185, 129, 0.25);
            --accent: #0284c7;
            --accent-dark: #0369a1;
            --success: #16a34a;
            --warning: #f59e0b;
            --danger: #ef4444;
            --bg: #f8fafc;
            --card-bg: #ffffff;
            --text-main: #0f172a;
            --text-muted: #64748b;
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
            --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
            --shadow-lg: 0 10px 25px -4px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
            --shadow-xl: 0 20px 40px -12px rgba(0,0,0,0.25);
        }

        * { 
            box-sizing: border-box; 
            font-family: 'Plus Jakarta Sans', 'Noto Sans Tamil', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
        }
        body { margin: 0; padding: 0; background: #064e3b; color: var(--text-main); height: 100vh; display: flex; flex-direction: column; overflow: hidden; align-items: center; justify-content: center; }

        /* Mobile Simulator Wrapper */
        .viewport-wrapper {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            background: var(--bg);
            transition: all 0.3s ease;
            position: relative;
        }

        /* Smartphone Frame Mockup Mode */
        .viewport-wrapper.mobile-mockup-mode {
            max-width: 412px;
            max-height: 860px;
            border-radius: 40px;
            box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 0 12px #334155;
            border: 4px solid #1e293b;
            overflow: hidden;
        }

        /* Top Unified Navigation */
        .navbar {
            background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
            color: white;
            padding: 6px 14px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            border-bottom: 1px solid rgba(255,255,255,0.12);
            z-index: 100;
            -webkit-app-region: drag;
            box-sizing: border-box;
            flex-shrink: 0;
            min-height: 48px;
        }

        .brand-box { 
            display: flex; 
            align-items: center; 
            gap: 12px; 
            -webkit-app-region: no-drag;
        }
        .brand-logo { 
            width: 40px;
            height: 40px;
            background: transparent;
            border: none;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 14px rgba(0,0,0,0.25);
            flex-shrink: 0;
        }
        .brand-logo svg {
            width: 100%;
            height: 100%;
            display: block;
        }
        .brand-title {
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        .brand-title-heading { 
            margin: 0; 
            font-size: 24px !important; 
            font-weight: 900 !important; 
            letter-spacing: -0.5px; 
            color: #ffffff;
            display: inline-flex !important;
            align-items: baseline !important;
            line-height: 1.1;
        }
        .brand-title-heading .brand-text-main {
            font-size: 24px !important;
            font-weight: 900 !important;
            color: #ffffff !important;
            display: inline !important;
        }
        .brand-title-heading .brand-text-accent { 
            font-size: 24px !important; 
            font-weight: 900 !important; 
            color: #f59e0b !important; 
            display: inline !important;
            margin-left: 1px;
        }
        .brand-tagline-text { 
            font-size: 11px !important; 
            color: #a7f3d0 !important; 
            font-weight: 600 !important; 
            display: block !important; 
            margin-top: 2px;
            letter-spacing: -0.1px;
            line-height: 1.2;
        }

        .nav-actions { 
            display: flex; 
            align-items: center; 
            gap: 8px; 
            -webkit-app-region: no-drag;
        }

        .live-status-pill {
            display: none !important;
            align-items: center;
            gap: 6px;
            background: rgba(255, 255, 255, 0.12);
            border: 1px solid rgba(255, 255, 255, 0.2);
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11px;
            color: #ecfdf5;
            font-weight: 700;
            letter-spacing: 0.2px;
        }
        .status-dot-pulse {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #4ade80;
            box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.4);
            animation: pulseDot 2s infinite;
        }
        @keyframes pulseDot {
            0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
            70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
            100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
        }

        /* International Standard Unified Header Actions */
        .nav-header-btn,
        .nav-tab {
            height: 34px !important;
            min-height: 34px !important;
            max-height: 34px !important;
            box-sizing: border-box !important;
            border-radius: 8px !important;
            font-size: 12px !important;
            font-weight: 600 !important;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 0 14px;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            white-space: nowrap;
            line-height: 1;
            cursor: pointer;
            border: 1px solid transparent;
        }

        .nav-header-btn[style*="display: none"],
        .nav-tab[style*="display: none"] {
            display: none !important;
        }

        .nav-profile-badge {
            background: rgba(255, 255, 255, 0.12) !important;
            color: #ffffff !important;
            border: 1px solid rgba(255, 255, 255, 0.22) !important;
            cursor: default !important;
        }

        .nav-btn-accent {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
            color: #ffffff !important;
            border: 1px solid rgba(255, 255, 255, 0.25) !important;
            box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3) !important;
        }
        .nav-btn-accent:hover { filter: brightness(1.08); transform: translateY(-1px); }

        .nav-btn-download {
            background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
            color: #ffffff !important;
            box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3) !important;
        }

        .nav-btn-logout {
            background: rgba(220, 38, 38, 0.25) !important;
            color: #ffffff !important;
            border: 1px solid #ef4444 !important;
            height: 34px !important;
            padding: 0 12px !important;
            border-radius: 8px !important;
            display: inline-flex !important;
            align-items: center !important;
            gap: 6px !important;
            font-size: 11.5px !important;
            font-weight: 700 !important;
            flex-shrink: 0 !important;
            cursor: pointer !important;
            transition: all 0.2s !important;
        }
        .nav-btn-logout:hover {
            background: #dc2626 !important;
            color: #ffffff !important;
            border-color: #b91c1c !important;
            transform: translateY(-1px);
        }

        /* Modern Compact Icon Buttons (Desktop & Header Actions) */
        .nav-icon-btn {
            width: 36px !important;
            min-width: 36px !important;
            height: 34px !important;
            min-height: 34px !important;
            max-height: 34px !important;
            box-sizing: border-box !important;
            padding: 0 !important;
            border-radius: 8px !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            font-size: 15px !important;
            background: rgba(255, 255, 255, 0.12) !important;
            color: #ffffff !important;
            border: 1px solid rgba(255, 255, 255, 0.22) !important;
            cursor: pointer !important;
            position: relative !important;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
            flex-shrink: 0 !important;
        }
        .nav-icon-btn:hover {
            background: rgba(255, 255, 255, 0.26) !important;
            border-color: rgba(255, 255, 255, 0.45) !important;
            transform: translateY(-1px);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
        }
        .nav-icon-btn:active {
            transform: translateY(0);
        }

        .nav-icon-btn.btn-desk-active {
            background: rgba(245, 158, 11, 0.25) !important;
            border-color: #f59e0b !important;
            color: #fde047 !important;
        }
        .nav-icon-btn.btn-desk-active:hover {
            background: #f59e0b !important;
            color: #1e293b !important;
            border-color: #d97706 !important;
        }

        .nav-icon-btn.btn-save-draft {
            background: rgba(22, 163, 74, 0.3) !important;
            border-color: #22c55e !important;
            color: #86efac !important;
        }
        .nav-icon-btn.btn-save-draft:hover {
            background: #16a34a !important;
            color: #ffffff !important;
            border-color: #15803d !important;
        }

        .nav-icon-btn.btn-home {
            background: rgba(255, 255, 255, 0.12) !important;
            border-color: rgba(255, 255, 255, 0.22) !important;
            color: #ffffff !important;
        }
        .nav-icon-btn.btn-home:hover {
            background: rgba(16, 185, 129, 0.28) !important;
            border-color: #10b981 !important;
            color: #a7f3d0 !important;
            transform: translateY(-1px);
        }

        .nav-icon-btn.btn-reset {
            background: rgba(255, 255, 255, 0.12) !important;
            border-color: rgba(255, 255, 255, 0.22) !important;
            color: #cbd5e1 !important;
        }
        .nav-icon-btn.btn-reset:hover {
            background: rgba(239, 68, 68, 0.25) !important;
            border-color: #ef4444 !important;
            color: #fca5a5 !important;
        }

        /* Modern Floating Tooltip on Hover */
        [data-tooltip] {
            position: relative;
        }
        [data-tooltip]::after {
            content: attr(data-tooltip);
            position: absolute;
            top: 42px;
            right: 0;
            background: #0f172a;
            color: #f8fafc;
            padding: 6px 11px;
            border-radius: 6px;
            font-size: 11.5px;
            font-weight: 700;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
            border: 1px solid #334155;
            z-index: 100000;
            line-height: 1.3;
        }
        [data-tooltip]::before {
            content: '';
            position: absolute;
            top: 34px;
            right: 12px;
            border: 5px solid transparent;
            border-bottom-color: #0f172a;
            opacity: 0;
            pointer-events: none;
            transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 100001;
        }
        [data-tooltip]:hover::after,
        [data-tooltip]:hover::before {
            opacity: 1;
            transform: translateY(2px);
        }

        .nav-tabs { 
            display: flex; 
            align-items: center;
            gap: 6px; 
            background: transparent !important; 
            padding: 0 !important; 
            margin: 0 !important;
        }

        .nav-tab {
            background: rgba(255, 255, 255, 0.12) !important;
            color: #f1f5f9 !important;
            border: 1px solid rgba(255, 255, 255, 0.18) !important;
        }
        .nav-tab:hover {
            background: rgba(255, 255, 255, 0.22) !important;
            color: #ffffff !important;
            border-color: rgba(255, 255, 255, 0.3) !important;
        }
        .nav-tab.active { 
            background: #ffffff !important; 
            color: var(--primary) !important; 
            font-weight: 700 !important;
            border-color: #ffffff !important;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
        }

        .btn-view-toggle {
            background: #f59e0b !important;
            color: #1e293b !important;
            font-weight: 700 !important;
            box-shadow: 0 2px 6px rgba(245,158,11,0.3) !important;
        }

        /* Main Container */
        .app-body {
            flex: 1;
            display: flex;
            overflow: hidden;
            position: relative;
            background: var(--bg);
        }

        /* 0. AUTH / LOGIN SCREEN (WORLD CLASS CIVIC PORTAL) */
        .auth-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: radial-gradient(circle at 12% 18%, rgba(16, 185, 129, 0.22) 0%, transparent 45%),
                        radial-gradient(circle at 88% 82%, rgba(2, 132, 199, 0.18) 0%, transparent 50%),
                        radial-gradient(circle at 50% 50%, rgba(5, 150, 105, 0.1) 0%, transparent 60%),
                        linear-gradient(135deg, #022c22 0%, #064e3b 45%, #0f172a 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px 16px;
            z-index: 99999;
            overflow-y: auto;
            box-sizing: border-box;
        }

        .auth-portal-container {
            width: 100%;
            max-width: 980px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 36px;
            margin: auto;
        }

        .auth-hero-pane {
            flex: 1.1;
            color: white;
            display: flex;
            flex-direction: column;
            gap: 16px;
            padding: 10px;
        }

        .auth-hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: rgba(255, 255, 255, 0.12);
            border: 1px solid rgba(255, 255, 255, 0.22);
            padding: 6px 14px;
            border-radius: 30px;
            font-size: 12px;
            font-weight: 700;
            color: #a7f3d0;
            backdrop-filter: blur(8px);
            width: fit-content;
        }
        .auth-hero-badge svg {
            width: 22px;
            height: 22px;
            display: inline-block;
            vertical-align: middle;
            flex-shrink: 0;
        }

        .auth-hero-title {
            font-size: 28px;
            font-weight: 800;
            line-height: 1.3;
            margin: 0;
            background: linear-gradient(135deg, #ffffff 30%, #a7f3d0 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .auth-hero-desc {
            font-size: 13.5px;
            line-height: 1.6;
            color: #cbd5e1;
            margin: 0;
        }

        .auth-hero-features {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 4px;
        }

        .auth-feat-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            background: rgba(255, 255, 255, 0.07);
            border: 1px solid rgba(255, 255, 255, 0.12);
            padding: 12px 14px;
            border-radius: 12px;
            backdrop-filter: blur(10px);
            transition: transform 0.2s ease, background 0.2s ease;
        }
        .auth-feat-item:hover {
            background: rgba(255, 255, 255, 0.12);
            transform: translateX(4px);
        }

        .auth-feat-icon {
            width: 34px;
            height: 34px;
            border-radius: 10px;
            background: rgba(16, 185, 129, 0.25);
            color: #34d399;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            flex-shrink: 0;
        }

        .auth-feat-text h4 {
            margin: 0 0 2px 0;
            font-size: 13px;
            font-weight: 700;
            color: #f1f5f9;
        }
        .auth-feat-text p {
            margin: 0;
            font-size: 11.5px;
            color: #94a3b8;
            line-height: 1.4;
        }

        .auth-hero-trust {
            display: flex;
            align-items: center;
            gap: 16px;
            font-size: 11.5px;
            color: #a7f3d0;
            font-weight: 600;
            padding-top: 6px;
            border-top: 1px solid rgba(255, 255, 255, 0.15);
        }

        .auth-card {
            flex: 0.95;
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(24px);
            border-radius: 20px;
            width: 100%;
            max-width: 440px;
            padding: 24px 26px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.3);
            text-align: center;
            box-sizing: border-box;
        }

        .auth-card .logo-badge {
            width: 56px;
            height: 56px;
            background: transparent;
            border: none;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 10px auto;
            box-shadow: 0 6px 18px rgba(5, 150, 105, 0.28);
        }
        .auth-card .logo-badge svg {
            width: 100%;
            height: 100%;
            display: block;
        }

        .auth-card h2 { margin: 0 0 3px 0; font-size: 19px; color: var(--text-main); font-weight: 800; letter-spacing: -0.3px; }
        .auth-card p { margin: 0 0 14px 0; font-size: 11.5px; color: var(--text-muted); font-weight: 500; }

        .auth-input-group {
            margin-bottom: 11px;
            text-align: left;
        }

        .auth-input-group label {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11.5px;
            font-weight: 700;
            color: #334155;
            margin-bottom: 5px;
        }

        .auth-input-group input[type="text"],
        .auth-input-group input[type="email"],
        .auth-input-group input[type="tel"] {
            width: 100%;
            padding: 10px 12px;
            border: 1.5px solid #cbd5e1;
            border-radius: 10px;
            font-size: 13px;
            outline: none;
            box-sizing: border-box;
            background: #f8fafc;
            color: #0f172a;
            transition: all 0.2s ease;
        }

        .auth-input-group input:focus {
            background: #ffffff;
            border-color: #10b981;
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
        }

        /* Password Input Wrap with Eye Toggle Icon */
        .password-input-wrap {
            position: relative;
            display: flex;
            align-items: center;
            width: 100%;
        }

        .password-input-wrap input {
            width: 100%;
            padding: 10px 42px 10px 12px;
            border: 1.5px solid #cbd5e1;
            border-radius: 10px;
            font-size: 13px;
            outline: none;
            box-sizing: border-box;
            background: #f8fafc;
            color: #0f172a;
            transition: all 0.2s ease;
        }

        .password-input-wrap input:focus {
            background: #ffffff;
            border-color: #10b981;
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
        }

        .btn-toggle-password {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            background: transparent;
            border: none;
            color: #64748b;
            font-size: 15px;
            cursor: pointer;
            padding: 6px 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            transition: color 0.15s ease, background 0.15s ease;
            z-index: 2;
        }

        .btn-toggle-password:hover {
            color: #0f172a;
            background: rgba(0, 0, 0, 0.06);
        }

        .phone-input-wrap {
            display: flex;
            align-items: center;
            border: 1.5px solid #cbd5e1;
            border-radius: 10px;
            overflow: hidden;
            background: #f8fafc;
            transition: all 0.2s ease;
        }
        .phone-input-wrap:focus-within {
            background: #ffffff;
            border-color: #10b981;
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
        }
        .phone-input-wrap span {
            padding: 10px 12px;
            font-weight: 700;
            font-size: 13px;
            color: #0f172a;
            background: #e2e8f0;
            border-right: 1.5px solid #cbd5e1;
        }
        .phone-input-wrap input {
            flex: 1;
            border: none;
            padding: 10px 12px;
            font-size: 13px;
            outline: none;
            background: transparent;
            font-weight: 600;
            color: #0f172a;
        }

        .auth-grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }
        @media (max-width: 480px) {
            .auth-grid-2 {
                grid-template-columns: 1fr;
                gap: 0;
            }
        }

        .btn-auth-submit {
            width: 100%;
            padding: 11px 16px;
            background: linear-gradient(135deg, #059669 0%, #047857 100%);
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 13.5px;
            font-weight: 800;
            cursor: pointer;
            margin-top: 6px;
            box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .btn-auth-submit:hover {
            background: linear-gradient(135deg, #047857 0%, #064e3b 100%);
            transform: translateY(-1px);
            box-shadow: 0 6px 16px rgba(5, 150, 105, 0.45);
        }

        .auth-divider {
            display: flex;
            align-items: center;
            text-align: center;
            margin: 14px 0;
            color: #94a3b8;
            font-size: 11px;
            font-weight: 600;
        }
        .auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid #e2e8f0; }
        .auth-divider span { padding: 0 10px; }

        .btn-google-login {
            width: 100%;
            padding: 10px 14px;
            background: white;
            border: 1.5px solid #cbd5e1;
            border-radius: 10px;
            font-size: 12.5px;
            font-weight: 700;
            color: #334155;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
            transition: all 0.2s ease;
        }
        .btn-google-login:hover {
            background: #f8fafc;
            border-color: #94a3b8;
            transform: translateY(-1px);
            box-shadow: 0 3px 8px rgba(0,0,0,0.08);
        }

        @media (max-width: 860px) {
            .auth-portal-container {
                flex-direction: column;
                gap: 18px;
            }
            .auth-hero-pane {
                text-align: center;
                align-items: center;
            }
            .auth-hero-title {
                font-size: 22px;
            }
            .auth-hero-features {
                display: none;
            }
            .auth-hero-trust {
                justify-content: center;
            }
            .auth-card {
                max-width: 100%;
                padding: 20px 18px;
            }
        }

        /* Mode Panels */
        .tab-panel {
            width: 100%;
            height: 100%;
            display: none;
        }
        .tab-panel.active-panel {
            display: flex;
        }

        /* 1. CITIZEN PORTAL (Chat + Sidebar) */
        .citizen-chat-area {
            flex: 2.2;
            display: flex;
            flex-direction: column;
            background: white;
            border-right: 1px solid #cbd5e1;
            position: relative;
        }

        #chatScrollBottomBtn {
            display: none;
            position: absolute;
            bottom: 66px;
            right: 20px;
            z-index: 45;
            height: 34px;
            padding: 0 14px;
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.92);
            backdrop-filter: blur(4px);
            color: #f8fafc;
            border: 1px solid #475569;
            font-size: 12px;
            font-weight: 700;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
            cursor: pointer;
            align-items: center;
            gap: 6px;
            transition: all 0.2s ease;
        }
        #chatScrollBottomBtn:hover {
            background: #1e293b;
            border-color: #64748b;
        }
        #chatScrollBottomBtn.has-new-msg {
            background: #0284c7 !important;
            border-color: #38bdf8 !important;
            color: white !important;
            box-shadow: 0 4px 16px rgba(2, 132, 199, 0.45) !important;
            animation: bounceSoft 2s infinite ease-in-out;
        }
        @keyframes bounceSoft {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-4px); }
        }

        .chat-messages {
            flex: 1;
            padding: 14px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 10px;
            background: #f8fafc;
        }

        .msg-bubble {
            max-width: 85%;
            padding: 10px 14px;
            border-radius: 14px;
            font-size: 13px;
            line-height: 1.45;
            white-space: pre-wrap;
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
        }

        .msg-bot {
            background: white;
            color: var(--text-main);
            align-self: flex-start;
            border-left: 4px solid var(--primary);
        }

        .msg-user {
            background: var(--primary);
            color: white;
            align-self: flex-end;
            border-radius: 14px 14px 2px 14px;
        }

        .chat-options-container {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }

        .chat-option-chip {
            background: #f0fdf4;
            border: 1.5px solid var(--primary);
            color: var(--primary-dark);
            padding: 8px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }

        .chat-option-chip:hover {
            background: var(--primary);
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(13, 92, 58, 0.3);
        }

        .chat-inline-upload-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
            color: white;
            padding: 9px 18px;
            border-radius: 10px;
            font-size: 12.5px;
            font-weight: 700;
            cursor: pointer;
            margin-top: 10px;
            box-shadow: 0 3px 8px rgba(2, 132, 199, 0.35);
            transition: all 0.2s ease;
        }

        .chat-inline-upload-btn:hover {
            background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
            transform: translateY(-2px);
            box-shadow: 0 5px 12px rgba(2, 132, 199, 0.45);
        }

        .chat-input-box {
            padding: 10px 14px;
            background: white;
            border-top: 1px solid #e2e8f0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .chat-input-box input[type="text"] {
            flex: 1;
            padding: 9px 13px;
            border: 1px solid #cbd5e1;
            border-radius: 20px;
            font-size: 13px;
            outline: none;
        }
        .chat-input-box input[type="text"]:focus { border-color: var(--primary); }

        .btn-icon {
            background: #f1f5f9;
            border: 1px solid #cbd5e1;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: #475569;
            font-size: 14px;
        }

        .btn-send {
            background: var(--primary);
            color: white;
            border: none;
            padding: 9px 18px;
            border-radius: 20px;
            font-weight: 600;
            cursor: pointer;
            font-size: 13px;
        }

        /* Citizen Sidebar (Live Extracted Details) */
        .citizen-sidebar {
            flex: 1.2;
            background: #f8fafc;
            padding: 14px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .sidebar-header {
            font-size: 13.5px;
            font-weight: 700;
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding-bottom: 6px;
            border-bottom: 2px solid #e2e8f0;
        }

        .card-box {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            padding: 10px;
            font-size: 11.5px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.03);
        }
        .card-box h4 { margin: 0 0 6px 0; font-size: 12px; color: #1e293b; display: flex; align-items: center; gap: 5px; }
        .card-row { margin-bottom: 3px; color: var(--text-muted); }
        .card-row strong { color: var(--text-main); }
        .badge-green { color: var(--success); font-weight: 700; }
        .badge-empty { color: #94a3b8; font-style: italic; }

        /* 2. DOCUMENT LOCKER (ஆவணப் பெட்டகம்) */
        .locker-container {
            width: 100%;
            height: 100%;
            padding: 18px;
            overflow-y: auto;
            background: #f8fafc;
        }

        .locker-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 12px;
            margin-top: 14px;
        }

        .doc-item-card {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            padding: 14px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            box-shadow: 0 2px 4px rgba(0,0,0,0.04);
        }

        .doc-icon-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
        .doc-icon { width: 38px; height: 38px; border-radius: 8px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 18px; }
        .btn-download-doc {
            background: var(--accent);
            color: white;
            border: none;
            padding: 7px 12px;
            border-radius: 6px;
            font-weight: 600;
            font-size: 11.5px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            text-decoration: none;
        }

        /* 3. ADMIN DASHBOARD */
        .admin-container {
            width: 100%;
            height: 100%;
            padding: 18px;
            overflow-y: auto;
            background: #f8fafc;
        }

        .admin-stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
            margin-bottom: 18px;
        }

        .stat-card {
            background: white;
            border-radius: 10px;
            padding: 14px;
            border: 1px solid #e2e8f0;
            box-shadow: 0 2px 4px rgba(0,0,0,0.04);
        }
        .stat-card span { font-size: 11px; color: var(--text-muted); font-weight: 600; }
        .stat-card h2 { margin: 4px 0 0 0; font-size: 20px; color: var(--primary); }

        /* ==================== LIVE PROGRESS BAR ==================== */
        .automation-progress-bar {
            background: white;
            border-top: 2px solid var(--primary);
            padding: 8px 14px;
            display: none;
        }
        .automation-progress-bar.active { display: block; }
        .apb-label { font-size: 11px; font-weight: 700; color: var(--primary); margin-bottom: 4px; display: flex; justify-content: space-between; }
        .apb-track { background: #e2e8f0; border-radius: 20px; height: 7px; overflow: hidden; }
        .apb-fill { background: linear-gradient(90deg, #16a34a, #0d5c3a); height: 100%; border-radius: 20px; transition: width 0.6s ease; width: 0%; }

        /* Application number banner */
        .app-number-banner {
            display: none;
            position: relative;
            background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
            color: white;
            padding: 10px 16px;
            border-bottom: 2px solid #059669;
            box-shadow: 0 4px 14px rgba(6, 78, 59, 0.25);
            animation: fadeInDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .app-number-banner.show { display: block; }
        .app-number-banner .ref-no { font-family: monospace; font-size: 15px; letter-spacing: 1.5px; font-weight: 800; }

        /* Resume banner */
        .resume-banner {
            display: none;
            background: #fffbeb;
            border: 1.5px solid #f59e0b;
            border-radius: 10px;
            padding: 10px 14px;
            margin: 10px;
            font-size: 12px;
            align-items: center;
            gap: 10px;
        }
        .resume-banner.show { display: flex; }

        /* Responsive Styles when in Mobile View */
        .mobile-view-active .citizen-sidebar { display: none !important; }
        .mobile-view-active .citizen-chat-area { flex: 1 !important; }

        @media (max-width: 800px) {
            .viewport-wrapper { max-width: 100% !important; max-height: 100% !important; border-radius: 0 !important; box-shadow: none !important; border: none !important; }
            body:not(.is-desktop-app):not(.is-operator-mode) .citizen-sidebar { display: none; }
            body:not(.is-desktop-app):not(.is-operator-mode) .citizen-chat-area { flex: 1; }
            .btn-view-toggle { display: none; }
        }

        /* Operator Desk & Desktop App: Sidebar must NEVER be hidden during automation or normal workflow! */
        body.is-desktop-app .citizen-sidebar,
        body.is-operator-mode .citizen-sidebar {
            display: flex !important;
            flex: 1.2 !important;
            min-width: 290px !important;
            max-width: 440px !important;
            visibility: visible !important;
        }

        body.is-desktop-app .citizen-chat-area,
        body.is-operator-mode .citizen-chat-area {
            flex: 2.2 !important;
            min-width: 0 !important;
            border-right: 1px solid #cbd5e1 !important;
        }

        body.is-desktop-app #panel-citizen.tab-panel.active-panel,
        body.is-operator-mode #panel-citizen.tab-panel.active-panel {
            display: flex !important;
            flex-direction: row !important;
            width: 100% !important;
            max-width: 100% !important;
            height: 100% !important;
        }

        /* Modal Styles */
        .modal-overlay {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            justify-content: center;
            align-items: center;
        }

        .filter-pill {
            padding: 5px 12px;
            border-radius: 20px;
            border: 1px solid #cbd5e1;
            background: white;
            font-size: 11.5px;
            font-weight: 600;
            color: #475569;
            cursor: pointer;
            transition: all 0.2s;
        }
        .filter-pill:hover {
            border-color: var(--primary);
        }
        .filter-pill.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        @keyframes spinSmooth {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* AI Document Scanner HUD Styles */
        @keyframes laserScan {
            0% { top: 0%; opacity: 0.8; }
            50% { top: 88%; opacity: 1; }
            100% { top: 0%; opacity: 0.8; }
        }

        .ai-laser-beam {
            position: absolute;
            left: 0;
            width: 100%;
            height: 3px;
            background: linear-gradient(90deg, rgba(34,197,94,0) 0%, #22c55e 50%, rgba(34,197,94,0) 100%);
            box-shadow: 0 0 15px 3px #22c55e, 0 0 25px 6px rgba(74, 222, 128, 0.6);
            animation: laserScan 1.8s infinite ease-in-out;
            pointer-events: none;
        }

        .ai-step-item {
            display: flex;
            align-items: center;
            gap: 9px;
            font-size: 11.5px;
            font-weight: 600;
            color: #475569;
            margin-bottom: 7px;
            transition: all 0.3s ease;
        }
        .ai-step-item:last-child { margin-bottom: 0; }
        .ai-step-item.active {
            opacity: 1 !important;
            color: #0f172a !important;
            font-weight: 700;
        }
        .ai-step-item.done {
            opacity: 1 !important;
            color: #166534 !important;
        }

        /* Dedicated Citizen Mobile-App Experience Styles */
        .citizen-mode {
            max-width: 580px !important;
            margin: 0 auto !important;
            height: calc(100vh - 65px) !important;
            background: #ffffff !important;
            border-radius: 16px !important;
            border: 1px solid #e2e8f0 !important;
            box-shadow: 0 6px 28px rgba(0, 0, 0, 0.08) !important;
            display: flex !important;
            flex-direction: column !important;
            overflow: hidden !important;
            position: relative !important;
        }
        @media (max-width: 600px) {
            .citizen-mode {
                max-width: 100% !important;
                height: 100vh !important;
                border-radius: 0 !important;
                border: none !important;
                box-shadow: none !important;
            }
        }
        body:not(.is-desktop-app):not(.is-operator-mode) .citizen-mode .citizen-sidebar {
            display: none !important;
        }
        body:not(.is-desktop-app):not(.is-operator-mode) .citizen-mode .citizen-chat-area {
            border-right: none !important;
            flex: 1 !important;
            height: 100% !important;
            overflow: hidden !important;
        }
        
        .c-bottom-nav {
            height: 58px;
            background: #ffffff;
            border-top: 1px solid #e2e8f0;
            display: flex;
            align-items: center;
            justify-content: space-around;
            padding: 0 6px;
            z-index: 100;
            flex-shrink: 0;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
        }
        .c-bottom-btn {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            background: none;
            border: none;
            color: #64748b;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            padding: 6px 0;
            transition: all 0.2s ease;
            border-radius: 8px;
        }
        .c-bottom-btn i {
            font-size: 17px;
            transition: transform 0.2s ease;
        }
        .c-bottom-btn.active {
            color: #059669;
            font-weight: 800;
        }
        .c-bottom-btn.active i {
            transform: scale(1.15);
            color: #059669;
        }
        .c-bottom-btn:hover {
            color: #0f172a;
            background: #f1f5f9;
        }

        .c-service-card {
            background: white;
            border-radius: 12px;
            padding: 16px;
            border: 1px solid #e2e8f0;
            box-shadow: 0 2px 6px rgba(0,0,0,0.04);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            transition: all 0.2s ease;
            cursor: pointer;
            text-align: left;
        }
        .c-service-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(0,0,0,0.08);
            border-color: #10b981;
        }