/* ==========================================================================
   MYFINANCESHEET - CUSTOM STYLING & CORE DESIGN SYSTEM
   ========================================================================== */

/* ── Global keyframe animations (must be at root level — not inside @media) ── */
@keyframes sidebar-slide-in {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

@keyframes scrim-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

:root {
    color-scheme: dark;
    
    /* Harmonious HSL Palette */
    --bg-primary: #15161e;
    --bg-secondary: #1e1f29;
    --bg-tertiary: #272836;
    
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-blue-glow: rgba(59, 130, 246, 0.2);
    
    --color-win: #10b981;
    --color-win-bg: rgba(16, 185, 129, 0.1);
    --color-win-glow: rgba(16, 185, 129, 0.15);
    
    --color-loss: #ef4444;
    --color-loss-bg: rgba(239, 68, 68, 0.1);
    --color-loss-glow: rgba(239, 68, 68, 0.15);
    
    --color-wash: #6b7280;
    --color-wash-bg: rgba(107, 114, 128, 0.1);
    
    --color-open: #f59e0b;
    --color-open-bg: rgba(245, 158, 11, 0.1);
    
    --color-setup: #a855f7;
    --color-setup-bg: rgba(168, 85, 247, 0.15);
    
    --saffron: #fb923c;
    
    --color-note: #eab308;
    --color-note-bg: rgba(234, 179, 8, 0.15);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    
    --glass-bg: rgba(30, 31, 41, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --rrg-canvas-bg: rgba(0, 0, 0, 0.2);
    
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
    --border-radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    
    /* Scrollbars */
    --scrollbar-track: var(--bg-primary);
    --scrollbar-thumb: rgba(255, 255, 255, 0.15);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.3);
    
    /* Mobile Sidebar Panel Drawer */
    --sidebar-panel-bg: #12131a;
    --sidebar-panel-color: #e0e1e8;
    --sidebar-panel-shadow: 4px 0 32px rgba(0, 0, 0, 0.9);
    
    /* Dialog Modals & Replay Simulator */
    --modal-overlay-bg: rgba(10, 11, 15, 0.7);
    --mental-replay-overlay-bg: rgba(10, 11, 15, 0.9);
    --replay-container-bg: rgba(20, 21, 28, 0.7);
    --replay-sidebar-bg: rgba(20, 21, 28, 0.4);
    --replay-chart-area-bg: rgba(0, 0, 0, 0.15);
    
    /* Interactive Hover backgrounds */
    --nav-item-bg: rgba(255, 255, 255, 0.01);
    --nav-item-hover: rgba(255, 255, 255, 0.03);
    --hover-bg: rgba(255, 255, 255, 0.02);
    
    /* Lock Screen & PIN Keypad */
    --lock-overlay-bg: rgba(15, 17, 26, 0.85);
    --keypad-btn-bg: rgba(255, 255, 255, 0.02);
    --keypad-btn-color: var(--text-primary);
    --keypad-btn-hover-bg: rgba(255, 255, 255, 0.08);
    --keypad-btn-active-bg: rgba(255, 255, 255, 0.15);
    
    /* Calendar Picker Icon Filter */
    --calendar-icon-filter: invert(1) brightness(2.0);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, .logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius-md);
}

/* Performance: Remove backdrop-filter when typing inside a glass-card to prevent Chrome rendering lag */
.glass-card:focus-within {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.text-green { color: var(--color-win) !important; }
.text-red { color: var(--color-loss) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-muted { color: var(--text-muted) !important; }

.flex-row { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.align-end { align-items: flex-end; }
.align-center { align-items: center; }
.margin-top { margin-top: 16px; }
.margin-top-auto { margin-top: auto; }
.hidden { display: none !important; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.h-full { height: 100%; }

/* Privacy Blur Effect */
body.privacy-active .privacy-blur {
    filter: blur(6px) !important;
    user-select: none !important;
    pointer-events: none !important;
}

/* ==========================================================================
   BUTTONS & INPUTS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    color: var(--text-primary);
}

.btn-primary {
    background-color: var(--accent-blue);
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    box-shadow: 0 0 12px var(--accent-blue-glow);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color-hover);
}

.btn-full {
    width: 100%;
}

.btn-action-trade {
    background-color: var(--accent-blue-hover);
}

.btn-action-trade:hover {
    background-color: var(--accent-blue);
    box-shadow: 0 0 12px var(--accent-blue-glow);
}

.btn-action-setup {
    background-color: var(--color-setup-bg);
    border: 1px solid var(--color-setup);
    color: var(--color-setup);
}

.btn-action-setup:hover {
    background-color: var(--color-setup);
    color: var(--text-primary);
    box-shadow: 0 0 12px var(--color-setup-bg);
}

.btn-action-note {
    background-color: var(--color-note-bg);
    border: 1px solid var(--color-note);
    color: var(--color-note);
}

.btn-action-note:hover {
    background-color: var(--color-note);
    color: var(--bg-primary);
    box-shadow: 0 0 12px var(--color-note-bg);
}

.btn-icon-only {
    padding: 10px;
    border-radius: var(--border-radius-md);
}

.btn-google {
    background-color: #ffffff;
    color: #1f2937;
    border: none;
}

.btn-google:hover {
    background-color: #f3f4f6;
}

.btn-danger {
    background-color: var(--color-loss-bg);
    border: 1px solid var(--color-loss);
    color: var(--color-loss);
}

.btn-danger:hover {
    background-color: var(--color-loss);
    color: var(--text-primary);
    box-shadow: 0 0 12px var(--color-loss-glow);
}

/* Split footer: delete on left, cancel+save on right */
.modal-footer-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Clickable trade rows */
.trade-log-table tbody tr[data-trade-id]:hover {
    background-color: rgba(255, 255, 255, 0.025);
}

.icon-btn, .icon-btn-tiny {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.icon-btn {
    padding: 8px;
    border-radius: var(--border-radius-md);
}

.icon-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.icon-btn-tiny {
    padding: 4px;
}

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

/* Input Fields */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    outline: none;
    font-family: inherit;
    font-size: 13px;
    transition: all var(--transition-fast);
}

input[type="date"],
input[type="datetime-local"] {
    color-scheme: inherit;
}

/* Remove spinner arrows from Leverage inputs */
#trade-margin::-webkit-inner-spin-button,
#trade-margin::-webkit-outer-spin-button,
#edit-trade-margin::-webkit-inner-spin-button,
#edit-trade-margin::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue-glow);
}

/* Custom Select Dropdowns */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.portfolio-dropdown {
    width: 100%;
    appearance: none;
    padding-right: 32px !important;
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
}

/* Radio Toggles */
.side-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.label-heading {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.toggle-switch {
    display: flex;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 4px;
    width: fit-content;
}

.toggle-switch input[type="radio"] {
    display: none;
}

.toggle-switch label {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.toggle-switch input[type="radio"]:checked + label.label-long {
    background-color: var(--color-win-bg);
    color: var(--color-win);
}

.toggle-switch input[type="radio"]:checked + label.label-short {
    background-color: var(--color-loss-bg);
    color: var(--color-loss);
}

/* Slider */
.slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

input[type="range"] {
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: var(--border-radius-full);
    background: var(--bg-tertiary);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-setup);
    cursor: pointer;
    box-shadow: 0 0 10px var(--color-setup-bg);
    transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-axis {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
}

/* Button groups */
.btn-toggle-group {
    display: flex;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 3px;
    gap: 4px;
    width: fit-content;
}

.toggle-btn-small {
    background: transparent;
    border: none;
    padding: 6px 12px;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.toggle-btn-small svg {
    width: 16px;
    height: 16px;
}

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

.toggle-btn-small.active {
    background-color: var(--accent-blue);
    color: var(--text-primary);
}

/* ==========================================================================
   AUTHENTICATION MODULE SCREEN
   ========================================================================== */

.screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.screen-overlay.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.auth-header {
    text-align: center;
}

.logo-text {
    font-size: 28px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.auth-form.active {
    display: flex;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 10px;
}

.auth-switch {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-status-link-wrapper {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-status-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    transition: all var(--transition-fast);
}

.auth-status-link:hover {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: var(--text-primary) !important;
    transform: translateY(-1px);
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */

#app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar navigation — owns its own visual styles (not from glass-card class) */
#app-sidebar {
    width: 260px;
    height: calc(100vh - 24px);
    margin: 12px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
    overflow: hidden;
    /* Own glass styles (was glass-card) — desktop only */
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius-md);
}

.sidebar-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-portfolio {
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.balance-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.balance-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-val {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
}

.balance-sub {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-nav ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    font-size: 11.5px;
    background: var(--nav-item-bg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    min-height: 38px;
    text-align: left;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.nav-item:hover {
    background-color: var(--nav-item-hover);
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.nav-item:hover svg {
    transform: translateY(-1px);
}

.nav-item.active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--accent-blue) !important;
    box-shadow: 0 0 10px var(--accent-blue-glow);
}

.nav-item.span-2 {
    grid-column: span 2;
    padding: 8px 14px;
    gap: 12px;
}

.sidebar-actions {
    padding: 8px 10px;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.sidebar-actions .btn {
    padding: 8px 10px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-details span:first-child {
    font-weight: 500;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.user-details span:last-child {
    font-size: 11px;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Main content panel */
#app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 12px 12px 0;
    height: 100vh;
    overflow: hidden;
}

#main-header {
    height: 60px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-bottom: 12px;
    position: relative;
    z-index: 1010;
}

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

.date-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.date-filters::-webkit-scrollbar {
    display: none; /* Hide scrollbars for the filters bar */
}

.filter-pill {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--border-radius-full);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-pill:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.filter-pill.active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.header-date-text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Tab contents viewport */
#page-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.tab-view {
    display: none;
}

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

/* ==========================================================================
   TAB: DASHBOARD VIEW
   ========================================================================== */

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    gap: 12px;
}

.curve-thumb-card {
    height: 100%;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-equity-chart {
    width: 100%;
    height: 100%;
}

.progress-ring-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.ring-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    gap: 10px;
}

.ring-container {
    position: relative;
    width: 60px;
    height: 60px;
}

.ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 3.5;
}

.ring-fill {
    fill: none;
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dasharray var(--transition-normal);
}

.ring-fill.win-color { stroke: var(--color-win); }
.ring-fill.loss-color { stroke: var(--color-loss); }
.ring-fill.open-color { stroke: var(--accent-blue); }
.ring-fill.wash-color { stroke: var(--color-wash); }

.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.card-details {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.card-val {
    font-size: 18px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    margin-top: 2px;
}

.average-pnl-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.average-pnl-cards .stat-card {
    padding: 12px 16px;
    font-size: 12px;
}

@media (min-width: 1025px) {
    .average-pnl-cards {
        height: 100%;
    }
    .average-pnl-cards .stat-card {
        flex: 1;
    }
}

.average-pnl-cards .lbl {
    font-weight: 600;
    color: var(--text-secondary);
}

.average-pnl-cards .val {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
}

.average-pnl-cards .pct {
    font-size: 10px;
    font-weight: 500;
}

.pnl-bar-card {
    flex-direction: row !important;
}

.pnl-meter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-left: 20px;
}

.pnl-gauge-bg {
    width: 100%;
    height: 4px;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius-full);
    position: relative;
    overflow: hidden;
}

.pnl-gauge-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--color-win);
    width: 0%;
    border-radius: var(--border-radius-full);
    transition: width var(--transition-normal);
}

.pnl-total-pct {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 700;
}

/* Grouped Trade Table Stylings */
.trade-log-container {
    padding: 16px;
}

.table-scroll-container {
    width: 100%;
    overflow-x: auto;
    min-height: 200px;
}

.trade-log-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 12.5px;
}

.trade-log-table th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
    font-size: 12px;
}

.trade-log-table th.sortable {
    cursor: pointer;
}

.trade-log-table th.sortable:hover {
    color: var(--text-primary);
}

.sort-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    vertical-align: middle;
}

.trade-log-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
}

.trade-log-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Pill status tags */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--border-radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.status-pill.win { background-color: var(--color-win-bg); color: var(--color-win); }
.status-pill.loss { background-color: var(--color-loss-bg); color: var(--color-loss); }
.status-pill.wash { background-color: var(--color-wash-bg); color: var(--text-secondary); }
.status-pill.open { background-color: var(--color-open-bg); color: var(--color-open); }

.side-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.side-arrow svg {
    width: 14px;
    height: 14px;
}

/* Daily Divider Row */
.daily-divider-row td {
    background-color: var(--bg-secondary) !important;
    padding: 8px 16px !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-top: 1px solid var(--border-color) !important;
}

.divider-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.divider-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.divider-date {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

.divider-mood {
    display: flex;
    gap: 4px;
    color: var(--text-secondary);
}

.divider-mood svg {
    width: 14px;
    height: 14px;
}

.divider-summary-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-note);
    background-color: var(--color-note-bg);
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
}

.divider-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.divider-pnl {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.divider-return-pct {
    font-size: 11px;
    font-weight: 500;
}

.divider-badge-group {
    display: flex;
    gap: 6px;
}

.divider-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.divider-badge.win { background-color: var(--color-win); color: var(--bg-primary); }
.divider-badge.loss { background-color: var(--color-loss); color: var(--text-primary); }

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    gap: 12px;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 320px;
}

/* ==========================================================================
   TAB: CHARTS VIEW
   ========================================================================== */
.charts-ux-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: var(--border-radius-md);
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.charts-ux-banner .ux-banner-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.charts-ux-banner span {
    font-size: 11.5px;
    line-height: 1.4;
}

.charts-ux-banner strong {
    color: var(--text-primary);
}

.charts-view-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 155px);
    min-height: 500px;
    padding: 0;
    overflow: hidden;
    border-radius: var(--border-radius-md);
}

.tradingview-widget-container {
    flex: 1;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #131722;
    display: flex;
    flex-direction: column;
}

.tradingview-widget-container iframe,
.tradingview-widget-container div:not(#chart-main-pane):not(#chart-rsi-pane):not(#chart-pane-splitter):not(.custom-chart-note) {
    height: 100% !important;
    width: 100% !important;
}

/* ==========================================================================
   TAB: STATS VIEW
   ========================================================================== */

