/**
 * Watchlist UI Stylesheet (browser/styles.css)
 * Iranian Stock Market Analyzer
 * Website: tjb24.ir
 * Strict adherence to reference design: clean fintech, RTL layout, responsive
 */

:root {
    /* OLED Minimal Design Tokens (tjb24.ir 4-Zone Architecture) */
    --bg-app: #020617;
    --surface-card: #0f172a;
    --surface-card-hover: #1e293b;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);

    /* AI Hero Tokens */
    --color-ai-hero: #8b5cf6;
    --color-ai-hero-hover: #7c3aed;
    --color-ai-bg: rgba(139, 92, 246, 0.14);
    --color-ai-border: rgba(139, 92, 246, 0.35);

    /* Card Metrics & Layout Tokens */
    --card-radius: 14px;
    --transition-smooth: 180ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Brand & Accent Colors */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-border: #c7d2fe;

    /* Status Colors */
    --positive: #10b981;
    --positive-dark: #059669;
    --positive-bg: #f0fdf4;
    --positive-border: #bbf7d0;

    --negative: #ef4444;
    --negative-dark: #dc2626;
    --negative-bg: #fef2f2;
    --negative-border: #fecaca;

    --neutral: #64748b;
    --gold: #f59e0b;

    /* Surface & Background */
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Shadows & Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-card: 20px;
    --radius-full: 9999px;

    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 25px -3px rgba(0, 0, 0, 0.08);
    --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Fonts */
    --font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Reset & Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    direction: rtl;
    text-align: right;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    transition: all 0.2s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* App Wrapper */
.app-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 32px 48px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Header Section */
.app-header {
    background: transparent;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

/* Header Branding (Right side in RTL) */
.header-branding {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: var(--radius-full);
    min-width: 38px;
    height: 28px;
}

.badge-sync {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
    cursor: default;
}

.badge-sync i, .badge-sync svg {
    width: 14px;
    height: 14px;
}

.badge-sync-live {
    background-color: var(--positive-bg);
    color: var(--positive-dark);
    border: 1px solid var(--positive-border);
}

.badge-sync-fallback {
    background-color: #fefce8;
    color: #b45309;
    border: 1px solid #fef08a;
}

.badge-sync-connecting {
    background-color: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.header-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Header Controls (Left side in RTL) */
.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.search-input {
    width: 260px;
    height: 44px;
    padding: 0 42px 0 36px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    width: 320px;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.clear-search-btn {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search-btn:hover {
    color: var(--text-primary);
}

/* Dropdown Control Buttons */
.dropdown-wrapper {
    position: relative;
}

.btn-control {
    height: 44px;
    padding: 0 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-control:hover, .btn-control[aria-expanded="true"] {
    background-color: #f1f5f9;
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-icon {
    width: 17px;
    height: 17px;
    color: var(--text-muted);
}

.chevron-icon {
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.btn-control[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-modal);
    min-width: 190px;
    z-index: 50;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
}

.dropdown-menu.show {
    display: flex;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    text-align: right;
    padding: 9px 14px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.dropdown-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Primary Action Button (Add Stock) */
.btn-primary {
    height: 44px;
    padding: 0 20px;
    background-color: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary .btn-icon {
    color: #ffffff;
    width: 18px;
    height: 18px;
}

.btn-about {
    height: 44px;
    padding: 0 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-about:hover {
    background-color: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}

.btn-about:active {
    transform: translateY(0);
}

.btn-about .btn-icon {
    color: var(--primary);
    width: 18px;
    height: 18px;
}

/* Main Container */
.main-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Filter Indicator Bar */
.filter-indicator-bar {
    background-color: #f1f5f9;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.btn-reset-filters {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-reset-filters:hover {
    text-decoration: underline;
}

/* Stocks Cards Container */
.stocks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.25rem;
    min-height: 300px;
}

/* Stock Card (4-Zone Minimal Architecture) */
.stock-card {
    background-color: var(--surface-card, #0f172a);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: var(--card-radius, 14px);
    padding: 1rem;
    box-shadow: var(--shadow-card, 0 4px 20px -2px rgba(0, 0, 0, 0.25));
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all var(--transition-smooth, 0.2s cubic-bezier(0.16, 1, 0.3, 1));
    position: relative;
    box-sizing: border-box;
    overflow: visible;
}

.stock-card:hover {
    background-color: var(--surface-card-hover, #1e293b);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.35), 0 0 16px -4px rgba(139, 92, 246, 0.18);
    transform: translateY(-2px);
}

/* Backward compatibility for legacy 3-column markup */
.stock-card:has(.card-identity-col) {
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    align-items: center;
    gap: 28px;
    padding: 24px 28px;
    background-color: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
}

/* ==========================================================================
   Minimal 4-Zone Card Layout & Dropdown Menus
   Zone 1: .card-zone-header (Avatar, Symbol, Company, Price, Change, Star)
   Zone 2: .card-zone-hero (.ai-hero-pill & .sparkline-wrap)
   Zone 3: .card-zone-stats (Market Cap, Volume, P/E, Smart Money)
   Zone 4: .card-zone-actions (.btn-live-avatar, .btn-summary-minimal, .quick-actions-menu)
   Author: alimohammadzadeh@ut.ac.ir | Website: tjb24.ir
   ========================================================================== */

/* ZONE 1: Identity & Price Header */
.card-zone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.zone-header-identity {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.zone-header-avatar,
.card-zone-header .stock-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.25) 0%, rgba(139, 92, 246, 0.3) 100%);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zone-header-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.zone-header-symbol,
.card-zone-header .stock-symbol-text,
.card-zone-header .stock-symbol {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.2;
    white-space: nowrap;
}

.zone-header-company,
.card-zone-header .stock-company-name,
.card-zone-header .stock-name {
    font-size: 0.75rem;
    font-weight: 400;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.zone-header-price-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.zone-header-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.zone-price-val,
.card-zone-header .stock-price {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    font-feature-settings: "tnum";
    white-space: nowrap;
}

.zone-price-unit {
    font-size: 0.65rem;
    color: #64748b;
}

.zone-change-badge,
.card-zone-header .change-badge,
.card-zone-header .price-change-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 7px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    font-feature-settings: "tnum";
    white-space: nowrap;
    direction: ltr;
}

.zone-change-badge.positive,
.card-zone-header .change-badge.positive,
.card-zone-header .price-change-chip.positive {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.zone-change-badge.negative,
.card-zone-header .change-badge.negative,
.card-zone-header .price-change-chip.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.card-zone-header .favorite-btn {
    color: #64748b;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.card-zone-header .favorite-btn:hover {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.card-zone-header .favorite-btn.favorited {
    color: #f59e0b;
}

.card-zone-header .favorite-btn svg {
    width: 18px;
    height: 18px;
}

/* ZONE 2: AI Hero Zone (.ai-hero-pill & .sparkline-wrap) */
.card-zone-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    border-radius: 10px;
}

.ai-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.65rem;
    background: var(--color-ai-bg, rgba(139, 92, 246, 0.14));
    border: 1px solid var(--color-ai-border, rgba(139, 92, 246, 0.35));
    border-radius: 9999px;
    cursor: pointer;
    transition: all var(--transition-smooth, 0.2s cubic-bezier(0.16, 1, 0.3, 1));
    user-select: none;
    text-decoration: none;
    white-space: nowrap;
}

.ai-hero-pill:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

.ai-hero-pill .ai-hero-badge,
.ai-hero-pill .ai-pill-score {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 800;
    color: #ffffff;
    font-feature-settings: "tnum";
}

.ai-hero-pill .ai-hero-badge svg,
.ai-hero-pill .ai-hero-badge [data-lucide] {
    width: 13px;
    height: 13px;
    color: #c4b5fd;
}

.ai-hero-pill .ai-hero-label,
.ai-hero-pill .ai-pill-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ddd6fe;
    padding: 0 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.ai-hero-pill .ai-hero-dots,
.ai-hero-pill .ai-pill-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ai-hero-pill .ai-hero-dot,
.ai-hero-pill .ai-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.ai-hero-pill .ai-hero-dot.dot-green,
.ai-hero-pill .ai-pill-dot.dot-green {
    background-color: #10b981;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
}

.ai-hero-pill .ai-hero-dot.dot-yellow,
.ai-hero-pill .ai-pill-dot.dot-yellow {
    background-color: #eab308;
    box-shadow: 0 0 4px rgba(234, 179, 8, 0.5);
}

.ai-hero-pill .ai-hero-dot.dot-red,
.ai-hero-pill .ai-pill-dot.dot-red {
    background-color: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

.ai-hero-pill:hover .ai-hero-dot,
.ai-hero-pill:hover .ai-pill-dot {
    transform: scale(1.15);
}

/* Micro-Sparkline Wrap */
.sparkline-wrap {
    flex: 1;
    min-width: 90px;
    max-width: 140px;
    height: 36px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sparkline-wrap canvas,
.stock-sparkline-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* ZONE 3: Metric Strip */
.card-zone-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    padding: 0.45rem 0.55rem;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    border-radius: 8px;
}

.card-zone-stats .stat-item,
.card-zone-stats .card-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
}

.card-zone-stats .stat-label {
    font-size: 0.67rem;
    color: #94a3b8;
    white-space: nowrap;
}

.card-zone-stats .stat-value,
.card-zone-stats .stat-val {
    font-size: 0.78rem;
    font-weight: 600;
    color: #f1f5f9;
    font-feature-settings: "tnum";
    white-space: nowrap;
}

.card-zone-stats .stat-value.flow-in,
.card-zone-stats .stat-val.flow-in {
    color: #10b981;
}

.card-zone-stats .stat-value.flow-out,
.card-zone-stats .stat-val.flow-out {
    color: #ef4444;
}

/* ZONE 4: Action Hub & Floating Quick Actions */
.card-zone-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    margin-top: 0.15rem;
}

.card-zone-actions .btn-live-avatar,
.card-zone-actions .btn-live-avatar-trigger {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.16);
    color: #a5b4fc;
    border: 1px solid rgba(79, 70, 229, 0.32);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.card-zone-actions .btn-live-avatar:hover,
.card-zone-actions .btn-live-avatar-trigger:hover {
    background: rgba(79, 70, 229, 0.28);
    border-color: rgba(79, 70, 229, 0.6);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.card-zone-actions .btn-summary-minimal,
.card-zone-actions .btn-summary-trigger {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.card-zone-actions .btn-summary-minimal:hover,
.card-zone-actions .btn-summary-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.card-zone-actions .btn-live-avatar svg,
.card-zone-actions .btn-live-avatar-trigger svg,
.card-zone-actions .btn-summary-minimal svg,
.card-zone-actions .btn-summary-trigger svg {
    width: 14px;
    height: 14px;
}

/* Quick Actions Dropdown Button & Menu */
.quick-actions-wrap,
.card-zone-actions .quick-actions-wrapper {
    position: relative;
    display: inline-flex;
}

.card-zone-actions .btn-quick-actions,
.card-zone-actions .btn-more-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-zone-actions .btn-quick-actions:hover,
.card-zone-actions .btn-more-actions:hover,
.card-zone-actions .btn-quick-actions.is-active,
.card-zone-actions .btn-more-actions.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.card-zone-actions .btn-quick-actions svg,
.card-zone-actions .btn-more-actions svg {
    width: 16px;
    height: 16px;
}

/* Floating Sleek Glass Quick Actions Dropdown */
.quick-actions-menu,
.quick-actions-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 190px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
    z-index: 50;
    display: none;
    flex-direction: column;
    gap: 2px;
    animation: quickActionsFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-actions-menu.is-active,
.quick-actions-dropdown.is-active,
.quick-actions-menu.show,
.quick-actions-dropdown.show {
    display: flex;
}

@keyframes quickActionsFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-actions-menu a,
.quick-actions-dropdown a,
.quick-actions-menu button,
.quick-actions-dropdown button,
.quick-actions-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    border: none;
    background: transparent;
    text-align: right;
    justify-content: flex-start;
}

.quick-actions-menu a:hover,
.quick-actions-dropdown a:hover,
.quick-actions-menu button:hover,
.quick-actions-dropdown button:hover,
.quick-actions-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.quick-actions-menu a svg,
.quick-actions-dropdown a svg,
.quick-actions-menu button svg,
.quick-actions-dropdown button svg,
.quick-actions-item svg,
.quick-actions-menu [data-lucide],
.quick-actions-dropdown [data-lucide] {
    width: 14px;
    height: 14px;
    opacity: 0.75;
    flex-shrink: 0;
}

.quick-actions-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

/* Column 1: Identity & Analysis (Far right in RTL) */
.card-identity-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.identity-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.identity-info-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Avatar Logo */
.stock-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    color: var(--primary);
    font-size: 1.15rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.identity-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stock-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

.identity-sub-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 3px;
}

.stock-symbol {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.stock-last-update {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    letter-spacing: -0.2px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.stock-card:hover .stock-last-update {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
}

.stock-last-update svg,
.stock-last-update [data-lucide] {
    width: 11px;
    height: 11px;
    color: var(--text-muted);
    opacity: 0.8;
    flex-shrink: 0;
}

/* Favorite Star */
.favorite-btn {
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.favorite-btn:hover {
    color: var(--gold);
    background-color: #fef3c7;
}

.favorite-btn.favorited {
    color: var(--gold);
}

.favorite-btn svg {
    width: 22px;
    height: 22px;
}

/* ==========================================================================
   TJB24.ir AI Score Widget & 4-Pillar Circular Gauges
   tjb24.ir | Author: alimohammadzadeh@ut.ac.ir
   ========================================================================== */

/* Title row with rating dot */
.stock-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Rating Indicator Dot */
.rating-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rating-indicator-dot.dot-green {
    background-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2), 0 0 6px rgba(16, 185, 129, 0.4);
}

.rating-indicator-dot.dot-yellow {
    background-color: #eab308;
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.2), 0 0 6px rgba(234, 179, 8, 0.4);
}

.rating-indicator-dot.dot-red {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2), 0 0 6px rgba(239, 68, 68, 0.4);
}

/* TJB24.ir Widget Wrap */
.tjb24-widget-wrap {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-sizing: border-box;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stock-card:hover .tjb24-widget-wrap {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Left Box: Main AI Score */
.tjb24-main-box {
    flex: 0 0 120px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 8px 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tjb24-main-box:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.tjb24-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 2px;
    width: 100%;
}

.tjb24-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.2px;
}

.tjb24-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.tjb24-info-btn:hover {
    background-color: #1d4ed8;
    transform: scale(1.1);
}

.tjb24-info-btn svg,
.tjb24-info-btn [data-lucide] {
    width: 10px;
    height: 10px;
    stroke-width: 2.5;
}

/* Main Gauge */
.tjb24-gauge-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 2px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tjb24-gauge-svg {
    width: 80px;
    height: 80px;
    display: block;
}

.gauge-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 6.5;
}

.gauge-progress {
    fill: none;
    stroke-width: 6.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.gauge-green {
    stroke: #10b981;
}

.gauge-yellow {
    stroke: #eab308;
}

.gauge-red {
    stroke: #ef4444;
}

.tjb24-gauge-score {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

/* TJB24.ir Recommendation Signal Label */
.tjb24-signal-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    margin: 4px 0 8px 0;
    white-space: nowrap;
}

.signal-text-green {
    color: #059669;
}

.signal-text-yellow {
    color: #d97706;
}

.signal-text-red {
    color: #dc2626;
}

/* Clickable Action Link: See AI Analysis */
.tjb24-analysis-link {
    width: calc(100% + 16px);
    margin: auto -8px 0 -8px;
    padding: 7px 4px;
    border: none;
    border-top: 1px solid #e2e8f0;
    background: transparent;
    color: #2563eb;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 0 0 11px 11px;
    white-space: nowrap;
}

.tjb24-analysis-link:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}

/* Right Block: 4 Sub-Scores Column */
.tjb24-subscores-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    padding: 2px 0;
}

.subscore-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.subscore-item:hover {
    background-color: #ffffff;
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.subscore-gauge-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.subscore-gauge-svg {
    width: 36px;
    height: 36px;
    display: block;
}

.subscore-gauge-wrap .gauge-bg {
    stroke: #e2e8f0;
    stroke-width: 3.5;
}

.subscore-gauge-wrap .gauge-progress {
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.subscore-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.subscore-labels {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.15;
}

.subscore-fa {
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.subscore-en {
    font-size: 0.66rem;
    font-weight: 500;
    color: #64748b;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

/* Recommendation Badge */
.recommendation-badge {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-sizing: border-box;
    width: 100%;
}

.recommendation-badge .badge-signal-part {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    white-space: nowrap;
}

.recommendation-badge .badge-signal-part svg,
.recommendation-badge .badge-signal-part [data-lucide] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.recommendation-badge .badge-divider {
    width: 1px;
    height: 14px;
    background-color: currentColor;
    opacity: 0.25;
    flex-shrink: 0;
}

.recommendation-badge .badge-score-part {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.recommendation-badge .badge-score-num {
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1;
}

.recommendation-badge .badge-score-max {
    font-size: 0.72rem;
    opacity: 0.75;
    font-weight: 500;
}

.recommendation-badge .badge-stars {
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-right: 4px;
    color: var(--gold);
    line-height: 1;
}

/* Signal Specific Color Themes */
/* Strong Buy: Emerald */
.signal-strong-buy {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border-color: #059669;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.22);
}
.signal-strong-buy .badge-signal-part svg {
    color: #059669;
}

/* Buy: Green */
.signal-buy {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.16);
}
.signal-buy .badge-signal-part svg {
    color: #10b981;
}

/* Hold: Amber */
.signal-hold {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.16);
}
.signal-hold .badge-signal-part svg {
    color: #f59e0b;
}

/* Sell: Orange */
.signal-sell {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: #9a3412;
    border-color: #f97316;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.16);
}
.signal-sell .badge-signal-part svg {
    color: #f97316;
}

/* Strong Sell: Red */
.signal-strong-sell {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.22);
}
.signal-strong-sell .badge-signal-part svg {
    color: #ef4444;
}

/* Analysis Buttons Container */
.analysis-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-analysis {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-align: center;
    cursor: pointer;
}

.btn-analysis svg {
    width: 18px;
    height: 18px;
}

/* Technical Report Button */
.btn-technical {
    background-color: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.btn-technical:hover {
    background-color: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

/* Fundamental Report Button */
.btn-fundamental {
    background-color: var(--positive-bg);
    color: var(--positive-dark);
    border-color: var(--positive-border);
}

.btn-fundamental:hover {
    background-color: #dcfce7;
    border-color: #86efac;
    transform: translateY(-1px);
}

/* Executive Summary Button */
.btn-summary {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    color: #6d28d9;
    border-color: #ddd6fe;
}

.btn-summary:hover {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-color: #c4b5fd;
    color: #5b21b6;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.15);
}

.btn-summary svg,
.btn-summary [data-lucide] {
    color: #7c3aed;
}

.btn-summary > *,
.recommendation-badge > * {
    pointer-events: none;
}

/* Re-analyze Stock Button */
.btn-reanalyze {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    background-color: #f8fafc;
    color: #475569;
    border: 1px dashed #cbd5e1;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
    margin-top: 4px;
}

.btn-reanalyze:hover {
    background-color: #eef2ff;
    color: var(--primary);
    border-color: var(--primary);
    border-style: solid;
    transform: translateY(-1px);
}

.btn-reanalyze svg {
    width: 16px;
    height: 16px;
}

/* Animation utilities & button states */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.btn-reanalyze.loading {
    cursor: wait;
    opacity: 0.8;
}

.btn-reanalyze.loading svg,
.btn-reanalyze.loading [data-lucide] {
    animation: spin 1s linear infinite;
}

.btn-reanalyze:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Column 2: Stats & External Links (Center in RTL) */
.card-stats-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    padding: 0 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    direction: ltr;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Change Percent Styling */
.stat-value.is-positive {
    color: var(--positive-dark);
}

.stat-value.is-negative {
    color: var(--negative-dark);
}

.change-arrow {
    width: 16px;
    height: 16px;
}

/* External Links Row */
.external-links-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-external {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.btn-external:hover {
    background-color: #f8fafc;
    border-color: var(--border-hover);
    color: var(--primary);
}

.btn-external.btn-github {
    background-color: #f8fafc;
    color: #1e293b;
    border-color: #cbd5e1;
}

.btn-external.btn-github:hover {
    background-color: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    transform: translateY(-1px);
}

.btn-external svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.btn-external:hover svg {
    color: var(--primary);
}

/* Column 3: 14-Day Chart (Far left in RTL) */
.card-chart-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-header-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
}

.chart-canvas-wrap {
    position: relative;
    width: 100%;
    height: 140px;
}

/* Loading & Empty States */
.loading-state, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    gap: 16px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.empty-icon {
    width: 32px;
    height: 32px;
}

.empty-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.empty-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* Pagination Bar */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding: 16px 20px;
    background-color: transparent;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background-color: #f1f5f9;
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.page-btn.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    font-weight: 700;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn.page-ellipsis {
    border: none;
    background: transparent;
    cursor: default;
}

.page-btn svg {
    width: 16px;
    height: 16px;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-size-select {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    font-size: 0.88rem;
    cursor: pointer;
}

.page-size-select:focus {
    border-color: var(--primary);
}

/* Modal Dialog */
.modal-backdrop,
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-dialog {
    background-color: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 520px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.modal-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.modal-close-btn {
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background-color: #f1f5f9;
}

.modal-close-btn svg {
    width: 20px;
    height: 20px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.required-star {
    color: var(--negative);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-input.has-error, .form-textarea.has-error, .form-select.has-error {
    border-color: var(--negative);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.select-wrapper .form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-left: 38px;
    cursor: pointer;
}

.select-wrapper .select-chevron {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.field-error {
    color: var(--negative);
    font-size: 0.8rem;
    display: none;
}

.field-error.show {
    display: block;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.btn-secondary {
    height: 42px;
    padding: 0 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
}

/* About Us & Agentic AI Modal */
.about-modal-dialog {
    max-width: 780px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 28px 32px;
}

.modal-title-with-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.about-agentic-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(99, 102, 241, 0.06));
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 0.92rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-lead {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(99, 102, 241, 0.02));
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.about-lead-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 0.98rem;
}

.about-lead-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.about-lead p {
    color: var(--text-primary);
    font-size: 0.92rem;
    line-height: 1.8;
}

.about-steps-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

.section-icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.about-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-step-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.about-step-card:hover {
    background-color: #ffffff;
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.06);
    transform: translateY(-1px);
}

.about-step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.about-step-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.about-step-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.about-step-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.about-badge-tag {
    display: inline-block;
    padding: 2px 8px;
    background-color: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    font-weight: 600;
}

.about-step-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.about-step-desc strong {
    color: var(--text-primary);
}

.about-footer-info {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.about-info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.7;
}

.about-info-row a {
    color: var(--primary);
    text-decoration: underline;
}

.about-info-row a:hover {
    color: var(--primary-hover);
}

.disclaimer-row {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.82rem;
    color: #92400e;
}

.info-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 3px;
}

.text-warning {
    color: #d97706;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-modal);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
    color: var(--text-primary);
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast.toast-success {
    border-right: 4px solid var(--positive);
}

.toast.toast-error {
    border-right: 4px solid var(--negative);
}

.toast.toast-info {
    border-right: 4px solid var(--primary);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--positive); }
.toast-error .toast-icon { color: var(--negative); }
.toast-info .toast-icon { color: var(--primary); }

/* Summary Hover Popover (Fintech Glassmorphism with 300ms delay) */
.summary-hover-popover {
    position: fixed;
    z-index: 900;
    max-width: 400px;
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.88rem;
    line-height: 1.65;
    direction: rtl;
    text-align: right;
}

.summary-hover-popover.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Directional Indicator Arrow */
.summary-hover-popover::after {
    content: '';
    position: absolute;
    top: -6px;
    right: 28px;
    width: 12px;
    height: 12px;
    background: rgba(15, 23, 42, 0.94);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    transform: rotate(-45deg);
    pointer-events: none;
}

.summary-hover-popover.arrow-bottom::after {
    top: auto;
    bottom: -6px;
    border-top: none;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.summary-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-popover-title {
    font-weight: 700;
    color: #a78bfa;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-popover-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.summary-popover-body {
    color: #e2e8f0;
    font-size: 0.85rem;
    line-height: 1.65;
}

.summary-popover-footer {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    color: #94a3b8;
}

.summary-popover-footer svg,
.summary-popover-footer [data-lucide] {
    width: 11px;
    height: 11px;
    opacity: 0.8;
}

/* Executive Summary Modal (#summaryModal) */
.summary-modal-dialog {
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 32px;
}

.summary-modal-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(109, 40, 217, 0.08);
    color: #6d28d9;
    border: 1px solid rgba(109, 40, 217, 0.2);
}

.summary-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.summary-modal-lead {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.06) 0%, rgba(79, 70, 229, 0.03) 100%);
    border: 1px solid rgba(109, 40, 217, 0.2);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-lead-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6d28d9;
    font-weight: 700;
    font-size: 0.98rem;
}

.summary-lead-icon {
    width: 20px;
    height: 20px;
    color: #7c3aed;
}

.summary-text-content {
    font-size: 0.96rem;
    line-height: 1.85;
    color: var(--text-primary);
    text-align: justify;
}

.summary-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.summary-metric-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.summary-metric-val {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-metric-val.text-success {
    color: var(--positive-dark);
}

.summary-metric-val.text-danger {
    color: var(--negative-dark);
}

.summary-modal-footer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.summary-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-meta-item .meta-icon {
    width: 16px;
    height: 16px;
}

.summary-meta-item .text-gold {
    color: var(--gold);
}

.summary-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.btn-github-modal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: #0f172a;
    color: #ffffff;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid #0f172a;
}

.btn-github-modal:hover {
    background-color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
    color: #ffffff;
}

.btn-github-modal svg {
    width: 18px;
    height: 18px;
}

.btn-xai-modal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #ffffff;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid #1d4ed8;
    cursor: pointer;
}

.btn-xai-modal:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    color: #ffffff;
}

.btn-xai-modal svg,
.btn-xai-modal i {
    width: 18px;
    height: 18px;
}

/* Explainable AI (XAI) Modal */
.xai-modal-dialog {
    max-width: 820px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 24px 28px 20px;
}

.xai-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.xai-header-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xai-modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.xai-header-badges-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.xai-modal-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 700;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.xai-modal-update-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.xai-modal-update-badge i,
.xai-modal-update-badge svg {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

/* Tab Bar */
.xai-tab-bar {
    overflow-x: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 2px 10px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.xai-tab-bar::-webkit-scrollbar {
    height: 4px;
}

.xai-tab-bar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

.xai-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.xai-tab-btn i,
.xai-tab-btn svg {
    width: 15px;
    height: 15px;
}

.xai-tab-btn:hover:not(.active) {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.xai-tab-btn.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #93c5fd;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

/* Modal Body & Panels */
.xai-modal-body {
    overflow-y: auto;
    padding: 18px 4px 10px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1 1 auto;
    max-height: calc(90vh - 210px);
}

.xai-panel-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Overview Banner */
.xai-overview-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 16px 20px;
    gap: 16px;
}

.xai-overview-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.xai-overview-gauge-wrap {
    position: relative;
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.xai-overview-gauge-svg {
    width: 76px;
    height: 76px;
}

.xai-overview-gauge-score {
    position: absolute;
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
}

.xai-overview-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xai-overview-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
}

.xai-overview-signal {
    display: inline-flex;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    width: fit-content;
}

/* Section Header */
.xai-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.xai-section-title i,
.xai-section-title svg {
    width: 17px;
    height: 17px;
    color: #2563eb;
}

/* Formula Box */
.xai-formula-box {
    background: #0f172a;
    color: #38bdf8;
    padding: 14px 18px;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.65;
    direction: ltr;
    text-align: left;
    overflow-x: auto;
    border: 1px solid #1e293b;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Pillars Grid (Overview) */
.xai-pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.xai-pillar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.xai-pillar-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.xai-pillar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.xai-pillar-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.xai-pillar-weight {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 600;
}

.xai-pillar-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.xai-pillar-score {
    font-size: 1.15rem;
    font-weight: 800;
}

.xai-pillar-progress-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.xai-pillar-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Pillar Header Banner */
.xai-pillar-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.xai-pillar-banner-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.xai-pillar-badge-score {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
}

.xai-pillar-badge-score span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.xai-pillar-grade-badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 700;
}

/* Raw Inputs Badge Grid */
.xai-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.xai-badge-chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xai-chip-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.xai-chip-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    direction: ltr;
    text-align: right;
    font-family: inherit;
}

/* Verified Data Sources */
.xai-sources-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.xai-source-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    background: #ffffff;
    gap: 10px;
    flex-wrap: wrap;
}

.xai-source-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.xai-source-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.xai-source-doc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.xai-source-recency {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    padding: 3px 9px;
    border-radius: 4px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 600;
    border: 1px solid #a7f3d0;
}

.xai-source-recency i,
.xai-source-recency svg {
    width: 12px;
    height: 12px;
}

/* Analytical Rationale Box */
.xai-rationale-box {
    background: #f0fdf4;
    border-right: 4px solid #10b981;
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 0.94rem;
    line-height: 1.85;
    color: #064e3b;
    text-align: justify;
}

/* Footer & Buttons */
.xai-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

/* Responsive Grid Breakpoints & Mobile Optimization */
@media (min-width: 1024px) {
    .stocks-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .stocks-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stock-card {
        padding: 0.875rem;
        gap: 0.65rem;
    }
}

@media (max-width: 768px) {
    html,
    body,
    .app-wrapper {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .app-wrapper {
        padding: 12px 10px;
    }

    /* Mobile Stock Grid */
    .stocks-container {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    /* Mobile Compact Stock Card (< 200px height) */
    .stock-card {
        padding: 0.65rem 0.75rem;
        gap: 0.45rem;
        max-height: 198px;
        box-sizing: border-box;
        overflow: visible;
    }

    .card-zone-header {
        gap: 0.5rem;
        padding-bottom: 0.35rem;
    }

    .card-zone-header .stock-avatar,
    .zone-header-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .card-zone-header .stock-symbol-text,
    .zone-header-symbol {
        font-size: 0.95rem;
    }

    .card-zone-header .stock-company-name,
    .zone-header-company {
        font-size: 0.7rem;
        max-width: 110px;
    }

    .card-zone-header .stock-price,
    .zone-price-val {
        font-size: 0.9rem;
    }

    .card-zone-hero {
        padding: 0.35rem 0.5rem;
        gap: 0.5rem;
    }

    .ai-hero-pill {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .sparkline-wrap {
        height: 30px;
        min-width: 75px;
    }

    .card-zone-stats {
        padding: 0.35rem 0.45rem;
        gap: 0.25rem;
    }

    .card-zone-stats .stat-label {
        font-size: 0.62rem;
    }

    .card-zone-stats .stat-value,
    .card-zone-stats .stat-val {
        font-size: 0.74rem;
    }

    .card-zone-actions {
        gap: 0.4rem;
        margin-top: 0.1rem;
    }

    /* Mobile Touch Targets >= 44px */
    .card-zone-header .favorite-btn,
    .favorite-btn {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }

    .card-zone-actions .btn-quick-actions,
    .card-zone-actions .btn-more-actions,
    .btn-quick-actions,
    .btn-more-actions {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }

    .card-zone-actions .btn-live-avatar,
    .card-zone-actions .btn-live-avatar-trigger,
    .btn-live-avatar,
    .btn-live-avatar-trigger {
        min-height: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }

    .card-zone-actions .btn-summary-minimal,
    .card-zone-actions .btn-summary-trigger,
    .btn-summary-minimal,
    .btn-summary-trigger {
        min-height: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }

    .quick-actions-menu a,
    .quick-actions-dropdown a,
    .quick-actions-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Two-Tier Mobile Header */
    .app-header {
        padding: 0.75rem 0.5rem;
    }

    .header-container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .header-branding {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        width: 100%;
    }

    .header-title-row {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }

    .header-title {
        font-size: 1.05rem;
    }

    .header-subtitle {
        font-size: 0.78rem;
    }

    .header-controls {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
    }

    .search-box {
        flex: 1 1 100%;
        width: 100%;
        min-height: 44px;
    }

    .search-input {
        width: 100% !important;
        min-height: 44px;
    }

    .dropdown-wrapper {
        flex: 1 1 auto;
    }

    .btn-control,
    .btn-about,
    .btn-primary {
        min-height: 44px;
        touch-action: manipulation;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .stocks-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stock-card {
        padding: 0.875rem;
        gap: 0.65rem;
        max-height: none;
    }
}

/* Legacy Scoped Media Queries (preserved for backward compatibility) */
@media (max-width: 1180px) {
    .stock-card.legacy-card {
        grid-template-columns: 280px 1fr 300px;
        gap: 20px;
        padding: 20px;
    }
}

@media (max-width: 992px) {
    .stock-card.legacy-card {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .card-identity-col {
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 16px;
    }

    .analysis-buttons-group {
        flex-direction: row;
    }

    .btn-analysis {
        flex: 1;
    }

    .card-stats-col {
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 16px;
    }

    .app-wrapper {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
    }

    .header-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box, .search-input {
        width: 100% !important;
    }

    .dropdown-wrapper {
        width: 100%;
    }

    .btn-control {
        width: 100%;
        justify-content: space-between;
    }

    .dropdown-menu {
        width: 100%;
    }

    .btn-about {
        width: 100%;
        justify-content: center;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .about-modal-dialog {
        padding: 20px 16px;
        max-height: 92vh;
    }

    .about-step-card {
        flex-direction: column;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analysis-buttons-group {
        flex-direction: column;
    }

    .pagination-bar {
        flex-direction: column;
        align-items: center;
    }

    .xai-modal-dialog {
        padding: 16px;
        width: 96%;
    }

    .xai-overview-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .xai-overview-left {
        width: 100%;
    }

    .xai-badge-grid {
        grid-template-columns: 1fr;
    }

    .xai-pillars-grid {
        grid-template-columns: 1fr;
    }

    .xai-source-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .summary-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .summary-modal-footer > * {
        width: 100%;
        justify-content: center;
    }

    .xai-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .xai-modal-footer > * {
        width: 100%;
        justify-content: center;
    }
}

/* Site Footer & Trust Seals */
.app-site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 28px 16px 16px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
}

.footer-trust-seals {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.enamad-badge-wrap {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.enamad-badge-wrap:hover {
    box-shadow: var(--shadow-card);
    border-color: rgba(79, 70, 229, 0.35);
    transform: translateY(-2px);
}

.enamad-badge-wrap img {
    width: 95px;
    height: 95px;
    object-fit: contain;
    display: block;
}

.footer-bottom-row {
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: center;
}

.footer-copyright a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.footer-copyright a:hover {
    color: var(--primary-hover);
}

