/* ===============================
 static/css/labhtark_ai/chat.css
 =============================== */
:root {
    /* Primary Colors - LabhTark Brand (Premium Stock Market) */
    --color-primary-dark: #022140;
    --color-primary-slate: #265077;
    --color-primary-light: #1E4258;
    --color-accent-primary: #2D5F5D;
    --color-text-secondary: #494B68;
    --color-secondary: var(--color-gray-100);
    --color-cream: #F8F9FA;
    --color-border-subtle: #E8EAED;

    --color-teal-400: rgb(94, 149, 154);
    --color-red-400: rgba(255, 84, 89, 1);
    --color-red-500: rgba(192, 21, 47, 1);
    --color-orange-400: rgba(230, 129, 97, 1);
    --color-orange-500: rgba(168, 75, 47, 1);
    --color-brown-600-rgb: 94, 82, 64;
    --color-teal-500-rgb: 33, 128, 141;
    --color-slate-900-rgb: 19, 52, 59;
    --color-slate-500-rgb: 98, 108, 113;
    --color-red-500-rgb: 192, 21, 47;
    --color-red-400-rgb: 255, 84, 89;
    --color-orange-500-rgb: 168, 75, 47;
    --color-orange-400-rgb: 230, 129, 97;

    --color-success-rgb: 62, 125, 103;
    --color-error-rgb: 192, 21, 47;
    --color-warning-rgb: 168, 75, 47;
    --color-info-rgb: 98, 108, 113;
    /* Background color tokens (Light Mode) */
    --color-background: #F8F9FA;
    --color-bg-1: rgba(59, 130, 246, 0.08);
    /* Light blue */
    --color-bg-2: rgba(245, 158, 11, 0.08);
    /* Light yellow */
    --color-bg-3: rgba(34, 197, 94, 0.08);
    /* Light green */
    --color-bg-4: rgba(239, 68, 68, 0.08);
    /* Light red */
    --color-bg-5: rgba(147, 51, 234, 0.08);
    /* Light purple */
    --color-bg-6: rgba(249, 115, 22, 0.08);
    /* Light orange */
    --color-bg-7: rgba(236, 72, 153, 0.08);
    /* Light pink */
    --color-bg-8: rgba(6, 182, 212, 0.08);
    /* Light gray */
    --color-bg-9: rgba(128, 128, 128, 0.08);

    /* Light cyan */
    /* Main app background */
    --color-surface: #FFFFFF;
    /* Cards, panels, tables */
    --color-surface-muted: #F3F4F6;
    /* Subtle sections / sidebars */
    /* Accent Colors */
    --color-accent-dark: #2D5F5D;
    --color-accent-slate: #1E4258;
    --color-accent-light: #265077;

    /* Neutral Colors */
    --color-white: #FFFFFF;
    --color-light-text: #ECF0F1;
    --color-light-gray: #BDC3C7;
    --color-gray-50: #F5F5F5;
    --color-gray-100: #ECEFF1;
    --color-gray-200: #CFD8DC;
    --color-gray-300: #B0BEC5;
    --color-gray-400: #90A4AE;
    --color-gray-500: #78909C;
    --color-gray-700: #455A64;
    --color-gray-900: #263238;

    --color-slate-500: rgba(98, 108, 113, 1);
    --color-brown-600: rgba(94, 82, 64, 1);
    --color-charcoal-700: rgba(31, 33, 33, 1);
    --color-charcoal-800: rgba(38, 40, 40, 1);
    --color-slate-900: rgba(19, 52, 59, 1);

    /* Semantic Colors */
    --color-error: var(--color-red-500);
    --color-success: #27AE60;
    --color-warning: var(--color-orange-500);
    --color-info: #3498DB;

    /* Custom gradients */
    --gradient-primary: linear-gradient(135deg, #265077 0%, #022140 100%);
    --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);

    /* Common style patterns */
    --focus-ring: 0 0 0 3px var(--color-primary-light);

    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    --font-family-lt: 'Mulish', sans-serif;
    --font-family-heading: 'Segoe UI', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    --font-size-4xl: 40px;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Spacing */
    --space-2: 2px;
    --space-4: 4px;
    --space-6: 6px;
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    --space-32: 32px;
    --space-40: 40px;
    --space-48: 48px;

    /* Border Radius */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-base: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Animation */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

    /* Transitions */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 350ms;
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
}


