/* ============================================================
   WHALE TRACKER - Modern Design System
   ============================================================ */

/* ==================== DARK THEME (Default) ==================== */
:root {
    /* Backgrounds */
    --bg-dark: #0f172a;
    --bg-panel: #1e293b;
    --bg-hover: #334155;
    --bg-elevated: #1e293b;
    
    /* Text Colors */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-disabled: #64748b;
    
    /* Brand Colors */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --accent-color: #10b981;
    --accent-hover: #059669;
    --accent-glow: rgba(16, 185, 129, 0.4);
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.4);
    --warning-color: #f59e0b;
    --warning-hover: #d97706;
    --warning-glow: rgba(245, 158, 11, 0.4);
    
    /* Category Colors */
    --cat-main: #60a5fa;
    --cat-satellite: #fbbf24;
    --cat-sharing: #94a3b8;
    --tag-bg: rgba(71, 85, 105, 0.4);
    
    /* Borders & Shadows */
    --border-color: #334155;
    --border-light: rgba(51, 65, 85, 0.5);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow-primary: 0 0 20px rgba(59, 130, 246, 0.3);
    --shadow-glow-accent: 0 0 20px rgba(16, 185, 129, 0.3);
    --ftse-accent: #d6a94b;
    --ftse-accent-strong: #f3cb72;
    --ftse-accent-soft: rgba(214, 169, 75, 0.16);
    --ftse-accent-faint: rgba(214, 169, 75, 0.08);
    --ftse-shell-border: rgba(214, 169, 75, 0.24);
    --ambient-primary: rgba(59, 130, 246, 0.18);
    --ambient-accent: rgba(16, 185, 129, 0.14);
    --surface-highlight: rgba(255, 255, 255, 0.035);
    --surface-sheen: rgba(255, 255, 255, 0.08);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* ==================== LIGHT THEME ==================== */
body[data-theme="light"] {
    --bg-dark: #f1f5f9;
    --bg-panel: #ffffff;
    --bg-hover: #e2e8f0;
    --bg-elevated: #ffffff;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-disabled: #94a3b8;

    --border-color: #e2e8f0;
    --border-light: rgba(226, 232, 240, 0.8);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15);

    --cat-main: #2563eb;
    --cat-satellite: #d97706;
    --cat-sharing: #64748b;
    --tag-bg: rgba(0, 0, 0, 0.04);
    --ftse-accent: #a16207;
    --ftse-accent-strong: #854d0e;
    --ftse-accent-soft: rgba(161, 98, 7, 0.12);
    --ftse-accent-faint: rgba(161, 98, 7, 0.06);
    --ftse-shell-border: rgba(161, 98, 7, 0.18);
    --ambient-primary: rgba(59, 130, 246, 0.12);
    --ambient-accent: rgba(16, 185, 129, 0.08);
    --surface-highlight: rgba(255, 255, 255, 0.7);
    --surface-sheen: rgba(148, 163, 184, 0.16);
}

/* Light mode overrides for buttons with low contrast */
body[data-theme="light"] .btn-help {
    color: #2563eb;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}
body[data-theme="light"] .btn-export {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}
body[data-theme="light"] #mobileCloseActions {
    color: var(--text-main);
}


/* Light mode scrollbar - higher contrast */
body[data-theme="light"] ::-webkit-scrollbar-track {
    background: #e2e8f0;
}

body[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #94a3b8;
}

body[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::selection {
    background: var(--primary-color);
    color: white;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-display: swap;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== LAYOUT ==================== */
.app-container {
    display: flex;
    height: 100%;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 200px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.brand {
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: all var(--transition-base);
}

.brand-icon svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
}

.brand:hover .brand-icon {
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-2px) scale(1.05);
}

.brand h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.nav-menu {
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-align: left;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-main);
    transform: translateX(6px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12) 0%, transparent 100%);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item.active::before {
    transform: scaleY(1);
}

.sidebar-footer {
    padding: 20px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.09), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 22%),
        var(--bg-dark);
    margin-left: 200px;
    width: calc(100% - 200px);
    position: relative;
    isolation: isolate;
}

.main-content::before,
.main-content::after {
    display: none;
}

.main-content::before {
    content: none;
}

.main-content::after {
    content: none;
}

.top-header {
    height: 68px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)), var(--bg-panel);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.12);
}

.top-header::after {
    content: '';
    position: absolute;
    left: 32px;
    right: 32px;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.45), rgba(16, 185, 129, 0.24), transparent);
}

.search-module {
    position: relative;
    display: flex;
    align-items: center;
}

.search-module input {
    width: 400px;
    padding: 10px 40px 10px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--surface-highlight), transparent), var(--bg-dark);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-base);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 20px rgba(2, 6, 23, 0.08);
}

.search-module input:hover {
    border-color: rgba(59, 130, 246, 0.25);
}

.search-module input::placeholder {
    color: var(--text-muted);
}

.search-module input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-panel);
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-base);
}

.search-clear-btn:hover {
    background: var(--bg-hover);
    color: var(--danger-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.period-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--surface-highlight), transparent), var(--bg-dark);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.period-selector::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(59, 130, 246, 0.06) 50%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.period-selector:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: var(--shadow-md);
}

.period-selector:hover::before {
    opacity: 1;
}

.period-selector-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    margin-right: 4px;
}

.period-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 7px 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-base);
    transform: translateY(0);
}

.period-chip:hover {
    color: var(--text-main);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.period-chip.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-color);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.15), 0 10px 18px rgba(37, 99, 235, 0.14);
}

.period-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dataset-mode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px 9px 30px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning-color);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dataset-mode-badge::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    transform: translateY(-50%);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.dataset-mode-badge::after {
    display: none;
}

/* ==================== BUTTONS ==================== */
.btn-help {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-base);
    height: 38px;
}

.btn-help:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.15) 100%);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-export {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-base);
    height: 38px;
}

.btn-export:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.15) 100%);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 4px 12px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-analyze {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-analyze:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.btn-analyze:active {
    transform: translateY(0);
}

.page-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 7px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition-base);
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-main);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ==================== FILTER CONTROLS ==================== */
.filter-toolbar {
    background: var(--bg-panel);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.filter-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.filter-select {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    min-width: 130px;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 36px;
}

.filter-select:hover {
    border-color: var(--text-muted);
}

.filter-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ==================== CONTENT BODY ==================== */
.content-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex-grow: 1;
    position: relative;
    z-index: 1;
    scroll-behavior: auto;
}

/* ==================== KPI GRID ==================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-box {
    background: linear-gradient(180deg, var(--surface-highlight), transparent 36%), var(--bg-panel);
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-slow), border-color var(--transition-slow), box-shadow var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.kpi-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.kpi-box::after {
    display: none;
}

.kpi-box:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl), var(--shadow-glow-primary);
    border-color: rgba(59, 130, 246, 0.4);
}

.kpi-box:hover::before {
    opacity: 1;
}

.kpi-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.kpi-box h2 {
    font-size: 34px;
    margin-top: 10px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

/* ==================== DATA PANELS ==================== */
.data-panel {
    background: linear-gradient(180deg, var(--surface-highlight), transparent 30%), var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
    backdrop-filter: blur(10px);
}

.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--surface-highlight), transparent 60%), var(--bg-elevated);
    position: relative;
    overflow: hidden;
}

.panel-header::after {
    content: '';
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.35), rgba(16, 185, 129, 0.12), transparent 80%);
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.panel-header p {
    color: var(--text-muted);
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
}

/* ==================== CARDS ==================== */
.group-card {
    background: linear-gradient(180deg, var(--surface-highlight), transparent 30%), var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    overflow: hidden;
    transition: transform var(--transition-slow), border-color var(--transition-slow), box-shadow var(--transition-slow), background-color var(--transition-slow);
    position: relative;
}

.group-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    pointer-events: none;
    transition: all var(--transition-base);
}

.group-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.group-card:hover::before {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.05);
}

.group-card::after {
    display: none;
}

.group-card.open {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
}

.group-card.open::before {
    border-color: var(--primary-color);
    box-shadow: inset 0 0 30px rgba(59, 130, 246, 0.08);
}

.card-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.06));
    transition: background var(--transition-base);
}

.card-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.card-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.chevron {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-base);
    color: var(--text-muted);
}

.group-card.open .chevron {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.card-body {
    display: none;
    border-top: 1px solid var(--border-color);
    overflow-x: auto;
}

.group-card.open .card-body {
    display: block;
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-stats {
    display: flex;
    gap: 24px;
    padding: 16px 20px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.stat-item {
    font-size: 11px;
    color: var(--text-muted);
}

.stat-item span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 4px;
}

/* ==================== TABLES ==================== */
.card-table {
    width: 100%;
    border-collapse: collapse;
}

.card-table th,
.card-table td {
    padding: 12px 18px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.card-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.08);
}

.card-table tr {
    transition: all var(--transition-base);
}

.card-table tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

.card-table tr:last-child td {
    border-bottom: none;
}

/* ==================== BADGES & TAGS ==================== */
.badge-ticker {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 4px 9px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    transition: all var(--transition-base);
}

.badge-ticker:hover {
    box-shadow: 0 4px 10px var(--primary-glow);
    transform: translateY(-1px);
}

.type-tag {
    display: inline-block;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--tag-bg);
    border: 1px solid var(--border-color);
    font-weight: 500;
    color: var(--text-main);
    transition: all var(--transition-base);
    text-align: center;
}

