/* ==========================================================================
   INVEST WIZARD - DATA PIPELINE MONITOR & INSPECTOR CSS
   Theme: Modern Financial Terminal / Dark Glassmorphism
   ========================================================================== */

:root {
    --bg-main: #060911;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(6, 182, 212, 0.3);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --color-cyan: #06b6d4;
    --color-emerald: #10b981;
    --color-purple: #a855f7;
    --color-amber: #f59e0b;
    --color-rose: #f43f5e;
    --color-blue: #3b82f6;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
    pointer-events: none;
    z-index: -1;
    transform: translateZ(0);
    will-change: transform;
}

/* Typography Utility */
.font-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.text-cyan { color: var(--color-cyan) !important; }
.text-emerald { color: var(--color-emerald) !important; }
.text-purple { color: var(--color-purple) !important; }
.text-amber { color: var(--color-amber) !important; }
.text-rose { color: var(--color-rose) !important; }
.text-blue { color: var(--color-blue) !important; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 0.5rem; }
.py-6 { padding-top: 2rem; padding-bottom: 2rem; }

/* Optimized Glass Component (Zero GPU Jitter) */
.glass {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    contain: layout style;
}

/* Smooth Scrolling & Hardware Layer Acceleration */
.main-container {
    transform: translateZ(0);
    will-change: scroll-position;
}