.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.stats-mini-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stats-mini-card .lbl {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.stats-mini-card .val {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.chart-container-large {
    padding: 20px;
}

.chart-header-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.canvas-wrapper-large {
    width: 100%;
    height: 350px;
}

.stats-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stats-three-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.chart-card-medium {
    padding: 20px;
}

.canvas-wrapper-medium {
    width: 100%;
    height: 250px;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.breakdown-card {
    padding: 20px;
}

.breakdown-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.breakdown-card th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
}

.breakdown-card td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-card tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   STATS INSIGHT CARDS: EXPECTANCY & FOUR QUADRANTS
   ========================================================================== */

.stats-insight-card {
    padding: 20px;
}

/* -- Expectancy -- */
.expectancy-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.expectancy-main-value {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.expectancy-amount {
    font-family: 'Outfit', sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

.expectancy-per-trade {
    font-size: 12px;
    color: var(--text-secondary);
}

.expectancy-badge-wrap {
    display: flex;
}

.expectancy-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid;
}

.expectancy-badge.badge-positive {
    color: var(--color-win);
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
}

.expectancy-badge.badge-negative {
    color: var(--color-loss);
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}

.expectancy-badge.badge-neutral {
    color: var(--text-secondary);
    border-color: var(--border-color);
    background: transparent;
}

.expectancy-chips {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
}

.exp-chip {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 7px 12px;
}

.exp-chip-lbl {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.exp-chip-val {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}


/* -- Four Quadrants -- */
.quadrants-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
    height: 190px;
    margin-bottom: 10px;
}

.quadrant {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    border-radius: var(--border-radius-sm);
    padding: 10px 8px;
    border: 1px solid;
    text-align: center;
}

.q-big-win  { background: rgba(16,185,129,0.09); border-color: rgba(16,185,129,0.28); }
.q-small-win { background: rgba(16,185,129,0.04); border-color: rgba(16,185,129,0.12); }
.q-small-loss { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.18); }
.q-big-loss { background: rgba(239,68,68,0.09); border-color: rgba(239,68,68,0.28); }

.q-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.q-count {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}

.q-pnl {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 600;
}

.q-pct {
    font-size: 10px;
    color: var(--text-secondary);
}

.quad-profile-text {
    margin: 0;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* -- Expectancy Split Card (Left stats + Right surface heatmap) -- */
.expectancy-split-card {
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.expectancy-left {
    flex: 0 0 48%;
    padding: 20px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.expectancy-right {
    flex: 1;
    padding: 16px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

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

.surface-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--text-primary);
    text-transform: uppercase;
}

.surface-subtitle {
    font-size: 10px;
    color: var(--text-secondary);
}

.surface-canvas-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
}

.surface-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border-radius: 4px;
}

.surface-axis-y {
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    font-size: 8px;
    color: var(--text-secondary);
    white-space: nowrap;
    letter-spacing: 0.04em;
}

.surface-axis-x {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: var(--text-secondary);
    white-space: nowrap;
    letter-spacing: 0.04em;
}

.surface-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

.legend-dot-star {
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255,255,255,0.8);
}

.surface-tooltip {
    position: absolute;
    display: none;
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 7px 11px;
    font-size: 10px;
    line-height: 1.7;
    color: var(--text-primary);
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}

/* Mobile surface viz — CSS gradient bar (no canvas) */
.surface-mobile-viz {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.surface-gradient-bar {
    position: relative;
    height: 18px;
    border-radius: 9px;
    overflow: visible;
    background: linear-gradient(to right,
        #7f1d1d 0%,
        #ef4444 20%,
        #f97316 35%,
        #eab308 50%,
        #22c55e 65%,
        #16a34a 80%,
        #14532d 100%);
}

.surface-pos-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid rgba(0,0,0,0.4);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3), 0 2px 8px rgba(0,0,0,0.5);
    transition: left 0.4s ease;
    z-index: 2;
}

.surface-zone-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.surface-zone-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.surface-zone-meta {
    font-size: 10px;
    color: var(--text-secondary);
}

.surface-gradient-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-secondary);
    margin-top: -6px;
}

/* ==========================================================================
   TAB: CALENDAR VIEW
   ========================================================================== */

.calendar-layout-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 12px;
}

.calendar-main-card {
    padding: 24px;
}

.calendar-header-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.calendar-month-year-label {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    min-width: 120px;
    text-align: center;
}

.calendar-weekdays-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 90px;
    gap: 6px;
}

.calendar-day-box {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.01);
    transition: all var(--transition-fast);
    cursor: pointer;
    overflow: hidden;
}

.calendar-day-box:hover {
    border-color: var(--border-color-hover);
    background-color: var(--bg-tertiary);
}

.calendar-day-num {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.calendar-day-box.outside-month {
    opacity: 0.25;
    pointer-events: none;
}

/* Color Coding Days */
.calendar-day-box.day-profit {
    border-color: rgba(16, 185, 129, 0.3);
    background-color: rgba(16, 185, 129, 0.05);
}
.calendar-day-box.day-profit:hover {
    border-color: var(--color-win);
    background-color: rgba(16, 185, 129, 0.1);
}

.calendar-day-box.day-loss {
    border-color: rgba(239, 68, 68, 0.3);
    background-color: rgba(239, 68, 68, 0.05);
}
.calendar-day-box.day-loss:hover {
    border-color: var(--color-loss);
    background-color: rgba(239, 68, 68, 0.1);
}

.calendar-day-box.day-wash {
    border-color: rgba(107, 114, 128, 0.3);
}

.calendar-day-pnl {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-align: right;
}

.calendar-day-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
}

.calendar-day-mood {
    display: flex;
    align-items: center;
}

.calendar-day-mood svg {
    width: 12px;
    height: 12px;
}

.calendar-side-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.weekly-summaries-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.weekly-summary-item {
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--border-radius-md);
    background-color: rgba(255, 255, 255, 0.01);
}

.weekly-summary-item .title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.weekly-summary-item .pnl-row {
    display: flex;
    justify-content: space-between;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
}

.weekly-summary-item .stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   TAB: SETTINGS VIEW & SUB-TABS
   ========================================================================== */

.settings-layout-wrapper {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 12px;
}

.settings-nav-card {
    padding: 16px 12px;
    height: fit-content;
}

.settings-nav-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.settings-nav-item svg {
    width: 16px;
    height: 16px;
}

.settings-nav-item:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.settings-nav-item.active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-left: 2px solid var(--accent-blue);
    border-top-left-radius: 2px;
    border-bottom-left-radius: 2px;
}

.settings-viewports-container {
    width: 100%;
}

.settings-viewport {
    display: none;
    padding: 24px;
    width: 100%;
}

.settings-viewport.active {
    display: block;
}

.settings-title {
    font-size: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.settings-sharing-panel {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.sharing-desc {
    color: var(--text-secondary);
    font-size: 12.5px;
    margin-bottom: 16px;
    max-width: 500px;
}

#public-link-container {
    display: flex;
    gap: 8px;
    max-width: 500px;
}

#public-link-input {
    flex: 1;
    background-color: var(--bg-primary);
}

/* Tag Manager Panel Styles */
.tag-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.tag-manager-header h3 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

#settings-tag-table-body td {
    padding: 10px 16px;
}

/* ==========================================================================
   DIALOG MODALS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 11, 15, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

.modal-container {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-container.width-sm { width: 100%; max-width: 400px; }
.modal-container.width-md { width: 100%; max-width: 540px; }
.modal-container.width-lg { width: 100%; max-width: 800px; }

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

.modal-header h3 {
    font-size: 16px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
}

.modal-tab-btn {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

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

.modal-tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-blue);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden !important;
}

.modal-tab-panel {
    display: none;
}

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

.modal-form-row {
    display: flex;
    gap: 16px;
}

.modal-form-row > .input-group {
    min-width: 0;
}

.modal-form-row input,
.modal-form-row select {
    min-width: 0;
    width: 100%;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Dynamic Transactions Lists inside New Trade Modal */
.transaction-lines-section {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.transaction-line-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 100px 80px 40px;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 10px;
}

/* Multiselect Custom Search Container */
.tags-multiselect-container {
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius-md);
    padding: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: relative;
}

.selected-tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── Market Pill Selector ─────────────────────────── */
/* Full-width horizontal band at top of modal */
.market-pill-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 14px;
}

.market-pill-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
}

.market-pill-selector {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}
.market-pill-selector::-webkit-scrollbar { display: none; }

.market-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 20px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

.market-pill:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: var(--accent-blue-glow);
    transform: translateY(-1px);
}

.market-pill.active {
    border-color: var(--accent-blue);
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

@media (max-width: 640px) {
    .market-pill-row {
        padding: 6px 8px;
        gap: 6px;
    }
    .market-pill {
        padding: 4px 7px;
        font-size: 10px;
    }
}

/* ══════════════════════════════════════════════════
   TRADING JOURNEY CARD
══════════════════════════════════════════════════ */
.journey-card { padding: 0; border: 1px solid var(--border-color); }

.journey-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}
.journey-card-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0 0 2px; font-family: 'Outfit', sans-serif; }
.journey-card-sub   { font-size: 12px; color: var(--text-muted); margin: 0; }

.journey-stage-badge {
    display: flex; flex-direction: column; align-items: center;
    background: color-mix(in srgb, var(--stage-color) 12%, transparent);
    border: 1.5px solid var(--stage-color);
    border-radius: 10px; padding: 8px 16px; flex-shrink: 0;
}
.journey-badge-num  { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: var(--stage-color); text-transform: uppercase; }
.journey-badge-name { font-size: 13px; font-weight: 700; color: var(--stage-color); white-space: nowrap; }

.journey-svg-wrapper { padding: 12px 16px 4px; background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.1) 100%); }
.journey-svg { width: 100%; height: auto; max-height: 200px; display: block; }

@keyframes journeyPulseOuter { 0%,100% { opacity:0.12; } 50% { opacity:0.28; } }
@keyframes journeyPulseMid   { 0%,100% { opacity:0.30; } 50% { opacity:0.55; } }
.journey-pulse-outer { animation: journeyPulseOuter 2s ease-in-out infinite; }
.journey-pulse-mid   { animation: journeyPulseMid   2s ease-in-out infinite; }

.journey-stages-row {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border-color);
}
.journey-stage-tile { padding: 12px 14px; border-right: 1px solid var(--border-color); }
.journey-stage-tile:last-child { border-right: none; }
.journey-stage-tile.passed   { background: color-mix(in srgb, var(--tile-color) 6%, transparent); }
.journey-stage-tile.active   { background: color-mix(in srgb, var(--tile-color) 14%, transparent); border-top: 2px solid var(--tile-color); }
.journey-stage-tile.upcoming { opacity: 0.45; }

.journey-tile-top  { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.journey-tile-emoji { font-size: 16px; }
.journey-tile-num  { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); text-transform: uppercase; flex: 1; }
.journey-tile-check { font-size: 11px; font-weight: 800; color: var(--tile-color); background: color-mix(in srgb, var(--tile-color) 15%, transparent); border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.journey-tile-name  { font-size: 12px; font-weight: 600; color: var(--tile-color, var(--text-primary)); display: block; }
.journey-stage-tile.upcoming .journey-tile-name { color: var(--text-muted); }

.journey-insight-row { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border-color); }
.journey-insight-left { padding: 16px 18px; border-right: 1px solid var(--border-color); }
.journey-insight-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 14px; }

.journey-metrics-mini { display: flex; gap: 10px; flex-wrap: wrap; }
.jmm-item { display: flex; flex-direction: column; gap: 2px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 8px; padding: 6px 12px; min-width: 78px; }
.jmm-label { font-size: 9px; font-weight: 700; letter-spacing: 0.07em; color: var(--text-muted); text-transform: uppercase; }
.jmm-val   { font-size: 17px; font-weight: 800; color: var(--text-primary); font-family: 'Outfit', monospace; }