.type-tag.cp {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

.type-tag.id {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.entity-name {
    font-weight: 600;
    color: var(--text-main);
    transition: color var(--transition-base);
}

.entity-name:hover {
    color: var(--primary-color);
}

.issuer-name {
    color: var(--text-muted);
    font-size: 12px;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* ==================== PROGRESS BARS ==================== */
.progress-container {
    width: 100px;
    height: 6px;
    background: var(--bg-dark);
    border-radius: var(--radius-full);
    display: inline-block;
    margin-left: 8px;
    overflow: hidden;
    vertical-align: middle;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color) 0%, #34d399 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* ==================== DEMOGRAPHICS BAR ==================== */
.demo-bar-container {
    display: flex;
    height: 7px;
    width: 140px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--bg-dark);
    margin-top: 8px;
    border: 1px solid var(--border-color);
}

.demo-bar-segment {
    height: 100%;
    transition: width var(--transition-slow);
}

/* ==================== PORTFOLIO DONUT ==================== */
.portfolio-viz {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mini-donut {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mini-donut::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: var(--bg-dark);
    border-radius: 50%;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.donut-legend-item {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 7px;
}

.donut-legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ==================== CHARTS ==================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.chart-container {
    background: linear-gradient(180deg, var(--surface-highlight), transparent 32%), var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    height: 360px;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow), border-color var(--transition-slow), box-shadow var(--transition-slow);
    overflow: hidden;
}

.chart-container:hover {
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: var(--shadow-lg);
}

.chart-container::before {
    display: none;
}

.chart-container h3 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
    text-align: center;
    font-weight: 600;
    flex-shrink: 0;
}

.chart-container canvas {
    flex-grow: 1;
    max-height: 100%;
}

.chart-container[style*="grid-column"] {
    height: 420px;
}

/* ==================== MODAL ==================== */
@keyframes backdropFade {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(15px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: backdropFade 0.3s ease-out forwards;
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    height: 85%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-elevated);
}

.modal-header h3 {
    font-size: 15px;
    color: var(--primary-color);
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.modal-close:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.modal-body {
    flex-grow: 1;
    position: relative;
    background: var(--bg-dark);
}

.graph-tooltip {
    position: absolute;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    pointer-events: none;
    font-size: 12px;
    color: var(--text-main);
    z-index: 1100;
    box-shadow: var(--shadow-xl);
}

/* ==================== THEME TOGGLE ==================== */
.theme-fab {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px var(--primary-glow);
    cursor: pointer;
    border: none;
    z-index: 100;
    transition: all var(--transition-base);
}

.theme-fab:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 8px 28px var(--primary-glow);
}

.theme-fab:active {
    transform: scale(0.95);
}

/* ==================== SAWERIA BUTTON ==================== */
.saweria-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #faae2b 0%, #fbbd5c 100%);
    color: #000 !important;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 14px;
    transition: all var(--transition-base);
    width: 100%;
    box-shadow: 0 4px 12px rgba(250, 174, 43, 0.3);
}

.saweria-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(250, 174, 43, 0.4);
}

.saweria-btn svg {
    stroke: #000;
}

/* ==================== ECOSYSTEM INFO BOX ==================== */
.info-box {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1400px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}



@media (max-width: 768px) {
    html, body {
        height: auto;
        overflow: auto;
    }
    
    .app-container {
        flex-direction: column;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        height: 60px;
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        z-index: 1000;
        border-right: none;
        border-top: 1px solid var(--border-color);
        background: var(--bg-panel);
        padding: 0;
        display: flex;
        flex-direction: row;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    }

    .brand { display: none; }

    .nav-menu {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        padding: 0 4px;
        margin: 0;
        gap: 0;
        overflow: visible;
        background: transparent;
        border: none;
    }

    .nav-item {
        flex-direction: column;
        padding: 8px 4px;
        font-size: 10px;
        text-align: center;
        gap: 4px;
        border-radius: 8px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        white-space: nowrap;
        width: 20%;
    }

    .nav-item svg { width: 20px; height: 20px; margin: 0 auto; }
    .nav-item::before { display: none; }

    .nav-item.active {
        color: var(--primary-color);
        background: transparent;
        font-weight: 700;
    }
    
    .nav-item.active svg { stroke-width: 2.5; }

    .sidebar-footer { display: none; }

    .main-content {
        margin-left: 0;
        width: 100%;
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding-bottom: 80px;
    }

    .top-header {
        position: sticky;
        top: 0;
        z-index: 101;
        flex-direction: column;
        padding: 12px 16px;
        height: auto;
        gap: 12px;
        align-items: stretch;
        background: var(--bg-panel);
        backdrop-filter: blur(8px);
    }

    .header-actions {
        justify-content: space-between;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .period-selector {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .dataset-mode-badge {
        width: 100%;
        justify-content: center;
    }

    .btn-export { padding: 6px 10px; font-size: 11px; }

    .content-body {
        padding: 16px;
        overflow-y: visible;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .kpi-box { padding: 16px; }
    .kpi-box h2 { font-size: 22px; }
    
    .kpi-box:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .charts-grid { grid-template-columns: 1fr; gap: 16px; }
    .chart-container { height: 300px; padding: 12px; }
    .chart-container[style*="grid-column"] { grid-column: span 1 !important; height: 350px !important; }

    .filter-toolbar {
        position: relative;
        top: 0;
        padding: 12px 16px;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 12px;
        scrollbar-width: none;
    }
    .filter-toolbar::-webkit-scrollbar { display: none; }
    
    .filter-group {
        flex-direction: column;
        width: auto;
        min-width: 120px;
        flex-shrink: 0;
        align-items: flex-start;
    }
    .filter-select { width: 100%; min-width: unset; }

    .sector-intel-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }
    
    .card-header-left {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .card-header-left > div {
        flex: 1 1 100%;
    }

    .card-header-right {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
    }

    .issuer-name {
        max-width: 100%;
        white-space: normal;
        display: block;
        margin-top: 4px;
        margin-bottom: 8px;
    }

    .card-table { display: block; width: 100%; }
    .card-table thead { display: none; }
    .card-table tbody { display: block; width: 100%; }
    
    .card-table tr {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 14px;
        background: var(--bg-dark);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        margin-bottom: 10px;
        position: relative;
    }
    
    .card-table td {
        padding: 0;
        border: none;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
        font-size: 12px;
        color: var(--text-muted);
    }
    
    /* Let the entity name be prominent (usually column 1 or 2) */
    .card-table td:nth-child(1),
    .card-table td:nth-child(2) {
        color: var(--text-main);
    }
    
    /* Make the last column (always percentage/holding) stand out */
    .card-table td:last-child {
        width: 100%;
        justify-content: space-between;
        background: rgba(0,0,0,0.1);
        padding: 8px;
        border-radius: 6px;
        margin-top: 4px;
        color: var(--text-main);
        font-weight: 600;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-width: none;
        max-height: none;
    }
    
    .modal-header { position: sticky; top: 0; z-index: 10; background: var(--bg-panel); }
    
    /* Fix theme fab overlapping the bottom nav */
    .theme-fab { bottom: 100px; right: 16px; width: 44px; height: 44px; }
}



@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}
/* ==================== NETWORK ANIMATION ==================== */
.network-link-pulse {
    stroke-dasharray: 6 50;
    stroke-linecap: round;
    animation: flowPulse 1s linear infinite;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.4));
}

@keyframes flowPulse {
    from {
        stroke-dashoffset: 56;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* ==================== COMPARE FEATURE ==================== */
.compare-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--text-disabled); /* Gunakan warna yang lebih kontras dari border biasa */
    border-radius: 6px;
    cursor: pointer;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .compare-checkbox {
    border-color: #b1bccd; /* Warna yang lebih gelap untuk light mode */
    background: #ffffff;
}

body[data-theme="light"] .compare-checkbox.checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.main-content.compare-mode .compare-checkbox {
    display: flex; /* Show only in compare mode */
}

.compare-checkbox.checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.compare-checkbox svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.compare-checkbox.checked svg {
    opacity: 1;
}

.group-card.compare-selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color), var(--shadow-glow-primary);
}

.compare-banner {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    z-index: 1000;
    animation: slideUpCenter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

@keyframes slideUpCenter {
    from { transform: translate(-50%, 100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.compare-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.compare-tags-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.compare-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.compare-tag span {
    cursor: pointer;
    opacity: 0.6;
    font-size: 14px;
    line-height: 1;
}

.compare-tag span:hover {
    opacity: 1;
}

.compare-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.compare-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.compare-card {
    transition: transform 0.2s;
}

.compare-card:hover {
    transform: translateY(-2px);
}

/* Compare modal - horizontal scroll for cards container */
#compareColsContainer {
    overflow-x: auto;
    padding-bottom: 8px;
}

/* Compare modal - overlap section */
#compareOverlapContainer {
    width: 100%;
    min-width: 0;
}

.compare-overlap-section {
    margin-top: 32px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
}

.compare-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    display: block;
}

.compare-overlap-table {
    width: 100%;
    border-collapse: collapse;
}

.compare-overlap-table th, 
.compare-overlap-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    text-align: left;
}

.compare-overlap-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0,0,0,0.1);
}

.compare-overlap-table tr:hover {
    background: rgba(255,255,255,0.02);
}

.compare-overlap-table td.pct-cell {
    font-weight: 600;
    color: var(--primary-color);
}

/* Sector Intelligence Cards */
.sector-intel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.sector-intel-card {
    background: linear-gradient(180deg, var(--surface-highlight), transparent 34%), var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.sector-intel-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
    background: var(--bg-elevated);
}

.sector-intel-card::after {
    display: none;
}

.sector-intel-card .card-rank-badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.sector-intel-card .stat-box {
    background: var(--bg-dark);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.sector-intel-card:hover .stat-box {
    border-color: var(--border-color);
    background: var(--bg-panel);
}

.sector-intel-card .stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    font-weight: 600;
}

.sector-intel-card .stat-value {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sector-intel-card .progress-track {
    height: 6px;
    background: var(--bg-dark);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 6px;
    border: 1px solid var(--border-light);
}

.sector-intel-card .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--warning-color), #fbbf24);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

