/* ==========================================================================
   Maintec Technologies AI Platform - Design System
   Theme: High-Tech Enterprise Glassmorphism, Deep Cobalt & Electric Cyan
   ========================================================================== */

:root {
    /* Color Tokens - Dark (Default) */
    --bg-app: #060A12;
    --bg-sidebar: #090F1B;
    --bg-card: rgba(13, 22, 39, 0.75);
    --bg-card-hover: rgba(20, 32, 56, 0.85);
    --bg-input: rgba(12, 20, 36, 0.92);
    --bg-modal: #0B1324;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(0, 212, 255, 0.35);
    --border-glow: rgba(0, 212, 255, 0.6);

    /* Brand Accents - Maintec Cobalt & Cyan */
    --primary: #00D4FF;
    --primary-hover: #38E1FF;
    --primary-glow: rgba(0, 212, 255, 0.25);
    --accent-cobalt: #0A84FF;
    --accent-blue: #0066FF;
    --accent-indigo: #4F46E5;
    --accent-cyan: #00F0FF;
    --accent-gradient: linear-gradient(135deg, #00D4FF 0%, #0A84FF 50%, #4F46E5 100%);
    
    /* Domain Specific Colors */
    --color-global-dot: #00D4FF;
    --color-global-bg: rgba(0, 212, 255, 0.12);
    --color-global-border: rgba(0, 212, 255, 0.3);
    --color-india-dot: #10B981;
    --color-india-bg: rgba(16, 185, 129, 0.12);
    --color-india-border: rgba(16, 185, 129, 0.3);

    /* Typography Colors */
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #060A12;

    /* Message Bubbles */
    --user-bubble-bg: linear-gradient(135deg, #0A84FF 0%, #0052CC 100%);
    --assistant-bubble-bg: rgba(15, 25, 45, 0.72);
    --assistant-bubble-border: rgba(0, 212, 255, 0.16);

    /* Shadows & Glows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.65);
    --shadow-neon: 0 0 24px rgba(0, 212, 255, 0.28);

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing & Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 26px;
    --sidebar-width: 300px;
    --drawer-width: 440px;
}

/* Light Theme Variables */
body.light-theme {
    --bg-app: #F8FAFC;
    --bg-sidebar: #EDF2F7;
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-card-hover: rgba(241, 245, 249, 0.98);
    --bg-input: #FFFFFF;
    --bg-modal: #FFFFFF;
    
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-highlight: rgba(0, 102, 255, 0.35);
    --border-glow: rgba(0, 102, 255, 0.6);

    --primary: #0066FF;
    --primary-hover: #0052CC;
    --primary-glow: rgba(0, 102, 255, 0.2);

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-inverse: #FFFFFF;

    --user-bubble-bg: linear-gradient(135deg, #0066FF 0%, #0044B3 100%);
    --assistant-bubble-bg: #FFFFFF;
    --assistant-bubble-border: rgba(0, 102, 255, 0.18);
    --shadow-neon: 0 4px 16px rgba(0, 102, 255, 0.15);
}

/* Base Reset & Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Buttons & Inputs Reset */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input, textarea, select {
    font-family: inherit;
    outline: none;
    border: none;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 18px 16px;
    position: relative;
    z-index: 40;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

@media (min-width: 993px) {
    .sidebar.closed {
        margin-left: calc(-1 * var(--sidebar-width));
    }
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px var(--primary-glow);
    overflow: hidden;
    padding: 3px;
}

.brand-official-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

.brand-logo-icon .logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: #FFFFFF;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-close-sidebar {
    display: none;
}

/* Dual Domain Badges Strip */
.domain-badges-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.domain-chip {
    display: flex;
    flex-direction: column;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s ease;
}

.domain-chip:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border-highlight);
    transform: translateY(-1px);
}

.domain-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 4px;
}
.dot-global { background-color: var(--color-global-dot); box-shadow: 0 0 8px var(--color-global-dot); }
.dot-india { background-color: var(--color-india-dot); box-shadow: 0 0 8px var(--color-india-dot); }

.domain-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

.domain-flag {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Sidebar Action Bar */
.sidebar-action-bar {
    margin-bottom: 16px;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    background: var(--accent-gradient);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(0, 102, 255, 0.35);
    transition: all 0.25s ease;
}

.new-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.45);
}