.journey-next-step { padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.journey-next-label { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
.journey-next-desc  { font-size: 13px; color: var(--text-secondary); line-height: 1.65; margin: 0; border-left: 3px solid var(--accent-blue); padding-left: 12px; }
.journey-mastered .journey-next-label { color: #6366f1; }
.journey-mastered .journey-next-desc  { border-color: #6366f1; }

@media (max-width: 768px) {
    .journey-stages-row  { grid-template-columns: repeat(2, 1fr); }
    .journey-insight-row { grid-template-columns: 1fr; }
    .journey-insight-left { border-right: none; border-bottom: 1px solid var(--border-color); }
    .journey-card-header  { flex-direction: column; align-items: flex-start; }
    .journey-stage-badge  { flex-direction: row; gap: 8px; }
}

@media (max-width: 480px) {
    /* Fix 1: Force taller chart — max-height alone doesn't work because SVG
       auto-calculates height from viewBox aspect ratio (900×195 → ~87px on 400px screens).
       We must set explicit height to override the ratio. */
    .journey-svg-wrapper {
        padding: 10px 10px 2px;
        min-height: 165px;
    }
    .journey-svg {
        height: 165px;       /* force height — overrides auto aspect-ratio */
        max-height: unset;
        width: 100%;
    }

    /* Fix 2: 4 metric boxes in a clean 2×2 grid, equal width */
    .journey-metrics-mini {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .jmm-item {
        min-width: unset;
        width: 100%;
    }
}

.selected-tag-pill {
    background-color: var(--color-setup-bg);
    color: var(--color-setup);
    border: 1px solid var(--color-setup);
    padding: 2px 8px;
    font-size: 11px;
    border-radius: var(--border-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}


.selected-tag-pill svg {
    width: 10px;
    height: 10px;
    cursor: pointer;
}

.tags-multiselect-container input[type="text"] {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 4px 6px !important;
    min-width: 120px;
    box-shadow: none !important;
}

.tag-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.tag-dropdown-item {
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.tag-dropdown-item:hover {
    background-color: var(--bg-tertiary);
}

/* Rich Notes Editor toolbar */
.editor-toolbar {
    display: flex;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-top-left-radius: var(--border-radius-md);
    border-top-right-radius: var(--border-radius-md);
    padding: 4px;
    gap: 4px;
}

.editor-toolbar + textarea {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.tool-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tool-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

/* Setup R:R calculator */
.risk-reward-indicator-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.01);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.risk-reward-indicator-panel .ratio-val {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-blue);
}

/* Day Note Selectors */
.note-selectors-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

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

/* ==========================================================================
   TOAST NOTIFICATIONS & GLOBAL LOADERS
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--accent-blue);
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    animation: slide-in var(--transition-normal);
}

.toast.win-toast { border-left-color: var(--color-win); }
.toast.loss-toast { border-left-color: var(--color-loss); }

.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 11, 15, 0.5);
    backdrop-filter: blur(2px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

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

@keyframes scale-up {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-fade-in { animation: fade-in var(--transition-normal) forwards; }
.animate-scale-up { animation: scale-up var(--transition-normal) forwards; }

.mobile-only-flex {
    display: none !important;
}

/* ==========================================================================
   MOBILE & TABLET BREAKPOINTS (RESPONSIVENESS)
   ========================================================================== */

/* Mobile header / burger display logic */
.mobile-only-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
}
@media (max-width: 1400px) {
    .trade-log-table th,
    .trade-log-table td {
        padding: 8px 6px;
        font-size: 11.5px;
    }
}

@media (max-width: 1024px) {
    /* Responsive grids */
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-overview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-charts-row,
    .stats-three-charts-row {
        grid-template-columns: 1fr;
    }
    
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
    
    .calendar-layout-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .mobile-only-btn {
        display: block;
    }

    /* ── PERFORMANCE FIX ──────────────────────────────────────────────────────
       backdrop-filter: blur() forces the GPU to composite EVERY element behind
       the blurred element on every frame. On mid-range tablets this causes severe
       lag (dropped frames, janky scrolling). Remove ALL blur effects on mobile/tablet.
    ─────────────────────────────────────────────────────────────────────────── */
    *,
    *::before,
    *::after {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Compensate: glass-card gets a solid opaque background instead of blur */
    .glass-card {
        background: var(--bg-secondary) !important;
    }

    #app-container {
        flex-direction: column;
    }

    /* ── MOBILE/TABLET SIDEBAR: Full-viewport overlay approach ────────────────
       #app-sidebar covers the ENTIRE SCREEN when open (position:fixed; inset:0)
       This makes it IMPOSSIBLE for GPU canvas layers to bleed through —
       the sidebar element physically owns all screen pixels.
       #sidebar-panel is the actual 285px drawer with solid background.        */

    #app-sidebar {
        display: none;
        position: fixed;
        top: 0;                             /* explicit — inset:0 not supported on Chrome<87 */
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        z-index: 9999;
        background: rgba(0, 0, 0, 0.55);   /* this IS the scrim — no canvas behind */
        flex-direction: row;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        cursor: pointer;
    }

    #app-sidebar.mobile-open {
        display: flex;
    }

    #sidebar-panel {
        width: 285px;
        flex-shrink: 0;
        height: 100%;
        background: var(--sidebar-panel-bg);
        color: var(--sidebar-panel-color);
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        box-shadow: var(--sidebar-panel-shadow);
        cursor: default;                   /* reset cursor inside panel */
    }

    
    #app-main {
        padding: 12px;
    }
    
    #main-header {
        padding: 0 16px;
    }
    
    .date-filters {
        width: 100%;
        padding: 8px 0;
    }
    
    .progress-ring-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-layout-wrapper {
        grid-template-columns: 1fr;
    }
    
    .settings-form-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .note-selectors-row {
        grid-template-columns: 1fr;
    }
    
    .transaction-line-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .transaction-line-row button {
        grid-column: span 1;
    }
    
    .modal-form-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    #sidebar-open-btn {
        display: none !important;
    }
    
    #app-main {
        padding: 12px 12px 80px 12px !important;
    }

    /* SaaS Administrative Dashboard Mobile Layout Styles */
    #page-content-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .admin-section-container {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px 8px !important;
        gap: 15px !important;
    }

    .admin-tab-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        padding: 4px !important;
        gap: 6px !important;
        scrollbar-width: none !important; /* Firefox */
    }

    .admin-tab-nav::-webkit-scrollbar {
        display: none !important; /* Chrome, Safari, Opera */
    }

    .admin-subtab-btn {
        flex-shrink: 0 !important;
        padding: 6px 12px !important;
        font-size: 13px !important;
    }

    .support-dash-grid,
    .admin-ann-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .admin-section-container .glass-card {
        min-width: 0 !important;
        padding: 16px 12px !important;
    }

    .admin-section-container table th,
    .admin-section-container table td {
        padding: 8px 6px !important;
        font-size: 12px !important;
    }

    .admin-section-container table th {
        font-size: 11.5px !important;
    }


    #main-header {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        height: auto !important;
        padding: 12px 12px 12px 16px !important;
        gap: 10px 6px !important;
        overflow: visible !important;
    }
    
    .header-left {
        display: contents !important;
    }
    
    .date-filters {
        display: none !important;
    }

    .mobile-date-dropdown-wrapper {
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: flex !important;
        position: relative !important;
        width: 120px !important;
        max-width: 120px !important;
    }
    
    .header-date-select {
        width: 100% !important;
    }
    
    .custom-date-range-container {
        display: none !important;
        grid-column: 1 / span 2 !important;
        grid-row: 2 !important;
        margin-left: 0 !important;
        width: 100% !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        padding-top: 4px !important;
    }
    
    .custom-date-range-container.mobile-show {
        display: flex !important;
    }
    
    .header-date-input {
        flex: 1 !important;
        min-width: 0 !important;
        width: auto !important;
        padding: 6px 10px !important;
    }
    
    .header-right {
        grid-column: 2 !important;
        grid-row: 1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        margin-left: 0 !important;
        border-top: none !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        flex-shrink: 0 !important;
        padding-right: 4px !important;
    }

    /* Shrink header icon buttons on mobile so all fit */
    .header-right .icon-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        padding: 0 !important;
        font-size: 13px !important;
    }

    .header-right .user-avatar-btn img,
    .header-right .user-avatar-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
    }

    #date-range-label {
        display: none !important;
    }
    
    .mobile-only-flex {
        display: flex !important;
    }
    
    #mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        z-index: 1050;
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        background: rgba(30, 31, 41, 0.85);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
        padding: 0 10px;
        user-select: none;
        -webkit-user-select: none;
    }
    
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        font-size: 10px;
        font-weight: 500;
        cursor: pointer;
        flex: 1;
        height: 100%;
        gap: 4px;
        transition: color var(--transition-fast), transform var(--transition-fast);
    }
    
    .bottom-nav-item svg,
    .bottom-nav-item i {
        width: 20px;
        height: 20px;
    }
    
    .bottom-nav-item:hover,
    .bottom-nav-item.active {
        color: var(--accent-blue);
    }
    
    .bottom-nav-item:active {
        transform: scale(0.95);
    }
    
    #mobile-fab {
        position: fixed;
        bottom: 80px;
        right: 20px;
        width: 56px;
        height: 56px;
        z-index: 1050;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-hover) 100%);
        color: #ffffff;
        box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
        cursor: pointer;
        transition: transform var(--transition-fast), box-shadow var(--transition-fast);
        user-select: none;
        -webkit-user-select: none;
    }
    
    #mobile-fab svg,
    #mobile-fab i {
        width: 24px;
        height: 24px;
    }
    
    #mobile-fab:active {
        transform: scale(0.9);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }
}

/* ==========================================================================
   TRADE ROW HOVER POPUP
   ========================================================================== */

.trade-hover-popup {
    position: fixed;
    z-index: 9000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--border-radius-md);
    padding: 12px;
    min-width: 220px;
    max-width: 320px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.trade-hover-popup.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.popup-tag-pill {
    display: inline-flex;
    align-items: center;
    background: var(--accent-blue-glow);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    border-radius: var(--border-radius-full);
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.popup-screenshot {
    width: 100%;
    border-radius: var(--border-radius-sm);
    max-height: 180px;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   IMAGE UPLOAD ZONE
   ========================================================================== */

.image-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload-zone:hover {
    border-color: var(--accent-blue);
    background: var(--accent-blue-glow);
}

.image-upload-zone.drag-over {
    border-color: var(--accent-blue);
    background: var(--accent-blue-glow);
    transform: scale(1.01);
}

.image-upload-zone.has-image {
    padding: 0;
    border-style: solid;
    border-color: var(--border-color-hover);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.upload-placeholder svg {
    width: 32px;
    height: 32px;
    opacity: 0.6;
}

.uploaded-preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--border-radius-md);
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    color: white;
    z-index: 10;
    pointer-events: all;
    transition: background var(--transition-fast);
}

.remove-image-btn:hover {
    background: var(--color-loss);
}

/* ==========================================================================
   Dual Screenshot Grid Layout & Lightbox
   ========================================================================== */

/* Dual Screenshot Grid Layout */
.image-upload-grid {
    display: flex;
    gap: 16px;
    width: 100%;
}

.image-upload-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-section-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.upload-section-heading.before {
    color: var(--accent-blue);
    background: rgba(99, 102, 241, 0.1);
}

.upload-section-heading.after {
    color: var(--color-win);
    background: rgba(16, 185, 129, 0.1);
}

/* Trade Details View Previews */
.trade-view-images-grid {
    display: flex;
    gap: 16px;
    width: 100%;
    margin-top: 16px;
}

.trade-view-img-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

.trade-view-img-heading.before {
    color: var(--accent-blue);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.trade-view-img-heading.after {
    color: var(--color-win);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.trade-view-images-grid .trade-view-img-wrapper {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.trade-view-img-aspect-box {
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius-sm);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.trade-view-screenshot-img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
    cursor: pointer;
    transition: transform var(--transition-fast), filter var(--transition-fast);
}

.trade-view-screenshot-img:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* Fullscreen Lightbox Overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 11, 15, 0.95);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.lightbox-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.05);
}

.lightbox-container {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.lightbox-comparison-header {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px;
    border-radius: 30px;
    backdrop-filter: blur(8px);
}

.lightbox-tab-btn {
    background: transparent;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lightbox-tab-btn.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.lightbox-img-wrapper {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    padding: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.lightbox-img-wrapper img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--border-radius-sm);
    display: block;
}

/* Mobile Stacking Rules */
@media (max-width: 768px) {

    /* Fix 1: Stack Expectancy card vertically on mobile */
    .expectancy-split-card {
        flex-direction: column !important;
    }
    .expectancy-left {
        flex: none !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding-bottom: 16px !important;
    }
    .expectancy-right {
        padding: 14px 16px 16px !important;
        min-height: 160px !important;
    }
    /* Hide canvas + desktop-only axis labels on mobile */
    #expectancy-surface-canvas,
    .surface-axis-y,
    .surface-axis-x,
    .surface-tooltip {
        display: none !important;
    }
    /* Hide the desktop legend (mobile viz has its own labels) */
    .surface-legend {
        display: none !important;
    }

    /* Fix 2: Filter panel — just below the header bar on mobile */
    .filter-overlay-panel {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        top: 68px !important;
        bottom: auto !important;
        transform: none !important;
        width: auto !important;
        max-height: calc(100vh - 140px) !important;
        overflow-y: auto !important;
        z-index: 1300 !important;
    }

    /* Fix 4: Remove backdrop-filter from scrollable cards (BIGGEST lag fix) */
    .glass-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* ═══════════════════════════════════════════════
       SETTINGS — Connect Broker & Taxes layout fixes
       ═══════════════════════════════════════════════ */

    /* Stack ALL settings flex rows vertically on mobile
       (they all have class modal-form-row with inline display:flex) */
    .settings-viewport .modal-form-row,
    .settings-section .modal-form-row {
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* Broker "Sync Trades Now" button — make full width when stacked */
    #settings-broker-form .modal-form-row > div[style*="width: 200px"],
    #settings-broker-form .modal-form-row > div[style*="200px"] {
        width: 100% !important;
    }
    #broker-sync-now-btn {
        width: 100% !important;
    }

    /* Brokerage & Capital Gains 3-col rows — already fixed by .modal-form-row above */
    /* But also ensure flex-1 divs don't collapse */
    .settings-viewport .modal-form-row .input-group,
    .settings-viewport .modal-form-row .flex-1 {
        width: 100% !important;
        flex: none !important;
    }
    .settings-viewport .modal-form-row select,
    .settings-viewport .modal-form-row input {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Custom Transaction-Level Taxes TABLE — horizontal scroll with readable min widths */
    .settings-viewport .table-wrapper,
    .settings-viewport [style*="overflow-x: auto"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    /* Give each column a minimum width so names aren't chopped */
    #settings-tax-rows-container td,
    .settings-viewport .ledger-table td,
    .settings-viewport .ledger-table th {
        min-width: 80px !important;
        font-size: 12px !important;
        padding: 6px 8px !important;
        white-space: nowrap !important;
    }
    /* Tax name input wide enough to show the full label */
    #settings-tax-rows-container input[type="text"],
    #settings-tax-rows-container input[type="number"] {
        min-width: 65px !important;
        width: 100% !important;
        font-size: 12px !important;
    }
    #settings-tax-rows-container select {
        min-width: 90px !important;
        font-size: 12px !important;
    }

    .image-upload-grid {
        flex-direction: column;
        gap: 12px;
    }
    .trade-view-images-grid {
        flex-direction: column;
        gap: 12px;
    }
    .trade-view-screenshot-img {
        max-height: 180px;
    }
    .lightbox-container {
        max-width: 95vw;
        max-height: 80vh;
    }
    .lightbox-img-wrapper img {
        max-height: 55vh;
    }
}

/* ==========================================================================
   TAG CREATE-NEW OPTION IN DROPDOWN
   ========================================================================== */

.tag-dropdown-item.create-new-tag {
    color: var(--accent-blue);
    font-weight: 600;
    background: var(--accent-blue-glow);
    border-bottom: 1px solid var(--border-color);
}

.tag-dropdown-item.create-new-tag:hover {
    background: var(--accent-blue) !important;
    color: var(--text-primary) !important;
}

/* ==========================================================================
   ROW OPTIONS MENU DROPDOWN
   ========================================================================== */

.row-menu-container {
    position: relative;
    display: inline-block;
}

.row-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.row-menu-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.row-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 140px;
    padding: 4px 0;
    margin-top: 4px;
}

.row-menu-dropdown.hidden {
    display: none;
}

.row-menu-dropdown.open-up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

.row-menu-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.row-menu-dropdown .dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.row-menu-dropdown .dropdown-item i {
    width: 14px;
    height: 14px;
}

.row-menu-dropdown .dropdown-item.delete-trade-btn {
    color: var(--color-loss);
}

.row-menu-dropdown .dropdown-item.delete-trade-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Notes Text inside Hover Popup */
.popup-notes {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
    word-break: break-word;
    border-left: 2px solid var(--accent-blue);
    padding-left: 6px;
}

/* ==========================================================================
   HEADER PROFILE DROP-DOWN & MENU WIDGET
   ========================================================================== */

.header-profile-menu-container {
    position: relative;
}

.header-avatar-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-fast);
}

.header-avatar-btn:hover {
    opacity: 0.8;
}

.header-profile-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    width: 220px;
    z-index: 1020;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--glass-shadow);
}

.header-profile-dropdown.hidden {
    display: none !important;
}

.dropdown-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 8px;
}

.logged-in-lbl {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.logged-in-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.dropdown-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 4px 0;
}

.header-profile-dropdown .dropdown-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 13px;
    width: 100%;
    text-align: left;
    transition: all var(--transition-fast);
}

.header-profile-dropdown .dropdown-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-profile-dropdown .dropdown-item svg {
    width: 16px;
    height: 16px;
}

.dropdown-theme-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
}

.dropdown-theme-selector .theme-label-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.theme-toggle-group {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    padding: 2px;
    border: 1px solid var(--border-color);
}