body[data-theme="light"] .sector-intel-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

body[data-theme="light"] .sector-intel-card .stat-box {
    background: #f8fafc;
    border-color: #f1f5f9;
}

.sector-intel-card:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.15);
}

.delta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.delta-chip.positive {
    color: var(--accent-color);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.2);
}

.delta-chip.negative {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.2);
}

.delta-chip.neutral {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.18);
}

.compare-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.compare-status-badge.new {
    color: var(--accent-color);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.2);
}

.compare-status-badge.removed {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.2);
}

.compare-status-badge.increased {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.2);
}

.compare-status-badge.decreased {
    color: #fca5a5;
    background: rgba(252, 165, 165, 0.12);
    border-color: rgba(252, 165, 165, 0.2);
}

.compare-status-badge.scripless_shift,
.compare-status-badge.script_shift,
.compare-status-badge.rebalanced {
    color: var(--warning-color);
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.2);
}

.compare-status-badge.unchanged {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.18);
}

/* KPI Item Highlighting */
.kpi-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-base);
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin: 0 -4px;
}

.kpi-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
    border-color: var(--primary-color);
}

.kpi-item:last-child {
    border-bottom: none;
}

body[data-theme="light"] .kpi-item:hover {
    background: rgba(59, 130, 246, 0.05);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .main-content::before,
    .main-content::after,
    .dataset-mode-badge::before,
    .dataset-mode-badge::after {
        display: none !important;
    }
}

/* Balance Post Redesign */
.balance-post-shell {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 28%),
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.08), transparent 24%),
        var(--bg-panel);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.balance-post-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.015), transparent 35%),
        linear-gradient(0deg, rgba(15, 23, 42, 0.16), transparent 32%);
    pointer-events: none;
}

.balance-post-hero {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.balance-post-kicker {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: var(--primary-color);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
}

.balance-post-hero h2 {
    font-size: 28px;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.balance-post-hero p {
    color: var(--text-muted);
    margin-top: 8px;
    max-width: 760px;
    line-height: 1.6;
}

.balance-post-story {
    margin-top: 16px;
    display: inline-flex;
    max-width: 760px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.6;
}

.balance-post-context {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.balance-context-pill {
    min-width: 170px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.16);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.balance-context-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.balance-context-pill strong {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 800;
}

.balance-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
}

.balance-summary-card {
    padding: 18px 18px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 50%),
        rgba(15, 23, 42, 0.48);
    box-shadow: var(--shadow-md);
    min-height: 116px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.balance-summary-card-local {
    border-color: rgba(59, 130, 246, 0.28);
}

.balance-summary-card-foreign {
    border-color: rgba(245, 158, 11, 0.28);
}

.balance-summary-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.balance-summary-value {
    color: var(--text-main);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.balance-summary-meta {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.balance-top-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    position: relative;
    z-index: 1;
}

.balance-rank-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 42%),
        var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow-lg);
}

.balance-rank-card-local {
    border-top: 3px solid rgba(59, 130, 246, 0.9);
}

.balance-rank-card-foreign {
    border-top: 3px solid rgba(245, 158, 11, 0.9);
}

.balance-rank-card__header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.balance-rank-card__header p {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.55;
}

.balance-rank-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.balance-rank-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all var(--transition-base);
}

.balance-rank-item:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.06);
}

.balance-rank-main {
    display: flex;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.balance-rank-number {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-main);
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

.balance-rank-copy {
    min-width: 0;
    flex: 1;
}

.balance-rank-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.balance-rank-ticker {
    color: var(--text-main);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.balance-rank-company {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.balance-rank-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.balance-rank-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.balance-rank-chip.is-local {
    color: var(--primary-color);
    border-color: rgba(59, 130, 246, 0.16);
    background: rgba(59, 130, 246, 0.1);
}

.balance-rank-chip.is-foreign {
    color: var(--warning-color);
    border-color: rgba(245, 158, 11, 0.18);
    background: rgba(245, 158, 11, 0.1);
}

.balance-rank-bar {
    height: 7px;
    border-radius: var(--radius-full);
    margin-top: 10px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.12);
}

.balance-rank-bar span {
    display: block;
    height: 100%;
    border-radius: var(--radius-full);
}

.balance-rank-value {
    min-width: 92px;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.balance-rank-value strong {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-family: 'JetBrains Mono', monospace;
}

.balance-rank-value span {
    font-size: 11px;
    color: var(--text-muted);
}

.balance-filter-toolbar {
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background: var(--bg-panel);
    padding-top: 20px;
    padding-bottom: 16px;
    align-items: flex-end;
    gap: 14px;
}

.balance-filter-group {
    min-width: 170px;
}

.balance-filter-group--range {
    flex: 0 1 190px;
}

.balance-filter-group--sort {
    flex: 1 1 260px;
    min-width: 230px;
}

.balance-filter-toolbar .filter-label {
    font-size: 10px;
    font-weight: 700;
}

.balance-filter-toolbar .filter-select {
    min-width: 100%;
}

.balance-accordion-header {
    display: grid;
    grid-template-columns: 2.7fr 1fr 1.35fr 1.35fr;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-bottom: 2px solid var(--primary-color);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: 0.08em;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.balance-stock-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 42%),
        var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.balance-stock-card__header {
    display: grid;
    grid-template-columns: 2.7fr 1fr 1.35fr 1.35fr;
    gap: 16px;
    padding: 20px 24px;
    align-items: center;
    border: none;
}

.balance-stock-card__identity {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.balance-stock-card__copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.balance-stock-card__badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.balance-stock-card__company {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.balance-stock-card__window {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.balance-market-context {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.balance-market-range {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.balance-flow-summary {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.balance-flow-summary--local {
    border-color: rgba(59, 130, 246, 0.18);
    background: rgba(59, 130, 246, 0.06);
}

.balance-flow-summary--foreign {
    border-color: rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.06);
}

.balance-flow-tag {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.balance-flow-tag--local {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
}

.balance-flow-tag--foreign {
    color: var(--warning-color);
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.22);
}

.balance-flow-value {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-family: 'JetBrains Mono', monospace;
}

.balance-flow-meta {
    font-size: 11px;
    color: var(--text-main);
    font-weight: 700;
}

.balance-flow-subtext {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.45;
}

.balance-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.balance-chip.positive {
    color: var(--accent-color);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.2);
}

.balance-chip.negative {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.2);
}

.balance-chip.neutral {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.18);
}

.ftse-shell {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--ftse-shell-border);
    background:
        radial-gradient(circle at top right, rgba(214, 169, 75, 0.16), transparent 26%),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.99));
    box-shadow: 0 24px 50px -34px rgba(0, 0, 0, 0.55);
}

.ftse-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 36%),
        linear-gradient(180deg, transparent 72%, rgba(214, 169, 75, 0.06));
}

.ftse-hero {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 32px 34px 24px;
    border-bottom: 1px solid rgba(214, 169, 75, 0.18);
}

.ftse-hero-copy {
    flex: 1;
    min-width: 0;
}

.ftse-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--ftse-accent-faint);
    border: 1px solid var(--ftse-shell-border);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ftse-accent);
}

.ftse-kicker::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--ftse-accent), var(--ftse-accent-strong));
    box-shadow: 0 0 16px rgba(214, 169, 75, 0.28);
}

.ftse-headline {
    margin-top: 18px;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-main);
}

.ftse-subheadline {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

.ftse-intro-note {
    margin-top: 14px;
    max-width: 760px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
}

.ftse-hero-side {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-end;
    gap: 10px;
    min-width: 240px;
}

.ftse-context-pill {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.ftse-context-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ftse-context-pill strong {
    font-size: 14px;
    color: var(--text-main);
}

.ftse-context-pill span:last-child {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.ftse-status-banner {
    position: relative;
    z-index: 1;
    margin: 0 34px;
    padding: 16px 20px;
    border-radius: 18px;
    border: 1px solid var(--ftse-shell-border);
    background: linear-gradient(90deg, var(--ftse-accent-faint), rgba(255, 255, 255, 0.02));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.ftse-status-banner-copy {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ftse-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--ftse-accent);
    box-shadow: 0 0 0 6px rgba(214, 169, 75, 0.12);
    flex-shrink: 0;
}

.ftse-status-banner-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ftse-accent);
}

.ftse-status-banner-note {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-main);
}

.ftse-status-banner-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--ftse-accent-strong);
    text-align: right;
}

.ftse-section {
    position: relative;
    z-index: 1;
    padding: 28px 34px 0;
}

.ftse-section:last-child {
    padding-bottom: 34px;
}

.ftse-section-label {
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ftse-decision-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ftse-impact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.ftse-card {
    position: relative;
    overflow: hidden;
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 132px;
}

.ftse-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 2px;
    opacity: 0.9;
}

.ftse-card.tone-positive::before {
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.ftse-card.tone-warning::before {
    background: linear-gradient(90deg, var(--warning-color), transparent);
}

.ftse-card.tone-neutral::before {
    background: linear-gradient(90deg, var(--ftse-accent), transparent);
}

.ftse-card-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ftse-card-value {
    margin-top: 10px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-main);
}

.ftse-card-note {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-muted);
}

.ftse-card.tone-positive .ftse-card-value {
    color: var(--accent-color);
}

.ftse-card.tone-warning .ftse-card-value {
    color: var(--warning-color);
}

.ftse-card.tone-neutral .ftse-card-value {
    color: var(--ftse-accent-strong);
}

.ftse-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.95fr);
    gap: 14px;
}

.ftse-meta-card {
    padding: 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ftse-meta-card h3 {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.ftse-meta-card p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
}

.ftse-source-list,
.ftse-doc-list,
.ftse-monitor-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.ftse-source-item,
.ftse-doc-item,
.ftse-monitor-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 15px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ftse-source-item a,
.ftse-doc-item a {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.5;
}

.ftse-source-item a:hover,
.ftse-doc-item a:hover {
    color: var(--primary-color);
}

.ftse-source-url,
.ftse-doc-url {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
    word-break: break-all;
}

.ftse-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ftse-chip.live {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.22);
    color: var(--accent-color);
}