.new-chat-btn i {
    width: 18px;
    height: 18px;
}

.sidebar-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-left: 6px;
}

/* Chat Sessions List */
.chat-sessions-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.chat-session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.chat-session-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.chat-session-item.active {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.25);
    color: var(--primary);
    font-weight: 500;
}

.chat-session-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.chat-session-delete {
    opacity: 0;
    color: var(--text-muted);
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.chat-session-item:hover .chat-session-delete {
    opacity: 1;
}

.chat-session-delete:hover {
    color: #EF4444;
}

/* Sidebar Footer */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 14px;
}

.footer-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.84rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.footer-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.footer-btn i {
    width: 17px;
    height: 17px;
}

.badge-pill {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    background: rgba(0, 212, 255, 0.15);
    color: var(--primary);
}

.contact-quick-strip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-subtle);
}

.strip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.73rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.strip-item:hover {
    color: var(--primary);
}

.strip-item i {
    width: 13px;
    height: 13px;
}

/* ==========================================================================
   MAIN CONTENT & HEADER
   ========================================================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-app);
    position: relative;
    overflow: hidden;
}

.chat-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(6, 10, 18, 0.8);
    backdrop-filter: blur(16px);
    z-index: 30;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.icon-btn i {
    width: 19px;
    height: 19px;
}

.model-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 500;
}

.agent-council-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-size: 0.76rem;
    color: #A5B4FC;
    font-weight: 500;
    transition: all 0.25s ease;
}

.agent-council-badge i {
    width: 14px;
    height: 14px;
    color: #818CF8;
}

.status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10B981;
    box-shadow: 0 0 8px #10B981;
}

.header-center {
    display: flex;
    align-items: center;
}

.header-page-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dual-site-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-pill-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.header-pill-btn:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--border-highlight);
    color: var(--primary);
}

.header-pill-btn i {
    width: 14px;
    height: 14px;
}

.theme-toggle-btn .sun-icon {
    display: none;
}
body.light-theme .theme-toggle-btn .moon-icon {
    display: none;
}
body.light-theme .theme-toggle-btn .sun-icon {
    display: block;
}

/* ==========================================================================
   CHAT SCROLL AREA & WELCOME HERO
   ========================================================================== */

.chat-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.welcome-hero {
    max-width: 860px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0 30px;
}

.hero-logo-wrapper {
    position: relative;
    width: 84px;
    height: 84px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-glow-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: var(--accent-gradient);
    opacity: 0.4;
    filter: blur(12px);
    animation: pulseRing 3.5s infinite alternate ease-in-out;
}

@keyframes pulseRing {
    0% { transform: scale(0.95); opacity: 0.3; }
    100% { transform: scale(1.1); opacity: 0.55; }
}

.hero-logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 30px var(--primary-glow);
    overflow: hidden;
    padding: 10px;
}

.hero-official-logo {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.hero-logo-circle span {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 800;
    color: #FFFFFF;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #FFFFFF 0%, #A5F3FC 50%, #00D4FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 0.96rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 680px;
    margin-bottom: 26px;
}

.hero-domain-link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
}

/* Live Stats Strip */
.stats-pills-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 34px;
}

.stat-pill {
    display: flex;
    flex-direction: column;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.stat-pill:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.15);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Starter Prompts Grid */
.starter-prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    width: 100%;
}

.prompt-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-align: left;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.prompt-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-highlight);
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon);
}

.prompt-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.prompt-card-icon i {
    width: 20px;
    height: 20px;
}