.theme-toggle-opt {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.theme-toggle-opt svg {
    width: 14px;
    height: 14px;
}

.theme-toggle-opt:hover {
    color: var(--text-primary);
}

.theme-toggle-opt.active {
    background: var(--bg-primary);
    color: var(--accent-blue);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

body.light-theme {
    color-scheme: light;
    
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-blue-glow: rgba(37, 99, 235, 0.1);
    
    --color-win: #059669;
    --color-win-bg: rgba(16, 185, 129, 0.08);
    --color-win-glow: rgba(16, 185, 129, 0.12);
    
    --color-loss: #dc2626;
    --color-loss-bg: rgba(239, 68, 68, 0.08);
    --color-loss-glow: rgba(239, 68, 68, 0.12);
    
    --color-wash: #475569;
    --color-wash-bg: rgba(71, 85, 105, 0.08);
    
    --color-open: #d97706;
    --color-open-bg: rgba(245, 158, 11, 0.08);
    
    --color-setup: #7c3aed;
    --color-setup-bg: rgba(168, 85, 247, 0.08);
    
    --color-note: #b45309;
    --color-note-bg: rgba(217, 119, 6, 0.08);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --border-color: rgba(15, 23, 42, 0.08);
    --border-color-hover: rgba(15, 23, 42, 0.16);
    
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(15, 23, 42, 0.06);
    --glass-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.06);
    --rrg-canvas-bg: rgba(15, 23, 42, 0.04);
    
    /* Scrollbars */
    --scrollbar-track: var(--bg-primary);
    --scrollbar-thumb: rgba(15, 23, 42, 0.18);
    --scrollbar-thumb-hover: rgba(15, 23, 42, 0.35);
    
    /* Mobile Sidebar Panel Drawer */
    --sidebar-panel-bg: var(--bg-secondary);
    --sidebar-panel-color: var(--text-primary);
    --sidebar-panel-shadow: 4px 0 32px rgba(15, 23, 42, 0.08);
    
    /* Dialog Modals & Replay Simulator */
    --modal-overlay-bg: rgba(15, 23, 42, 0.4);
    --mental-replay-overlay-bg: rgba(240, 242, 245, 0.9);
    --replay-container-bg: var(--glass-bg);
    --replay-sidebar-bg: var(--bg-primary);
    --replay-chart-area-bg: var(--bg-secondary);
    
    /* Interactive Hover backgrounds */
    --nav-item-bg: rgba(15, 23, 42, 0.01);
    --nav-item-hover: rgba(15, 23, 42, 0.03);
    --hover-bg: rgba(15, 23, 42, 0.02);
    
    /* Lock Screen & PIN Keypad */
    --lock-overlay-bg: rgba(240, 242, 245, 0.85);
    --keypad-btn-bg: rgba(15, 23, 42, 0.03);
    --keypad-btn-color: var(--text-primary);
    --keypad-btn-hover-bg: rgba(15, 23, 42, 0.08);
    --keypad-btn-active-bg: rgba(15, 23, 42, 0.15);
    
    /* Calendar Picker Icon Filter */
    --calendar-icon-filter: opacity(0.5);
}

/* ==========================================================================
   PERSONAL PROFILE AVATAR EDITOR & HOVER OVERLAY
   ========================================================================== */

.profile-avatar-wrapper {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

.profile-avatar-edit-overlay {
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.profile-avatar-wrapper:hover .profile-avatar-edit-overlay {
    opacity: 1;
}

/* ==========================================================================
   DANGER ZONE PANEL STYLES
   ========================================================================== */

.danger-section {
    padding: 16px 0;
}

.danger-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.danger-section p {
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.5;
}

/* Tooltip styling */
.info-tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-muted);
}

.info-tooltip-trigger:hover {
    color: var(--text-primary);
}

.info-tooltip-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f222e; /* dark Slate */
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: normal;
    width: 200px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-weight: normal;
    line-height: 1.4;
}

.info-tooltip-trigger:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ==========================================================================
   DYNAMIC FILTER PANEL OVERLAY
   ========================================================================== */

.filter-overlay-panel {
    position: absolute;
    top: calc(100% - 10px);
    right: 24px;
    z-index: 1050;
    width: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--border-radius-md);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(16px);
}

.filter-overlay-panel.hidden {
    display: none !important;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.filter-total-trades {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-select {
    width: 100%;
    background-color: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    padding-right: 32px !important;
    appearance: none;
    cursor: pointer;
}

.filter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    margin-top: 4px;
}

/* Day separator condition/volatility icons styling */
.divider-cond, .divider-vol {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.divider-cond svg, .divider-vol svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   DYNAMIC CHART OVERLAY & ACCOUNT LEDGER MODAL STYLES
   ========================================================================== */

/* Chart value overlay */
.curve-thumb-card {
    position: relative !important;
}

.chart-value-overlay {
    position: absolute;
    top: 14px;
    left: 16px;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.chart-value-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.chart-value-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
}

/* Account Details Row */
.account-details-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
    width: 100%;
}

.flex-3 { flex: 3; }
.flex-2 { flex: 2; }
.flex-1 { flex: 1; }
.align-center {
    align-items: center;
    text-align: center;
}

/* Primary Checkbox custom layout */
.primary-checkbox-wrapper {
    position: relative;
    width: 100%;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.primary-checkbox-btn {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.primary-checkbox-btn:hover {
    border-color: var(--border-color-hover);
    background-color: rgba(255, 255, 255, 0.02);
}

.primary-checkbox-btn .check-icon {
    width: 18px;
    height: 18px;
    color: transparent;
    transition: var(--transition-fast);
}

.hidden-checkbox:checked + .primary-checkbox-btn {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
}

.hidden-checkbox:checked + .primary-checkbox-btn .check-icon {
    color: var(--accent-blue);
}

/* Account Balance Read-only box */
.account-balance-display {
    width: 100%;
    height: 38px;
    border-radius: var(--border-radius-md);
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 0 16px;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-blue);
    font-family: 'Outfit', sans-serif;
}

/* Transactions Ledger Section */
.ledger-section {
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.ledger-header {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ledger-table-wrapper {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background-color: rgba(0, 0, 0, 0.15);
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.ledger-table th {
    background-color: var(--bg-secondary);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid var(--border-color);
}

.ledger-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.ledger-table tbody tr:last-child td {
    border-bottom: none;
}

.ledger-table input, .ledger-table select {
    width: 100%;
    height: 32px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0 8px;
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition-fast);
}

.ledger-table input:focus, .ledger-table select:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.ledger-type-select {
    font-weight: 600;
}

.ledger-type-select.deposit {
    color: var(--color-win) !important;
}

.ledger-type-select.withdraw {
    color: var(--color-loss) !important;
}

/* Delete Row Button (Pink circle with X) */
.btn-row-delete {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-loss);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-row-delete:hover {
    background-color: var(--color-loss);
    color: white;
    border-color: var(--color-loss);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.btn-row-delete svg {
    width: 12px;
    height: 12px;
}

/* Add Row Centered Plus Button */
.ledger-add-row-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 14px;
    margin-bottom: 10px;
}

.btn-circular-add {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    border: none;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px var(--accent-blue-glow);
}

.btn-circular-add:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.4);
}

.btn-circular-add svg {
    width: 16px;
    height: 16px;
}

/* Account Modal Footer Custom Layout */
.account-modal-footer {
    display: flex;
    gap: 12px;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 20px;
}

.btn-danger {
    background-color: var(--color-loss);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-secondary-outline {
    background-color: #4a453f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e5e5;
}

.btn-secondary-outline:hover {
    background-color: #5a544d;
    color: white;
}

.flex-spacer {
    flex-grow: 1;
}

/* Trade View Modal Styling */
.trade-view-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 12px;
}

.trade-view-symbol-badge {
    background-color: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    padding: 6px 14px;
    border-radius: var(--border-radius-pill);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
}

.trade-view-pnl-label {
    font-size: 18px;
    font-weight: 700;
}

.trade-view-pills-right {
    display: flex;
    gap: 8px;
}

.trade-view-badge-pill {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--border-radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.trade-view-badge-pill.duration {
    background-color: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.2);
}

.trade-view-badge-pill.side-long {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-win);
    border-color: rgba(16, 185, 129, 0.3);
}

.trade-view-badge-pill.side-short {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--color-loss);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Timeline component styling */
.trade-view-timeline-wrapper {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 24px 16px;
    margin: 10px 0;
    position: relative;
}

.view-timeline-track {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    width: 100%;
}

.view-timeline-track::before {
    content: '';
    position: absolute;
    top: 50px; /* center vertically with circle */
    left: 10%;
    right: 10%;
    height: 4px;
    background: linear-gradient(to right, var(--color-win), var(--accent-blue), var(--color-loss));
    z-index: 1;
    border-radius: 2px;
}

.view-timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    text-align: center;
    min-width: 120px;
}

.view-timeline-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.view-timeline-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(0,0,0,0.5);
    border: 2px solid #ffffff;
}

.view-timeline-circle.buy {
    background-color: var(--color-win);
    box-shadow: 0 0 10px var(--color-win-glow);
}

.view-timeline-circle.sell {
    background-color: var(--color-loss);
    box-shadow: 0 0 10px var(--color-loss-glow);
}

.view-timeline-details {
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 8px;
    font-weight: 600;
}

/* Notes Section */
.trade-view-notes-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.trade-view-section-header {
    display: flex;
    align-items: center;
    width: 100%;
}

.trade-view-section-header::before,
.trade-view-section-header::after {
    content: '';
    flex: 1;
    border-bottom: 1px dashed var(--border-color);
}

.trade-view-section-title {
    padding: 0 16px;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.trade-view-notes-box {
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trade-view-notes-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    word-break: break-word;
}

.trade-view-img-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.trade-view-screenshot-img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.trade-view-target-badge {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--border-radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   CALENDAR DAY HOVER POPUP
   ========================================================================== */

.calendar-hover-popup {
    position: fixed;
    z-index: 9000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--border-radius-md);
    padding: 14px;
    min-width: 260px;
    max-width: 300px;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.calendar-hover-popup.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.cal-popup-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cal-popup-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cal-popup-trade-item {
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.cal-popup-trade-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.cal-popup-trade-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.cal-popup-symbol {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-primary);
    flex-grow: 1;
}

.cal-popup-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
}

.cal-popup-badge.side-long {
    background: rgba(46, 204, 113, 0.15);
    color: var(--color-win);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.cal-popup-badge.side-short {
    background: rgba(231, 76, 60, 0.15);
    color: var(--color-loss);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.cal-popup-badge.status-win {
    background: rgba(46, 204, 113, 0.2);
    color: var(--color-win);
}

.cal-popup-badge.status-loss {
    background: rgba(231, 76, 60, 0.2);
    color: var(--color-loss);
}

.cal-popup-badge.status-wash {
    background: rgba(127, 140, 141, 0.2);
    color: var(--text-secondary);
}

.cal-popup-badge.status-open {
    background: rgba(52, 152, 219, 0.2);
    color: var(--accent-blue);
}

.cal-popup-trade-details {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cal-popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.mobile-date-dropdown-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.header-date-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    outline: none;
    padding: 6px 32px 6px 16px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    width: 140px;
}

.header-date-select:focus, .header-date-select:hover {
    border-color: var(--accent-blue);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

.select-arrow-tiny {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 12px;
    height: 12px;
    color: var(--text-secondary);
}

.custom-date-range-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

.header-date-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    outline: none;
    width: 140px;
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.header-date-input:focus, .header-date-input:hover {
    border-color: var(--accent-blue);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

/* Make custom indicators match dark theme */
.header-date-input::-webkit-calendar-picker-indicator {
    filter: var(--calendar-icon-filter);
    cursor: pointer;
    margin-left: 2px;
}

.date-sep {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.icon-btn-apply {
    background: var(--accent-blue);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--border-radius-full);
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.icon-btn-apply:hover {
    background: var(--accent-blue-hover, #2563eb);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* ==========================================================================
   TAB: INSIGHTS & BEHAVIOR DIAGNOSTICS
   ========================================================================== */

.insights-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 24px;
}

.insights-pillars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 4px;
}

.pillar-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.pillar-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.pillar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.pillar-pct {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    opacity: 0.85;
}

.pillar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.pillar-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.pillar-val {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    line-height: 1.1;
}

.pillar-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.pillar-footer {
    display: flex;
    align-items: center;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--border-radius-full);
    font-size: 11px;
    font-weight: 600;
}

.status-badge svg {
    width: 13px;
    height: 13px;
}

.badge-red {
    background: var(--color-loss-bg);
    color: var(--color-loss);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-green {
    background: var(--color-win-bg);
    color: var(--color-win);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Diagnostics Columns */
.diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.diagnostic-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.diag-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.diag-header svg {
    width: 20px;
    height: 20px;
}

.header-edge {
    color: var(--color-win);
}

.header-leak {
    color: var(--color-loss);
}

.diag-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diag-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.03);
}

.diag-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.diag-lbl {
    color: var(--text-secondary);
    font-size: 13px;
}

.diag-val {
    font-weight: 600;
    font-size: 13px;
}

/* Mood Correlation & Emotional Impact */
.mood-correlation-card {
    padding: 24px;
}

.section-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-card-title svg {
    width: 18px;
    height: 18px;
}

.section-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-bottom: 16px;
}

.mood-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.mood-stat-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--border-radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.mood-stat-badge:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-tertiary);
}

.mood-badge-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.mood-badge-icon svg {
    width: 20px;
    height: 20px;
}

.mood-happy .mood-badge-icon {
    color: var(--color-win);
    background: var(--color-win-bg);
}

.mood-neutral .mood-badge-icon {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.mood-sad .mood-badge-icon {
    color: var(--color-loss);
    background: var(--color-loss-bg);
}

.mood-badge-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mood-lbl {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.mood-val {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.mood-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* Strategy Drawdown Diagnostics */
.drawdown-diagnostics-card {
    padding: 24px;
}

.drawdown-table-container {
    width: 100%;
    overflow-x: auto;
}

.insights-drawdown-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.insights-drawdown-table thead tr {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.insights-drawdown-table th {
    padding: 12px 12px;
    font-weight: 600;
}

.insights-drawdown-table th.dd-col {
    width: 35%;
}

.insights-drawdown-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 13px;
    transition: background-color var(--transition-fast);
}

.insights-drawdown-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

.insights-drawdown-table td {
    padding: 12px 12px;
}

.insights-drawdown-table td.strategy-name {
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.dd-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dd-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}

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

.dd-bar-label {
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.drawdown-empty-state {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Actionable Trading Coach Rules */
.coach-section-header {
    margin-top: 24px;
    margin-bottom: 12px;
}

.coach-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 12px;
}

.coach-rule-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    transition: transform var(--transition-normal);
}

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

.rule-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rule-icon-box svg {
    width: 18px;
    height: 18px;
}

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

.rule-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.rule-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Specific rule colors */
.rule-success {
    border-left: 4px solid var(--color-win);
}

.rule-success .rule-icon-box {
    background: var(--color-win-bg);
    color: var(--color-win);
}

.rule-danger {
    border-left: 4px solid var(--color-loss);
}

.rule-danger .rule-icon-box {
    background: var(--color-loss-bg);
    color: var(--color-loss);
}

.rule-caution {
    border-left: 4px solid var(--color-note);
}

.rule-caution .rule-icon-box {
    background: var(--color-note-bg);
    color: var(--color-note);
}

.rule-info {
    border-left: 4px solid var(--accent-blue);
}

.rule-info .rule-icon-box {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

/* Trading Systems Tab & Dashboard */
.systems-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.system-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    transition: transform var(--transition-normal), border-color var(--transition-fast);
}

.system-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-hover);
}

.system-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.system-header-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.system-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}

.system-tag-badge {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 600;
    background-color: var(--color-setup-bg);
    color: var(--color-setup);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 2px 8px;
    border-radius: var(--border-radius-full);
    text-transform: uppercase;
}

.system-card-actions {
    display: flex;
    gap: 8px;
}

.system-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-md);
    padding: 12px;
}

.system-stat-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
}