.ftse-chip.preview {
    background: var(--ftse-accent-soft);
    border-color: var(--ftse-shell-border);
    color: var(--ftse-accent-strong);
}

.ftse-chip.neutral {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.18);
    color: var(--text-muted);
}

.ftse-chip.warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.22);
    color: var(--warning-color);
}

.ftse-chip.positive {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.22);
    color: var(--accent-color);
}

.ftse-monitor-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ftse-monitor-note {
    padding: 14px 15px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-muted);
}

.ftse-monitor-item strong {
    display: block;
    font-size: 12px;
    color: var(--text-main);
}

.ftse-monitor-item span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.6;
    color: var(--text-muted);
}

.ftse-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.ftse-btn {
    border: 1px solid var(--ftse-shell-border);
    background: var(--ftse-accent-soft);
    color: var(--ftse-accent-strong);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all var(--transition-base);
}

.ftse-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(214, 169, 75, 0.36);
}

.ftse-btn.secondary {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.ftse-empty-state {
    margin-top: 16px;
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
}

.ftse-footnote {
    margin-top: 18px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-muted);
    padding-top: 18px;
    border-top: 1px solid rgba(214, 169, 75, 0.14);
}

body[data-theme="light"] .ftse-shell {
    background:
        radial-gradient(circle at top right, rgba(161, 98, 7, 0.10), transparent 28%),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.05), transparent 22%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 1));
    box-shadow: 0 22px 42px -32px rgba(15, 23, 42, 0.24);
}

body[data-theme="light"] .ftse-shell::after {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.48), transparent 42%),
        linear-gradient(180deg, transparent 72%, rgba(161, 98, 7, 0.04));
}

body[data-theme="light"] .ftse-hero,
body[data-theme="light"] .ftse-footnote {
    border-color: rgba(161, 98, 7, 0.12);
}

body[data-theme="light"] .ftse-context-pill,
body[data-theme="light"] .ftse-card,
body[data-theme="light"] .ftse-meta-card,
body[data-theme="light"] .ftse-source-item,
body[data-theme="light"] .ftse-doc-item,
body[data-theme="light"] .ftse-monitor-item,
body[data-theme="light"] .ftse-monitor-note {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.16);
}

body[data-theme="light"] .ftse-status-banner {
    background: linear-gradient(90deg, rgba(161, 98, 7, 0.08), rgba(255, 255, 255, 0.92));
}

body[data-theme="light"] .ftse-btn.secondary {
    background: #ffffff;
    border-color: #dbe2ea;
}

body[data-theme="light"] .balance-post-shell {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.10), transparent 26%),
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.10), transparent 22%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 1));
    border-color: rgba(226, 232, 240, 0.95);
}

body[data-theme="light"] .balance-post-shell::after {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 42%),
        linear-gradient(0deg, rgba(148, 163, 184, 0.08), transparent 38%);
}

body[data-theme="light"] .balance-post-kicker {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.18);
}

body[data-theme="light"] .balance-post-story {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 14px 30px -24px rgba(15, 23, 42, 0.26);
}

body[data-theme="light"] .balance-context-pill {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 14px 28px -24px rgba(15, 23, 42, 0.18);
}

body[data-theme="light"] .balance-summary-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 20px 36px -30px rgba(15, 23, 42, 0.26);
}

body[data-theme="light"] .balance-summary-card-local {
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.98) 55%);
    border-color: rgba(59, 130, 246, 0.24);
}

body[data-theme="light"] .balance-summary-card-foreign {
    background:
        linear-gradient(180deg, rgba(245, 158, 11, 0.10), rgba(255, 255, 255, 0.98) 55%);
    border-color: rgba(245, 158, 11, 0.24);
}

body[data-theme="light"] .balance-rank-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 18px 34px -28px rgba(15, 23, 42, 0.24);
}

body[data-theme="light"] .balance-rank-item {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(148, 163, 184, 0.18);
}

body[data-theme="light"] .balance-rank-item:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.24);
}

body[data-theme="light"] .balance-rank-number {
    background: #e2e8f0;
    color: #334155;
}

body[data-theme="light"] .balance-rank-chip {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

body[data-theme="light"] .balance-rank-bar {
    background: #e2e8f0;
}

body[data-theme="light"] .balance-stock-card {
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.02), rgba(255, 255, 255, 1));
    box-shadow: 0 18px 30px -28px rgba(15, 23, 42, 0.22);
}

body[data-theme="light"] .balance-flow-summary {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(148, 163, 184, 0.18);
}

body[data-theme="light"] .balance-flow-summary--local {
    background: rgba(59, 130, 246, 0.06);
}

body[data-theme="light"] .balance-flow-summary--foreign {
    background: rgba(245, 158, 11, 0.08);
}

body[data-theme="light"] .balance-chip.neutral {
    color: #475569;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

@media (max-width: 1100px) {
    .ftse-hero,
    .ftse-status-banner {
        margin-left: 24px;
        margin-right: 24px;
    }

    .ftse-hero {
        padding-left: 24px;
        padding-right: 24px;
        flex-direction: column;
    }

    .ftse-hero-side {
        justify-content: flex-start;
    }

    .ftse-section {
        padding-left: 24px;
        padding-right: 24px;
    }

    .ftse-meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .ftse-decision-grid,
    .ftse-impact-grid {
        grid-template-columns: 1fr;
    }

    .ftse-status-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .ftse-status-banner-value {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .ftse-shell {
        border-radius: 18px;
    }

    .ftse-hero,
    .ftse-section {
        padding-left: 18px;
        padding-right: 18px;
    }

    .ftse-status-banner {
        margin-left: 18px;
        margin-right: 18px;
        padding: 14px 16px;
    }

    .ftse-headline {
        font-size: 28px;
    }

    .ftse-context-pill {
        min-width: 100%;
    }

    .ftse-source-item,
    .ftse-doc-item,
    .ftse-monitor-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 1200px) {
    .balance-post-hero {
        flex-direction: column;
    }

    .balance-summary-grid,
    .balance-top-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .balance-summary-grid,
    .balance-top-grid {
        grid-template-columns: 1fr;
    }

    .balance-accordion-header {
        display: none;
    }

    .balance-stock-card__header {
        grid-template-columns: 1fr;
    }

    .balance-market-context {
        align-items: flex-start;
        text-align: left;
    }

    .balance-filter-group,
    .balance-filter-group--range,
    .balance-filter-group--sort {
        flex: 1 1 100%;
        min-width: 0;
    }
}

/* ==================== CHANGELOG ==================== */
.changelog-shell {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.changelog-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 28px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(59, 130, 246, 0.18);
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.16), transparent 28%),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.22), transparent 32%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    box-shadow: 0 28px 48px -34px rgba(15, 23, 42, 0.78);
}

.changelog-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 28%),
        linear-gradient(180deg, transparent 68%, rgba(59, 130, 246, 0.08));
}

.changelog-hero-copy,
.changelog-hero-meta {
    position: relative;
    z-index: 1;
}

.changelog-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.38);
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.changelog-hero h2 {
    margin-top: 14px;
    font-size: 32px;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.changelog-hero p {
    margin-top: 12px;
    max-width: 720px;
    color: rgba(226, 232, 240, 0.86);
    font-size: 14px;
    line-height: 1.75;
}

.changelog-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 12px;
    min-width: min(360px, 100%);
}

.changelog-meta-pill {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.36);
    backdrop-filter: blur(10px);
}

.changelog-meta-label {
    display: block;
    color: rgba(148, 163, 184, 0.9);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.changelog-meta-value {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
}

.changelog-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.changelog-kpi-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    box-shadow: 0 18px 36px -32px rgba(15, 23, 42, 0.72);
}

.changelog-kpi-card::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    opacity: 0.9;
}

.changelog-kpi-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.changelog-kpi-value {
    display: block;
    margin-top: 10px;
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.changelog-kpi-meta {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

.changelog-kpi-card.is-positive::after {
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.changelog-kpi-card.is-warning::after {
    background: linear-gradient(90deg, var(--warning-color), transparent);
}

.changelog-kpi-card.is-danger::after {
    background: linear-gradient(90deg, var(--danger-color), transparent);
}

.changelog-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
}

.changelog-toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 170px;
    flex: 1 1 0;
}

.changelog-toolbar-group.search {
    min-width: 260px;
    flex: 1.5 1 320px;
}

.changelog-toolbar label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
}

.changelog-input,
.changelog-select {
    width: 100%;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-main);
    padding: 0 14px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.changelog-input::placeholder {
    color: rgba(148, 163, 184, 0.82);
}

.changelog-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px 14px;
    cursor: pointer;
    color-scheme: dark;
}

.changelog-select::-ms-expand {
    display: none;
}

.changelog-select option {
    background: #0f172a;
    color: #f8fafc;
}

.changelog-input:focus,
.changelog-select:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.changelog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.changelog-main,
.changelog-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.changelog-panel {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    box-shadow: 0 22px 38px -34px rgba(15, 23, 42, 0.72);
}

.changelog-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--border-color);
}

.changelog-panel-head h3 {
    font-size: 16px;
    letter-spacing: -0.02em;
}

.changelog-panel-head p {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.changelog-results-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.changelog-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.3);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.changelog-chip.soft {
    color: #cbd5e1;
}

.changelog-chip.positive {
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.24);
    background: rgba(16, 185, 129, 0.12);
}

.changelog-chip.negative {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.22);
    background: rgba(239, 68, 68, 0.12);
}

.changelog-chip.warning {
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.12);
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
}

.changelog-card {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    overflow: hidden;
}