/* Base styles */
html {
    font-size: var(--font-size-base) !important;
    font-family: var(--font-family-lt) !important;
    color: var(--color-primary-dark) !important;
    line-height: var(--line-height-normal) !important;
    background-color: var(--color-background) !important;
    -webkit-font-smoothing: antialiased !important;
    box-sizing: border-box !important;
}

body {
    font-family: var(--font-family-lt) !important;
    margin: 0;
    padding: 0;
    height: 100vh;
    background-color: var(--color-background) !important;
    font-size: 1rem;
    /* equal to 16px */
    line-height: 1.5;
    /* improves readability */

}

*,
*::before,
*::after {
    box-sizing: inherit;

    ;
}

button,
input {
    font: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
}

/* ===============================
 App
 =============================== */
.app {
    display: grid;
    grid-template-columns: 184px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* ===============================
 Sidebar
 =============================== */
.sidebar {
    background: var(--color-white);
    border-right: 1px solid var(--color-border-subtle);
    display: flex;
    flex-direction: column;
    padding: 10px 8px 12px;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    transition: width 0.25s ease;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .history,
.sidebar.collapsed .profile-name {
    display: none;
}

.sidebar.collapsed .sidebar-top {
    justify-content: center;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding-inline: 0;
}

.sidebar.collapsed .profile-row {
    justify-content: center;
}

.sidebar.collapsed .profile-left {
    justify-content: center;
}

.sidebar.collapsed .sidebar-footer {
    margin-top: auto;
    padding-inline: 0;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    padding: 4px 6px 12px;
}

.sidebar.collapsed .sidebar-top {
    justify-content: center;
    padding-inline: 0;
}

.sidebar.collapsed .logo {
    display: none;
}

.sidebar.collapsed .icon-btn {
    width: 100%;
    display: grid;
    place-items: center;
}

.sidebar.collapsed .icon-btn svg {
    opacity: 1;
    visibility: visible;
}

/* ===============================
 Logo
 =============================== */
.logo {
    display: flex;
    align-items: center;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--text);
}

.logo img {
    display: block;
    width: 100px;
    height: 20px;
    object-fit: contain;
}

/* ===============================
 Icone Button
 =============================== */
.icon-btn {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--color-primary-dark);
    flex-shrink: 0;
    overflow: visible;
}

.icon-btn:hover,
.nav-item:hover,
.history-item:hover,
.composer-pill:hover,
.action-btn:hover,
.top-action:hover,
.tab:hover {
    color: var(--color-primary-light);
    background: var(--color-secondary);
}

/* ===============================
 Sidebar Nav
 =============================== */
.sidebar-nav {
    display: grid;
    gap: 4px;
}

.nav-item,
.history-item,
.team-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* ===============================
 History
 =============================== */
.history {
    margin-top: 10px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item.active {
    background: var(--color-secondary);
    color: var(--color-secondary-text);
}

.history-item span,
.profile-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===============================
 Sidebar Footer
 =============================== */
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    display: grid;
    gap: 4px;
    margin-top: auto;
    flex-shrink: 0;
}

/* ===============================
 Profile Row
 =============================== */
.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 12px;
}

.profile-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}


.profile-name {
    font-size: 14px;
    color: #5e594f;
    max-width: 108px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #159a8c;
    flex-shrink: 0;
}

/* =========================
main
========================= */
.main {
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    overflow: hidden;
}