.prompt-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prompt-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.prompt-card-desc {
    font-size: 0.77rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   CHAT MESSAGES
   ========================================================================== */

.chat-messages-container {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chat-message-row {
    display: flex;
    gap: 14px;
    width: 100%;
    animation: fadeInMsg 0.3s ease-out;
}

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

.chat-message-row.user-row {
    justify-content: flex-end;
}

.user-avatar, .assistant-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.85rem;
}

.assistant-avatar {
    background: var(--accent-gradient);
    color: #FFFFFF;
    box-shadow: 0 0 12px var(--primary-glow);
    overflow: hidden;
    padding: 3px;
}

.avatar-official-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

.user-avatar {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.message-bubble-wrap {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-bubble {
    background: var(--user-bubble-bg);
    color: #FFFFFF;
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    border-bottom-right-radius: 4px;
    font-size: 0.93rem;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    word-break: break-word;
}

.assistant-bubble {
    background: var(--assistant-bubble-bg);
    border: 1px solid var(--assistant-bubble-border);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    padding: 18px 22px;
    border-radius: var(--radius-lg);
    border-top-left-radius: 4px;
    font-size: 0.93rem;
    line-height: 1.65;
    box-shadow: var(--shadow-md);
    word-break: break-word;
}

/* Markdown styling inside assistant bubble */
.assistant-bubble h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.assistant-bubble h4 {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 600;
    color: #E2E8F0;
    margin: 14px 0 6px;
}

.assistant-bubble p {
    margin-bottom: 10px;
}

.assistant-bubble ul, .assistant-bubble ol {
    margin: 8px 0 14px 20px;
}

.assistant-bubble li {
    margin-bottom: 6px;
}

.assistant-bubble hr {
    border: 0;
    height: 1px;
    background: var(--border-subtle);
    margin: 16px 0;
}

.assistant-bubble a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.assistant-bubble strong {
    color: #FFFFFF;
}

.assistant-bubble code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 6px;
    border-radius: 4px;
    color: #38BDF8;
}

/* Verified Source Badges */
.sources-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.sources-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.74rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.source-badge.domain-com {
    background: var(--color-global-bg);
    border: 1px solid var(--color-global-border);
    color: var(--color-global-dot);
}

.source-badge.domain-in {
    background: var(--color-india-bg);
    border: 1px solid var(--color-india-border);
    color: #10B981;
}

.source-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.source-badge i {
    width: 12px;
    height: 12px;
}

/* Message Actions & Follow-up Suggestions */
.message-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 4px;
}

.msg-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.74rem;
    transition: all 0.2s ease;
}

.msg-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.msg-action-btn i {
    width: 13px;
    height: 13px;
}

.follow-up-suggestions-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.suggestion-pill {
    padding: 6px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.77rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.suggestion-pill:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--border-highlight);
    color: var(--primary);
    transform: translateY(-1px);
}

/* Content Creation Animation: Streaming Cursor */
.streaming-cursor {
    display: inline-block;
    width: 3px;
    height: 1.15em;
    background: var(--primary);
    border-radius: 2px;
    margin-left: 3px;
    vertical-align: text-bottom;
    box-shadow: 0 0 10px var(--primary), 0 0 18px rgba(0, 212, 255, 0.5);
    animation: cursorBlink 0.75s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.15; transform: scaleY(0.85); }
}

/* Agent Reasoning / Thought Stream Accordion */
.thought-accordion-box {
    background: rgba(10, 17, 30, 0.65);
    border: 1px solid rgba(0, 212, 255, 0.22);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.8rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    animation: thoughtFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.thought-accordion-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.08), transparent);
    animation: thoughtShimmer 2.8s infinite;
}

@keyframes thoughtShimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

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

.thought-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
    user-select: none;
    gap: 8px;
}