.changelog-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 18px 14px;
}

.changelog-card-main-toggle {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.changelog-card-main-toggle:focus-visible,
.changelog-card-preview:focus-visible,
.changelog-ticker-button:focus-visible,
.changelog-expand:focus-visible,
.changelog-page-btn:focus-visible,
.correction-link-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
}

.changelog-card-title {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.changelog-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.changelog-ticker-button {
    min-width: 68px;
    height: 42px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.12);
    color: #bfdbfe;
    font-weight: 800;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.changelog-ticker-button:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.44);
}

.changelog-card-company {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.changelog-card-subtitle {
    margin-top: 6px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
}

.changelog-card-tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.changelog-card-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.28);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.changelog-card-main-toggle:hover .changelog-card-toggle {
    border-color: rgba(96, 165, 250, 0.32);
    background: rgba(59, 130, 246, 0.12);
}

.changelog-card-chevron {
    transition: transform var(--transition-base);
}

.changelog-card-chevron.is-open {
    transform: rotate(180deg);
}

.changelog-card-preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    padding: 0 18px 18px;
    border: none;
    background: transparent;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}

.changelog-preview-item {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.10);
    background: rgba(15, 23, 42, 0.22);
}

.changelog-preview-label {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.changelog-preview-value {
    display: block;
    margin-top: 8px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.changelog-preview-meta {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.45;
}

.changelog-card-detail {
    border-top: 1px solid rgba(148, 163, 184, 0.10);
    padding-top: 18px;
}

.changelog-card-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 0 18px 18px;
}

.changelog-stat {
    padding: 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.changelog-stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.changelog-stat-value {
    display: block;
    margin-top: 8px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.changelog-stat-meta {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.45;
}

.changelog-holder-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 18px 18px;
}

.changelog-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(180px, 0.9fr) minmax(180px, 0.8fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(15, 23, 42, 0.34);
}

.changelog-row-primary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.changelog-row-name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    word-break: break-word;
}

.changelog-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.change-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-main);
}

.change-status-badge.status-new,
.change-status-badge.status-increased {
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.24);
    background: rgba(16, 185, 129, 0.14);
}

.change-status-badge.status-removed,
.change-status-badge.status-decreased {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.14);
}

.change-status-badge.status-scripless_shift,
.change-status-badge.status-script_shift,
.change-status-badge.status-rebalanced {
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.14);
}

.changelog-row-snapshot,
.changelog-row-delta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.changelog-row-snapshot span,
.changelog-row-delta span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.changelog-row-snapshot strong,
.changelog-row-delta strong {
    color: var(--text-main);
    font-weight: 700;
    text-align: right;
}

.changelog-expand {
    width: 100%;
    padding: 12px 18px 16px;
    border: none;
    background: transparent;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.changelog-expand:hover {
    color: #bfdbfe;
}

.changelog-empty {
    padding: 26px 22px 24px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.75;
}

.changelog-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 18px 18px;
}

.changelog-pagination.is-top {
    padding-top: 18px;
    padding-bottom: 6px;
}

.changelog-pagination.is-bottom {
    padding-top: 0;
}

.changelog-page-btn {
    min-width: 112px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.36);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base), opacity var(--transition-base);
}

.changelog-page-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.24);
}

.changelog-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.correction-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
}

.correction-card {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.38);
}

.correction-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.correction-card-title {
    font-size: 14px;
    font-weight: 800;
}

.correction-card-subtitle {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.55;
}

.correction-card-note {
    margin-top: 12px;
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.7;
}

.correction-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.correction-link-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: rgba(59, 130, 246, 0.1);
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.correction-link-chip:hover {
    background: rgba(59, 130, 246, 0.16);
}

.correction-highlight-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.correction-highlight {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    line-height: 1.55;
}

.correction-highlight strong {
    color: var(--text-main);
}

body[data-theme="light"] .changelog-hero {
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.10), transparent 24%),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(246, 250, 255, 0.98), rgba(255, 255, 255, 1));
    border-color: rgba(96, 165, 250, 0.18);
    box-shadow:
        0 22px 38px -32px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.72) inset,
        0 0 28px rgba(59, 130, 246, 0.10);
}

body[data-theme="light"] .changelog-kicker {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), rgba(148, 163, 184, 0.16));
    border-color: rgba(96, 165, 250, 0.22);
    color: #2563eb;
    box-shadow: 0 10px 22px -18px rgba(59, 130, 246, 0.28);
}

body[data-theme="light"] .changelog-hero p {
    color: #475569;
}

body[data-theme="light"] .changelog-meta-pill,
body[data-theme="light"] .changelog-kpi-card,
body[data-theme="light"] .changelog-panel,
body[data-theme="light"] .changelog-card,
body[data-theme="light"] .correction-card,
body[data-theme="light"] .changelog-stat,
body[data-theme="light"] .changelog-row {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 255, 0.98));
    border-color: rgba(96, 165, 250, 0.14);
    box-shadow:
        0 18px 34px -30px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.84) inset,
        0 0 18px rgba(59, 130, 246, 0.08);
}

body[data-theme="light"] .changelog-toolbar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 255, 0.98));
    border-color: rgba(96, 165, 250, 0.14);
    box-shadow:
        0 18px 34px -30px rgba(15, 23, 42, 0.10),
        0 0 0 1px rgba(255, 255, 255, 0.84) inset,
        0 0 18px rgba(59, 130, 246, 0.07);
}

body[data-theme="light"] .changelog-input,
body[data-theme="light"] .changelog-select {
    background-color: #ffffff;
    color: #0f172a;
    border-color: rgba(203, 213, 225, 0.95);
    color-scheme: light;
}

body[data-theme="light"] .changelog-input::placeholder {
    color: #64748b;
}

body[data-theme="light"] .changelog-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px 14px;
}

body[data-theme="light"] .changelog-select option {
    background: #ffffff;
    color: #0f172a;
}

body[data-theme="light"] .changelog-meta-label,
body[data-theme="light"] .changelog-kpi-label,
body[data-theme="light"] .changelog-toolbar label,
body[data-theme="light"] .changelog-stat-label,
body[data-theme="light"] .changelog-preview-label {
    color: #5f7695;
}

body[data-theme="light"] .changelog-meta-value,
body[data-theme="light"] .changelog-kpi-value,
body[data-theme="light"] .changelog-card-company,
body[data-theme="light"] .correction-card-title,
body[data-theme="light"] .changelog-panel-head h3,
body[data-theme="light"] .changelog-row-name,
body[data-theme="light"] .changelog-row-snapshot strong,
body[data-theme="light"] .changelog-row-delta strong,
body[data-theme="light"] .changelog-stat-value {
    color: #0f172a;
}

body[data-theme="light"] .changelog-panel-head p,
body[data-theme="light"] .changelog-card-subtitle,
body[data-theme="light"] .changelog-kpi-meta,
body[data-theme="light"] .changelog-stat-meta,
body[data-theme="light"] .changelog-preview-meta,
body[data-theme="light"] .correction-card-subtitle,
body[data-theme="light"] .correction-card-note,
body[data-theme="light"] .changelog-row-snapshot span,
body[data-theme="light"] .changelog-row-delta span {
    color: #475569;
}

body[data-theme="light"] .changelog-panel-head,
body[data-theme="light"] .correction-card-header {
    border-color: rgba(96, 165, 250, 0.12);
}

body[data-theme="light"] .changelog-chip {
    background: linear-gradient(180deg, #f8fbff, #f2f7ff);
    border-color: rgba(147, 197, 253, 0.38);
    color: #33506f;
    box-shadow: 0 8px 18px -16px rgba(59, 130, 246, 0.18);
}

body[data-theme="light"] .changelog-chip.soft {
    background: linear-gradient(180deg, #f7faff, #eff6ff);
    border-color: rgba(191, 219, 254, 0.9);
    color: #5f7695;
}

body[data-theme="light"] .changelog-chip.positive {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.22);
    color: #047857;
}

body[data-theme="light"] .changelog-chip.negative {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.20);
    color: #b91c1c;
}

body[data-theme="light"] .changelog-chip.warning {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.22);
    color: #b45309;
}

body[data-theme="light"] .changelog-page-btn {
    background: linear-gradient(180deg, #ffffff, #f5f9ff);
    border-color: rgba(147, 197, 253, 0.42);
    color: #0f172a;
    box-shadow: 0 10px 20px -18px rgba(59, 130, 246, 0.16);
}

body[data-theme="light"] .changelog-card-toggle {
    background: linear-gradient(180deg, #ffffff, #f5f9ff);
    border-color: rgba(147, 197, 253, 0.34);
    color: #33506f;
}

body[data-theme="light"] .changelog-preview-item {
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(240, 247, 255, 0.98));
    border-color: rgba(147, 197, 253, 0.20);
    box-shadow:
        0 12px 24px -22px rgba(59, 130, 246, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.74) inset;
}

body[data-theme="light"] .changelog-preview-value {
    color: #0f172a;
}

body[data-theme="light"] .changelog-card-detail {
    border-top-color: rgba(147, 197, 253, 0.18);
}

body[data-theme="light"] .correction-link-chip {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.10), rgba(219, 234, 254, 0.78));
    border-color: rgba(96, 165, 250, 0.22);
    color: #2563eb;
}

body[data-theme="light"] .change-status-badge {
    color: #334155;
}

body[data-theme="light"] .change-status-badge.status-new,
body[data-theme="light"] .change-status-badge.status-increased {
    color: #047857;
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.10);
}

body[data-theme="light"] .change-status-badge.status-removed,
body[data-theme="light"] .change-status-badge.status-decreased {
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.18);
    background: rgba(239, 68, 68, 0.09);
}

body[data-theme="light"] .change-status-badge.status-scripless_shift,
body[data-theme="light"] .change-status-badge.status-script_shift,
body[data-theme="light"] .change-status-badge.status-rebalanced {
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.20);
    background: rgba(245, 158, 11, 0.10);
}