/* =========================
Topbar
========================= */
.topbar {
    height: 44px;
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: var(--color-surface);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* Hide topbar when in composer-only mode */
.topbar.hidden {
    display: none !important;
}

/* =========================
Tabs
========================= */
.tabs {
    display: flex;
    align-items: center;
    margin: 0 auto;
    gap: 18px;
    transform: translateX(38px);
}

.tab {
    height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: #59554d;
    border-bottom: 2px solid transparent;
    padding: 0 2px;
}

.tab.active {
    color: var(--text);
    border-bottom-color: var(--text);
    font-weight: 500;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-action {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #3f3b35;
}

.download-btn {
    background: #1f1d1a;
    color: #fff;
    border-color: #1f1d1a;
}

.content {
    overflow-y: auto;
    min-height: 0;
    padding: 28px 32px 0;
    background: var(--color-background);
}

/* =========================
Dynamic Chat Messages
========================= */
#dynamic-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

/* =========================
Chat Turn
========================= */
.chat-turn {
    position: relative;
    width: 100%;
    min-height: 140px;
}

/* =========================
User Chip
========================= */
.user-chip {
    position: absolute;
    top: 32px;
    right: 290px;
    background: var(--color-secondary);
    color: var(--color-text-secondary);
    padding: 10px 15px;
    border-radius: 14px;
    font-size: 14px;
    max-width: 420px;
    word-break: break-word;
    white-space: pre-wrap;
}

/* =========================
Answer Wrap
========================= */
.answer-wrap {
    width: min(700px, 100%);
    margin: 88px auto 0;
}

/* =========================
thinking
========================= */
.thinking {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.thinking .divider-arrow {
    color: var(--color-light-gray);
    font-size: 16px;
    transform: translateY(-1px);
}

.answer-text {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 22px;
}

/* =========================
User Action and Reaction
========================= */
.assistant-actions-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}


.under-actions,
.reaction-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-secondar);
}

.action-btn {
    position: relative;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}


.action-btn:hover {
    background: var(--color-secondary);
    color: var(--color-primary-light);
}

.action-btn.active {
    background: var(--color-secondary);
    color: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

.action-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--color-primary-dark);
    color: var(--color-white);
    font-size: 11px;
    line-height: 1;
    padding: 6px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.15s ease;
    z-index: 1000;
}

.action-btn:hover::after,
.action-btn:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.action-toast {
    position: fixed;
    top: 60px;
    right: 1%;
    transform: translateX(-50%) translateY(10px);
    background: var(--color-primary-dark);
    color: var(--color-white);
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
}

.action-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.action-toast.error {
    background: var(--color-error);
}

.action-toast.success {
    background: var(--color-primary-dark);
}

/* =========================
Composer Wrap
========================= */
.composer-wrap {
    padding: 18px 24px 14px;
    display: flex;
    justify-content: center;
    background: var(--color-background);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* New chat mode */
.composer-wrap.composer-centered {
    min-height: calc(100vh - 120px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.composer {
    width: min(660px, calc(100% - 32px));
    background: var(--color-background);
    border: 2px solid var(--color-border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 14px 16px 12px;

}

.composer input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 17px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.composer input::placeholder {
    color: #8e887d;
}

.composer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.composer-left,
.composer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.composer-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-background);
}

.composer-icon:hover {
    color: var(--color-primary-light);
    background: var(--color-secondary);
}

.composer-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(-color-border-subtle);
    border-radius: 999px;
    color: var(--color-text-secondary);
    background: var(--color-background);
    font-size: 14px;
}

/* =========================
Send Button
========================= */
.send-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-gray-400);
    color: var(--color-primary-dark);
    display: grid;
    place-items: center;
    opacity: 0.45;
    cursor: not-allowed;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.send-btn.active {
    opacity: 1;
    cursor: pointer;
    background: var(--color-primary-dark);
    color: var(--color-white);

}

.send-btn:hover {
    background: var(--color-primary-light);
    color: var(--color-white);
}

/* =========================
Responsive
========================= */
@media (max-width: 1100px) {
    .user-chip {
        right: 120px;
    }
}

@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .tabs {
        transform: none;
        margin: 0;
    }

    .topbar {
        padding-inline: 10px;
    }

    .content {
        padding: 24px 18px 0;
    }

    .user-chip {
        position: static;
        width: fit-content;
        margin-left: auto;
        margin-bottom: 18px;
    }

    .answer-wrap,
    .reaction-actions {
        width: 100%;
    }

    .topbar-right .download-btn {
        display: none;
    }
}