.thought-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thought-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 212, 255, 0.25);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.thought-toggle-arrow {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.thought-accordion-box.collapsed .thought-toggle-arrow {
    transform: rotate(-90deg);
}

.thought-steps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.thought-accordion-box.collapsed .thought-steps-list {
    display: none;
}

.thought-step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.77rem;
    color: var(--text-secondary);
    animation: stepIn 0.3s ease both;
}

.thought-step-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    flex-shrink: 0;
}

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

/* Aurora Background Nebula */
.main-content::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -100px;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, rgba(10, 132, 255, 0.03) 45%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    filter: blur(55px);
    animation: auroraDrift 14s ease-in-out infinite alternate;
}

@keyframes auroraDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-60px, 60px) scale(1.15); }
}

/* Staggered Spring Entrance for Suggestions & Badges */
.sources-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    animation: fadeInUp 0.4s ease 0.15s both;
}

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

.follow-up-suggestions-wrap .suggestion-pill {
    animation: springIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.follow-up-suggestions-wrap .suggestion-pill:nth-child(1) { animation-delay: 0.1s; }
.follow-up-suggestions-wrap .suggestion-pill:nth-child(2) { animation-delay: 0.18s; }
.follow-up-suggestions-wrap .suggestion-pill:nth-child(3) { animation-delay: 0.26s; }
.follow-up-suggestions-wrap .suggestion-pill:nth-child(4) { animation-delay: 0.34s; }

@keyframes springIn {
    0% { opacity: 0; transform: translateY(12px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Shimmer Headline inside Assistant Bubble */
.assistant-bubble h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #00D4FF 0%, #38BDF8 40%, #FFFFFF 80%, #00D4FF 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 4s ease infinite;
}

@keyframes textShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Typing Indicator */
.typing-indicator-row {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 14px;
    align-items: center;
}

.typing-bubble {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary);
    animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.1); opacity: 1; }
}

.typing-status-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: 6px;
}

/* ==========================================================================
   CHAT INPUT COMPONENT
   ========================================================================== */

.chat-input-wrapper {
    padding: 16px 24px 20px;
    background: linear-gradient(180deg, transparent 0%, var(--bg-app) 30%);
    position: relative;
    z-index: 20;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
}

.chat-input-box {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 10px 14px 10px 18px;
    box-shadow: var(--shadow-md);
    transition: all 0.25s ease;
}

.chat-input-box:focus-within {
    border-color: var(--border-highlight);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.25);
}

.chat-textarea {
    flex: 1;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    max-height: 180px;
    min-height: 24px;
    padding: 4px 0;
}

.chat-textarea::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.input-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.input-icon-btn.recording {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.15);
    animation: pulseMic 1.5s infinite;
}

@keyframes pulseMic {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.send-message-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-message-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
}

.send-message-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 14px var(--primary-glow);
}

.input-disclaimer {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.4;
}

.input-disclaimer a {
    color: var(--primary);
    text-decoration: underline;
}

/* ==========================================================================
   MODALS & DRAWERS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 90vh;
}

.drawer-modal {
    width: 900px;
    max-width: 95vw;
    height: 82vh;
}

.standard-modal {
    width: 520px;
    max-width: 90vw;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-subtitle {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.modal-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    color: #FFFFFF;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 212, 255, 0.35);
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 24px;
    background: rgba(0, 0, 0, 0.15);
}

.tab-btn {
    padding: 12px 18px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.modal-search-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 14px;
    background: rgba(255, 255, 255, 0.015);
}

.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
}

.search-input-wrap i {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-input-wrap input {
    background: transparent;
    color: var(--text-primary);
    font-size: 0.84rem;
    width: 100%;
}

.domain-filter-group {
    display: flex;
    gap: 6px;
}

.filter-chip {
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 0.74rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.filter-chip.active {
    background: var(--primary);
    color: var(--text-inverse);
    font-weight: 600;
    border-color: var(--primary);
}

.modal-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* Knowledge Cards */
.knowledge-cards-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.knowledge-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.2s ease;
}

.knowledge-item-card:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
}