body[data-theme="light"] .changelog-ticker-button {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body[data-theme="light"] .changelog-ticker-button:hover {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1d4ed8;
}

@media (max-width: 1280px) {
    .changelog-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .changelog-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .changelog-hero {
        flex-direction: column;
    }

    .changelog-hero-meta {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .changelog-card-actions,
    .changelog-card-header,
    .changelog-card-main-toggle {
        align-items: stretch;
    }

    .changelog-card-header {
        flex-direction: column;
    }

    .changelog-card-main-toggle {
        flex-direction: column;
    }

    .changelog-card-preview,
    .changelog-card-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .changelog-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .changelog-kpi-grid,
    .changelog-hero-meta,
    .changelog-card-preview,
    .changelog-card-summary {
        grid-template-columns: 1fr;
    }

    .changelog-hero {
        padding: 22px 18px;
    }

    .changelog-hero h2 {
        font-size: 26px;
    }

    .changelog-toolbar,
    .changelog-panel-head,
    .changelog-list,
    .correction-list {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ==================== INVESTOR CLASSIFICATION ==================== */
.ic-shell {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.ic-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 26px;
    padding: 30px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(59, 130, 246, 0.22);
    background:
        radial-gradient(circle at 88% 18%, rgba(45, 212, 191, 0.18), transparent 28%),
        radial-gradient(circle at 10% 5%, rgba(59, 130, 246, 0.26), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    box-shadow: 0 28px 48px -34px rgba(15, 23, 42, 0.82);
}

.ic-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 32%),
        linear-gradient(180deg, transparent 62%, rgba(59, 130, 246, 0.08));
}

.ic-hero-copy,
.ic-hero-meta {
    position: relative;
    z-index: 1;
}

.ic-hero h2 {
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.ic-hero p {
    margin-top: 14px;
    max-width: 760px;
    color: rgba(226, 232, 240, 0.86);
    font-size: 14px;
    line-height: 1.78;
}

.ic-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 12px;
    min-width: min(380px, 100%);
}

.ic-meta-pill {
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(10px);
}

.ic-meta-pill span,
.ic-kpi-card span,
.ic-toolbar-group span,
.ic-preview-item span,
.ic-stat span,
.ic-class-name span,
.ic-rank-copy span {
    display: block;
    color: var(--text-muted);
}

.ic-meta-pill span,
.ic-kpi-card span,
.ic-toolbar-group span,
.ic-preview-item span,
.ic-stat span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.ic-meta-pill strong {
    display: block;
    margin-top: 8px;
    color: #f8fafc;
    font-size: 15px;
    line-height: 1.35;
}

.ic-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.ic-kpi-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    min-height: 128px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    box-shadow: 0 18px 36px -32px rgba(15, 23, 42, 0.72);
}

.ic-kpi-card::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
}

.ic-kpi-card.is-positive::after {
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.ic-kpi-card.is-negative::after {
    background: linear-gradient(90deg, var(--danger-color), transparent);
}

.ic-kpi-card.is-warning::after {
    background: linear-gradient(90deg, var(--warning-color), transparent);
}

.ic-kpi-card strong {
    display: block;
    margin-top: 10px;
    color: var(--text-main);
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.ic-kpi-card em {
    display: block;
    margin-top: 9px;
    color: var(--text-muted);
    font-size: 12px;
    font-style: normal;
    line-height: 1.45;
}

.ic-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
}

.ic-toolbar-group {
    display: flex;
    flex: 1 1 0;
    min-width: 180px;
    flex-direction: column;
    gap: 8px;
}

.ic-toolbar-group.search {
    flex: 1.6 1 320px;
    min-width: 260px;
}

.ic-input,
.ic-select {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding: 0 14px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.ic-input::placeholder {
    color: rgba(148, 163, 184, 0.82);
}

.ic-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px 14px;
    color-scheme: dark;
    cursor: pointer;
}

.ic-select::-ms-expand {
    display: none;
}

.ic-select option {
    background: #0f172a;
    color: #f8fafc;
}

.ic-input:focus,
.ic-select:focus {
    border-color: rgba(59, 130, 246, 0.52);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.13);
}

.ic-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.ic-main,
.ic-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ic-panel,
.ic-note-card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    box-shadow: 0 22px 38px -34px rgba(15, 23, 42, 0.74);
}

.ic-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--border-color);
}

.ic-panel-head.compact {
    display: block;
}

.ic-panel-head h3 {
    font-size: 16px;
    letter-spacing: -0.02em;
}

.ic-panel-head p {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.ic-results-meta,
.ic-card-tags,
.ic-card-actions,
.ic-class-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ic-results-meta {
    justify-content: flex-end;
}

.ic-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.30);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.ic-chip.soft {
    color: #cbd5e1;
}

.ic-chip.positive {
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.24);
    background: rgba(16, 185, 129, 0.12);
}

.ic-chip.negative {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.22);
    background: rgba(239, 68, 68, 0.12);
}

.ic-chip.warning {
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.12);
}

.ic-pagination-slot {
    padding: 0 18px;
}

.ic-pagination-slot:empty {
    display: none;
}

.ic-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 16px;
}

.ic-pagination.is-bottom {
    padding: 0 0 18px;
}

.ic-page-btn,
.ic-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.32);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}

.ic-page-btn {
    padding: 9px 14px;
}

.ic-page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.ic-page-btn:not(:disabled):hover,
.ic-expand:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.36);
    background: rgba(59, 130, 246, 0.12);
}

.ic-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
}

.ic-card {
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
}

.ic-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 18px 14px;
}

.ic-ticker-button {
    flex: 0 0 auto;
    min-width: 64px;
    min-height: 52px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(96, 165, 250, 0.36);
    background: rgba(59, 130, 246, 0.16);
    color: #dbeafe;
    font-size: 15px;
    font-weight: 900;
    font-family: inherit;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.ic-ticker-button:hover {
    background: rgba(59, 130, 246, 0.24);
}

.ic-card-main-toggle,
.ic-card-preview {
    width: 100%;
    border: none;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.ic-card-main-toggle {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 0;
}

.ic-card-title {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

.ic-card-title strong {
    color: var(--text-main);
    font-size: 17px;
    line-height: 1.28;
}

.ic-card-title > span {
    color: #93c5fd;
    font-size: 13px;
    line-height: 1.45;
}

.ic-card-actions {
    justify-content: flex-end;
    align-items: flex-start;
    min-width: 270px;
}

.ic-card-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.28);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ic-chevron {
    transition: transform var(--transition-base);
}

.ic-chevron.is-open {
    transform: rotate(180deg);
}

.ic-card-preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 0 18px 18px 94px;
}

.ic-preview-item,
.ic-stat {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.10);
    background: rgba(15, 23, 42, 0.34);
    padding: 15px;
}

.ic-preview-item strong,
.ic-stat strong {
    display: block;
    margin-top: 8px;
    color: var(--text-main);
    font-size: 20px;
    line-height: 1.1;
    font-weight: 900;
}

.ic-preview-item em,
.ic-stat em {
    display: block;
    margin-top: 8px;
    color: #93c5fd;
    font-size: 12px;
    font-style: normal;
    line-height: 1.45;
}

.ic-card-detail {
    padding: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.ic-card-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.ic-class-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ic-class-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.4fr);
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.10);
    background: rgba(15, 23, 42, 0.28);
}

.ic-class-name strong,
.ic-rank-copy strong {
    display: block;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.35;
}

.ic-class-name span,
.ic-rank-copy span {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
}

.ic-class-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ic-dual-bar,
.ic-rank-track {
    position: relative;
    overflow: hidden;
    height: 9px;
    border-radius: var(--radius-full);
    background: rgba(15, 23, 42, 0.55);
}

.ic-dual-bar span,
.ic-rank-track span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
}

.ic-dual-bar .march {
    background: rgba(148, 163, 184, 0.38);
}

.ic-dual-bar .april {
    height: 4px;
    top: auto;
    bottom: 0;
    background: linear-gradient(90deg, #3b82f6, #2dd4bf);
}

.ic-class-metrics span {
    color: var(--text-muted);
    font-size: 12px;
}

.ic-class-metrics strong {
    color: var(--text-main);
}

.ic-class-metrics .positive,
.ic-rank-value.positive {
    color: #86efac;
}

.ic-class-metrics .negative,
.ic-rank-value.negative {
    color: #fca5a5;
}

.ic-expand {
    width: 100%;
    margin-top: 14px;
    padding: 11px 14px;
}

.ic-rank-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.ic-rank-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
}

.ic-rank-value {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 900;
}

.ic-rank-track {
    grid-column: 1 / -1;
    height: 7px;
}

.ic-rank-track span {
    background: linear-gradient(90deg, #3b82f6, #2dd4bf);
}

.ic-rank-track span.positive {
    background: linear-gradient(90deg, #10b981, #67e8f9);
}

.ic-rank-track span.negative {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.ic-note-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 18px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
}

.ic-note-card strong {
    color: var(--text-main);
    font-size: 14px;
}

.ic-note-card span {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.65;
}

.ic-empty {
    padding: 24px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
}

body[data-theme="light"] .ic-hero {
    background:
        radial-gradient(circle at 88% 18%, rgba(45, 212, 191, 0.13), transparent 26%),
        radial-gradient(circle at 10% 5%, rgba(59, 130, 246, 0.17), transparent 30%),
        linear-gradient(180deg, rgba(246, 250, 255, 0.99), rgba(255, 255, 255, 1));
    border-color: rgba(96, 165, 250, 0.20);
    box-shadow:
        0 22px 38px -32px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.76) inset,
        0 0 28px rgba(59, 130, 246, 0.10);
}

body[data-theme="light"] .ic-hero p {
    color: #475569;
}

body[data-theme="light"] .ic-meta-pill,
body[data-theme="light"] .ic-kpi-card,
body[data-theme="light"] .ic-toolbar,
body[data-theme="light"] .ic-panel,
body[data-theme="light"] .ic-card,
body[data-theme="light"] .ic-preview-item,
body[data-theme="light"] .ic-stat,
body[data-theme="light"] .ic-class-row,
body[data-theme="light"] .ic-note-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 255, 0.98));
    border-color: rgba(96, 165, 250, 0.14);
    box-shadow:
        0 18px 34px -30px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.84) inset,
        0 0 18px rgba(59, 130, 246, 0.08);
}