.system-stat-label {
    font-size: 9px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.system-stat-val {
    font-size: 13.5px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.system-params-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 14px;
}

.system-param-badge {
    font-size: 10.5px;
    font-weight: 500;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 4px;
}

.system-param-badge svg {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
}

.system-motivation-box {
    background: rgba(59, 130, 246, 0.03);
    border-left: 2px solid var(--accent-blue);
    padding: 10px 12px;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.system-motivation-item {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.system-motivation-item strong {
    color: var(--text-primary);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: block;
    margin-bottom: 2px;
}

.system-rules-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.system-rule-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.system-rule-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.system-rule-label svg {
    width: 14px;
    height: 14px;
    color: var(--accent-blue);
}

.system-rule-list {
    list-style: none;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.system-rule-item {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    position: relative;
}

.system-rule-item::before {
    content: "•";
    color: var(--accent-blue);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    position: absolute;
}

.systems-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    min-height: 350px;
}

.systems-empty-icon-box {
    background: var(--color-setup-bg);
    border-radius: 50%;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--color-setup);
}

.systems-empty-icon-box svg {
    width: 36px;
    height: 36px;
}

/* Responsive Overrides */
@media (max-width: 900px) {
    .insights-pillars-grid {
        grid-template-columns: 1fr;
    }
    .diagnostics-grid {
        grid-template-columns: 1fr;
    }
    .mood-metrics-row {
        grid-template-columns: 1fr;
    }
    .coach-rules-grid {
        grid-template-columns: 1fr;
    }
    .systems-grid {
        grid-template-columns: 1fr;
    }
}

.trade-risk-display {
    font-size: 0.8rem;
    margin-top: 4px;
    font-weight: 500;
    min-height: 18px;
    transition: color 0.2s ease-in-out;
}

.trade-risk-display.high-risk {
    color: #ef4444 !important;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* Taxes Settings Table Styles */
#settings-viewport-taxes .ledger-table input,
#settings-viewport-taxes .ledger-table select {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 6px 10px;
    font-size: 13px;
    width: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#settings-viewport-taxes .ledger-table input:focus,
#settings-viewport-taxes .ledger-table select:focus {
    border-color: var(--accent-blue);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

#settings-viewport-taxes .ledger-table td {
    padding: 8px 12px;
}

#settings-viewport-taxes .delete-tax-row-btn {
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-loss);
    cursor: pointer;
    transition: all var(--transition-fast);
}

#settings-viewport-taxes .delete-tax-row-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--color-loss);
}

/* CSV Drag and Drop Zone */
.csv-dropzone-container {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--border-radius-md);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.csv-dropzone-container:hover,
.csv-dropzone-container.dragover {
    border-color: var(--accent-blue);
    background: rgba(99, 102, 241, 0.05);
}

.csv-dropzone-container .upload-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-blue);
    opacity: 0.8;
}

.csv-dropzone-container .upload-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.csv-dropzone-container .browse-link {
    color: var(--accent-blue);
    text-decoration: underline;
}

#csv-mapping-tbody select,
#csv-mapping-tbody input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-main);
    border-radius: var(--border-radius-sm);
    padding: 6px 10px;
    font-size: 0.85rem;
    width: 100%;
}

#csv-mapping-tbody select:focus {
    border-color: var(--accent-blue);
    outline: none;
}

/* ==========================================================================
   SYMBOL AUTOCOMPLETE & LIVE PRICE CHIP STYLES
   ========================================================================== */

.symbol-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    min-width: 320px;
    max-height: 250px;
    overflow-y: auto;
    background: rgba(26, 27, 37, 0.98);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid var(--border-color-hover);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    margin-top: 5px;
}

.symbol-autocomplete-dropdown.hidden {
    display: none;
}

.symbol-autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background var(--transition-fast);
}

.symbol-autocomplete-item:hover,
.symbol-autocomplete-item.active {
    background: var(--accent-blue-glow);
}

.symbol-autocomplete-item strong {
    font-family: monospace;
}

.symbol-exchange-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.symbol-exchange-badge.badge-nse {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.symbol-exchange-badge.badge-bse {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.12);
    border: 1px solid rgba(236, 72, 153, 0.25);
}

.symbol-exchange-badge.badge-lse {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.symbol-exchange-badge.badge-us {
    color: #818cf8;
    background: rgba(129, 140, 248, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.25);
}

.symbol-exchange-badge.badge-crypto {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.symbol-exchange-badge.badge-future {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.symbol-exchange-badge.badge-forex {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Pulsing Live Price Badge */
.live-price-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-win);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--border-radius-full);
    padding: 2px 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.live-price-badge:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.live-price-badge:active {
    transform: scale(0.97);
}

.live-price-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-win);
    display: inline-block;
    animation: pricePulse 1.5s infinite;
}

@keyframes pricePulse {
    0% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* ==========================================================================
   APP LOCK SCREEN STYLES
   ========================================================================== */

.lock-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--lock-overlay-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.lock-screen-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.lock-container {
    width: 100%;
    max-width: 360px;
    padding: 32px 24px;
    text-align: center;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.lock-icon-wrapper, .lock-avatar-wrapper {
    transition: transform 0.3s ease;
}

.lock-icon-wrapper:hover, .lock-avatar-wrapper:hover {
    transform: scale(1.05);
}

.pin-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    background: transparent;
    transition: all 0.15s ease;
}

.pin-dot.filled {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue-glow);
    transform: scale(1.1);
}

.keypad-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--keypad-btn-bg);
    color: var(--keypad-btn-color);
    font-size: 20px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    outline: none;
}

.keypad-btn:hover {
    background: var(--keypad-btn-hover-bg);
    border-color: var(--border-color-hover);
    transform: scale(1.05);
}

.keypad-btn:active {
    background: var(--keypad-btn-active-bg);
    transform: scale(0.95);
}

.keypad-btn.text-btn {
    border: none;
    background: transparent;
    font-size: 11px;
    color: var(--text-secondary);
}

.keypad-btn.text-btn:hover {
    background: transparent;
    color: var(--text-primary);
    transform: none;
}

.keypad-btn.text-btn:active {
    transform: none;
}

.text-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.text-link-btn:hover {
    color: var(--text-primary) !important;
    text-decoration: underline;
}

.shake-anim {
    animation: lock-shake 0.5s ease-in-out;
}

@keyframes lock-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* ==========================================================================
   NETWORK & DATABASE STATUS STYLES
   ========================================================================== */

.header-avatar-btn {
    border: 2px solid transparent;
    padding: 2px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast) !important;
}

.header-avatar-btn.status-online {
    border-color: var(--color-win);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.header-avatar-btn.status-offline {
    border-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.connection-status-tooltip {
    position: absolute;
    top: 48px;
    right: 0;
    width: 240px;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 12px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12.5px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    box-shadow: var(--glass-shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.connection-status-tooltip.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.status-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.status-tooltip-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.status-tooltip-value {
    font-weight: 600;
    text-align: right;
}

.text-orange {
    color: #f59e0b !important;
}

/* ==========================================================================
   ANNOUNCEMENT / BELL NOTIFICATION SYSTEM
   ========================================================================== */

/* Red badge counter on the bell icon */
.bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 0 0 2px var(--bg-secondary);
    animation: badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bell-badge.hidden {
    display: none;
}

@keyframes badge-pop {
    0%   { transform: scale(0); opacity: 0; }
    70%  { transform: scale(1.25); }
    100% { transform: scale(1); opacity: 1; }
}

/* Wrapper so bell button can have position:relative for badge */
.bell-btn-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bell-btn-wrapper .icon-btn {
    position: relative;
}

/* Announcement panel — glassmorphic dropdown */
.announcement-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-height: 480px;
    display: flex;
    flex-direction: column;
    z-index: 1100;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: var(--bg-secondary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (max-width: 768px) {
    .announcement-panel {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        top: 68px !important;
        width: auto !important;
        max-height: calc(100vh - 150px) !important;
        z-index: 1300 !important;
        transform: translateY(-4px);
    }
    .announcement-panel.announcement-panel-visible {
        transform: translateY(0);
    }
}

.announcement-panel.announcement-panel-visible {
    opacity: 1;
    transform: translateY(0);
}

.announcement-panel.hidden {
    display: none !important;
}

/* Panel header bar */
.announcement-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* "Mark all read" button in panel header */
.announcement-mark-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 4px 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}
.announcement-mark-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Scrollable list area */
.announcement-list {
    overflow-y: auto;
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.announcement-list::-webkit-scrollbar { width: 4px; }
.announcement-list::-webkit-scrollbar-track { background: transparent; }
.announcement-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

/* Individual announcement card */
.announcement-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-blue);
    border-radius: var(--border-radius-md);
    padding: 12px 14px;
    transition: background var(--transition-fast);
}

.announcement-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Unread item highlight */
.announcement-item.announcement-unread {
    background: rgba(99, 102, 241, 0.06);
}

/* Header row: type badge + date */
.announcement-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
}

/* Colored type pill badge */
.announcement-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 999px;
}

/* Date label */
.announcement-date {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* Title */
.announcement-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    line-height: 1.4;
}

/* Message body */
.announcement-message {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Empty state */
.announcement-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.82rem;
    gap: 4px;
}

/* ==========================================================================
   EXIT EFFICIENCY & FORGONE PROFITS INSIGHTS STYLES
   ========================================================================== */
.exit-perf-card {
    padding: 20px;
    margin-top: 20px;
}

.exit-efficiency-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}

.exit-hero-stat {
    display: flex;
    flex-direction: column;
}

.exit-hero-val {
    font-family: 'Outfit', sans-serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.exit-hero-lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
}

/* Multi-colored Distribution Bar */
.exit-dist-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    margin-top: 8px;
    margin-bottom: 16px;
}

.exit-dist-segment {
    height: 100%;
    transition: width 0.5s ease;
}

.exit-dist-perfect {
    background: var(--color-win);
}

.exit-dist-good {
    background: var(--accent-blue);
}

.exit-dist-early {
    background: var(--color-loss);
}

/* Regret List Table */
.regret-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.regret-list-table th,
.regret-list-table td {
    padding: 8px 12px;
    text-align: left;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.regret-list-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.01);
}

.regret-list-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.regret-list-table td.pnl-loss {
    color: var(--color-loss);
    font-weight: 600;
}

/* ==========================================
   DAILY GUARDRAILS & DISCIPLINE TRACKER
   ========================================== */
.guardrails-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.guardrails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.guardrail-cell {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.guardrail-cell-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.guardrail-cell-icon.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.guardrail-cell-info {
    display: flex;
    flex-direction: column;
}

.guardrail-cell-lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guardrail-cell-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

/* Guardrails Editor */
.guardrails-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

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

.guardrail-input-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.guardrail-input-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.guardrail-input-group input:focus {
    border-color: var(--accent-blue);
    outline: none;
}

/* Breach History Log */
.breach-history-list {
    margin-top: 12px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.breach-item {
    background: rgba(239, 68, 68, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.breach-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breach-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-loss);
    flex-shrink: 0;
}

.breach-desc {
    font-size: 12.5px;
    color: var(--text-primary);
}

.breach-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.discipline-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.discipline-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-win) 0%, var(--accent-blue) 100%);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Position Sizer & Collapsible Dashboard */
.risk-discipline-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 12px;
    margin-top: 12px;
}

@media (max-width: 1024px) {
    .risk-discipline-grid {
        grid-template-columns: 1fr;
    }
}

#tab-dashboard.summary-collapsed .dashboard-stats-grid,
#tab-dashboard.summary-collapsed #dashboard-risk-discipline-hub {
    display: none !important;
}

.table-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.table-title {
    font-family: 'Outfit';
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* Sizer inputs & result styling */
.sizer-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.sizer-result-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sizer-result-lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sizer-result-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sizer-result-val.highlight {
    color: var(--accent-blue);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Accordion helper for modals */
.sizer-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.sizer-accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sizer-accordion-content {
    display: none;
    padding: 14px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -12px;
    margin-bottom: 16px;
}

.sizer-accordion-content.active {
    display: block;
}

/* ==========================================
   POST-MORTEM MENTAL REPLAY SIMULATOR
   ========================================== */
#mental-replay-overlay {
    transition: opacity 0.3s ease;
}

#replay-chart-canvas {
    cursor: crosshair;
}

/* Replay slider styling */
#replay-speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    transition: transform 0.1s;
}

#replay-speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#replay-speed-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    transition: transform 0.1s;
}

#replay-speed-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Replay buttons transition effects */
#replay-btn-hold, #replay-btn-scale, #replay-btn-exit, #replay-btn-play {
    transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
}

#replay-btn-hold:hover {
    transform: translateY(-1px);
}

#replay-btn-scale:hover {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    transform: translateY(-1px);
}

#replay-btn-exit:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-1px);
}

#replay-btn-play:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Replay scorecard badges & scores */
.replay-score-positive {
    color: var(--color-win);
    font-weight: 700;
}

.replay-score-negative {
    color: var(--color-loss);
    font-weight: 700;
}

/* Replay verdict styling classes */
.replay-verdict-excellent {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--color-win);
}

.replay-verdict-good {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

.replay-verdict-warn {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.replay-verdict-poor {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-loss);
}

/* Unified Card Header styles */
.section-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
    width: 100%;
}

.section-header-flex .header-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.section-header-flex .header-title-group svg {
    width: 18px;
    height: 18px;
}

.section-header-flex .header-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Insights tab responsive layout adjustments */
.market-breakdown-row {
    display: grid;
    grid-template-columns: 130px 1fr 95px 75px;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.drawdown-table-container,
.table-scroll-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .section-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .section-header-flex .header-badge {
        margin-left: 0 !important;
        align-self: flex-start;
    }
    .market-breakdown-row {
        grid-template-areas: 
            "label pnl trades"
            "bar bar bar";
        grid-template-columns: auto 1fr auto;
        row-gap: 6px;
        column-gap: 12px;
        align-items: center;
        font-size: 13px;
        padding: 6px 0;
    }
    .market-breakdown-row > *:nth-child(1) {
        grid-area: label;
    }
    .market-breakdown-row > *:nth-child(2) {
        grid-area: bar;
        margin-top: 2px;
    }
    .market-breakdown-row > *:nth-child(3) {
        grid-area: pnl;
        text-align: right;
    }
    .market-breakdown-row > *:nth-child(4) {
        grid-area: trades;
        text-align: right;
        font-size: 11px;
    }
    .exit-efficiency-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .exit-hero-stat {
        flex-direction: row-reverse;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.02);
        padding-bottom: 8px;
    }
    .exit-hero-lbl {
        margin-top: 0;
    }
    .exit-hero-val {
        font-size: 20px;
    }
    .exit-efficiency-hero > div:last-child {
        margin-left: 0 !important;
        flex-direction: row-reverse !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    .insights-drawdown-table {
        min-width: 650px;
    }
}

/* ==========================================================================
   BACKTESTER & AI ANALYST STYLES
   ========================================================================== */
.backtest-sidebar {
    animation: slideInRight 0.3s ease;
    z-index: 10;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.backtest-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.backtest-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.backtest-form-group label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.backtest-form-group input, 
.backtest-form-group select,
.backtest-form-group textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.backtest-form-group input:focus, 
.backtest-form-group select:focus,
.backtest-form-group textarea:focus {
    border-color: var(--accent-blue);
}

.backtest-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ai-prompt-box {
    background: rgba(14, 165, 233, 0.05);
    border: 1px dashed rgba(14, 165, 233, 0.25);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-prompt-box textarea {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    padding: 8px;
    font-size: 11.5px;
    color: var(--text-primary);
    resize: none;
    height: 50px;
    outline: none;
}

.backtest-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.backtest-metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.backtest-metric-card .lbl {
    font-size: 9.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.backtest-metric-card .val {
    font-family: 'Outfit', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
}

.equity-curve-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    margin-top: 10px;
    height: 160px;
    position: relative;
}

.equity-curve-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.backtest-trades-log {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    max-height: 180px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.1);
}

.backtest-trade-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    font-size: 11px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    align-items: center;
}

.backtest-trade-header {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
}

.backtest-trade-row:last-child {
    border-bottom: none;
}