.item-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.item-card-title {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
}

.item-domain-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.tag-global { background: var(--color-global-bg); color: var(--color-global-dot); }
.tag-india { background: var(--color-india-bg); color: #10B981; }
.tag-both { background: rgba(147, 51, 234, 0.15); color: #C084FC; }

.item-card-summary {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.45;
}

.item-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.item-source-link {
    color: var(--primary);
    text-decoration: none;
}
.item-source-link:hover {
    text-decoration: underline;
}

/* Pages Table */
.pages-table-wrap {
    overflow-x: auto;
}

.pages-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.pages-table th {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-weight: 600;
}

.pages-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.pages-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.page-title-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    display: block;
}
.page-title-link:hover {
    text-decoration: underline;
}

.page-url-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    word-break: break-all;
}

/* Overview Panel */
.overview-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.overview-stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.overview-box-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.overview-box-val {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Settings Modal */
.modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
}

.setting-select, .setting-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.setting-select:focus, .setting-input:focus {
    border-color: var(--border-highlight);
}

.setting-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.password-input-wrap {
    display: flex;
    align-items: center;
    position: relative;
}

.password-input-wrap input {
    width: 100%;
    padding-right: 36px;
}

.toggle-password-btn {
    position: absolute;
    right: 8px;
    color: var(--text-muted);
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary);
}
input:checked + .slider:before {
    transform: translateX(20px);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* ==========================================================================
   SIDEBAR BACKDROP (MOBILE & TABLET DRAWER OVERLAY)
   ========================================================================== */

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   CORPORATE INTELLIGENCE ADVISORY UI (METRICS, ACTIONS & IMAGE CARDS)
   ========================================================================== */

.rag-metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.22);
    font-size: 0.74rem;
    font-family: var(--font-body);
    color: var(--text-secondary);
    margin-bottom: 8px;
    backdrop-filter: blur(8px);
}

.rag-metric-pill .metric-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 8px #10B981;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.rag-metric-pill .metric-sep {
    opacity: 0.4;
}

.rag-metric-pill strong {
    color: var(--primary);
    font-weight: 600;
}

/* Interactive CTA Actions (1-Click Apply, Call, Explore) */
.rag-actions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.rag-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    min-height: 38px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(59, 130, 246, 0.18));
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: var(--radius-md);
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rag-action-btn:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(59, 130, 246, 0.35));
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--primary-glow);
    color: #FFFFFF;
}

.rag-action-btn i {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

/* Verified Corporate Image Cards */
.rag-images-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    width: 100%;
}

.rag-image-card {
    position: relative;
    max-width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.rag-image-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 212, 255, 0.15);
}

.rag-image-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    background: #0B1120;
    display: block;
}

.rag-image-caption {
    display: block;
    padding: 6px 10px;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   MULTI-DEVICE RESPONSIVE BREAKPOINTS (DESKTOP, TABLET & MOBILE)
   ========================================================================== */

/* 1. Large Laptops / Medium Desktops (<= 1200px) */
@media (max-width: 1200px) {
    .header-page-title {
        font-size: 0.88rem;
    }
}

/* 2. Tablets & Small Desktops (<= 992px) */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 320px;
        max-width: 85vw;
        z-index: 50;
        transform: translateX(-100%);
        box-shadow: none;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 12px 0 45px rgba(0, 0, 0, 0.75);
    }

    .mobile-close-sidebar {
        display: flex;
    }

    .header-page-title {
        display: none;
    }

    .welcome-hero {
        padding: 10px 0 20px;
    }

    .hero-title {
        font-size: 1.85rem;
    }

    .starter-prompts-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* 3. Phablets & Portrait Tablets (<= 768px) */