.trade-log-section,
.explorer-section,
.category-breakdown {
    content-visibility: auto;
    contain-intrinsic-size: 1px 400px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 15, 29, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    transform: translateZ(0);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-icon {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-live {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--color-cyan);
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.header-stat .stat-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.header-stat .stat-value {
    font-size: 0.95rem;
    font-weight: 600;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: var(--color-cyan);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-refresh:hover {
    background: var(--color-cyan);
    color: #000;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
}

/* Main Container */
.main-container {
    flex: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.metric-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-card.glow-cyan:hover { box-shadow: 0 8px 25px rgba(6, 182, 212, 0.2); }
.metric-card.glow-emerald:hover { box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2); }
.metric-card.glow-purple:hover { box-shadow: 0 8px 25px rgba(168, 85, 247, 0.2); }
.metric-card.glow-amber:hover { box-shadow: 0 8px 25px rgba(245, 158, 11, 0.2); }
.metric-card.glow-blue:hover { box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2); }

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.metric-icon {
    font-size: 1.2rem;
}

.metric-big {
    font-size: 1.9rem;
    font-weight: 700;
}

.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-cyan), var(--color-emerald));
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-footer {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Category Progress Pills */
.category-breakdown {
    padding: 1.25rem;
}

.section-title h2 {
    font-size: 1.05rem;
    font-weight: 600;
}

.section-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.category-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.category-counts {
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* Explorer Section */
.explorer-section {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.explorer-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.explorer-title-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge-count {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(10, 15, 29, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    flex: 1;
    min-width: 260px;
    position: relative;
}

.search-box:focus-within {
    border-color: var(--color-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-dim);
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.85rem;
}

.pill-group {
    display: flex;
    background: rgba(10, 15, 29, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.pill-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.pill-btn:hover {
    color: var(--text-main);
}

.pill-btn.active {
    background: rgba(6, 182, 212, 0.2);
    color: var(--color-cyan);
    font-weight: 600;
}

.select-wrapper select {
    background: rgba(10, 15, 29, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.select-wrapper select:focus {
    border-color: var(--color-cyan);
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.data-table, .modal-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.data-table th, .modal-data-table th {
    background: rgba(15, 23, 42, 0.95);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td, .modal-data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.badge-status.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status.status-rate-limited {
    background: rgba(244, 63, 94, 0.15);
    color: var(--color-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-status.status-failed {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* Sub-type badges */
.badge-sub {
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Action Drilldown Button */
.btn-drilldown {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--color-cyan);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-drilldown:hover {
    background: var(--color-cyan);
    color: #000;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

/* Pagination Bar */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-page {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-page:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

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

.page-current {
    font-size: 0.85rem;
    padding: 0 0.5rem;
}

/* ==========================================================================
   DRILL-DOWN MODAL
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.9);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ticker-badge {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--color-cyan), var(--color-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-ticker-name {
    font-size: 1rem;
    color: var(--text-muted);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Summary Strip */
.summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.strip-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.strip-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.strip-val {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Missing Alert Box */
.missing-alert-box {
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-rose);
    font-size: 0.85rem;
}

.missing-dates-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.date-tag-missing {
    background: rgba(244, 63, 94, 0.2);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.4);
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

/* Calendar Timeline */
.calendar-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.calendar-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
}

.legend {
    display: flex;
    gap: 0.85rem;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.dot-present { background: var(--color-emerald); box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
.dot-missing { background: var(--color-rose); box-shadow: 0 0 6px rgba(244, 63, 94, 0.4); }
.dot-weekend { background: rgba(255, 255, 255, 0.08); }

.calendar-timeline-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-height: 120px;
    overflow-y: auto;
    padding: 0.25rem;
}

.day-cell {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    cursor: pointer;
    transition: transform var(--transition-fast);
    position: relative;
}

.day-cell:hover {
    transform: scale(1.6);
    z-index: 10;
}

.day-cell.cell-present { background: var(--color-emerald); }
.day-cell.cell-missing { background: var(--color-rose); }
.day-cell.cell-empty { background: rgba(255, 255, 255, 0.05); }

/* Tabs inside Modal */
.modal-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}

.modal-tab:hover {
    color: var(--text-main);
}

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

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.modal-table-box {
    max-height: 300px;
    overflow-y: auto;
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(6, 182, 212, 0.2);
    border-top-color: var(--color-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

/* Footer */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    border-top: 1px solid var(--border-color);
    background: rgba(6, 9, 17, 0.9);
}

/* ==========================================================================
   AI MODEL TRAINING & BACKTEST STUDIO STYLES
   ========================================================================== */

/* Main Navigation Tabs */
.main-nav {
    display: flex;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.35rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(168, 85, 247, 0.25));
    color: #fff;
    border: 1px solid rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.2);
}

.badge-gpu {
    font-size: 0.65rem;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    color: #000;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}

/* App Views */
.app-view {
    display: none;
}

.app-view.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

/* Control Card */
.ml-control-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ml-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.title-with-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.title-with-badge h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.badge-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

.badge-tag.glow-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.hardware-info-badge {
    background: rgba(6, 182, 212, 0.1);
    color: var(--color-cyan);
    border: 1px solid rgba(6, 182, 212, 0.25);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

.ml-control-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr auto;
    gap: 1.25rem;
    align-items: flex-start;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.flex-end {
    align-self: center;
    margin-top: 0.5rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-lg {
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    outline: none;
    transition: var(--transition-fast);
}

.input-lg:focus {
    border-color: var(--color-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.input-with-action {
    display: flex;
    gap: 0.35rem;
}

.input-with-action input {
    flex: 1;
}

.btn-input-action {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 0 0.75rem;
    cursor: pointer;
}

.quick-stock-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.quick-pill {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.quick-pill:hover, .quick-pill.active {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--color-cyan);
    color: #fff;
}

.input-currency-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-prefix {
    position: absolute;
    left: 0.75rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    pointer-events: none;
}

.input-currency-wrapper input {
    width: 100%;
    padding-left: 3.2rem;
}

.capital-pills {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.pill-cap {
    font-size: 0.7rem;
    padding: 0.2rem 0.45rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
}

.pill-cap.active, .pill-cap:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--color-emerald);
    color: var(--color-emerald);
}

.field-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.btn-execute-ml {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.35);
    transition: var(--transition-fast);
}

.btn-execute-ml:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(6, 182, 212, 0.5);
}

.btn-execute-ml:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading Card */
.ml-loading-card {
    text-align: center;
    padding: 3rem 2rem;
    margin-bottom: 1.5rem;
}

.spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(168, 85, 247, 0.2);
    border-top-color: var(--color-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.25rem;
}

/* Results Grid */
.ml-results-top-grid {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Tomorrow Forecast Card */
.forecast-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.forecast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.forecast-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-cyan);
    letter-spacing: 0.5px;
}

.forecast-verdict-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1.25rem;
}

.verdict-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.verdict-big {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.verdict-big.true {
    color: var(--color-rose);
    text-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

.verdict-big.false {
    color: var(--color-cyan);
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.verdict-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.forecast-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.f-detail-item {
    background: rgba(30, 41, 59, 0.4);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.f-lbl {
    display: block;
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 600;
}

.f-val {
    font-size: 0.95rem;
    font-weight: 600;
}

.sub-models-box {
    background: rgba(15, 23, 42, 0.5);
    padding: 0.85rem;
    border-radius: var(--radius-sm);
}

.sub-title {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sub-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
}

.sub-bar-name {
    width: 65px;
    color: var(--text-muted);
}

.sub-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.sub-bar-fill {
    height: 100%;
    background: var(--color-cyan);
    border-radius: var(--radius-full);
}

.sub-bar-val {
    width: 40px;
    text-align: right;
    font-weight: 600;
}

/* Portfolio Performance Card */
.portfolio-card {
    padding: 1.5rem;
}

.portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.portfolio-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-emerald);
    letter-spacing: 0.5px;
}

.portfolio-main-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
}

.pf-lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.25rem;
}

.pf-big {
    font-size: 1.6rem;
    font-weight: 700;
}

.pf-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
}

.pf-metric-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.pf-m-lbl {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.pf-m-val {
    font-size: 1.05rem;
    font-weight: 600;
}

/* Chart & Table Sections */
.chart-section, .trade-log-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-section .section-title {
    margin-bottom: 1rem;
}

.trade-tag-ok {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.75rem;
}

.trade-tag-miss {
    background: rgba(244, 63, 94, 0.15);
    color: var(--color-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.75rem;
}

.action-badge-buy {
    background: rgba(16, 185, 129, 0.2);
    color: var(--color-emerald);
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.action-badge-sell {
    background: rgba(244, 63, 94, 0.2);
    color: var(--color-rose);
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.action-badge-hold {
    color: var(--text-dim);
    font-size: 0.75rem;
}

/* ==========================================================================
   FIND SURGE (TOP 5 飆股雷達) STYLING
   ========================================================================== */

.glow-tab-purple {
    border-color: rgba(168, 85, 247, 0.4) !important;
}

.glow-tab-purple:hover, .glow-tab-purple.active {
    background: rgba(168, 85, 247, 0.15) !important;
    border-color: var(--color-purple) !important;
    color: var(--color-purple) !important;
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.3) !important;
}

.surge-intro-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
}

.banner-icon {
    font-size: 1.75rem;
}

.banner-content {
    font-size: 0.95rem;
    line-height: 1.5;
}

.surge-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.surge-card {
    position: relative;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(168, 85, 247, 0.25);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.surge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -6px rgba(168, 85, 247, 0.35);
    border-color: rgba(168, 85, 247, 0.6);
}

.surge-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rank-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
}

.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #000; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #000; }
.rank-3 { background: linear-gradient(135deg, #b45309, #78350f); color: #fff; }
.rank-other { background: rgba(255, 255, 255, 0.1); color: var(--text-main); }

.surge-prob-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-purple);
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.surge-card-title {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.surge-ticker {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-cyan);
}

.surge-name {
    font-size: 1.05rem;
    color: var(--text-main);
}

.surge-price-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.sp-item {
    display: flex;
    flex-direction: column;
}

.sp-lbl {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 600;
}

.sp-val {
    font-size: 1.15rem;
    font-weight: 700;
}

.surge-net-gain {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
}

.catalyst-tags-box {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.catalyst-tag {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.btn-card-backtest {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: var(--color-cyan);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
}

.btn-card-backtest:hover {
    background: var(--color-cyan);
    color: #000;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

/* Surge Mode Tabs */
.surge-mode-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 20px;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.75);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.surge-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.surge-mode-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.surge-mode-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.2);
}

.tab-icon {
    font-size: 1.15rem;
}

/* Surge Backtest Tables & Daily Stock Pills */
.surge-daily-table, .surge-ledger-table {
    min-width: 1100px;
    border-collapse: collapse;
}

.surge-daily-table th.text-right, .surge-daily-table td.text-right,
.surge-ledger-table th.text-right, .surge-ledger-table td.text-right {
    text-align: right !important;
}

.daily-picks-cell {
    white-space: normal !important;
    min-width: 380px !important;
    max-width: 460px !important;
    padding: 0.5rem 0.75rem !important;
    line-height: 1.4;
}

.daily-picks-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.73rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    line-height: 1.2;
}

.stock-pill .pill-ticker {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--color-cyan);
}

.stock-pill .pill-name {
    color: var(--text-main);
    font-size: 0.72rem;
}

.stock-pill .pill-ret {
    font-family: var(--font-mono);
    font-weight: 700;
}

.stock-pill.ret-pos {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
}

.stock-pill.ret-pos .pill-ret {
    color: #34d399;
}

.stock-pill.ret-neg {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.35);
}

.stock-pill.ret-neg .pill-ret {
    color: #fb7185;
}

/* Responsive */
@media (max-width: 1024px) {
    .ml-control-grid {
        grid-template-columns: 1fr 1fr;
    }
    .ml-results-top-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
    }
    .main-nav {
        width: 100%;
        justify-content: space-between;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .ml-control-grid {
        grid-template-columns: 1fr;
    }
    .pf-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Modal Dual-Layer Stock Price & Institutional Chips Chart Suite
   -------------------------------------------------------------------------- */
.modal-chart-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chart-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chart-title-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-main);
}

.chart-title-icon {
    font-size: 1.15rem;
}

.chart-range-controls {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.chart-range-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-range-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.chart-range-btn.active {
    background: var(--color-cyan);
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.chart-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 0.6rem 0.85rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.cs-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cs-lbl {
    color: var(--text-dim);
    font-size: 0.75rem;
}

.text-amber {
    color: #fbbf24;
}

.stock-chart-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.chart-canvas-box {
    position: relative;
    width: 100%;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
}

.chart-price-box {
    height: 230px;
}

.chart-chips-box {
    height: 140px;
}

.btn-card-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.18) 0%, rgba(168, 85, 247, 0.18) 100%);
    border: 1px solid rgba(6, 182, 212, 0.45);
    color: #38bdf8;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-card-chart:hover {
    background: linear-gradient(135deg, #06b6d4 0%, #a855f7 100%);
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.5);
    transform: translateY(-1px);
}

/* ==========================================================================
   Mobile Responsive Suite (Optimized for iPhone 16 / Mobile Devices)
   ========================================================================== */

@media screen and (max-width: 768px) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        overflow-x: hidden;
    }

    .main-container {
        padding: 10px;
    }

    /* App Header Mobile Layout */
    .app-header {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .brand {
        width: 100%;
        justify-content: space-between;
    }

    .brand-text h1 {
        font-size: 1.15rem;
    }

    .main-nav {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
        background: rgba(15, 23, 42, 0.6);
        padding: 4px;
        border-radius: var(--radius-md);
    }

    .nav-tab {
        justify-content: center;
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }

    .header-right {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding-top: 0.4rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .header-stat {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

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

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

    .user-profile-badge {
        padding: 4px 10px;
        font-size: 0.78rem;
    }

    /* Control Card & Filter Grid */
    .ml-control-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .ml-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .ml-control-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .form-group label {
        font-size: 0.72rem;
    }

    .btn-input-action, .btn-scan, .btn-primary, .btn-refresh {
        min-height: 44px;
        font-size: 0.9rem;
    }

    /* Surge Cards Grid for iPhone 16 */
    .surge-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .surge-card {
        padding: 1rem;
    }

    .surge-ticker {
        font-size: 1.25rem;
    }

    .surge-name {
        font-size: 0.95rem;
    }

    .sp-val {
        font-size: 1.05rem;
    }

    .surge-net-gain {
        font-size: 0.82rem;
        padding: 0.5rem 0.75rem;
    }

    /* Data Tables Mobile Overflow Touch Scroll */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-sm);
        margin-bottom: 1rem;
    }

    .data-table {
        min-width: 780px;
    }

    .data-table th, .data-table td {
        padding: 0.55rem 0.6rem;
        font-size: 0.78rem;
    }

    /* Explorer Header for 30-Day Ledger on Mobile */
    .explorer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .explorer-title-group {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.6rem !important;
    }

    #btn-trigger-validation {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }

    /* Modals on Mobile */
    .modal-content {
        width: 95% !important;
        max-height: 90vh !important;
        margin: 5vh auto !important;
        padding: 1rem !important;
        overflow-y: auto;
    }

    .chart-price-box {
        height: 190px !important;
    }

    .chart-chips-box {
        height: 120px !important;
    }
}

@media screen and (max-width: 414px) {
    /* Special iPhone 16 / small phone tweaks */
    .brand-text h1 {
        font-size: 1.05rem;
    }
}

.surge-mode-btn {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.surge-mode-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #f8fafc;
}

.surge-mode-btn.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(6, 182, 212, 0.25) 100%);
    border: 1px solid #a855f7;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}