.text-win {
    color: var(--color-win, #10b981) !important;
}

.text-loss {
    color: var(--color-loss, #ef4444) !important;
}

/* Markdown styling inside AI report */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--accent-blue);
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}
.markdown-body h1 { font-size: 20px; }
.markdown-body h2 { font-size: 17px; }
.markdown-body h3 { font-size: 14px; }
.markdown-body p {
    margin-bottom: 12px;
}
.markdown-body ul, .markdown-body ol {
    padding-left: 20px;
    margin-bottom: 12px;
}
.markdown-body li {
    margin-bottom: 4px;
}
.markdown-body blockquote {
    border-left: 3px solid var(--accent-blue);
    background: rgba(14, 165, 233, 0.05);
    padding: 10px 15px;
    margin: 12px 0;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}
.markdown-body code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* Backtester layout styling */
.backtester-layout-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    height: auto;
    min-height: 0;
    font-family: 'Outfit', sans-serif;
}

.backtest-inputs-panel {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: auto;
    overflow-y: visible;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    gap: 16px;
}

.backtest-visualizer-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: auto;
    overflow-y: visible;
    gap: 20px;
}

.backtest-limit-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.05);
    color: var(--text-primary);
    font-size: 12px;
}

.backtest-visualizer-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 520px;
    min-height: 520px;
    position: relative;
}

.candlestick-chart-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    height: calc(100% - 30px);
    background: rgba(0,0,0,0.15);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chart-pane-header {
    background: rgba(26, 27, 37, 0.95) !important;
}

.timeframe-btn {
    transition: all 0.2s ease;
}

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

.timeframe-btn.active {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: var(--accent-blue) !important;
    color: var(--accent-blue) !important;
}

/* Grids for top config layout */
.backtest-top-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    align-items: end;
}

@media (min-width: 1400px) {
    .backtest-top-inputs-grid {
        grid-template-columns: repeat(9, 1fr);
    }
}

.backtest-custom-ai-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 20px;
}

@media (max-width: 991px) {
    .backtest-custom-ai-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.backtest-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .backtest-grid-3 {
        grid-template-columns: 1fr;
    }
}

.backtest-charts-container {
    display: flex;
    gap: 15px;
    flex: 1;
    min-height: 0;
    width: 100%;
}

@media (max-width: 768px) {
    .backtest-charts-container {
        flex-direction: column !important;
    }
    #backtest-chart-wrapper-right {
        height: 250px !important;
    }
}

.active-chart-pane {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 10px rgba(9, 132, 227, 0.3) !important;
}

/* Backtest Trade Log Table */
.backtest-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    text-align: left;
}

.backtest-log-table th, 
.backtest-log-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.backtest-log-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.backtest-log-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* Preset strategy buttons styling */
.preset-btn {
    display: flex;
    flex-direction: column;
    text-align: left;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}
.preset-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}
.preset-btn[data-preset="rsi_oversold"] {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.15);
}
.preset-btn[data-preset="rsi_oversold"]:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
}
.preset-btn[data-preset="ema_golden"] {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.15);
}
.preset-btn[data-preset="ema_golden"]:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Mobile responsive layout for backtester */
@media (max-width: 991px) {
    .backtester-layout-container {
        flex-direction: column !important;
        height: auto !important;
        overflow-y: visible !important;
    }
    .backtest-inputs-panel {
        width: 100% !important;
        height: auto !important;
        flex-shrink: 1 !important;
        overflow-y: visible !important;
        padding: 16px !important;
    }
    .backtest-visualizer-panel {
        width: 100% !important;
        height: auto !important;
        overflow-y: visible !important;
        padding-right: 0 !important;
    }
    .backtest-visualizer-card {
        height: 380px !important;
        min-height: 380px !important;
        padding: 12px !important;
    }
}

/* Market Behavior Guide styles */
.market-behavior-card {
    transition: transform var(--transition-fast) ease;
}
.market-guide-layout {
    display: flex;
    gap: 20px;
}
.market-guide-sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.market-guide-tab {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.market-guide-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}
.market-guide-tab.active {
    background: rgba(14, 165, 233, 0.08) !important;
    border-color: var(--accent-blue) !important;
}
.market-guide-tab.active span {
    color: var(--accent-blue) !important;
}

@media (max-width: 768px) {
    .market-guide-layout {
        flex-direction: column !important;
        gap: 12px !important;
    }
    .market-guide-sidebar {
        width: 100% !important;
        flex-direction: row !important;
        overflow-x: auto;
        padding-bottom: 6px;
        gap: 8px !important;
        scrollbar-width: thin;
    }
    .market-guide-tab {
        flex-shrink: 0;
        width: 160px;
        padding: 8px 10px !important;
    }
    .market-guide-tab span:last-child {
        display: none !important; /* Hide description on mobile to save vertical space */
    }
}

/* Help & Documentation Split Layout styles */
.help-split-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    margin-top: 20px;
}
.help-main-col {
    flex: 1.6;
    min-width: 0;
}
.help-side-col {
    flex: 1;
    min-width: 0;
    position: sticky;
    top: 20px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
}
.help-split-layout .help-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0;
}

/* Help & Documentation Grid Card styles */
.help-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}
.help-card {
    padding: 24px;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.25s ease;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}
.help-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--accent-blue);
    border-color: var(--accent-blue);
}
.help-card[data-help-target="faq"]:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px #f59e0b;
    border-color: #f59e0b;
}
.help-card[data-help-target="learn-trading"]:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px #10b981;
    border-color: #10b981;
}
.help-card[data-help-target="chat"]:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px #8b5cf6;
    border-color: #8b5cf6;
}
.help-card[data-help-target="feedback"]:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px #0ea5e9;
    border-color: #0ea5e9;
}
.help-card[data-help-target="contact-us"]:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px #ec4899;
    border-color: #ec4899;
}
.help-card[data-help-target="system-status"]:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px #10b981;
    border-color: #10b981;
}
.help-card-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.help-card-icon-wrapper i,
.help-card-icon-wrapper svg {
    width: 20px;
    height: 20px;
}
.help-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.help-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 991px) {
    .help-split-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 30px;
    }
    .help-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}
@media (max-width: 576px) {
    .help-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .help-card {
        padding: 20px;
    }
}

/* ==========================================
   ADMIN PANEL STYLES
   ========================================== */

.admin-subtab-btn:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

.admin-subtab-btn.active {
    color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.admin-subtab-view {
    display: none;
}

.admin-subtab-view.active {
    display: block !important;
}

.admin-ticket-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition-fast);
}

.admin-ticket-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--glass-shadow);
}

/* Tickets Split Panel Layout */
.tickets-split-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
    width: 100%;
}

.tickets-list-column {
    flex: 0 0 380px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
}

.ticket-detail-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

/* Simplified Cards in Left Panel */
.admin-ticket-list-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-ticket-list-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.admin-ticket-list-card.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

/* Preset Responses & AI Button styling */
.ticket-reply-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.preset-response-select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 12.5px;
    cursor: pointer;
    flex-grow: 1;
}

.preset-response-select:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.ai-copilot-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.1);
    color: #c084fc;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-copilot-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.ai-copilot-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive collapse on mobile */
@media (max-width: 992px) {
    .tickets-split-container {
        flex-direction: column;
    }
    .tickets-list-column {
        flex: 1;
        max-width: 100%;
    }
}

.ticket-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-badge.bug { background: var(--color-loss-bg); color: var(--color-loss); }
.ticket-badge.feedback { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.ticket-badge.complaint { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.ticket-badge.billing { background: rgba(245, 158, 11, 0.1); color: var(--color-open); }
.ticket-badge.other { background: rgba(107, 114, 128, 0.1); color: var(--color-wash); }

.ticket-status-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.ticket-status-badge.open { background: var(--color-loss-bg); color: var(--color-loss); }
.ticket-status-badge.resolved { background: var(--color-win-bg); color: var(--color-win); }

.attention-ticket-card:hover {
    border-color: var(--border-color-hover) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    box-shadow: var(--glass-shadow);
}

/* Mental Replay Button Attention Animations */
@keyframes mental-replay-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.45);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@keyframes dot-blink {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ==========================================================================
   Interactive Chart Drawing Toolbar
   ========================================================================== */

.draw-tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

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

.draw-tool-btn.active {
    background: var(--accent-blue) !important;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.draw-tool-btn.clear-btn:hover {
    background: rgba(239, 83, 80, 0.15) !important;
    color: #ef5350 !important;
}

.draw-tool-btn i {
    width: 16px;
    height: 16px;
    stroke-width: 2px;
}

/* ==========================================================================
   INTERACTIVE RSI PANE SPLITTER
   ========================================================================== */

.chart-splitter {
    height: 6px;
    background: rgba(255, 255, 255, 0.04);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: ns-resize;
    position: relative;
    z-index: 10;
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
    flex-shrink: 0;
}

.chart-splitter:hover,
.chart-splitter.active {
    background: rgba(59, 130, 246, 0.3) !important;
    border-top-color: rgba(59, 130, 246, 0.5) !important;
    border-bottom-color: rgba(59, 130, 246, 0.5) !important;
}

/* Premium Symbol Toggle Group */
.symbol-toggle-group {
    display: flex;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 30px !important;
    padding: 3px !important;
    gap: 2px;
}

.symbol-toggle-group .filter-pill {
    padding: 4px 12px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    border-radius: 20px !important;
    border: 1px solid transparent !important;
    color: rgba(255, 255, 255, 0.6) !important;
    background: transparent !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.symbol-toggle-group .filter-pill:hover {
    color: #60a5fa !important;
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}

.symbol-toggle-group .filter-pill.active {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.35) !important;
    font-weight: 600 !important;
}

#card-symbol-breakdown:hover .symbol-toggle-group .filter-pill.active,
.symbol-toggle-group .filter-pill.active:hover {
    background: var(--accent-blue) !important;
    color: #ffffff !important;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.45) !important;
}

/* Stats Tab Mobile Responsive Adjustments */
@media (max-width: 768px) {
    /* 1. Prevent stats cards from stretching past viewport and causing overflow */
    .chart-card-medium,
    .chart-container-large,
    .breakdown-card,
    .stats-insight-card {
        padding: 14px 12px !important;
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .stats-charts-row,
    .stats-three-charts-row,
    .breakdown-grid {
        width: 100% !important;
        box-sizing: border-box !important;
        gap: 12px !important;
    }

    /* 2. Breakdown by Symbol header wrapping and toggle group layout */
    .breakdown-header-wrapper {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        margin-bottom: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .breakdown-header-wrapper .chart-header-title {
        margin-bottom: 0 !important;
    }

    .symbol-toggle-group {
        display: flex !important;
        width: 100% !important;
        box-sizing: border-box !important;
        justify-content: space-between !important;
    }

    .symbol-toggle-group .filter-pill {
        flex: 1 !important;
        text-align: center !important;
        padding: 6px 4px !important;
        font-size: 10px !important;
        white-space: nowrap !important;
    }

    /* 3. Table scroll container responsiveness & table min-width */
    .table-scroll-container {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .breakdown-card table {
        width: 100% !important;
        min-width: 520px !important;
    }

    /* 4. Dashboard Mobile Layout & Card Alignment Fixes */
    #page-content-wrapper {
        padding-right: 0 !important; /* Remove asymmetric right padding on mobile */
    }

    .dashboard-stats-grid,
    .progress-ring-cards,
    .average-pnl-cards,
    .risk-discipline-grid {
        width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }

    .curve-thumb-card,
    .ring-card,
    .average-pnl-cards .stat-card,
    .risk-status-card,
    .position-sizer-card,
    .trade-log-container {
        width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }

    .ring-card {
        padding: 12px 8px !important;
        gap: 8px !important;
    }
}

/* Modal Footer Buttons Responsive Fix for Mobile Devices */
@media (max-width: 576px) {
    .modal-footer,
    .modal-footer-split {
        flex-direction: column-reverse !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding-bottom: 10px !important;
    }

    #modal-api-csv .modal-footer-split {
        flex-direction: column !important;
    }

    .modal-footer-split > div {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .modal-footer .btn,
    .modal-footer button,
    .modal-footer-split .btn,
    .modal-footer-split button {
        width: 100% !important;
        margin: 0 !important;
        padding: 10px 16px !important; /* Force standard matching height/padding */
        font-size: 13px !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }
}

/* ==========================================================================
   TODAY'S PLAN & PRE-FLIGHT CHECKLIST STYLES
   ========================================================================== */

.checklist-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: 6px;
    user-select: none;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.checklist-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
}

.checklist-item:hover .custom-checkbox {
    border-color: var(--accent-blue);
    transform: scale(1.08);
}

.custom-checkbox::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
    margin-top: -2px;
}

.checklist-item.checked .custom-checkbox {
    background-color: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.checklist-item.checked .custom-checkbox::after {
    transform: rotate(45deg) scale(1);
}

.checklist-text {
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.25s ease;
}

.checklist-item.checked .checklist-text {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.65;
}

.checklist-progress-bar.complete {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Settings Template Editor Row */
.checklist-settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 4px;
}

.checklist-settings-row input[type="text"] {
    flex: 1;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
}

.checklist-delete-btn {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
    padding: 10px !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.checklist-delete-btn:hover {
    background: var(--color-loss) !important;
    border-color: var(--color-loss) !important;
    color: white !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.checklist-plan-container {
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.checklist-plan-container:hover {
    border-color: rgba(99, 102, 241, 0.3) !important;
    background-color: rgba(99, 102, 241, 0.03) !important;
}

.checklist-plan-container button:hover {
    color: var(--accent-blue) !important;
}

/* Quick Calculator Styling */
.btn-calc {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.btn-calc:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
    transform: scale(1.03);
}

.btn-calc:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.15);
}

.btn-calc.operator {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.btn-calc.operator:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
}

.btn-calc.equals:active {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.sizer-span-2 {
    grid-column: span 2;
}

@media (max-width: 480px) {
    .sizer-form-grid {
        grid-template-columns: 1fr !important;
    }
    .sizer-span-2 {
        grid-column: span 1 !important;
    }
}

.sizer-form-grid input,
.sizer-form-grid select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Pulsing Guardrail Breach Warning Icon */
.breach-pulse-icon {
    animation: breachPulse 2s infinite;
}

@keyframes breachPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
        transform: scale(1);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        transform: scale(1);
    }
}

/* Premium Toggle Switch Custom Component */
.switch {
    flex-shrink: 0 !important;
}

.switch input:checked + .slider {
    background-color: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

/* Broker Session Expiry Badges */
.broker-expiry-green {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.12) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.broker-expiry-amber {
    color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

.broker-expiry-red-pulse {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    animation: expiryPulse 1.5s infinite ease-in-out;
}

@keyframes expiryPulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
        background: rgba(239, 68, 68, 0.25);
    }
    100% {
        opacity: 1;
    }
}

.broker-expiry-blink {
    animation: expiryBlink 2s infinite ease-in-out !important;
}

@keyframes expiryBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* ==========================================================================
   CONVERSATIONAL AI COACH CHAT COMPONENT
   ========================================================================== */
.ai-coach-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #818cf8 100%);
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: float-agent 4s ease-in-out infinite;
}

.ai-coach-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.ai-coach-trigger:active {
    transform: scale(0.95);
}

.ai-agent-avatar {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-agent-avatar i {
    width: 28px;
    height: 28px;
    color: white;
}

.ai-agent-pulse-ring {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid #818cf8;
    opacity: 0;
    animation: agent-pulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.ai-coach-drawer {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 420px;
    height: 600px;
    max-height: calc(100vh - 140px);
    background: rgba(11, 17, 30, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: width 0.6s cubic-bezier(0.19, 1, 0.22, 1), height 0.6s cubic-bezier(0.19, 1, 0.22, 1), transform 0.6s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1), top 0.6s cubic-bezier(0.19, 1, 0.22, 1), left 0.6s cubic-bezier(0.19, 1, 0.22, 1), right 0.6s cubic-bezier(0.19, 1, 0.22, 1), bottom 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    overflow: hidden;
}

.ai-coach-drawer.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.ai-coach-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(30, 41, 59, 0.4);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.ai-coach-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-coach-title-group h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.ai-coach-status-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ai-coach-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.ai-coach-expand-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.period-review-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.period-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

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

.period-btn.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.coach-chat-messages {
    position: relative;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(0, 0, 0, 0.15);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.02);
}

.coach-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.coach-chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.coach-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.coach-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.chat-message.coach-message {
    align-self: flex-start;
}

.chat-message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.coach-message .chat-avatar {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
    color: #818cf8;
}

.user-message .chat-avatar {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

.chat-message-bubble {
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.coach-message .chat-message-bubble {
    border-radius: 4px 14px 14px 14px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.user-message .chat-message-bubble {
    border-radius: 14px 4px 14px 14px;
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
}

.coach-chat-suggestions {
    padding: 0 20px 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: rgba(0, 0, 0, 0.15);
}

.chat-suggestion-chip {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: 14px;
    padding: 5px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chat-suggestion-chip:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.coach-chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(30, 41, 59, 0.4);
}

.coach-chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

#coach-chat-input {
    flex: 1;
    height: 38px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

#coach-chat-input:focus {
    border-color: rgba(99, 102, 241, 0.4);
}

#coach-chat-send-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #818cf8 100%);
    border: none;
    color: white;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

#coach-chat-mic-btn {
    height: 38px;
    width: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    transition: all 0.2s;
}

#coach-chat-mic-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

#coach-chat-send-btn:hover {
    background: linear-gradient(135deg, var(--accent-blue-hover) 0%, #707df0 100%);
}

.chat-loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 4px 6px;
}

.chat-loading-dots span {
    width: 5px;
    height: 5px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: chatLoading 1.4s infinite ease-in-out both;
}

.chat-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.chat-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes float-agent {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes agent-pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes chatLoading {
    0%, 80%, 100% { 
        transform: scale(0);
        opacity: 0.3;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsiveness for Mobile Screens */
@media screen and (max-width: 576px) {
    .ai-coach-drawer {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }
    
    .ai-coach-drawer.expanded {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    
    .ai-coach-trigger {
        bottom: 148px !important;
        right: 20px !important;
        width: 56px !important;
        height: 56px !important;
    }
}

.chat-speak-btn:hover {
    color: var(--accent-blue) !important;
}

/* AI API Usage Tracker styling */
.coach-usage-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
}

/* Hide AI Coach widget on login/auth screens when app is hidden */
#app-container.hidden ~ #ai-coach-widget-container {
    display: none !important;
}

/* AI Coach fixes and expanded state */
.coach-chat-messages {
    overflow-x: hidden !important;
}
.chat-message-bubble {
    word-break: break-word !important;
}
.ai-coach-drawer.expanded {
    width: 850px;
    height: 800px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 120px);
}

/* Mic States & Visual Feedback */
.coach-chat-input-wrapper.mic-starting #coach-chat-input {
    border-color: rgba(245, 158, 11, 0.5) !important; /* Amber border */
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
    animation: mic-preparing-pulse 1s infinite alternate;
}

.coach-chat-input-wrapper.mic-starting #coach-chat-mic-btn {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    animation: mic-preparing-btn-pulse 1s infinite alternate;
}

.coach-chat-input-wrapper.mic-listening #coach-chat-input {
    border-color: transparent !important;
    background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.85)) padding-box,
                linear-gradient(135deg, #6366f1, #a855f7, #ec4899) border-box !important; /* Gemini multi-color border */
    border: 1px solid transparent !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
    animation: mic-listening-pulse 1.5s infinite alternate;
}

.coach-chat-input-wrapper.mic-listening #coach-chat-mic-btn {
    background: linear-gradient(135deg, #ef4444, #ec4899) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    animation: mic-listening-btn-pulse 1s infinite alternate;
}

/* Voice Wave Visualizer */
.coach-voice-wave {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 24px;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 5;
}

.coach-chat-input-wrapper.mic-listening .coach-voice-wave {
    display: flex;
}

.coach-chat-input-wrapper.mic-listening #coach-chat-input {
    color: transparent !important;
}