@media (max-width: 768px) {
    .chat-header {
        height: 58px;
        padding: 0 12px;
    }

    .header-left {
        gap: 8px;
    }

    .agent-council-badge {
        display: none;
    }

    .model-status-badge {
        padding: 4px 10px;
        font-size: 0.74rem;
    }

    .dual-site-links .header-pill-btn span {
        display: none;
    }

    .dual-site-links .header-pill-btn {
        padding: 6px 8px;
        border-radius: 50%;
    }

    .chat-scroll-area {
        padding: 16px 12px;
    }

    .hero-logo-wrapper {
        width: 68px;
        height: 68px;
        margin-bottom: 16px;
    }

    .hero-logo-circle {
        width: 64px;
        height: 64px;
        padding: 8px;
    }

    .hero-title {
        font-size: 1.55rem;
        margin-bottom: 8px;
    }

    .hero-subtitle {
        font-size: 0.88rem;
        margin-bottom: 18px;
        line-height: 1.5;
    }

    /* Stats container: clean 2-column mobile grid */
    .stats-pills-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
        margin-bottom: 22px;
    }

    .stat-pill {
        padding: 8px 12px;
        text-align: center;
        align-items: center;
    }

    .stat-value {
        font-size: 1.05rem;
    }

    .stat-label {
        font-size: 0.68rem;
    }

    /* Single column starter prompts for thumb tapping */
    .starter-prompts-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .prompt-card {
        padding: 12px 14px;
        min-height: 48px;
    }

    .prompt-card-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .prompt-card-title {
        font-size: 0.86rem;
    }

    .prompt-card-desc {
        font-size: 0.74rem;
    }

    /* Message rows */
    .chat-message-row {
        gap: 10px;
        margin-bottom: 16px;
    }

    .assistant-avatar, .user-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.82rem;
    }

    .assistant-bubble, .user-bubble {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    /* Actions & Image Cards */
    .rag-actions-container {
        flex-direction: column;
    }

    .rag-action-btn {
        width: 100%;
        min-height: 42px;
    }

    .rag-images-strip {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .rag-image-card {
        max-width: 100%;
    }

    .rag-image-card img {
        height: 95px;
    }

    /* Input wrapper touch target */
    .chat-input-wrapper {
        padding: 8px 12px 14px;
    }

    .chat-input-box {
        padding: 8px 10px 8px 14px;
        border-radius: var(--radius-lg);
    }

    .chat-textarea {
        font-size: 16px; /* Prevents auto-zoom on mobile devices */
    }

    .input-icon-btn, .send-message-btn {
        width: 36px;
        height: 36px;
    }

    /* Modals Responsive */
    .modal-content.drawer-modal {
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
    }

    .modal-content.standard-modal {
        width: calc(100vw - 20px);
        max-height: 90vh;
        margin: 10px;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-body {
        padding: 14px 16px;
    }

    .modal-tabs {
        padding: 0 12px;
        overflow-x: auto;
    }

    .modal-search-bar {
        padding: 10px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .domain-filter-group {
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .filter-chip {
        flex-shrink: 0;
    }
}

/* 4. Compact Mobile Smartphones (<= 480px) */
@media (max-width: 480px) {
    .chat-header {
        padding: 0 8px;
        gap: 4px;
    }

    .header-left {
        gap: 6px;
    }

    .header-right {
        gap: 4px;
    }

    .dual-site-links {
        display: none; /* Hide to give space to action buttons */
    }

    .icon-btn {
        width: 32px;
        height: 32px;
    }

    .icon-btn i {
        width: 16px;
        height: 16px;
    }

    .model-status-badge {
        max-width: 140px;
        padding: 3px 8px;
    }

    .model-status-badge .model-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.72rem;
    }

    .hero-title {
        font-size: 1.35rem;
    }

    .hero-subtitle {
        font-size: 0.82rem;
    }

    .thought-accordion-box {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .thought-steps-list {
        font-size: 0.74rem;
    }

    .rag-images-strip {
        grid-template-columns: 1fr;
    }

    .rag-image-card img {
        height: 120px;
    }

    .overview-stats-grid {
        grid-template-columns: 1fr;
    }
}