body[data-theme="light"] .ic-meta-pill strong,
body[data-theme="light"] .ic-kpi-card strong,
body[data-theme="light"] .ic-card-title strong,
body[data-theme="light"] .ic-preview-item strong,
body[data-theme="light"] .ic-stat strong,
body[data-theme="light"] .ic-class-name strong,
body[data-theme="light"] .ic-rank-copy strong,
body[data-theme="light"] .ic-note-card strong,
body[data-theme="light"] .ic-class-metrics strong {
    color: #0f172a;
}

body[data-theme="light"] .ic-meta-pill span,
body[data-theme="light"] .ic-kpi-card span,
body[data-theme="light"] .ic-toolbar-group span,
body[data-theme="light"] .ic-preview-item span,
body[data-theme="light"] .ic-stat span,
body[data-theme="light"] .ic-class-name span,
body[data-theme="light"] .ic-rank-copy span {
    color: #5f7695;
}

body[data-theme="light"] .ic-kpi-card em,
body[data-theme="light"] .ic-panel-head p,
body[data-theme="light"] .ic-note-card span {
    color: #475569;
}

body[data-theme="light"] .ic-card-title > span,
body[data-theme="light"] .ic-preview-item em,
body[data-theme="light"] .ic-stat em {
    color: #2563eb;
}

body[data-theme="light"] .ic-input,
body[data-theme="light"] .ic-select {
    background-color: #ffffff;
    color: #0f172a;
    border-color: rgba(203, 213, 225, 0.95);
    color-scheme: light;
}

body[data-theme="light"] .ic-input::placeholder {
    color: #64748b;
}

body[data-theme="light"] .ic-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

body[data-theme="light"] .ic-select option {
    background: #ffffff;
    color: #0f172a;
}

body[data-theme="light"] .ic-chip {
    background: linear-gradient(180deg, #f8fbff, #f2f7ff);
    border-color: rgba(147, 197, 253, 0.38);
    color: #33506f;
    box-shadow: 0 8px 18px -16px rgba(59, 130, 246, 0.18);
}

body[data-theme="light"] .ic-chip.positive {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.22);
    color: #047857;
}

body[data-theme="light"] .ic-chip.negative {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.20);
    color: #b91c1c;
}

body[data-theme="light"] .ic-chip.warning {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.22);
    color: #b45309;
}

body[data-theme="light"] .ic-ticker-button {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
}

body[data-theme="light"] .ic-card-toggle,
body[data-theme="light"] .ic-page-btn,
body[data-theme="light"] .ic-expand {
    background: linear-gradient(180deg, #ffffff, #f5f9ff);
    border-color: rgba(147, 197, 253, 0.42);
    color: #0f172a;
}

body[data-theme="light"] .ic-dual-bar,
body[data-theme="light"] .ic-rank-track {
    background: rgba(226, 232, 240, 0.88);
}

body[data-theme="light"] .ic-class-metrics span {
    color: #475569;
}

body[data-theme="light"] .ic-class-metrics .positive,
body[data-theme="light"] .ic-rank-value.positive {
    color: #047857;
}

body[data-theme="light"] .ic-class-metrics .negative,
body[data-theme="light"] .ic-rank-value.negative {
    color: #b91c1c;
}

@media (max-width: 1280px) {
    .ic-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ic-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .ic-hero,
    .ic-card-header,
    .ic-card-main-toggle {
        flex-direction: column;
    }

    .ic-hero-meta {
        width: 100%;
    }

    .ic-card-actions {
        justify-content: flex-start;
        min-width: 0;
    }

    .ic-card-preview,
    .ic-card-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-left: 18px;
    }

    .ic-class-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ic-hero,
    .ic-toolbar,
    .ic-panel-head,
    .ic-list,
    .ic-card-detail {
        padding-left: 16px;
        padding-right: 16px;
    }

    .ic-hero h2 {
        font-size: 27px;
    }

    .ic-kpi-grid,
    .ic-hero-meta,
    .ic-card-preview,
    .ic-card-summary {
        grid-template-columns: 1fr;
    }

    .ic-toolbar-group,
    .ic-toolbar-group.search {
        min-width: 100%;
    }
}
/* ==================== FREE FLOAT ==================== */
.ff-shell {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.ff-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 26px;
    padding: 30px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(245, 158, 11, 0.22);
    background:
        radial-gradient(circle at 88% 18%, rgba(245, 158, 11, 0.16), transparent 28%),
        radial-gradient(circle at 10% 5%, rgba(59, 130, 246, 0.22), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    box-shadow: 0 28px 48px -34px rgba(15, 23, 42, 0.82);
}

.ff-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 32%),
        linear-gradient(180deg, transparent 62%, rgba(245, 158, 11, 0.08));
}

.ff-hero-copy,
.ff-hero-meta {
    position: relative;
    z-index: 1;
}

.ff-hero h2 {
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.ff-hero p {
    margin-top: 14px;
    max-width: 760px;
    color: rgba(226, 232, 240, 0.86);
    font-size: 14px;
    line-height: 1.78;
}

.ff-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 12px;
    min-width: min(380px, 100%);
}

.ff-meta-pill,
.ff-kpi-card,
.ff-toolbar,
.ff-panel,
.ff-card,
.ff-preview-item,
.ff-stat,
.ff-compliance-row,
.ff-note-card {
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
}

.ff-meta-pill {
    padding: 15px 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.38);
    border-color: rgba(148, 163, 184, 0.16);
    backdrop-filter: blur(10px);
}

.ff-meta-pill span,
.ff-kpi-card span,
.ff-toolbar-group span,
.ff-preview-item span,
.ff-stat span,
.ff-rank-copy span,
.ff-watch-row em {
    display: block;
    color: var(--text-muted);
}

.ff-meta-pill span,
.ff-kpi-card span,
.ff-toolbar-group span,
.ff-preview-item span,
.ff-stat span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.ff-meta-pill strong {
    display: block;
    margin-top: 8px;
    color: #f8fafc;
    font-size: 15px;
    line-height: 1.35;
}

.ff-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.ff-kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 128px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    box-shadow: 0 18px 36px -32px rgba(15, 23, 42, 0.72);
}

.ff-kpi-card::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
}

.ff-kpi-card.is-positive::after {
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.ff-kpi-card.is-warning::after {
    background: linear-gradient(90deg, var(--warning-color), transparent);
}

.ff-kpi-card.is-danger::after {
    background: linear-gradient(90deg, var(--danger-color), transparent);
}

.ff-kpi-card strong {
    display: block;
    margin-top: 10px;
    color: var(--text-main);
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.ff-kpi-card em {
    display: block;
    margin-top: 9px;
    color: var(--text-muted);
    font-size: 12px;
    font-style: normal;
    line-height: 1.45;
}

.ff-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
}

.ff-toolbar-group {
    display: flex;
    flex: 1 1 0;
    min-width: 180px;
    flex-direction: column;
    gap: 8px;
}

.ff-toolbar-group.search {
    flex: 1.6 1 320px;
    min-width: 260px;
}

.ff-input,
.ff-select {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding: 0 14px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.ff-input::placeholder {
    color: rgba(148, 163, 184, 0.82);
}

.ff-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px 14px;
    color-scheme: dark;
    cursor: pointer;
}

.ff-select::-ms-expand {
    display: none;
}

.ff-select option {
    background: #0f172a;
    color: #f8fafc;
}

.ff-input:focus,
.ff-select:focus {
    border-color: rgba(245, 158, 11, 0.52);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.13);
}

.ff-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.ff-main,
.ff-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ff-panel,
.ff-note-card {
    border-radius: var(--radius-xl);
    box-shadow: 0 22px 38px -34px rgba(15, 23, 42, 0.74);
}

.ff-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--border-color);
}

.ff-panel-head.compact {
    display: block;
}

.ff-panel-head h3 {
    font-size: 16px;
    letter-spacing: -0.02em;
}

.ff-panel-head p {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.ff-results-meta,
.ff-card-tags,
.ff-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ff-results-meta {
    justify-content: flex-end;
}

.ff-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.30);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.ff-chip.soft,
.ff-chip.neutral {
    color: #cbd5e1;
}

.ff-chip.positive {
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.24);
    background: rgba(16, 185, 129, 0.12);
}

.ff-chip.warning,
.ff-chip.attention {
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.12);
}

.ff-chip.danger {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.22);
    background: rgba(239, 68, 68, 0.12);
}

.ff-pagination-slot {
    padding: 0 18px;
}

.ff-pagination-slot:empty {
    display: none;
}

.ff-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 16px;
}

.ff-pagination.is-bottom {
    padding: 0 0 18px;
}

.ff-page-btn,
.ff-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.32);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}

.ff-page-btn {
    padding: 9px 14px;
}

.ff-page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.ff-page-btn:not(:disabled):hover,
.ff-expand:hover {
    transform: translateY(-1px);
    border-color: rgba(245, 158, 11, 0.36);
    background: rgba(245, 158, 11, 0.12);
}

.ff-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
}

.ff-card {
    overflow: hidden;
    border-radius: 18px;
    border-color: rgba(148, 163, 184, 0.12);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
}

.ff-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 18px 14px;
}