@media (max-width: 640px) {
    .topbar {
        flex-wrap: wrap;
        height: auto;
        padding-block: 8px;
        gap: 8px;
    }

    .tabs {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .topbar-right {
        margin-left: auto;
    }

    .composer-wrap {
        padding-inline: 12px;
    }

    .composer {
        width: 100%;
    }
}

.hidden {
    display: none !important;
}

/* =========================
Screener table Wrapper
========================= */
.screener-table-wrapper table {
    margin-top: 8px;
    width: 100%;
    font-size: 12px;
}

/* =========================
Avatar
========================= */
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ddd;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================
User Profile Menu
========================= */
.user-profile-menu {
    position: absolute;
    bottom: 70px;
    left: 1;
    width: 260px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 999;
}

.user-profile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header */
.user-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary-dark);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 10px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-username {
    font-size: 12px;
    color: #777;
}

/* Divider */
hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 6px 0;
}

/* =========================
MENU-ITEM
========================= */

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item:hover {
    background: #f5f5f5;
    cursor: pointer;
}

/* =========================
PROFILE MINI AVATAR
========================= */
.avatar-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-primary-dark);
    color: var(--color-white);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-icon {
    font-size: 20px;
    color: #555;
}

.arrow-icon {
    font-size: 18px;
    color: #999;
}

.menu-item-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-item.logout a {
    color: #292529 !important;
}

/* =========================
LOACK ICON
========================= */
.lock-icon {
    font-size: 14px !important;
    line-height: 1 !important;
    vertical-align: middle;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
    font-size: 16px;
    line-height: 1;
    display: inline-block;
}


/* =========================
Auth Modal
========================= */
.auth-modal {
    display: none;
}

.auth-modal.show {
    display: flex;
}

.auth-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-modal-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.auth-modal-actions {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
}

.auth-btn.primary {
    background: var(--color-primary-dark);
    color: var(--color-white);
}

.auth-btn.google {
    background: var(--color-white);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-border-subtle);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
}

.google-icon {
    flex-shrink: 0;
}

.social-form {
    margin: 0;
}

.social-form .auth-btn.google {
    width: 100%;
    gap: 10px;
}

/* ===============================
 FREQUENTLY ASK QUESTIONS
 =============================== */

.qa-section {
    padding: 72px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.qa-shell {
    max-width: 920px;
    margin: 0 auto;
}

.qa-header {
    text-align: center;
    margin-bottom: 32px;
}

.qa-kicker {
    display: inline-block;
    margin-bottom: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--color-bg-8);
    color: var(--color-primary-dark);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qa-title {
    margin: 0 0 12px;
    color: var(--color-primary-dark);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.15;
    font-weight: 800;
}

.qa-subtitle {
    max-width: 680px;
    margin: 0 auto;
    color: var(--color-secondary-text);
    font-size: 16px;
    line-height: 1.7;
}

.qa-list {
    display: grid;
    gap: 14px;
}

.qa-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.qa-item:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.qa-question {
    margin: 0;
}

.qa-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    text-align: left;
    cursor: pointer;
    color: var(--color-primary-dark);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
}

.qa-toggle:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: -3px;
}

.qa-icon {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.qa-icon::before,
.qa-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background: #334155;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.qa-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.qa-toggle[aria-expanded="true"] .qa-icon::after {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg) scale(0.7);
}

.qa-answer {
    padding: 0 24px 22px;
    color: #475569;
    font-size: 15.5px;
    line-height: 1.75;
}

.qa-answer-inner {
    max-width: 72ch;
}

.qa-answer-inner p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--color-secondary-text);
}

.qa-answer-inner p+p {
    margin-top: 14px;
}


@media (max-width: 767px) {
    .qa-section {
        padding: 56px 14px;
    }

    .qa-header {
        text-align: left;
        margin-bottom: 24px;
    }

    .qa-title {
        font-size: clamp(24px, 7vw, 34px);
    }

    .qa-toggle {
        padding: 18px 18px;
        font-size: 15.5px;
    }

    .qa-answer {
        padding: 0 18px 18px;
        font-size: 14.5px;
    }

    .qa-answer-inner p {
        font-size: 14.5px;
        line-height: 1.8;
    }

    .qa-answer-inner p+p {
        margin-top: 12px;
    }
}
@media (max-width: 640px) {
  .faq-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
    border-radius: 16px;
  }
}
/* =========================
FAQ Modal
========================= */
.faq-modal {
    display: none;
}