.coach-chat-input-wrapper.mic-listening #coach-chat-input::placeholder {
    color: transparent !important;
}

.wave-bar {
    width: 3px;
    height: 4px;
    background: linear-gradient(to top, #6366f1, #a855f7, #ec4899);
    border-radius: 3px;
    animation: wave-bounce 0.8s ease-in-out infinite alternate;
}

.wave-bar:nth-child(1) { animation-delay: 0.1s; height: 6px; }
.wave-bar:nth-child(2) { animation-delay: 0.3s; height: 14px; }
.wave-bar:nth-child(3) { animation-delay: 0.6s; height: 8px; }
.wave-bar:nth-child(4) { animation-delay: 0.2s; height: 16px; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; height: 10px; }

@keyframes wave-bounce {
    0% {
        transform: scaleY(1);
    }
    100% {
        transform: scaleY(3.5);
    }
}


.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes mic-preparing-pulse {
    0% {
        border-color: rgba(245, 158, 11, 0.3);
        box-shadow: 0 0 4px rgba(245, 158, 11, 0.1);
    }
    100% {
        border-color: rgba(245, 158, 11, 0.7);
        box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
    }
}

@keyframes mic-preparing-btn-pulse {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

@keyframes mic-listening-pulse {
    0% {
        box-shadow: 0 0 6px rgba(168, 85, 247, 0.15);
    }
    100% {
        box-shadow: 0 0 18px rgba(168, 85, 247, 0.45);
    }
}

@keyframes mic-listening-btn-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
    }
    100% {
        transform: scale(1.1);
        box-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
    }
}

.ai-coach-drawer.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 10000 !important;
}

/* Highlight glow pulse for section redirection */
.section-highlight-glow {
    animation: highlight-pulse-glow 1.5s ease-in-out 2;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

@keyframes highlight-pulse-glow {
    0% {
        box-shadow: 0 0 0 0px rgba(59, 130, 246, 0.7);
        border-color: #3b82f6;
    }
    50% {
        box-shadow: 0 0 0 12px rgba(59, 130, 246, 0);
        border-color: #3b82f6;
    }
    100% {
        box-shadow: 0 0 0 0px rgba(59, 130, 246, 0);
    }
}

/* Reposition floating AI trigger on mobile screens to prevent overlap with bottom navigation */
@media screen and (max-width: 768px) {
    .ai-coach-trigger {
        bottom: 148px !important;
        right: 20px !important;
        width: 56px !important;
        height: 56px !important;
    }
}

/* Filter button custom styling */
#filter-panel-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    border-radius: var(--border-radius-md) !important;
    color: var(--accent-blue) !important;
    font-weight: 500;
    transition: all var(--transition-fast);
}

#filter-panel-toggle:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: var(--accent-blue) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 10px var(--accent-blue-glow);
}

#filter-panel-toggle i {
    width: 16px;
    height: 16px;
}

.filter-btn-text {
    font-size: 13px;
    font-weight: 500;
}

@media (max-width: 900px) {
    #filter-panel-toggle {
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        color: var(--text-secondary) !important;
        box-shadow: none !important;
    }
    #filter-panel-toggle:hover {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    .filter-btn-text {
        display: none !important;
    }
}

/* Clickable stats cards hover effect */
.clickable-card {
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.clickable-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.45) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35) !important;
}