.ff-ticker-button {
    flex: 0 0 auto;
    min-width: 64px;
    min-height: 52px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(251, 191, 36, 0.36);
    background: rgba(245, 158, 11, 0.14);
    color: #fde68a;
    font-size: 15px;
    font-weight: 900;
    font-family: inherit;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.ff-ticker-button:hover {
    background: rgba(245, 158, 11, 0.22);
}

.ff-card-main-toggle,
.ff-card-preview {
    width: 100%;
    border: none;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.ff-card-main-toggle {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 0;
}

.ff-card-title {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

.ff-card-title strong {
    color: var(--text-main);
    font-size: 17px;
    line-height: 1.28;
}

.ff-card-title > span {
    color: #fcd34d;
    font-size: 13px;
    line-height: 1.45;
}

.ff-card-actions {
    justify-content: flex-end;
    align-items: flex-start;
    min-width: 260px;
}

.ff-card-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.28);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ff-chevron {
    transition: transform var(--transition-base);
}

.ff-chevron.is-open {
    transform: rotate(180deg);
}

.ff-card-preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 0 18px 18px 94px;
}

.ff-preview-item,
.ff-stat {
    border-radius: 16px;
    border-color: rgba(148, 163, 184, 0.10);
    background: rgba(15, 23, 42, 0.34);
    padding: 15px;
}

.ff-preview-item strong,
.ff-stat strong {
    display: block;
    margin-top: 8px;
    color: var(--text-main);
    font-size: 20px;
    line-height: 1.1;
    font-weight: 900;
}

.ff-preview-item em,
.ff-stat em {
    display: block;
    margin-top: 8px;
    color: #fcd34d;
    font-size: 12px;
    font-style: normal;
    line-height: 1.45;
}

.ff-card-detail {
    padding: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.ff-card-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.ff-compliance-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ff-compliance-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
    gap: 16px;
    align-items: center;
    padding: 15px 16px;
    border-radius: 16px;
    border-color: rgba(148, 163, 184, 0.10);
    background: rgba(15, 23, 42, 0.28);
}

.ff-compliance-row strong {
    display: block;
    color: var(--text-main);
    font-size: 13px;
}

.ff-compliance-row span {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.ff-threshold-track,
.ff-rank-track {
    position: relative;
    overflow: hidden;
    height: 10px;
    border-radius: var(--radius-full);
    background: rgba(15, 23, 42, 0.55);
}

.ff-threshold-track span,
.ff-rank-track span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
}

.ff-threshold-track .required {
    background: rgba(148, 163, 184, 0.36);
}

.ff-threshold-track .actual {
    height: 4px;
    top: auto;
    bottom: 0;
}

.ff-threshold-track .actual.positive,
.ff-rank-track span.positive {
    background: linear-gradient(90deg, #10b981, #67e8f9);
}

.ff-threshold-track .actual.danger,
.ff-rank-track span.danger {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.ff-rank-track span.warning,
.ff-rank-track span.attention {
    background: linear-gradient(90deg, #f59e0b, #fde68a);
}

.ff-rank-track span.soft,
.ff-rank-track span.neutral {
    background: linear-gradient(90deg, #64748b, #cbd5e1);
}

.ff-expand {
    width: 100%;
    margin-top: 14px;
    padding: 11px 14px;
}

.ff-rank-list,
.ff-watch-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.ff-rank-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
}

.ff-rank-copy strong {
    display: block;
    color: var(--text-main);
    font-size: 13px;
}

.ff-rank-copy span {
    margin-top: 4px;
    font-size: 11px;
}

.ff-rank-value {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 900;
}

.ff-rank-track {
    grid-column: 1 / -1;
    height: 7px;
}

.ff-watch-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px;
    width: 100%;
    padding: 12px 13px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.28);
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.ff-watch-row:hover {
    border-color: rgba(245, 158, 11, 0.26);
    background: rgba(245, 158, 11, 0.08);
}

.ff-watch-row span {
    color: #fde68a;
    font-size: 12px;
    font-weight: 900;
}

.ff-watch-row strong {
    overflow: hidden;
    color: var(--text-main);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ff-watch-row em {
    grid-column: 2;
    font-size: 11px;
    font-style: normal;
}

.ff-note-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 18px;
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
}

.ff-note-card strong {
    color: var(--text-main);
    font-size: 14px;
}

.ff-note-card span {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.65;
}

.ff-empty {
    padding: 24px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
}

.ff-empty.small {
    padding: 14px;
    border-radius: 14px;
}

body[data-theme="light"] .ff-hero {
    background:
        radial-gradient(circle at 88% 18%, rgba(245, 158, 11, 0.11), transparent 26%),
        radial-gradient(circle at 10% 5%, rgba(59, 130, 246, 0.15), transparent 30%),
        linear-gradient(180deg, rgba(246, 250, 255, 0.99), rgba(255, 255, 255, 1));
    border-color: rgba(251, 191, 36, 0.24);
    box-shadow:
        0 22px 38px -32px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.76) inset,
        0 0 28px rgba(245, 158, 11, 0.09);
}

body[data-theme="light"] .ff-hero p {
    color: #475569;
}

body[data-theme="light"] .ff-meta-pill,
body[data-theme="light"] .ff-kpi-card,
body[data-theme="light"] .ff-toolbar,
body[data-theme="light"] .ff-panel,
body[data-theme="light"] .ff-card,
body[data-theme="light"] .ff-preview-item,
body[data-theme="light"] .ff-stat,
body[data-theme="light"] .ff-compliance-row,
body[data-theme="light"] .ff-note-card,
body[data-theme="light"] .ff-watch-row {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 255, 0.98));
    border-color: rgba(251, 191, 36, 0.18);
    box-shadow:
        0 18px 34px -30px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.84) inset,
        0 0 18px rgba(245, 158, 11, 0.07);
}

body[data-theme="light"] .ff-meta-pill strong,
body[data-theme="light"] .ff-kpi-card strong,
body[data-theme="light"] .ff-card-title strong,
body[data-theme="light"] .ff-preview-item strong,
body[data-theme="light"] .ff-stat strong,
body[data-theme="light"] .ff-rank-copy strong,
body[data-theme="light"] .ff-rank-value,
body[data-theme="light"] .ff-watch-row strong,
body[data-theme="light"] .ff-note-card strong,
body[data-theme="light"] .ff-compliance-row strong {
    color: #0f172a;
}

body[data-theme="light"] .ff-meta-pill span,
body[data-theme="light"] .ff-kpi-card span,
body[data-theme="light"] .ff-toolbar-group span,
body[data-theme="light"] .ff-preview-item span,
body[data-theme="light"] .ff-stat span,
body[data-theme="light"] .ff-rank-copy span,
body[data-theme="light"] .ff-compliance-row span {
    color: #5f7695;
}

body[data-theme="light"] .ff-kpi-card em,
body[data-theme="light"] .ff-panel-head p,
body[data-theme="light"] .ff-note-card span,
body[data-theme="light"] .ff-watch-row em {
    color: #475569;
}

body[data-theme="light"] .ff-card-title > span,
body[data-theme="light"] .ff-preview-item em,
body[data-theme="light"] .ff-stat em,
body[data-theme="light"] .ff-watch-row span {
    color: #b45309;
}

body[data-theme="light"] .ff-input,
body[data-theme="light"] .ff-select {
    background-color: #ffffff;
    color: #0f172a;
    border-color: rgba(203, 213, 225, 0.95);
    color-scheme: light;
}

body[data-theme="light"] .ff-input::placeholder {
    color: #64748b;
}

body[data-theme="light"] .ff-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

body[data-theme="light"] .ff-select option {
    background: #ffffff;
    color: #0f172a;
}

body[data-theme="light"] .ff-chip {
    background: linear-gradient(180deg, #f8fbff, #f2f7ff);
    border-color: rgba(251, 191, 36, 0.28);
    color: #33506f;
    box-shadow: 0 8px 18px -16px rgba(245, 158, 11, 0.18);
}

body[data-theme="light"] .ff-chip.positive {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.22);
    color: #047857;
}

body[data-theme="light"] .ff-chip.warning,
body[data-theme="light"] .ff-chip.attention {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.22);
    color: #b45309;
}

body[data-theme="light"] .ff-chip.danger {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.20);
    color: #b91c1c;
}

body[data-theme="light"] .ff-ticker-button {
    background: #fffbeb;
    border-color: #fbbf24;
    color: #b45309;
}

body[data-theme="light"] .ff-card-toggle,
body[data-theme="light"] .ff-page-btn,
body[data-theme="light"] .ff-expand {
    background: linear-gradient(180deg, #ffffff, #fff8ed);
    border-color: rgba(251, 191, 36, 0.36);
    color: #0f172a;
}

body[data-theme="light"] .ff-threshold-track,
body[data-theme="light"] .ff-rank-track {
    background: rgba(226, 232, 240, 0.88);
}

@media (max-width: 1280px) {
    .ff-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ff-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .ff-hero,
    .ff-card-header,
    .ff-card-main-toggle {
        flex-direction: column;
    }

    .ff-hero-meta {
        width: 100%;
    }

    .ff-card-actions {
        justify-content: flex-start;
        min-width: 0;
    }

    .ff-card-preview,
    .ff-card-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-left: 18px;
    }

    .ff-compliance-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ff-hero,
    .ff-toolbar,
    .ff-panel-head,
    .ff-list,
    .ff-card-detail {
        padding-left: 16px;
        padding-right: 16px;
    }

    .ff-hero h2 {
        font-size: 27px;
    }

    .ff-kpi-grid,
    .ff-hero-meta,
    .ff-card-preview,
    .ff-card-summary {
        grid-template-columns: 1fr;
    }

    .ff-toolbar-group,
    .ff-toolbar-group.search {
        min-width: 100%;
    }
}