.faq-modal.show {
    display: flex;
}

.faq-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.faq-modal-card {
    position: relative;
    width: min(100%, 560px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    padding: 10px 5px 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.faq-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(90vh - 80px);
    padding-right: 4px;
}

/* Scrollbar styling for modal body */
.faq-modal-body::-webkit-scrollbar {
    width: 6px;
}

.faq-modal-body::-webkit-scrollbar-track {
    background: var(--color-cream);
    border-radius: var(--radius-full);
}

.faq-modal-body::-webkit-scrollbar-thumb {
    background: var(--color-border-subtle);
    border-radius: var(--radius-full);
}

.faq-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-light);
}

#faqCloseBtn {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

#faqCloseBtn:hover {
    background: #e2e8f0;
}

#faqCloseBtn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .faq-modal-backdrop {
        padding: 10px;
        align-items: flex-end;
    }

    .faq-modal-card {
        width: 100%;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
        padding: 20px 16px 16px;
    }

    .modal-body {
        max-height: calc(92vh - 72px);
    }

    #faqCloseBtn {
        top: 10px;
        right: 10px;
        min-width: 40px;
        min-height: 40px;
        padding: 9px 12px;
        font-size: 13px;
        border-radius: 9px;
    }
}

@media (max-width: 480px) {
    .faq-modal-backdrop {
        padding: 0;
    }

    .faq-modal-card {
        max-height: 100vh;
        border-radius: 18px 18px 0 0;
        padding: 18px 14px 14px;
    }

    .modal-body {
        max-height: calc(100vh - 64px);
    }

    #faqCloseBtn {
        top: 8px;
        right: 8px;
        min-width: 38px;
        min-height: 38px;
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 8px;
    }
}

@media (min-width: 1024px) {
    #faqCloseBtn {
        top: 14px;
        right: 14px;
        min-width: 46px;
        min-height: 46px;
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* =========================
SCREENER TABLE 
========================= */
.screener-table-wrapper {
    margin-top: 12px;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.screener-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
    font-size: 14px;
    color: #111827;
}

.screener-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0f172a;
    color: #ffffff;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 12px 14px;
    border-bottom: 1px solid #1f2937;
    white-space: nowrap;
}

.screener-table thead th:first-child {
    border-top-left-radius: 14px;
}

.screener-table thead th:last-child {
    border-top-right-radius: 14px;
}

.screener-table tbody tr {
    transition: background-color 0.18s ease;
}

.screener-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.screener-table tbody tr:hover {
    background: #eef6ff;
}

.screener-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.screener-table tbody tr:last-child td {
    border-bottom: none;
}

.screener-table .col-symbol {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.screener-table .col-company {
    min-width: 260px;
    color: #1f2937;
}

.screener-table .col-exchange {
    white-space: nowrap;
    font-weight: 600;
    color: #334155;
}

.screener-table .col-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.screener-table .negative {
    color: #b91c1c;
    font-weight: 600;
}

.screener-table .positive {
    color: #047857;
    font-weight: 600;
}

.status-qualified {
    color: #15803d;
    font-weight: 600;
}

.status-emerging {
    color: #f59e0b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .screener-table {
        min-width: 100%;
        border-collapse: collapse;
    }

    .screener-table thead {
        display: none;
    }

    .screener-table tbody,
    .screener-table tr,
    .screener-table td {
        display: block;
        width: 100%;
    }

    .screener-table tbody tr {
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        padding: 10px 12px;
    }

    .screener-table tbody tr:nth-child(even) {
        background: #ffffff;
    }

    .screener-table td {
        border: none;
        padding: 8px 0;
        text-align: right;
    }

    .screener-table td::before {
        content: attr(data-label);
        float: left;
        color: #64748b;
        font-weight: 600;
        text-align: left;
        margin-right: 12px;
    }

    .screener-table .col-company {
        min-width: 0;
    }
}
/* Disable Span Text */
.disabled-text {
   opacity: 0.5;
  cursor: not-allowed;
}