/* Badge styling and hover interactivity */
.stats-card-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-blue);
    padding: 3px 8px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.clickable-card:hover .stats-card-badge {
    background: var(--accent-blue) !important;
    color: #ffffff !important;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* Progress bar for stats summary modal */
.stats-summary-progress-bg {
    width: 100%;
    max-width: 120px;
    height: 10px;
    background: var(--bg-tertiary, #1e293b);
    border-radius: 6px;
    overflow: hidden;
    display: inline-flex;
    vertical-align: middle;
    margin-right: 8px;
    border: 1px solid var(--glass-border);
}
.stats-summary-progress-win {
    height: 100%;
    background: var(--color-win, #10b981);
}
.stats-summary-progress-loss {
    height: 100%;
    background: var(--color-loss, #ef4444);
}

/* Filter button glowing effect when scrolling to trade logs */
.glowing-filter {
    animation: filter-pulse-glow 1.8s infinite ease-in-out;
    border-color: var(--accent-blue) !important;
    color: var(--text-primary) !important;
}

@keyframes filter-pulse-glow {
    0% {
        border-color: rgba(59, 130, 246, 0.3) !important;
        box-shadow: 0 0 4px rgba(59, 130, 246, 0.1);
        background: rgba(59, 130, 246, 0.1) !important;
    }
    50% {
        border-color: var(--accent-blue) !important;
        box-shadow: 0 0 14px rgba(59, 130, 246, 0.6), 0 0 6px rgba(59, 130, 246, 0.3);
        background: rgba(59, 130, 246, 0.25) !important;
    }
    100% {
        border-color: rgba(59, 130, 246, 0.3) !important;
        box-shadow: 0 0 4px rgba(59, 130, 246, 0.1);
        background: rgba(59, 130, 246, 0.1) !important;
    }
}

/* Fundamental Indicator Lightbulb & Tooltip */
.fundamental-indicator-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.fundamental-lightbulb {
    cursor: help;
    font-size: 13px;
    transition: filter var(--transition-normal);
}

.fundamental-lightbulb.blinking {
    animation: pulse-yellow-red 2.6s infinite ease-in-out;
    display: inline-block;
    filter: sepia(1) saturate(8) hue-rotate(-50deg) drop-shadow(0 0 8px #ef4444);
}

@keyframes pulse-yellow-red {
    0% {
        opacity: 0.4;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
    100% {
        opacity: 0.4;
        transform: scale(0.95);
    }
}

.fundamental-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    transform: translateY(-4px);
    background: rgba(15, 17, 26, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 260px;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.fundamental-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 8px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(15, 17, 26, 0.95) transparent;
}

.fundamental-indicator-wrapper:hover .fundamental-tooltip {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

/* Fundamental Catalyst Info Icon & Tooltip */
.catalyst-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.catalyst-info-icon {
    cursor: help;
    font-size: 9px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.catalyst-info-icon:hover {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

.catalyst-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: rgba(15, 17, 26, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    width: 250px;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    line-height: 1.4;
}

.catalyst-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(15, 17, 26, 0.95) transparent;
}

.catalyst-tooltip-wrapper:hover .catalyst-tooltip {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

/* Chart Fundamental Sidebar Panel styling */
.chart-fundamental-sidebar {
    width: 0;
    opacity: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, border-left-color 0.3s ease;
    display: flex;
    flex-direction: column;
    background: rgba(18, 19, 26, 0.75);
    backdrop-filter: blur(15px);
    border-left: 0px solid var(--border-color);
    height: 100%;
    z-index: 5;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.chart-fundamental-sidebar.active {
    width: 320px;
    opacity: 1;
    border-left: 1px solid var(--border-color);
}

.chart-fundamental-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.chart-fundamental-section {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 12px;
}

.chart-fundamental-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.chart-fundamental-grid {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 6px;
    line-height: 1.4;
    font-size: 11.5px;
}

.chart-fundamental-sidebar-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.chart-fundamental-sidebar-close:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

/* Calendar event overlay styling */
.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 3px;
    margin-bottom: auto;
    width: 100%;
    overflow: hidden;
}

.calendar-event-pill {
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
    line-height: 1.2;
}

.calendar-event-pill.event-earnings {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.calendar-event-pill.event-dividend {
    background: rgba(234, 179, 8, 0.12);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.calendar-event-pill.event-macro {
    background: rgba(249, 115, 22, 0.12);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.25);
}

.calendar-event-pill.event-holiday {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.cal-popup-event-section {
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
}

.cal-popup-event-title {
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cal-popup-event-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cal-popup-event-item:last-child {
    border-bottom: none;
}

/* Mobile optimizations for Trading Calendar grid and event badges */
@media (max-width: 768px) {
    .calendar-days-grid {
        grid-auto-rows: 65px !important;
        gap: 4px !important;
    }
    
    .calendar-day-box {
        justify-content: flex-start !important;
        gap: 3px !important;
        padding: 5px !important;
    }
    
    .calendar-day-meta {
        margin-bottom: 2px;
    }
    
    .calendar-day-num {
        font-size: 10px !important;
    }
    
    .calendar-day-events {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 2.5px !important;
        justify-content: flex-start;
        align-items: center;
        margin-top: 2px !important;
        min-height: 6px;
        width: 100%;
        overflow: visible;
    }
    
    .calendar-event-pill {
        width: 6px !important;
        height: 6px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        border: none !important;
        text-indent: -9999px !important;
        overflow: hidden !important;
        display: inline-block !important;
        min-width: 6px !important;
        max-width: 6px !important;
        background-color: transparent;
    }
    
    .calendar-event-pill.event-earnings {
        background-color: var(--accent-blue) !important;
        background: var(--accent-blue) !important;
    }
    
    .calendar-event-pill.event-dividend {
        background-color: #facc15 !important;
        background: #facc15 !important;
    }
    
    .calendar-event-pill.event-macro {
        background-color: #f97316 !important;
        background: #f97316 !important;
    }
    
    .calendar-event-pill.event-holiday {
        background-color: #ef4444 !important;
        background: #ef4444 !important;
    }
    
    .calendar-day-pnl {
        font-size: 8px !important;
        text-align: left !important;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-top: auto;
        line-height: 1;
    }
}

/* ==========================================================================
   TRADER TEST & PSYCHOLOGY ASSESSMENT STYLES
   ========================================================================== */
.trader-test-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease-out;
}

.trader-test-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .trader-test-grid {
        grid-template-columns: 1fr;
    }
}

.trader-test-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.trader-test-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.trader-test-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Quiz Card */
.quiz-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 400px;
}

.quiz-card.animate-slide {
    animation: quizSlideIn 0.3s ease-out;
}

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

/* History Card */
.quiz-history-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quiz-history-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.quiz-history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.quiz-history-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent-blue);
}

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

.quiz-history-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.quiz-history-score {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

/* Progress bar */
.quiz-progress-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.quiz-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.quiz-progress-track {
    background: rgba(255, 255, 255, 0.08);
    height: 8px;
    border-radius: 4px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.quiz-progress-bar {
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-cyan, #06b6d4) 100%);
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Intro UI */
.quiz-intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 20px 0;
}

.quiz-intro-icon {
    font-size: 48px;
    margin-bottom: 8px;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.quiz-intro-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    margin-top: 12px;
}

@media (max-width: 600px) {
    .quiz-intro-features {
        grid-template-columns: 1fr;
    }
}

.quiz-feature-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.quiz-feature-card i {
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.quiz-feature-card strong {
    color: var(--text-primary);
}

.quiz-feature-card span {
    color: var(--text-secondary);
    text-align: center;
}

/* Question Area */
.quiz-question-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.quiz-question-title {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
}

.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.quiz-option-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    width: 100%;
}

.quiz-option-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-blue);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quiz-option-btn.selected {
    background: rgba(9, 132, 227, 0.1);
    border-color: var(--accent-blue);
    font-weight: 500;
}

.quiz-option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.quiz-option-btn:hover .quiz-option-letter {
    background: var(--accent-blue);
    color: white;
}

.quiz-option-btn.selected .quiz-option-letter {
    background: var(--accent-blue);
    color: white;
}

/* Results UI */
.quiz-results-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.quiz-result-score-panel {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
}

@media (max-width: 600px) {
    .quiz-result-score-panel {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.quiz-result-radial {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quiz-score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-score-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.quiz-score-circle circle {
    fill: none;
    stroke-width: 8;
}

.quiz-score-circle .circle-bg {
    stroke: rgba(255, 255, 255, 0.08);
}

.quiz-score-circle .circle-progress {
    stroke: var(--accent-blue);
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-in-out;
}

.quiz-score-circle .circle-progress.fit { stroke: var(--color-win); }
.quiz-score-circle .circle-progress.caution { stroke: #facc15; }
.quiz-score-circle .circle-progress.unfit { stroke: var(--color-loss); }

.quiz-score-text {
    position: absolute;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.quiz-result-verdict-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-badge-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-pill.fit {
    background: rgba(38, 166, 154, 0.15);
    color: var(--color-win);
    border: 1px solid rgba(38, 166, 154, 0.3);
}

.badge-pill.caution {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.badge-pill.unfit {
    background: rgba(239, 83, 80, 0.15);
    color: var(--color-loss);
    border: 1px solid rgba(239, 83, 80, 0.3);
}

.quiz-verdict-title {
    font-size: 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

.quiz-verdict-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Category grid breakdown */
.quiz-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .quiz-categories-grid {
        grid-template-columns: 1fr;
    }
}

.quiz-cat-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.quiz-cat-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.quiz-cat-score {
    font-weight: 600;
    font-size: 13px;
}

.quiz-cat-score.fit { color: var(--color-win); }
.quiz-cat-score.caution { color: #facc15; }
.quiz-cat-score.unfit { color: var(--color-loss); }

.quiz-cat-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Action button row */
.quiz-btn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    width: 100%;
}

.quiz-action-btn-primary {
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    padding: 12px 24px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quiz-action-btn-primary:hover {
    background: var(--accent-blue-hover, #0870c2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.25);
}

.quiz-action-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.quiz-action-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px 24px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quiz-action-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Modal details history styles */
.quiz-history-clear-btn {
    background: none;
    border: none;
    color: var(--color-loss);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}
.quiz-history-clear-btn:hover {
    background: rgba(239, 83, 80, 0.1);
}
}

/* ==========================================================================
   BACKTESTER SUB-TABS & PROBABILITY ANALYZER STYLES
   ========================================================================== */
.backtest-subtab-btn {
    border: 1px solid transparent !important;
    background: transparent !important;
}

.backtest-subtab-btn:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-primary) !important;
}

.backtest-subtab-btn.active {
    background: rgba(9, 132, 227, 0.15) !important;
    border-color: var(--accent-blue) !important;
    color: var(--accent-blue) !important;
}

.backtest-subtab-btn.active i {
    color: var(--accent-blue) !important;
}

/* Probability grid layout (desktop: 2 cols symmetrical, mobile: 1 col) */
.prob-analyzer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 1024px) {
    .prob-analyzer-grid {
        grid-template-columns: 1fr;
    }
}

.prob-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 320px;
}

/* Seasonality 12-Month Grid (4x3 layout, responsive) */
.seasonality-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 480px) {
    .seasonality-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.seasonality-cell {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    font-size: 11px;
}

.seasonality-cell.bullish {
    background: rgba(38, 166, 154, 0.12) !important;
    border-color: rgba(38, 166, 154, 0.3) !important;
    color: var(--color-win) !important;
}

.seasonality-cell.bearish {
    background: rgba(239, 83, 80, 0.12) !important;
    border-color: rgba(239, 83, 80, 0.3) !important;
    color: var(--color-loss) !important;
}

.seasonality-cell .month-lbl {
    font-weight: 600;
    color: var(--text-primary);
}

.seasonality-cell .return-val {
    font-weight: 700;
    font-family: monospace;
}

/* Weekday list */
.weekday-prob-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.weekday-bar-container {
    background: rgba(255, 255, 255, 0.05);
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    display: flex;
    width: 100%;
}

.weekday-bar-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.weekday-bar-segment.trend { background: var(--color-win); }
.weekday-bar-segment.volatile { background: #facc15; }
.weekday-bar-segment.sideways { background: var(--accent-blue); }

.weekday-prob-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.weekday-legend-bullet {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

/* Donut chart SVG */
.donut-svg-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    height: 160px;
}

.donut-label-center {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.donut-label-center .primary-lbl {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.donut-label-center .sub-lbl {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Quick selections hover effects */
.quick-prob-tag:hover {
    background: rgba(9, 132, 227, 0.15) !important;
    border-color: var(--accent-blue) !important;
    color: var(--text-primary) !important;
}

/* Skeleton Loading styles */
.skeleton-line {
    animation: prob-skeleton-pulse 1.8s ease-in-out infinite;
}

@keyframes prob-skeleton-pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}

/* Galton Board Sweet Spot Visualizer */
.galton-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .galton-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

#galton-svg {
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.peg-hit {
    fill: #ffffff !important;
    r: 5px !important;
    opacity: 1 !important;
    filter: drop-shadow(0 0 5px #ffffff);
}

#galton-rerun-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
    border-color: var(--text-secondary) !important;
}

/* Probability Analyzer Landing Layout & Mobile Fixes */
.prob-landing-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    padding: 30px;
}

.prob-search-input-wrapper {
    position: relative;
    width: 100%;
}

.prob-analyze-btn {
    height: 50px;
    padding: 0 24px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    justify-content: center;
    width: 180px;
    box-sizing: border-box;
}

.prob-settings-row {
    grid-column: 1 / span 2;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 5px;
    text-align: left;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    width: 100%;
}

.prob-date-container {
    flex: 2;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.prob-date-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.prob-date-inputs input[type="date"] {
    flex: 1;
    height: 38px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 13.5px;
    outline: none;
    box-sizing: border-box;
    min-width: 0;
}

.prob-preset-row {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.prob-lang-container {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.prob-quick-select-row {
    grid-column: 1 / span 2;
    width: 100%;
}

@media (max-width: 480px) {
    .prob-analyzer-landing {
        padding: 0 10px 10px 10px !important;
    }
    
    .prob-landing-card {
        display: flex !important;
        flex-direction: column !important;
        padding: 16px !important;
        gap: 16px !important;
    }
    
    .prob-search-input-wrapper {
        width: 100% !important;
        order: 1 !important;
    }
    
    .prob-settings-row {
        width: 100% !important;
        order: 2 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }
    
    .prob-date-inputs {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    
    .prob-date-inputs span {
        text-align: center;
        margin: 2px 0;
        font-size: 11px;
    }
    
    .prob-date-inputs input[type="date"] {
        width: 100% !important;
        flex: none !important;
    }
    
    .prob-date-container {
        min-width: 100% !important;
    }
    
    .prob-lang-container {
        min-width: 100% !important;
    }
    
    .prob-preset-row {
        justify-content: space-between;
    }
    
    .btn-preset-date {
        flex: 1;
        text-align: center;
        padding: 6px 4px !important;
    }
    
    /* Analyze Ticker button should go below choose playbook language on mobile */
    .prob-analyze-btn {
        max-width: 100% !important;
        width: 100% !important;
        order: 3 !important;
        align-self: stretch !important;
    }
    
    .prob-quick-select-row {
        width: 100% !important;
        order: 4 !important;
    }
}

/* Automated Chart Pattern Detector CSS variables and layout */
:root {
    --color-pattern-bullish: #10b981;
    --color-pattern-bearish: #ef4444;
    --color-pattern-neutral: #3b82f6;
}

.pattern-layout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .pattern-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

/* ==========================================================================
   TradingView Backtester terminal aesthetics
   ========================================================================== */
.backtest-tv-stats-header {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin-bottom: 15px;
}

.tv-stat-col {
    background: var(--bg-card);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background var(--transition-fast);
}

.tv-stat-col:hover {
    background: rgba(255, 255, 255, 0.02);
}

.tv-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.tv-stat-value {
    font-family: 'Outfit';
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Tab navigation bar styles */
.backtest-tv-tabs-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.tv-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.tv-tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* Tab pane displays */
.backtest-tv-tab-pane {
    display: none;
    animation: fadeIn var(--transition-medium) ease;
}

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

/* Overview tab styles */
.tv-overview-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tv-overview-item {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tv-overview-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.tv-overview-value {
    font-size: 13px;
    font-weight: 600;
    font-family: 'Outfit';
}

/* Returns matrix styling */
.backtest-tv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    text-align: left;
}

.backtest-tv-table th, 
.backtest-tv-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.backtest-tv-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.01);
}

.backtest-tv-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.tbl-metric {
    font-weight: 500;
    color: var(--text-secondary);
    width: 35%;
}

.locked-cell {
    opacity: 0.5;
}

/* Custom visual layout elements */
.tv-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.tv-bar-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
}

.tv-bar-value {
    font-size: 11px;
    font-weight: 600;
}

.tv-progress-track {
    width: 100%;
    height: 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.tv-progress-fill {
    height: 100%;
    transition: width 0.4s ease;
}

.tv-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.tv-histogram-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
}

.tv-hist-label {
    width: 45px;
    color: var(--text-secondary);
}

.tv-hist-bar-wrapper {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.tv-hist-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.tv-hist-value {
    width: 40px;
    text-align: right;
    font-weight: 600;
}

@media (max-width: 576px) {
    .backtest-tv-stats-header {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==========================================================================
   SYNC TRADES CENTER VISUAL GUIDE SLIDE-OUT PANEL
   ========================================================================== */
.modal-container {
    transition: max-width 0.3s ease-in-out;
}

/* Slide-out active state for the modal container */
.modal-container.visual-guide-active {
    max-width: 1220px !important;
}

/* Slide-out active state for the side panel */
.modal-container.visual-guide-active .visual-guide-panel {
    width: 420px !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Close button hover animations */
#close-visual-guide-btn {
    transition: color 0.2s, transform 0.2s;
}
#close-visual-guide-btn:hover {
    color: var(--text-primary) !important;
    transform: translateX(2px);
}

/* Button style inside connection guide */
.btn-toggle-visual-guide:hover {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
    color: #fff !important;
}

/* Responsive adjustment for visual guide */
@media (max-width: 992px) {
    .modal-container.visual-guide-active {
        max-width: 95vw !important;
    }
    .modal-container.visual-guide-active .modal-body-wrapper {
        flex-direction: column !important;
    }
    .modal-container.visual-guide-active .visual-guide-panel {
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        max-height: 350px;
    }
}

/* ==========================================================================
   TRADING EDGE PLAYBOOK & GATING STYLES
   ========================================================================== */
.trading-edge-container {
    padding: 10px 0;
}

.trading-edge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
    margin-top: 10px;
    align-items: stretch;
}

/* Accordion cards inside Trading Edge */
.edge-accordion-card {
    border: 1px solid var(--border-color) !important;
    background: rgba(255, 255, 255, 0.01) !important;
    border-radius: var(--border-radius-md) !important;
    margin-bottom: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.edge-accordion-card:hover:not(.blurred-content) {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    transform: translateY(-1px);
}

.edge-accordion-card.blurred-content {
    filter: blur(1.5px);
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
}

/* Lock overlays for premium features */
.lock-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(10, 14, 23, 0.75) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 24px !important;
    z-index: 10 !important;
}

/* Shiny upgrade badge */
.badge-premium {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
    animation: premium-glow 2s infinite alternate;
}

@keyframes premium-glow {
    from {
        box-shadow: 0 0 4px rgba(245, 158, 11, 0.2);
    }
    to {
        box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
    }
}

.accordion-chevron {
    transition: transform 0.2s ease;
}

.vcp-chart-illustration {
    border: 1px dashed var(--border-color) !important;
    background: rgba(255, 255, 255, 0.01) !important;
    transition: all 0.2s ease;
}
.vcp-chart-illustration:hover {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: var(--accent-blue) !important;
}

.field-highlight-pulse {
    animation: field-glow-pulse 0.8s infinite alternate;
}

@keyframes field-glow-pulse {
    from {
        box-shadow: 0 0 4px rgba(59, 130, 246, 0.4);
        border-color: rgba(59, 130, 246, 0.6) !important;
    }
    to {
        box-shadow: 0 0 16px rgba(59, 130, 246, 0.9);
        border-color: rgba(59, 130, 246, 1) !important;
    }
}

.btn-compare-plans {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #93c5fd;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 rgba(59, 130, 246, 0);
    outline: none;
    text-decoration: none;
}

.btn-compare-plans:hover {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.6);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    transform: translateY(-1.5px);
}

.btn-compare-plans:active {
    transform: translateY(0.5px);
}

.btn-compare-plans-pulse {
    animation: compare-plans-pulse-glow 2.5s infinite ease-in-out;
}

@keyframes compare-plans-pulse-glow {
    0% {
        border-color: rgba(59, 130, 246, 0.25);
        box-shadow: 0 0 0px rgba(59, 130, 246, 0);
        background: rgba(59, 130, 246, 0.05);
    }
    50% {
        border-color: rgba(59, 130, 246, 0.6);
        box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
        background: rgba(59, 130, 246, 0.12);
    }
    100% {
        border-color: rgba(59, 130, 246, 0.25);
        box-shadow: 0 0 0px rgba(59, 130, 246, 0);
        background: rgba(59, 130, 246, 0.05);
    }
}

#rrg-sector-select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E') !important;
}

body.light-theme #rrg-sector-select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23475569%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E') !important;
}

.rrg-dashboard-layout {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 20px;
}

.rrg-chart-card {
    min-height: 480px;
}

@media (max-width: 768px) {
    .rrg-dashboard-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .rrg-chart-card {
        min-height: auto !important;
        padding: 12px !important;
    }
    .rrg-dashboard-layout > .glass-card {
        height: auto !important;
    }
}

.rrg-market-btn {
    padding: 4px 10px;
    border-radius: 4px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.rrg-market-btn.active {
    background: rgba(9, 132, 227, 0.15) !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

.rrg-market-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

@keyframes quantum-pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.45);
        border-color: rgba(99, 102, 241, 0.45);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(99, 102, 241, 0);
        border-color: rgba(99, 102, 241, 0.7);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
        border-color: rgba(99, 102, 241, 0.45);
    }
}

.quantum-guide-trigger {
    animation: quantum-pulse-glow 2s infinite ease-in-out;
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 22px;
    height: 22px;
    background: rgba(99, 102, 241, 0.05);
    color: var(--accent-blue);
    font-size: 11px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1;
}

.quantum-guide-trigger:hover {
    background: rgba(99, 102, 241, 0.18) !important;
    transform: scale(1.08);
}

@keyframes button-attention-blink {
    0%, 100% {
        opacity: 0.6;
        color: var(--text-secondary);
        transform: scale(1);
    }
    50% {
        opacity: 1;
        color: var(--accent-blue);
        transform: scale(1.15);
    }
}
.attention-blink {
    animation: button-attention-blink 1.5s infinite ease-in-out;
}



