/* ============================================
   Options Simulator - Main Stylesheet
   ============================================

   DESIGN NOTE - ICONS/EMOJIS:
   Do NOT use emoji icons in the UI unless explicitly requested.
   Previously used icons have been removed for cleaner design.

   List of removed icons for future reference:
   - 📊 Dashboard, charts, analytics
   - 🤖 AI Mentor, AUTOMAT mode
   - ⏹️ Stop button
   - ⚠️ Warnings
   - 🔄 Refresh, reset
   - 🔒 Lock icons
   - 💰 Money, budget
   - 📈📉 Trends
   - ✓✗ Check/cross marks (keep in tables)

   ============================================ */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent overscroll/rubber band on touch devices */
html {
    overscroll-behavior: none;
}

/* Vue v-cloak - hide elements until Vue is ready */
[v-cloak] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: var(--text-primary);
    overscroll-behavior-y: none;  /* Prevent vertical overscroll bounce */
    overflow-x: hidden;  /* Prevent horizontal scroll */
}

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

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

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

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

/* Grid Container */
.grid-container {
    display: grid;
    grid-template-columns: 55% 10% 35%;
    /* Graf | Ovládanie | Simulátor (rozšírený) */
    grid-template-rows: 40fr 60fr;  /* Chart row | Options/Controls row */
    gap: 1px;
    height: calc(100vh - 44px);  /* Exact viewport height minus menu */
    width: 100vw;
    margin-top: 44px;  /* Space for fixed menu (outside grid) */
    background: var(--bg-primary);
    box-sizing: border-box;
}

/* Block Base Styles */
.block {
    background: var(--bg-secondary);
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-primary);
}

/* Graph Block */
.block-graph {
    grid-column: 1;
    grid-row: 1;
}

.block-header {
    background: var(--bg-secondary);
    padding: clamp(3px, 0.42vh, 5px) 12px;
    border-bottom: 1px solid var(--border-primary);
}

/* Info Panel */
.info-panel {
    background: var(--bg-primary);
    padding: 0;
    border-bottom: 1px solid var(--border-primary);
    font-size: 10px;
    color: var(--text-secondary);
    height: 18px;
    line-height: 18px;
    overflow: hidden;
}

/* Marquee scrolling container */
.info-marquee {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.info-marquee-content {
    display: flex;
    width: fit-content;
    animation: marquee 60s linear infinite;
    padding: 0 12px;
}

.info-marquee-content span {
    white-space: nowrap;
    padding-right: 100px;
    /* Space between loops */
}

.info-marquee:hover .info-marquee-content {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Static info (for synthetic data) */
.info-static {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 12px;
    height: 100%;
}

.info-item {
    white-space: nowrap;
}

.info-item strong {
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 4px;
}

.controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
	margin-left: 5%;
}

.model-select {
    padding: 6px 10px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 130px;
    transition: all var(--transition-normal);
}

.model-select:hover {
    background: var(--bg-hover);
}

.model-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.time-select {
    padding: 6px 10px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 80px;
    transition: all var(--transition-normal);
}

.time-select:hover {
    background: var(--bg-hover);
}

.time-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Ticker Search Group */
.ticker-search-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.ticker-search-wrapper {
    position: relative;
}

.ticker-input {
    padding: 5px 10px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 11px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    width: 180px;
    height: var(--toolbar-btn-height);
    transition: all var(--transition-normal);
}

.ticker-input:hover {
    background: var(--bg-hover);
}

.ticker-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.ticker-input::placeholder {
    color: var(--text-muted);
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-secondary);
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-item.selected {
    background: var(--accent-primary);
    color: var(--text-inverse, #fff);
}

.search-result-item.selected strong {
    color: inherit;
}

.search-result-item.selected .result-name {
    color: inherit;
}

.search-result-item.selected .result-exchange {
    color: rgba(255, 255, 255, 0.8);
}

.search-result-item.no-results {
    cursor: default;
    color: var(--text-muted);
    font-style: italic;
}

.search-result-item.no-results:hover {
    background: var(--bg-tertiary);
}

.search-result-item strong {
    color: var(--accent-primary);
    font-size: 14px;
}

.search-result-item .result-name {
    color: var(--text-primary);
    font-size: 12px;
}

.search-result-item .result-exchange {
    color: var(--text-secondary);
    font-size: 11px;
}

.options-indicator {
    margin-left: 6px;
    font-size: 14px;
    opacity: 0.9;
}

.load-ticker-btn {
    padding: 5px 12px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    height: var(--toolbar-btn-height);
    transition: all var(--transition-normal);
}

.load-ticker-btn:hover:not(:disabled) {
    background: var(--accent-primary-hover);
}

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

.info-ticker-btn {
    /* Golden ratio: 26px / 1.618 ≈ 16px font, circle matches toolbar height */
    width: var(--toolbar-btn-height);
    height: var(--toolbar-btn-height);
    padding: 0;
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-secondary);
    border-radius: var(--radius-full);
    font-size: 16px;  /* toolbar height / golden ratio */
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.info-ticker-btn:hover:not(:disabled) {
    color: var(--accent-primary-light);
    border-color: var(--accent-primary-light);
}

.info-ticker-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.period-select {
    padding: 5px 8px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 11px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 60px;
    height: var(--toolbar-btn-height);
    transition: all var(--transition-normal);
}

.period-select:hover {
    background: var(--bg-hover);
}

.period-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Timeframe Buttons */
.tf-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: none;
    border-right: 1px solid var(--bg-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.tf-btn:last-child {
    border-right: none;
}

.tf-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tf-btn.active {
    background: var(--accent-primary);
    color: var(--text-white);
    font-weight: 600;
}

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

/* Chart Type Buttons */
.chart-type-btn {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: none;
    border-right: 1px solid var(--bg-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.chart-type-btn:last-child {
    border-right: none;
}

.chart-type-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chart-type-btn.active {
    background: var(--accent-primary);
    color: var(--text-white);
    font-weight: 600;
}

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

.generate-btn {
    padding: 5px 16px;
    background: var(--accent-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    height: var(--toolbar-btn-height);
    transition: background 0.2s;
    white-space: nowrap;
}

.generate-btn:hover:not(:disabled) {
    background: var(--accent-primary-hover);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.block-content {
    flex: 1;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-secondary);
}

/* Chart Area Wrapper */
.chart-area-wrapper {
    flex: 1;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

.chart-area-wrapper .tradingview-charts {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* TradingView Charts Container */
.tradingview-charts {
    flex: 1;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-secondary);
}

/* Chart Controls Bar (under chart) */
.chart-controls-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 4px 8px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    height: 28px;
    min-height: 28px;
    max-height: 28px;
}

.controls-spacer {
    flex: 1;
}

.help-chart-btn {
    padding: 5px 10px;
    white-space: nowrap;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    height: var(--toolbar-btn-height);
    margin-right: 6px;
    transition: all var(--transition-normal);
    min-width: 28px;
}

.help-chart-btn:hover {
    background: var(--accent-primary);
    color: var(--text-white);
    border-color: var(--accent-primary);
}

.ai-mentor-chart-btn {
    padding: 5px 10px;
    white-space: nowrap;
    background: var(--accent-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    height: var(--toolbar-btn-height);
    margin-right: 8px;
    transition: background var(--transition-normal);
}

.ai-mentor-chart-btn:hover:not(:disabled) {
    background: var(--accent-primary-hover);
}

.controls-group {
    display: flex;
    gap: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.ctrl-btn {
    padding: 3px 8px;
    background: var(--bg-tertiary);
    border: none;
    border-right: 1px solid var(--bg-primary);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    height: 20px;
    line-height: 14px;
}

.ctrl-btn:last-child {
    border-right: none;
}

.ctrl-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ctrl-btn.active {
    background: var(--accent-primary);
    color: var(--text-white);
    font-weight: 600;
}

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

.chart-main {
    flex: 1;
    min-height: 0;
    background: var(--bg-secondary);
}

.chart-volume {
    display: none;
    flex: 0;
    min-height: 0;
    background: var(--bg-secondary);
}

/* Control Column Wrapper */
.control-column {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Control Block */
.block-control {
    flex: 1 1 60%;
    /* Increased from flex: 1 to give more space */
    min-height: 0;
}

/* Trade Block */
.block-trade {
    flex: 1 1 40%;
    /* Changed from flex: 0 0 auto to flex proportion */
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Current Candle Date Display */
.current-candle-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary-light);
    text-align: center;
    padding: clamp(4px, 0.67vh, 8px) 10px;
    margin: 0 10px clamp(1px, 0.25vh, 3px) 10px;
}

/* Simulation Block */
.block-simulation {
    grid-column: 3;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
}

.simulation-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1vh, 12px);
    padding: clamp(3px, 0.42vh, 5px) 15px clamp(3px, 0.42vh, 5px) 5px;
    overflow-y: auto;
}

/* Simulator Sections */
.sim-section {
    padding: 2px 10px 2px 2px;
	/*background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-secondary);*/
}

.sim-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* Vertical Title Layout */
.sim-section.has-vertical-title {
    display: flex;
    flex-direction: row;
}

.sim-section-title-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    /*background: var(--bg-secondary);
    border-right: 1px solid #363a45;*/
    min-width: 22px;
}

.sim-section-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* Budget Section - Horizontal Layout */
.budget-section {
    flex-shrink: 0;
}

/* Budget Grid 2x2 */
.budget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 6px;
}

/* Budget Input Row */
.budget-input-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    /*border: 1px solid var(--border-secondary);*/
}

.budget-input-row .budget-label {
    font-size: 9px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budget-input-group {
    display: flex;
    gap: 4px;
}

.budget-input {
    flex: 1;
    padding: 5px 8px;  /* Reduced vertical padding */
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.budget-input:focus {
    outline: none;
    border-color: var(--accent-primary-light);
    box-shadow: 0 0 0 2px rgba(41, 98, 255, 0.1);
}

.budget-btn {
    padding: 5px 12px;  /* Reduced vertical padding */
    background: var(--accent-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;  /* Increased for consistency */
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budget-btn:hover {
    background: var(--accent-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(41, 98, 255, 0.3);
}

.budget-btn:active {
    transform: translateY(0);
}

/* Budget Display Group (replaces input) */
.budget-display-group {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.budget-display-value {
    flex: 1;
    padding: 6px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.budget-btn-vklad {
    padding: 5px 12px;  /* Reduced vertical padding */
    background: linear-gradient(135deg, var(--color-success) 0%, #66bb6a 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;  /* Increased for consistency */
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budget-btn-vklad:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.budget-btn-vklad:active {
    transform: translateY(0);
}


/* Budget Stat Items - Grid cells */
.budget-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-secondary);
    transition: all var(--transition-normal);
    position: relative;
}

/* Blue style for Total Value */
.budget-stat-item.blue {
    background: var(--gradient-primary);
    border-color: var(--accent-primary-light);
    box-shadow: 0 2px 8px rgba(41, 98, 255, 0.2);
}

.budget-stat-item.positive {
    background: var(--gradient-success);
    border-color: var(--color-success);
    box-shadow: 0 2px 8px rgba(8, 153, 129, 0.2);
}

.budget-stat-item.negative {
    background: var(--gradient-error);
    border-color: var(--color-error);
    box-shadow: 0 2px 8px rgba(242, 54, 69, 0.2);
}

/* Reserved Cash - yellow/orange indicator */
.budget-stat-item.reserved {
    background: linear-gradient(135deg, rgba(255, 159, 64, 0.15), rgba(255, 159, 64, 0.05));
    border-color: rgba(255, 159, 64, 0.3);
}

.budget-stat-item.reserved .budget-stat-value {
    color: var(--color-warning);
}

/* Available Cash - green indicator */
.budget-stat-item.available {
    background: linear-gradient(135deg, rgba(8, 153, 129, 0.15), rgba(8, 153, 129, 0.05));
    border-color: rgba(8, 153, 129, 0.3);
}

.budget-stat-item.available .budget-stat-value {
    color: var(--color-success);
}

/* Realized P/L - uses positive/negative colors */
.budget-stat-item.realized {
    font-size: 0.9em;
}

/* Unrealized P/L - uses positive/negative colors */
.budget-stat-item.unrealized {
    font-size: 0.9em;
}

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

.budget-stat-item.blue .budget-stat-label,
.budget-stat-item.positive .budget-stat-label,
.budget-stat-item.negative .budget-stat-label {
    color: rgba(255, 255, 255, 0.7);
}

.budget-stat-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 700;
    text-align: right;
}

/* White text for colored gradient backgrounds */
.budget-stat-item.blue .budget-stat-value,
.budget-stat-item.positive .budget-stat-value,
.budget-stat-item.negative .budget-stat-value {
    color: var(--text-white);
}

.budget-stat-percent {
    font-size: 8px;
    opacity: 0.9;
    margin-left: 3px;
}

/* Info Icon for Budget Stats */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 9px;
    font-style: italic;
    font-weight: bold;
    cursor: pointer;
    margin-left: 4px;
    transition: all 0.2s;
    vertical-align: middle;
}

.info-icon:hover {
    background: var(--accent-primary);
    color: white;
}

/* Info Tooltip */
.info-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    width: 260px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-top: 8px;
}

.info-tooltip-header {
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 6px;
    font-size: 13px;
}

.info-tooltip-desc {
    color: var(--text-primary);
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.info-tooltip-calc {
    color: var(--text-muted);
    font-size: 11px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    line-height: 1.4;
}

.info-tooltip-calc strong {
    color: var(--text-secondary);
}

/* Portfolio Section */
.portfolio-section {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

/* Portfolio Tabs */
.portfolio-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-secondary);
}

.portfolio-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 5px 16px;  /* Reduced vertical padding */
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.portfolio-tab:hover {
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.03);
}

.portfolio-tab.active {
    color: var(--accent-primary-light);
    border-bottom-color: var(--accent-primary-light);
}

.portfolio-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Positions Table */
.pos-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.pos-table-row {
    background: var(--bg-secondary);
    transition: background var(--transition-fast);
}

.pos-table-row:hover {
    background: var(--bg-hover);
}

.pos-table-row.short-position td:first-child {
    border-left: 3px solid var(--color-warning);
}

/* Inactive positions during rewind: position was acquired in the "future"
   (relative to current rewind candle) OR expired before the current candle.
   Grayed out, non-interactive; values are frozen (not recalculated). */
.pos-table-row.position-inactive {
    filter: grayscale(1);
    opacity: 0.45;
}

.pos-table-row.position-inactive:hover {
    background: var(--bg-secondary);  /* suppress hover highlight */
}

.pos-table-row.position-inactive .pos-price-current,
.pos-table-row.position-inactive .pos-pnl-amount,
.pos-table-row.position-inactive .pos-pnl-pct {
    color: var(--text-muted) !important;
}

.pos-table-row.position-inactive .close-position-btn {
    cursor: not-allowed;
    pointer-events: none;
}

.pos-table-row td {
    padding: 10px 10px;
    vertical-align: middle;
    border-top: 1px solid var(--border-secondary);
    border-bottom: 1px solid var(--border-secondary);
}

.pos-table-row td:first-child {
    border-left: 1px solid var(--border-secondary);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.pos-table-row td:last-child {
    border-right: 1px solid var(--border-secondary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Column 1: Type + Direction (stacked) */
.pos-td-type {
    white-space: nowrap;
    width: 1%;
}

.pos-td-type .item-symbol {
    display: block;
    text-align: center;
    margin-bottom: 4px;
}

.pos-td-type .item-position {
    display: block;
    text-align: center;
}

.item-symbol {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
}

.item-symbol.call {
    background: var(--color-success);
    color: var(--text-white);
}

.item-symbol.put {
    background: var(--color-error);
    color: var(--text-white);
}

.item-position {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    color: var(--text-white);
    letter-spacing: 0.3px;
}

.item-position.long {
    background: var(--accent-primary);
}

.item-position.short {
    background: var(--color-warning);
}

/* Column 2: Quantity */
.pos-td-qty {
    text-align: center;
    width: 1%;
    white-space: nowrap;
}

.pos-qty-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.pos-qty-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

/* Column 3: Price */
.pos-td-price {
    white-space: nowrap;
}

.pos-price-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.pos-price-avg {
    font-size: 13px;
    color: var(--text-secondary);
}

.pos-price-arrow {
    font-size: 13px;
    color: var(--text-muted);
}

.pos-price-current {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.pos-exp {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Column 4: P/L */
.pos-td-pnl {
    text-align: right;
    white-space: nowrap;
}

.pos-pnl-amount {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.pos-pnl-pct {
    display: block;
    font-size: 12px;
    font-weight: 600;
}

.pos-pnl-amount.positive,
.pos-pnl-pct.positive {
    color: var(--color-success);
}

.pos-pnl-amount.negative,
.pos-pnl-pct.negative {
    color: var(--color-error);
}

/* Column 5: Close Button */
.pos-td-action {
    width: 1%;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

.close-position-btn {
    padding: 0 8px;
    height: 100%;
    min-height: 52px;
    font-size: 10px;
    font-weight: 600;
    background: var(--color-error);
    color: var(--text-white);
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.close-position-btn:hover {
    background: var(--color-error-hover);
}

.close-position-btn:active {
    opacity: 0.85;
}

/* Notes row */
.pos-table-notes-row td {
    padding: 2px 10px 6px;
    border: none;
}

.pos-td-notes {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    cursor: pointer;
}

.notes-icon {
    font-size: 12px;
    opacity: 0.7;
    flex-shrink: 0;
}

.notes-icon:hover {
    opacity: 1;
}

.notes-text {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.3;
    word-break: break-word;
}

.portfolio-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
}

/* Portfolio Greeks Summary (in Positions tab) */
.portfolio-greeks-summary {
    border-top: 1px solid var(--border-color, #2d3748);
    margin-top: 8px;
    padding-top: 6px;
}

.portfolio-greeks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    user-select: none;
}

.portfolio-greeks-header:hover {
    background: rgba(255,255,255,0.03);
}

.greeks-header-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.greeks-header-arrow {
    font-size: 9px;
    color: var(--text-muted);
}

.portfolio-greeks-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 8px;
}

.portfolio-greek-card {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
}

.portfolio-greek-card .greek-symbol {
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 12px;
}

.portfolio-greek-card .greek-val {
    font-weight: 600;
    color: var(--text-primary);
}

.portfolio-greek-card .greek-val.positive { color: var(--success-color, #48bb78); }
.portfolio-greek-card .greek-val.negative { color: var(--danger-color, #f56565); }

.portfolio-greek-card .greek-unit {
    font-size: 9px;
    color: var(--text-muted);
}

.portfolio-greek-card.direction-card {
    background: rgba(99,102,241,0.1);
}

.portfolio-greeks-risk {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 8px 6px;
    font-size: 10px;
    color: var(--text-secondary);
}

.portfolio-greeks-risk .risk-item b.positive { color: var(--success-color, #48bb78); }
.portfolio-greeks-risk .risk-item b.negative { color: var(--danger-color, #f56565); }

.risk-level-low { color: var(--success-color, #48bb78); }
.risk-level-medium { color: var(--color-warning, #ecc94b); }
.risk-level-high { color: var(--danger-color, #f56565); }

/* Portfolio Tables */
.trades-table-wrapper,
.cashflow-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 400px;
}

.trades-table,
.cashflow-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.trades-table thead,
.cashflow-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.trades-table th,
.cashflow-table th {
    padding: 8px 6px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-secondary);
    font-size: 9px;
    text-transform: uppercase;
}

.trades-table td,
.cashflow-table td {
    padding: 6px;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-tertiary);
}

.trades-table tbody tr:hover,
.cashflow-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Trade badges */
.trade-badge,
.cf-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.trade-badge.buy,
.cf-badge.buy {
    background: var(--color-success);
    color: var(--text-white);
}

.trade-badge.sell,
.cf-badge.sell {
    background: var(--color-error);
    color: var(--text-white);
}

.cf-badge.exercise {
    background: var(--accent-primary-light);
    color: var(--text-white);
}

.cf-badge.expire {
    background: var(--text-secondary);
    color: var(--text-white);
}

.cf-badge.neutral {
    background: var(--bg-hover);
    color: var(--text-tertiary);
}

/* Table cells */
.trade-date,
.cf-date {
    color: var(--text-secondary);
    font-size: 9px;
}

.trade-symbol {
    color: var(--text-white);
    font-weight: 600;
}

.trade-qty {
    text-align: center;
    color: var(--text-tertiary);
}

.trade-price,
.trade-total {
    text-align: right;
}

.trade-pnl,
.cf-pnl {
    text-align: right;
    font-weight: 600;
}

.trade-pnl.positive,
.cf-pnl.positive {
    color: var(--color-success);
}

.trade-pnl.negative,
.cf-pnl.negative {
    color: var(--color-error);
}

.cf-total {
    text-align: right;
    font-weight: 600;
}

.cf-total.positive {
    color: var(--color-success);
}

.cf-total.negative {
    color: var(--color-error);
}

.cf-notes {
    color: var(--text-secondary);
    font-size: 9px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chart Section */
.chart-section {
    flex-shrink: 0;
    height: 240px;
    display: flex;
    flex-direction: column;
}

.pl-chart {
    flex: 1;
    min-height: 0;
}

/* Simulator Actions */
.sim-actions {
    flex-shrink: 0;
    padding: 10px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-primary);
}

.sim-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.reset-btn {
    background: var(--color-error);
    color: var(--text-white);
}

.reset-btn:hover {
    background: var(--color-error-hover);
}

/* Scrollbar for simulator */
.simulation-content::-webkit-scrollbar,
.portfolio-content::-webkit-scrollbar {
    width: 6px;
}

.simulation-content::-webkit-scrollbar-track,
.portfolio-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.simulation-content::-webkit-scrollbar-thumb,
.portfolio-content::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.simulation-content::-webkit-scrollbar-thumb:hover,
.portfolio-content::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* Options Block */
.block-options {
    grid-column: 1 / 3;
    grid-row: 2;
    height: 100%;  /* Match height with simulator block */
    display: flex;
    flex-direction: column;
}

/* Inactive Block Styles */
.block.inactive {
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
}

.block-title {
    font-size: 11px;
    font-weight: 600;
    padding: clamp(4px, 0.67vh, 8px) 12px;
    text-align: center;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
}

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

/* Control Content */
.control-content {
    padding: clamp(4px, 0.67vh, 8px) 6px clamp(6px, 1vh, 12px) 6px;
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 0.67vh, 8px);
    height: 100%;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 0.5vh, 6px);
    align-items: stretch;
}

.control-row {
    display: flex;
    gap: clamp(2px, 0.33vh, 4px);
}

.control-btn {
    padding: clamp(5px, 0.67vh, 8px);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
    color: var(--text-primary);
    border-radius: var(--radius-md);
}

.control-btn-small {
    padding: clamp(3px, 0.5vh, 6px);
    font-size: 13px;
}

.control-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.control-btn.play-btn {
    background: var(--color-success);
    color: var(--text-white);
    border-color: var(--color-success);
}

.control-btn.play-btn.active {
    background: var(--color-error);
    border-color: var(--color-error);
}

/* Pulsing effect for play button after generation */
.control-btn.play-btn.pulse-ready {
    animation: play-pulse 2s ease-in-out infinite;
}

.control-btn.play-btn.pulse-ready:hover {
    animation: none;
}

@keyframes play-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(8, 153, 129, 0);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(8, 153, 129, 0.25);
        transform: scale(1.03);
    }
}

/* Play tooltip */
.play-tooltip-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.play-tooltip-wrapper .control-btn.play-btn {
    width: 100%;
}

.play-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-success);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 100;
    animation: tooltip-fade-in 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.play-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--color-success);
}

@keyframes tooltip-fade-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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

/* AUTOMAT MÓD Button */
.btn-automat {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    padding: 5px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 11px;
    height: var(--toolbar-btn-height);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-automat:hover {
    background: linear-gradient(135deg, #ff7b45, #f9a32e);
    transform: translateY(-1px);
}

.btn-automat.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    animation: automat-pulse 1.5s infinite;
}

.btn-automat:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.automat-stats {
    color: #f7931e;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
}

@keyframes automat-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { opacity: 0.85; box-shadow: 0 0 10px 3px rgba(231, 76, 60, 0.3); }
}

.progress-info {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    outline: none;
    border-radius: 2px;
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    cursor: pointer;
    border-radius: 50%;
}

.progress-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.progress-slider:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.control-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.speed-select {
    padding: 5px 4px;
    border: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
    font-size: 11px;  /* Increased for consistency */
    cursor: pointer;
    color: var(--text-primary);
    border-radius: var(--radius-md);
}

.speed-select:hover:not(:disabled) {
    background: var(--bg-hover);
}

.speed-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Trade Group (Buy/Sell) */
/* Trade Content */
.trade-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.current-price {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px 8px;
    margin-bottom: 6px;
}

.price-value {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 700;
}

[data-theme="light"] .price-value,
.light-theme .price-value {
    color: var(--accent-primary);
}

.trade-buttons {
    display: flex;
    gap: 4px;
}

.trade-btn {
    flex: 1;
    padding: 8px 6px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trade-btn.buy-btn {
    background: var(--color-success);
    color: var(--text-white);
}

.trade-btn.buy-btn:hover:not(:disabled) {
    background: var(--color-success-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(8, 153, 129, 0.3);
}

.trade-btn.sell-btn {
    background: var(--color-error);
    color: var(--text-white);
}

.trade-btn.sell-btn:hover:not(:disabled) {
    background: var(--color-error-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(242, 54, 69, 0.3);
}

.trade-btn.short-btn {
    background: var(--color-warning);
    color: var(--text-white);
}

.trade-btn.short-btn:hover:not(:disabled) {
    background: var(--color-warning-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

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

/* Loading Message */
.loading-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    background: var(--bg-tertiary);
    padding: 30px 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-secondary);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* @keyframes spin - defined once at end of file */

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

/* Error Message */
.error-message {
    padding: 12px;
    background: var(--bg-tertiary);
    border-left: 3px solid var(--color-error);
    color: var(--color-error);
    font-size: 12px;
    margin: 10px;
    border-radius: var(--radius-md);
}

.error-message.error-compact {
    font-size: 11px;
    padding: 8px 12px;
    margin: 6px 10px;
}

/* Option Chain Styles */
.option-chain-empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 40px 20px;
}

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

.option-chain-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.option-loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    background: var(--bg-tertiary);
    padding: 25px 35px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-secondary);
}

/* Option Chain Header - Single Row */
.option-chain-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    flex-wrap: nowrap;
    min-height: 40px;
    overflow: visible;
    position: relative;
    z-index: 100;
}

.option-chain-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    min-width: 120px;
}

/* Expiration Tabs */
.expiration-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow-x: auto;  /* Allow horizontal scrolling for many expirations */
    overflow-y: hidden;
    flex-shrink: 0;
    max-width: 100%;  /* Prevent overflow beyond container */
}

/* Scrollbar styling for expiration tabs */
.expiration-tabs::-webkit-scrollbar {
    height: 4px;
}

.expiration-tabs::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.expiration-tabs::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 2px;
}

.expiration-tabs::-webkit-scrollbar-thumb:hover {
    background: #4a4e59;
}

.expiration-tab {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: none;
    border-right: 1px solid var(--bg-primary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    white-space: nowrap;
}

.expiration-tab:last-child {
    border-right: none;
}

.expiration-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.expiration-tab.active {
    background: var(--accent-primary);
    color: var(--text-white);
    font-weight: 600;
}

/* Expiration Modal Trigger (EXP button) */
.expiration-modal-trigger {
    background: var(--accent-primary) !important;
    color: var(--text-white) !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
}

.expiration-modal-trigger:hover {
    background: var(--accent-primary) !important;
    color: var(--text-white) !important;
}

/* Expiration Modal Popup (positioned above EXP button) */
.expiration-tabs-container {
    position: relative;
    display: flex;
    gap: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: visible;
    /* Allow modal to overflow */
    flex-shrink: 0;
}

.expiration-modal-popup {
    position: absolute;
    top: 100%;
    /* Position below the button */
    left: 0;
    margin-top: 8px;
    /* Gap between button and modal */
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 400px;
}

/* Expiration Modal Overlay (transparent, click outside to close) */
.expiration-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 999;
    cursor: default;
}


/* Modal Action Buttons (inline, top-right) */
.modal-action-buttons-inline {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.modal-btn-confirm,
.modal-btn-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    background: rgba(239, 68, 68, 0.15);
    color: rgb(239, 68, 68);
}

.modal-btn-confirm {
    background: rgba(34, 197, 94, 0.15);
    color: rgb(34, 197, 94);
}

.modal-btn-confirm:hover {
    background: rgba(34, 197, 94, 0.25);
}

.modal-btn-close:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Expirations Grid (5 columns) */
.expirations-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.expiration-grid-item {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.expiration-grid-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-secondary);
}

.expiration-grid-item.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.expiration-grid-item .exp-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.expiration-grid-item.active .exp-label {
    color: var(--text-white);
}

.expiration-grid-item .exp-days {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.expiration-grid-item.active .exp-days {
    color: var(--text-white);
    opacity: 0.9;
}

/* Strikes Selector */
.strikes-selector {
    display: flex;
    gap: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    align-items: center;
}

.strikes-label,
.greeks-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
    white-space: nowrap;
}

.strikes-btn {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: none;
    border-right: 1px solid var(--bg-primary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 32px;
}

.strikes-btn:last-child {
    border-right: none;
}

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

.strikes-btn.active {
    background: var(--color-success);
    color: var(--text-white);
    font-weight: 600;
}

/* Greeks Controls */
.greeks-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

/* Analytics Toggle Button (option chain header) */
.analytics-toggle-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.analytics-toggle-btn.active {
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
}

.greek-checkbox {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.greek-checkbox input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--accent-primary);
    margin: 0;
}

.greek-checkbox input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.greek-checkbox span {
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    cursor: help;
}

/* Custom tooltip for Greek letters */
.greek-checkbox span[data-tooltip] {
    position: relative;
}

.greek-checkbox span[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: normal;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
    border: 1px solid var(--border-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.greek-checkbox span[data-tooltip]::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    border: 5px solid transparent;
    border-bottom-color: var(--bg-tertiary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
}

.greek-checkbox span[data-tooltip]:hover::before,
.greek-checkbox span[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(4px);
}

.greek-checkbox span[data-tooltip]:hover::after {
    transform: translateX(-50%) translateY(-1px);
}

/* Option Chain Table */
.option-chain-table-wrapper {
    flex: 1;
    overflow: hidden auto;
    background: var(--bg-secondary);
    scroll-behavior: smooth;
    position: relative;
    z-index: 0;
    isolation: isolate;
}

.option-chain-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 11px;
    table-layout: auto;  /* Changed from fixed to allow proper column sizing */
}

.option-chain-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 20;
    box-shadow: 0 1px 0 var(--border-primary);
}

.option-chain-table th {
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.header-call {
    background: var(--color-success);
    color: var(--text-white);
    font-size: 12px;
    text-transform: uppercase;
}

.header-strike {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    text-transform: uppercase;
    width: 80px;
}

.header-put {
    background: var(--color-error);
    color: var(--text-white);
    font-size: 12px;
    text-transform: uppercase;
}

.subheader th {
    background: var(--bg-tertiary);
    font-size: 10px;
    color: var(--text-secondary);
    padding: 6px 4px;
}

.btn-label-buy,
.btn-label-sell {
    display: inline-block;
    padding: 2px 4px;
    margin: 0 2px;
    font-size: 9px;
    font-weight: 600;
    border-radius: 2px;
}

.btn-label-buy {
    background: var(--color-success);
    color: var(--text-white);
}

.btn-label-sell {
    background: var(--color-error);
    color: var(--text-white);
}

/* Greeks header styles are below in CSS Grid section */

/* Table Body */
.option-chain-table tbody tr {
    border-bottom: 1px solid var(--border-primary);
    transition: background 0.1s;
}

.option-chain-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.option-chain-table tbody tr.row-atm {
    background: rgba(41, 98, 255, 0.1);
    border-top: 1px solid var(--accent-primary);
    border-bottom: 1px solid var(--accent-primary);
}

.option-chain-table tbody tr.row-atm:hover {
    background: rgba(41, 98, 255, 0.15);
}

.option-chain-table td {
    padding: 6px 4px;
    text-align: center;
    color: var(--text-primary);
}

.col-actions {
    width: 50px;
    min-width: 50px;
    padding: 2px 4px;
    white-space: nowrap;
}

/* Combined K P + buttons cell */
.col-actions-combined {
    width: 90px;
    min-width: 90px;
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
}

.col-actions-combined .btn-label-add {
    color: var(--accent-primary-light);
    margin-left: 2px;
}

.col-greeks {
    padding: 4px 8px;
    white-space: nowrap;
}

.col-strike-value {
    width: 70px;
    min-width: 70px;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-white);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.col-strike-value:hover {
    background: var(--accent-primary-muted, rgba(33, 150, 243, 0.18));
    box-shadow: inset 0 0 0 1px var(--accent-primary, #2196F3);
}

.col-strike-value.strike-analytics-selected {
    background: var(--accent-primary, #2196F3);
    color: #ffffff;
    box-shadow: inset 0 0 0 2px var(--accent-primary, #2196F3);
}

.col-strike-value.strike-analytics-selected:hover {
    background: var(--accent-primary-hover, #1976D2);
}

/* Greeks Header - CSS Grid for alignment */
.greeks-header {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 2px;
    align-items: center;
    font-size: 11px;
}

.greeks-header span {
    text-align: center;
    min-width: 42px;
}

/* Greek tooltip on header hover */
.greek-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--text-secondary);
}

.greek-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary, #111827);
    color: var(--text-primary, #e0e0e0);
    border: 1px solid var(--border-secondary, #444);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.greek-tooltip:hover::after {
    opacity: 1;
}

/* Greeks Values - CSS Grid for alignment with header */
.greeks-values {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 2px;
    align-items: center;
    font-size: 11px;
}

/* Price values - centered */
.greeks-values .price {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 42px;
    text-align: center;
}

.greeks-values .greek {
    min-width: 42px;
    text-align: center;
    color: var(--text-primary);
    font-size: 11px;
    opacity: 0.85;
}

/* Moneyness highlighting */
.moneyness-itm {
    background: rgba(8, 153, 129, 0.08);
}

.moneyness-atm {
    background: rgba(41, 98, 255, 0.12);
}

.moneyness-otm {
    background: transparent;
}

/* Action Buttons */
.action-btn {
    padding: 4px 7px;
    margin: 0 2px;
    font-size: 9px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 22px;
    min-height: 22px;
    line-height: 1;
    vertical-align: middle;
}

.btn-buy {
    background: var(--color-success);
    color: var(--text-white);
}

.btn-buy:hover {
    background: var(--color-success-hover);
}

.btn-sell {
    background: var(--color-error);
    color: var(--text-white);
}

.btn-sell:hover {
    background: var(--color-error-hover);
}


/* Scrollbar for option chain table */
.option-chain-table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.option-chain-table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.option-chain-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.option-chain-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* Responsive */
@media (max-width: 1200px) {
    .grid-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 10px;
        padding: 10px;
        height: auto;
    }

    .block-graph {
        grid-column: 1;
        grid-row: auto;
        min-height: 400px;
    }

    .block-control,
    .block-simulation,
    .block-options {
        grid-column: 1;
        grid-row: auto;
        min-height: 200px;
    }

    .option-chain-table {
        font-size: 10px;
    }

    .greeks-values {
        font-size: 9px;
        gap: 4px;
    }

    .option-chain-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .option-chain-title {
        width: 100%;
        text-align: center;
    }

    .greeks-controls {
        margin-left: 0;
    }

    /* Footer responsive adjustments */
    .page-footer {
        padding: 1.5rem 1rem;
        min-height: 80px;
    }
}

/* ========================================
   Preview Modal
   ======================================== */

/* Preview button */
.preview-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal) ease;
}

.preview-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-secondary);
}

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

/* Export button */
.export-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal) ease;
}

.export-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-secondary);
}

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

/* Modal overlay */
.preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Modal window */
.preview-modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 90vw;
    max-width: 1400px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-primary);
}

/* Modal header */
.preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-primary);
}

.preview-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

/* Close button */
.preview-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal) ease;
    padding: 0;
}

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

/* Modal controls */
.preview-modal-controls {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.preview-timeframe-buttons {
    display: flex;
    gap: 4px;
}

.preview-tf-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal) ease;
}

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

.preview-tf-btn.active {
    background: var(--accent-primary);
    color: var(--text-white);
    border-color: var(--accent-primary);
}

/* Modal body */
.preview-modal-body {
    flex: 1;
    padding: 20px;
    overflow: hidden;
}

.preview-chart-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ============================================
   MODEL SETTINGS MODAL
   ============================================ */

/* Main button "Nastavenie modelu" */
.model-settings-btn {
    padding: 5px 18px;
    background: var(--accent-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    height: var(--toolbar-btn-height);
    transition: all var(--transition-normal) ease;
    min-width: 150px;
}

.model-settings-btn:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(41, 98, 255, 0.3);
}

.model-settings-btn:active {
    transform: translateY(0);
}

/* Modal Overlay and content moved to src/model-settings-modal.css (lazy loaded) */

/* Trade Modal CSS moved to src/trade-modal.css (lazy loaded) */

/* ============================================
   STRATEGIES SECTION
   ============================================ */

/* Strategies Tab Content */
.strategies-content {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    height: 100%;
}

/* Strategies Sidebar + Detail Layout */
.strategies-layout {
    display: flex;
    height: 380px;
    gap: 0;
}

/* Left Sidebar */
.strategies-sidebar {
    width: 180px;
    min-width: 180px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-secondary);
    overflow-y: auto;
    padding: 8px 0;
}

/* Level Groups */
.strategy-level-group {
    margin-bottom: 2px;
}

.strategy-level-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s;
}

.strategy-level-header:hover {
    background: var(--bg-tertiary);
}

.level-arrow {
    width: 16px;
    font-size: 10px;
    color: var(--text-secondary);
}

.level-title {
    flex: 1;
}

.level-count {
    background: var(--bg-hover);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

/* Risk Category Colors */
.risk-category-conservative {
    color: var(--color-success-text);  /* Green - low risk */
}

.risk-category-moderate {
    color: var(--accent-primary-light);  /* Blue - medium risk */
}

.risk-category-aggressive {
    color: var(--warning-color);  /* Orange - high risk */
}

.risk-category-speculative {
    color: #ef4444;  /* Red - very high/unlimited risk */
}

/* Strategy List Items */
.strategy-level-items {
    padding-left: 8px;
}

.strategy-list-item {
    display: flex;
    align-items: center;
    padding: 6px 12px 6px 20px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 11px;
    transition: all var(--transition-fast);
    border-left: 2px solid transparent;
}

.strategy-list-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.strategy-list-item.active {
    background: var(--bg-tertiary);
    color: var(--accent-primary-light);
    border-left-color: var(--accent-primary-light);
}

.item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-risk {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 6px;
}

.item-risk.risk-low {
    background: var(--color-success-text);
}

.item-risk.risk-medium {
    background: var(--color-warning);
}

.item-risk.risk-high {
    background: var(--color-error);
}

/* Right Detail Panel */
.strategies-detail {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: var(--bg-primary);
}

.detail-empty,
.detail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 13px;
}

.detail-loading .loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-secondary);
    border-top-color: var(--accent-primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

/* Detail Content */
.detail-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.detail-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.detail-risk {
    padding: 3px 8px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.detail-risk.risk-low {
    background: rgba(76, 175, 80, 0.2);
    color: var(--color-success-text);
}

.detail-risk.risk-medium {
    background: rgba(255, 152, 0, 0.2);
    color: var(--color-warning);
}

.detail-risk.risk-high {
    background: rgba(244, 67, 54, 0.2);
    color: var(--color-error);
}

.ai-mentor-btn-small {
    padding: 4px 10px;
    background: var(--gradient-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.ai-mentor-btn-small:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}

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

/* Analysis Results */
.detail-analysis {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 12px;
}

.analysis-header {
    margin-bottom: 10px;
}

.analysis-status {
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
}

.analysis-status.viable {
    background: rgba(76, 175, 80, 0.2);
    color: var(--color-success-text);
}

.analysis-status.not-viable {
    background: rgba(244, 67, 54, 0.2);
    color: var(--color-error);
}

.analysis-metrics {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.analysis-metrics .metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.analysis-metrics .metric-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.analysis-metrics .metric-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.analysis-metrics .metric-value.profit {
    color: var(--color-teal);
}

.analysis-metrics .metric-value.loss {
    color: var(--color-error-light);
}

/* Action Buttons */
.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.detail-actions .strategy-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.detail-actions .analyze-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.detail-actions .analyze-btn:hover:not(:disabled) {
    background: var(--bg-hover);
}

.detail-actions .execute-btn {
    background: var(--gradient-primary);
    color: var(--text-white);
}

.detail-actions .execute-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}

.detail-actions .strategy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Keep old styles for backward compatibility */
.ai-mentor-btn {
    padding: 6px 12px;
    background: var(--gradient-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.ai-mentor-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}

.ai-mentor-btn:active {
    transform: translateY(0);
}

/* Strategies Grid */
.strategies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

/* Strategy Card */
.strategy-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-left: 4px solid var(--color-teal);
    border-radius: var(--radius-xl);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all var(--transition-normal);
}

.strategy-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.strategy-card.not-viable {
    border-left-color: var(--color-error-light);
    opacity: 0.7;
}

/* Strategy Card Header */
.strategy-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.strategy-icon {
    font-size: 20px;
}

.strategy-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.strategy-risk {
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.strategy-risk.risk-low {
    background: rgba(76, 175, 80, 0.2);
    color: var(--color-success-text);
}

.strategy-risk.risk-medium {
    background: rgba(255, 152, 0, 0.2);
    color: var(--color-warning);
}

.strategy-risk.risk-high {
    background: rgba(244, 67, 54, 0.2);
    color: var(--color-error);
}

/* Strategy Card Body */
.strategy-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.strategy-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Strategy Analysis Preview */
.strategy-analysis-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 11px;
}

.analysis-viable {
    color: var(--color-teal);
    font-weight: 600;
}

.analysis-not-viable {
    color: var(--color-error-light);
    font-weight: 600;
}

.analysis-profit {
    color: var(--color-success-text);
}

.analysis-loss {
    color: var(--color-error-light);
}

/* Strategy Card Footer */
.strategy-card-footer {
    display: flex;
    gap: 6px;
}

.strategy-btn {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

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

.analyze-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--accent-primary-light);
}

.execute-btn {
    background: linear-gradient(135deg, var(--color-teal) 0%, #00897b 100%);
    color: var(--text-white);
    border-color: var(--color-teal);
}

.execute-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(38, 166, 154, 0.4);
}

.execute-btn:disabled {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-color: var(--border-primary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.strategy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty States */
.strategies-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-hint {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Loading State */
.strategies-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.strategies-loading .loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* @keyframes spin - defined once at end of file */

.strategies-loading .loading-text {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Strategies Tip */
.strategies-tip {
    padding: 10px;
    background: rgba(25, 63, 168, 0.1);
    border: 1px solid rgba(25, 63, 168, 0.2);
    border-radius: var(--radius-md);
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.strategies-tip strong {
    color: var(--text-primary);
}

/* ============================================
   STRATEGY DETAIL MODAL
   Moved to src/strategy-detail-modal.css for lazy loading
   ============================================ */

/* ============================================
   AI MENTOR CHAT MODAL
   Moved to src/ai-mentor-modal.css for lazy loading
   ============================================ */

/* ============================================
   P/L CHART TAB
   ============================================ */

.plchart-content {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.pl-chart-tab {
    width: 100%;
    height: 100%;
}

/* ============================================
   ANALYTICS & EXPORT BLOCK
   ============================================ */

.analytics-section {
    flex-shrink: 0;
}

.analytics-block {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
    overflow: hidden;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    background: var(--bg-secondary);
    transition: background var(--transition-fast);
}

.analytics-header:hover {
    background: var(--bg-hover);
}

.analytics-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-arrow {
    font-size: 10px;
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
}

.analytics-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-tertiary);
}

.analytics-buttons-row {
    display: flex;
    gap: 6px;
}

.analytics-btn {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.analytics-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.analytics-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.analytics-btn-full {
    background: var(--accent-primary-bg);
    border-color: var(--accent-primary);
}

.analytics-btn-full:hover:not(:disabled) {
    background: var(--accent-primary-bg-hover);
}

.analytics-divider {
    height: 1px;
    background: var(--border-secondary);
    margin: 4px 0;
}

.analytics-btn-save {
    flex: 1;
    padding: 10px;
    background: var(--accent-primary-bg);
    color: var(--text-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.analytics-btn-save:hover:not(:disabled):not(.btn-locked) {
    background: var(--accent-primary-bg-hover);
    border-color: var(--accent-primary-hover);
    transform: translateY(-1px);
}

.analytics-btn-save:disabled,
.analytics-btn-save.btn-locked {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px dashed var(--border-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.analytics-save-row {
    display: flex;
    gap: 8px;
}

.analytics-btn-dashboard {
    padding: 10px 16px;
    background: var(--gradient-primary);
    color: white;
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analytics-btn-dashboard:hover {
    background: var(--accent-primary-hover);
    border-color: var(--accent-primary-light);
    transform: translateY(-1px);
}

/* ============================================
   AI MENTOR STANDALONE BLOCK
   ============================================ */

/* ============================================
   PAYOFF DIAGRAM
   ============================================ */

.payoff-diagram-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 8px;
    height: 120px;
}

.payoff-canvas {
    width: 100%;
    height: 100%;
}

/* Analysis metrics inline layout */
.detail-analysis .analysis-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-analysis .metric {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.viable-status {
    color: var(--color-success-text) !important;
}

.not-viable-status {
    color: var(--color-error) !important;
}

/* ========================================
   CUSTOM STRATEGY BUILDER STYLES
   ======================================== */

/* Add to Strategy Button in Option Chain */
.col-add-strategy {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    text-align: center;
    padding: 2px 1px !important;
}

.btn-add-strategy {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-secondary);
    border-radius: 2px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.btn-add-strategy:hover {
    background: var(--accent-primary-light);
    border-color: var(--accent-primary-light);
    color: white;
}

.btn-add-strategy.has-leg {
    background: var(--accent-primary-light);
    border-color: var(--accent-primary-light);
    color: white;
}

/* Debit/Credit styling (shared by trade-modal, add-strategy-modal) */
.debit {
    color: var(--color-error) !important;
}

.credit {
    color: var(--color-success-text) !important;
}

/* ========================================
   SHARED MODAL STYLES
   Used by multiple modal components
   ======================================== */

.modal-close-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast) ease;
}

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

.modal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.modal-value {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

.modal-option-row {
    margin-bottom: 12px;
}

.modal-radio-group {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.modal-radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.modal-radio-group label.active {
    background: var(--accent-primary-light);
    border-color: var(--accent-primary-light);
    color: white;
}

.modal-radio-group label:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-radio-group input[type="radio"] {
    display: none;
}

.modal-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.modal-qty-controls .qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.modal-qty-controls .qty-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-qty-value {
    min-width: 32px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.price-row {
    padding-top: 12px;
    border-top: 1px solid var(--border-secondary);
}

.modal-cancel-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

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

.modal-confirm-btn {
    padding: 8px 16px;
    background: var(--accent-primary-light);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.modal-confirm-btn:hover {
    background: var(--accent-primary-hover);
}

/* ==========================================
   INLINE MENTOR CHAT PANELS
   Trade Modal mentor styles moved to src/trade-modal.css
   ========================================== */

/* Inline Mentor Panel - Shared Styles */
.inline-mentor-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Trade Mentor Panel styles moved to src/trade-modal.css */
/* Strategy Mentor Panel styles moved to src/custom-strategy-modal.css */

/* Inline Mentor Header */
.inline-mentor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(41, 98, 255, 0.15) 0%, rgba(41, 98, 255, 0.05) 100%);
    border-bottom: 1px solid var(--border-secondary);
}

.inline-mentor-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.inline-mentor-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.inline-mentor-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Inline Mentor Messages */
.inline-mentor-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mentor-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 13px;
}

.mentor-message {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    max-width: 95%;
}

.mentor-message.user-msg {
    background: linear-gradient(135deg, var(--accent-primary-light) 0%, var(--accent-primary-hover) 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.mentor-message.ai-msg {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.mentor-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
    opacity: 0.8;
}

.mentor-message-time {
    font-size: 10px;
}

.mentor-message-content {
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.mentor-message-content strong {
    font-weight: 600;
}

.mentor-message-content code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
}

/* Typing Indicator */
.mentor-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.mentor-typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.mentor-typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.mentor-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.mentor-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Inline Mentor Input Area */
.inline-mentor-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-secondary);
    background: var(--bg-primary);
}

.inline-mentor-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    resize: none;
    min-height: 40px;
    max-height: 80px;
    font-family: inherit;
}

.inline-mentor-input:focus {
    outline: none;
    border-color: var(--accent-primary-light);
}

.inline-mentor-input::placeholder {
    color: var(--text-secondary);
}

.inline-mentor-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary-light) 0%, var(--accent-primary-hover) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inline-mentor-send:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-primary-hover) 0%, var(--accent-primary) 100%);
    transform: scale(1.05);
}

.inline-mentor-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ====================================
   SIMULATION STATE MANAGEMENT STYLES
   ==================================== */

/* Idle State Overlay - simplified */
.idle-state-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.idle-state-content {
    text-align: center;
    padding: 20px;
}

.idle-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.idle-state-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
}

.idle-state-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    max-width: 280px;
    margin: 0 auto;
}

.idle-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.step-number {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-light) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.step-text {
    color: var(--text-primary);
    font-size: 13px;
}

/* Alternative-path step (e.g. "or click Random") — visually subordinate
   to the main 1→2→3 sequence so it reads as "branch" rather than "next". */
.idle-step.idle-step-alt {
    margin-top: 4px;
    background: transparent;
    border: 1px dashed var(--border-primary);
    opacity: 0.85;
}

.idle-step.idle-step-alt .step-number {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.idle-step.idle-step-alt .step-text {
    color: var(--text-secondary);
    font-style: italic;
}

/* Hidden charts class */
.hidden-charts {
    opacity: 0;
    pointer-events: none;
}

/* Reset Simulation Button in sim-actions */
.sim-actions .reset-simulation-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.sim-actions .reset-simulation-btn:hover:not(:disabled) {
    background: var(--color-error-bg);
    border-color: var(--color-error);
    color: var(--color-error);
}

.sim-actions .reset-simulation-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sim-actions .reset-portfolio-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.sim-actions .reset-portfolio-btn:hover:not(:disabled) {
    background: rgba(255, 152, 0, 0.1);
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.sim-actions .reset-portfolio-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Shared modal content styles (used in confirm-modal) */
.positions-summary {
    list-style: none;
    padding: 12px 16px;
    margin: 0 0 16px 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.positions-summary li {
    padding: 6px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.positions-summary li:last-child {
    border-bottom: none;
}

.positions-summary .positive {
    color: var(--success-text);
}

.positions-summary .negative {
    color: var(--error-text);
}

.reset-effects {
    list-style: disc;
    padding-left: 24px;
    margin: 0 0 16px 0;
}

.reset-effects li {
    color: var(--text-secondary);
    padding: 4px 0;
    line-height: 1.5;
}

.current-positions-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-top: 16px;
}

.current-positions-warning strong {
    color: var(--color-warning);
    display: block;
    margin-bottom: 8px;
}

.current-positions-warning .positions-summary {
    background: transparent;
    padding: 0;
    margin: 0;
}

/* Dashboard Save Placeholder */
.dashboard-save-placeholder {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary);
}

.dashboard-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}

.dashboard-checkbox-label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashboard-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: inherit;
}

.coming-soon-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--accent-primary-bg);
    color: var(--accent-primary-light);
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* =============================================================================
   TOAST NOTIFICATION STYLES (non-blocking, auto-dismiss)
   ============================================================================= */

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 380px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-lg, 10px);
    background: var(--bg-secondary, #1e1e2e);
    border: 1px solid var(--border-color, #333);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out;
    min-width: 260px;
    max-width: 380px;
}

.toast.toast-exiting {
    animation: toastSlideOut 0.25s ease-in forwards;
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary, #e0e0e0);
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    cursor: pointer;
    font-size: 16px;
    padding: 0 0 0 4px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast type variants */
.toast.success {
    border-color: var(--color-success, #4caf50);
    background: linear-gradient(135deg, var(--bg-secondary, #1e1e2e), rgba(76, 175, 80, 0.08));
}

.toast.error {
    border-color: var(--color-danger, #f44336);
    background: linear-gradient(135deg, var(--bg-secondary, #1e1e2e), rgba(244, 67, 54, 0.08));
}

.toast.warning {
    border-color: var(--color-warning, #ff9800);
    background: linear-gradient(135deg, var(--bg-secondary, #1e1e2e), rgba(255, 152, 0, 0.08));
}

.toast.info {
    border-color: var(--color-info, #2196f3);
    background: linear-gradient(135deg, var(--bg-secondary, #1e1e2e), rgba(33, 150, 243, 0.08));
}

/* Toast progress bar (auto-dismiss indicator) */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 0 0 var(--radius-lg, 10px) var(--radius-lg, 10px);
    animation: toastProgress linear forwards;
}

.toast.success .toast-progress { background: var(--color-success, #4caf50); }
.toast.error .toast-progress { background: var(--color-danger, #f44336); }
.toast.warning .toast-progress { background: var(--color-warning, #ff9800); }
.toast.info .toast-progress { background: var(--color-info, #2196f3); }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* =============================================================================
   UPGRADE TOAST (Sprint 2A — trigger-based conversion prompts)
   Richer variant of .toast: title + 2-line message + 2 action buttons +
   accent border-left. Used by simulator (`app.js → upgradeToasts`) when a
   Free user hits AI Mentor cap, save cap, or attempts a locked
   model/scenario/feature. Reuses .toast-container positioning + slide
   animations so no new container CSS needed.
   ============================================================================= */

.toast.toast-upgrade {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 18px 14px 16px;
    border-left: 4px solid var(--color-info, #2196f3);
    max-width: 360px;
    min-width: 320px;
    position: relative;
}

.toast.toast-upgrade.toast-upgrade-soft {
    /* Amber accent for "approaching limit" warnings (auto-dismiss). */
    border-left-color: var(--color-warning, #ff9800);
}

.toast-upgrade-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.toast-upgrade-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.toast-upgrade-close {
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 0 0 4px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.toast-upgrade-close:hover { opacity: 1; }

.toast-upgrade-message {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary, #e0e0e0);
    opacity: 0.9;
    /* Cap to ~2 lines of text — message copy is intentionally short. */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.toast-upgrade-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.toast-upgrade-cta {
    flex: 1;
    padding: 8px 14px;
    background: var(--accent-primary-light, #4f46e5);
    color: var(--text-white, #ffffff);
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
    text-decoration: none;
    text-align: center;
}

.toast-upgrade-cta:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.toast-upgrade-dismiss {
    padding: 8px 12px;
    background: transparent;
    color: var(--text-secondary, #aaa);
    border: 1px solid var(--border-color, #333);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.toast-upgrade-dismiss:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    color: var(--text-primary, #e0e0e0);
}

/* Mobile: full-width within container, slightly tighter padding */
@media (max-width: 640px) {
    .toast.toast-upgrade {
        max-width: calc(100vw - 32px);
        min-width: 0;
        padding: 12px 14px;
    }
    .toast-upgrade-title { font-size: 14px; }
    .toast-upgrade-message { font-size: 12.5px; }
}

/* =============================================================================
   ERROR MODAL STYLES (styled replacement for browser alerts)
   ============================================================================= */

.error-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 11000;
    backdrop-filter: blur(4px);
}

.error-modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--color-warning);
    box-shadow: 0 8px 32px rgba(255, 152, 0, 0.2);
}

.error-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-secondary);
}

.error-modal-icon {
    font-size: 24px;
}

.error-modal-header h3 {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-warning);
}

.error-modal-body {
    padding: 20px;
}

.error-modal-body p {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

.error-modal-shortfall {
    margin-top: 16px;
    padding: 12px;
    background: rgba(239, 83, 80, 0.1);
    border: 1px solid rgba(239, 83, 80, 0.3);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.shortfall-value {
    color: var(--color-error);
    font-size: 18px;
    font-weight: 700;
}

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

.error-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.error-btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

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

.error-btn-deposit {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-light) 100%);
    color: white;
    border: none;
}

.error-btn-deposit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* =============================================================================
   NOTIFICATION MODAL STYLES (universal notification system)
   ============================================================================= */

.notification-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 11000;
    backdrop-filter: blur(4px);
}

.notification-modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
}

.notification-modal.success {
    border-color: var(--color-success);
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.2);
}

.notification-modal.warning {
    border-color: var(--color-warning);
    box-shadow: 0 8px 32px rgba(255, 152, 0, 0.2);
}

.notification-modal.error {
    border-color: var(--color-error);
    box-shadow: 0 8px 32px rgba(239, 83, 80, 0.2);
}

.notification-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-secondary);
}

.notification-modal-icon {
    font-size: 24px;
}

.notification-modal-header h3 {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-primary-light);
}

.notification-modal.success .notification-modal-header h3 {
    color: var(--color-success);
}

.notification-modal.warning .notification-modal-header h3 {
    color: var(--color-warning);
}

.notification-modal.error .notification-modal-header h3 {
    color: var(--color-error);
}

.notification-modal-body {
    padding: 16px 20px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--border-secondary);
}

.notification-item:last-child {
    margin-bottom: 0;
}

.notification-item.success {
    border-left-color: var(--color-success);
    background: rgba(76, 175, 80, 0.1);
}

.notification-item.warning {
    border-left-color: var(--color-warning);
    background: rgba(255, 152, 0, 0.1);
}

.notification-item.error {
    border-left-color: var(--color-error);
    background: rgba(239, 83, 80, 0.1);
}

.notification-item.info {
    border-left-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.notification-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.notification-message {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
}

.notification-modal-footer {
    display: flex;
    justify-content: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border-secondary);
}

.notification-btn-ok {
    padding: 10px 40px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-light) 100%);
    color: white;
    border: none;
}

.notification-btn-ok:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.notification-shortfall {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-top: 12px;
    background: rgba(239, 83, 80, 0.1);
    border: 1px solid var(--color-error);
    border-radius: var(--radius-md);
}

.notification-shortfall .shortfall-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.notification-shortfall .shortfall-value {
    color: var(--color-error);
    font-size: 16px;
    font-weight: 600;
}

.notification-btn-deposit {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: linear-gradient(135deg, var(--color-success) 0%, #66bb6a 100%);
    color: white;
    border: none;
    margin-left: 8px;
}

.notification-btn-deposit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* =============================================================================
   CONFIRM MODAL STYLES (for warnings with continue/cancel)
   ============================================================================= */

.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 11000;
    backdrop-filter: blur(4px);
}

.confirm-modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--color-warning);
    box-shadow: 0 8px 32px rgba(255, 152, 0, 0.2);
}

.confirm-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-secondary);
}

.confirm-modal-icon {
    font-size: 24px;
}

.confirm-modal-header h3 {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-warning);
}

.confirm-modal-body {
    padding: 20px;
}

.confirm-modal-body p {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

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

.confirm-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.confirm-btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-secondary);
}

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

.confirm-btn-confirm {
    background: linear-gradient(135deg, var(--color-warning) 0%, #ffb74d 100%);
    color: #1a1a2e;
}

.confirm-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.confirm-btn-danger {
    background: linear-gradient(135deg, var(--color-error) 0%, var(--color-error-hover) 100%);
    color: white;
}

.confirm-btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.confirm-warning-text {
    color: var(--color-warning);
    background: rgba(255, 152, 0, 0.1);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 152, 0, 0.25);
    font-size: 13px;
    line-height: 1.5;
}

/* =============================================================================
   LOGIN MODAL STYLES
   ============================================================================= */

.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.login-modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    position: relative;
    border: 1px solid var(--border-primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.login-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.login-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-modal-header h2 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-modal-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* OAuth Buttons */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.oauth-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
}

.oauth-btn svg {
    flex-shrink: 0;
}

.oauth-google:hover {
    border-color: #4285F4;
}

.oauth-microsoft:hover {
    border-color: #00a4ef;
}

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-primary);
}

/* Admin Login Section */
.login-error {
    color: var(--accent-warning);
    font-size: 13px;
    padding: 8px 12px;
    background: rgba(233, 69, 96, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(233, 69, 96, 0.3);
}

/* Guest Info */
.guest-info {
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-primary);
}

.guest-info p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
}

.guest-btn {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    transition: all 0.2s;
}

.guest-btn:hover {
    text-decoration: underline;
}

/* User Menu Styles */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu-trigger:hover {
    border-color: var(--accent-primary);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 100;
    overflow: hidden;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.user-menu-item:hover {
    background: var(--bg-tertiary);
}

.user-menu-divider {
    height: 1px;
    background: var(--border-primary);
    margin: 4px 0;
}

.user-menu-item.logout {
    color: var(--accent-warning);
}

/* Tier Badge */
.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.tier-badge.guest {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.tier-badge.user {
    background: rgba(78, 205, 196, 0.2);
    color: var(--accent-success);
}

.tier-badge.premium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.tier-badge.admin {
    background: rgba(233, 69, 96, 0.2);
    color: var(--accent-primary);
}

/* Login Button (in header) */
.login-btn {
    padding: 8px 16px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn:hover {
    background: var(--accent-primary-light);
}

/* ====================================
   FEATURE-LOCKED ELEMENTS
   Elements disabled due to subscription tier
   ==================================== */

/* Feature-locked wrapper - for any element that should be locked */
.feature-locked {
    position: relative;
    opacity: 0.5;
    pointer-events: none;
}

/* Feature-locked overlay - for sections */
.feature-locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.feature-locked-message {
    background: var(--bg-tertiary);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    text-align: center;
}

.feature-locked-message .upgrade-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.feature-locked-message .upgrade-link:hover {
    text-decoration: underline;
}

/* Tooltip for locked elements */
[data-tier-tooltip] {
    position: relative;
    cursor: not-allowed !important;
}

[data-tier-tooltip]::before {
    content: attr(data-tier-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1000;
    border: 1px solid var(--border-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-tier-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 6px solid transparent;
    border-top-color: var(--bg-tertiary);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1001;
}

[data-tier-tooltip]:hover::before,
[data-tier-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

[data-tier-tooltip]:hover::before {
    transform: translateX(-50%) translateY(-4px);
}

[data-tier-tooltip]:hover::after {
    transform: translateX(-50%) translateY(0);
}

/* Locked button style */
/* Lock icon as image (replaces 🔒 emoji) */
.lock-icon-img {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.7;
}

/* Larger lock icon for overlays */
.lock-icon-img.lock-icon-lg {
    width: 28px;
    height: 28px;
    opacity: 0.8;
}

.btn-locked {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: auto !important; /* Allow hover for tooltip */
}

.btn-locked:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Locked section style */
.section-locked {
    position: relative;
}

.section-locked > *:not(.feature-locked-overlay) {
    opacity: 0.4;
    pointer-events: none;
}

/* Premium badge for locked features */
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 152, 0, 0.2) 100%);
    color: #ffc107;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-badge::before {
    content: '⭐';
    font-size: 10px;
}

/* Trading section locked */
.trade-group.locked .trade-btn {
    opacity: 0.5;
    pointer-events: auto;
    cursor: not-allowed;
}

/* Strategy category locked (Aggressive / Speculative for non-Premium tiers) */
.strategy-level-group-locked .strategy-level-header {
    opacity: 0.55;
    cursor: not-allowed;
}
.strategy-level-group-locked .strategy-level-header:hover {
    background: transparent;
}

/* Portfolio Greeks panel locked (visible when option positions exist but
   tier doesn't grant the feature — header shown so user knows it exists) */
.portfolio-greeks-summary-locked .portfolio-greeks-header {
    opacity: 0.55;
    cursor: not-allowed;
}
.portfolio-greeks-summary-locked .portfolio-greeks-header:hover {
    background: transparent;
}

/* Historical data locked */
.period-select.locked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto;
}

/* Option chain locked overlay */
.option-chain-locked {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    gap: 12px;
}

.option-chain-locked .lock-icon {
    font-size: 32px;
    opacity: 0.7;
}

.option-chain-locked .lock-message {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

.option-chain-locked .upgrade-btn {
    padding: 8px 20px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-chain-locked .upgrade-btn:hover {
    background: var(--accent-primary-hover);
}

/* ====================================
   DEMO LIMIT MODAL
   Registration prompt for guests
   ==================================== */

.demo-limit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.demo-limit-modal {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    border: 1px solid var(--border-primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

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

.demo-limit-header {
    text-align: center;
    margin-bottom: 24px;
}

.demo-limit-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.demo-limit-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-primary);
    font-weight: 600;
}

.demo-limit-body {
    text-align: center;
}

.demo-limit-message {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.demo-limit-benefits {
    background: rgba(38, 166, 154, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    text-align: left;
}

.demo-limit-benefits h4 {
    margin: 0 0 12px 0;
    color: var(--accent-primary);
    font-size: 14px;
    font-weight: 600;
}

.demo-limit-benefits ul {
    margin: 0;
    padding-left: 20px;
}

.demo-limit-benefits li {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.demo-limit-benefits li:last-child {
    margin-bottom: 0;
}

.demo-limit-free-note {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
}

.demo-limit-free-note strong {
    color: var(--color-success);
}

.demo-limit-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.demo-limit-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.demo-limit-btn-later {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.demo-limit-btn-later:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.demo-limit-btn-register {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #1e9e8f 100%);
    color: white;
    padding: 12px 32px;
}

.demo-limit-btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(38, 166, 154, 0.4);
}

/* ====================================
   RESUME SESSION MODAL
   For Premium users with saved session
   ==================================== */

.resume-session-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.resume-session-modal {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.resume-session-header {
    text-align: center;
    margin-bottom: 20px;
}

.resume-session-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.resume-session-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--text-primary);
    font-weight: 600;
}

.resume-session-body {
    text-align: center;
}

.resume-session-message {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.resume-session-info {
    background: rgba(38, 166, 154, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.session-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.session-info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

.resume-session-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.resume-session-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.resume-session-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.resume-session-btn-new {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.resume-session-btn-new:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.resume-session-btn-resume {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #1e9e8f 100%);
    color: white;
    padding: 12px 32px;
}

.resume-session-btn-resume:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(38, 166, 154, 0.4);
}

/* Demo mode indicator in header */
.demo-mode-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 6px;
    font-size: 12px;
    color: #ffc107;
}

.demo-mode-indicator .demo-count {
    font-weight: 600;
}

/* Demo Mode Banner - fixed bottom, aligned with option chain block */
.demo-mode-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 65%; /* Match option chain block width (55% + 10%) */
    z-index: 999;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 152, 0, 0.2) 100%);
    border-top: 1px solid rgba(255, 193, 7, 0.4);
    border-right: 1px solid rgba(255, 193, 7, 0.4);
    backdrop-filter: blur(8px);
    animation: slideUpBanner 0.3s ease-out;
}

@keyframes slideUpBanner {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.demo-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.demo-banner-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.demo-banner-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

.demo-banner-text strong {
    color: #ffc107;
}

.demo-banner-link {
    color: #ffc107;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.demo-banner-link:hover {
    color: #ffca28;
}

/* ========================================
   PROTOTYPE WARNING MODAL
   ======================================== */

.prototype-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.prototype-modal {
    background: linear-gradient(135deg, #1a2233 0%, #0d1117 100%);
    border-radius: 16px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #2a3441;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.prototype-modal-header {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
}

.prototype-modal-header h2 {
    color: #000;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.prototype-modal-body {
    padding: 24px;
}

.prototype-modal-body p {
    color: #d1d5db;
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 1rem;
}

.prototype-modal-body p:last-child {
    margin-bottom: 0;
}

.prototype-modal-body strong {
    color: #ffffff;
}

.prototype-modal-body .warning-text {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--warning-color);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    color: #fbbf24;
    font-size: 0.95rem;
}

.prototype-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.dont-show-again {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 0.9rem;
    cursor: pointer;
}

.dont-show-again input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4a9eff;
    cursor: pointer;
}

.btn-understand {
    background: linear-gradient(135deg, #4a9eff 0%, #3a8eef 100%);
    color: #ffffff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-understand:hover {
    background: linear-gradient(135deg, #5aa9ff 0%, #4a9eff 100%);
    transform: translateY(-1px);
}

.btn-understand:active {
    transform: translateY(0);
}

/* ============================================
   SKELETON LOADING STYLES
   Performance optimization for better UX
   ============================================ */

/* Skeleton animation */
@keyframes skeleton-pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.6;
    }
}

/* Base skeleton class */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-tertiary, #2a2d3a) 0%,
        var(--bg-secondary, #1e2130) 50%,
        var(--bg-tertiary, #2a2d3a) 100%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Skeleton variants */
.skeleton-text {
    height: 14px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-button {
    height: 36px;
    width: 100px;
}

.skeleton-chart {
    height: 100%;
    min-height: 200px;
    width: 100%;
}

/* Chart loading placeholder */
.chart-loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted, #6b7280);
    background: var(--bg-primary, #13151e);
}

.chart-loading-placeholder .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-primary, #2a2d3a);
    border-top-color: var(--accent-primary, #4a9eff);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.chart-loading-placeholder .loading-text {
    font-size: 14px;
}

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

/* Lazy load fadeIn effect */
.lazy-loaded {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   Mobile/Desktop Visibility Utilities
   ============================================ */

/* Hide mobile-only elements on desktop (width > 767px) */
.mobile-only {
    display: none !important;
}

/* Desktop-only elements visible by default, hidden on mobile via media query */
.desktop-only {
    display: block;
}

/* Hide hamburger menu on desktop */
.menu-hamburger {
    display: none !important;
}

/* Hide slide-out menu on desktop */
.menu-slide-out,
.menu-slide-out-overlay {
    display: none !important;
}

/* ============================================
   Keyboard Shortcuts Help Overlay
   ============================================ */

.kbd-help-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kbd-help-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.kbd-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-secondary);
}

.kbd-help-header h3 {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

.kbd-help-body {
    padding: 12px 16px;
}

.kbd-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.kbd-row kbd {
    display: inline-block;
    min-width: 50px;
    padding: 3px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    color: var(--text-primary);
}

.kbd-row span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   Export CSV Button
   ============================================ */

.export-csv-btn {
    font-size: 10px !important;
    padding: 4px 8px !important;
    opacity: 0.7;
}

.export-csv-btn:hover:not(:disabled) {
    opacity: 1;
}

/* ============================================
   Tablet Breakpoint (768px - 1024px)
   ============================================ */

@media (min-width: 768px) and (max-width: 1024px) {
    .grid-container {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
        padding: 8px;
        height: auto;
    }

    .block-graph {
        grid-column: 1 / -1;
        grid-row: 1;
        min-height: 350px;
    }

    .block-control {
        grid-column: 1;
        grid-row: 2;
        min-height: 180px;
    }

    .block-simulation {
        grid-column: 2;
        grid-row: 2;
        min-height: 180px;
    }

    .block-options {
        grid-column: 1 / -1;
        grid-row: 3;
        min-height: 250px;
    }

    .option-chain-table {
        font-size: 10px;
    }

    .greeks-values {
        font-size: 9px;
        gap: 4px;
    }

    .control-btn {
        padding: 6px 10px;
        font-size: 14px;
    }

    .play-btn {
        font-size: 22px;
        padding: 8px 20px;
    }

    .block-title {
        font-size: 11px;
    }

    .sim-actions {
        flex-wrap: wrap;
        gap: 4px;
    }

    .sim-action-btn {
        font-size: 10px;
        padding: 4px 8px;
    }

    /* Modal adjustments for tablet */
    .kbd-help-modal {
        width: 280px;
    }
}

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */

/* Analytics section buttons */
[data-theme="light"] .analytics-btn {
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-color: var(--border-secondary);
}

[data-theme="light"] .analytics-btn:hover:not(:disabled) {
    color: var(--accent-primary);
}

[data-theme="light"] .analytics-btn-save {
    color: var(--text-primary);
}

[data-theme="light"] .pos-table-row:hover {
    background: var(--bg-tertiary);
}

/* ==========================================
   LIGHT THEME: Modal Buttons & Controls
   ========================================== */
[data-theme="light"] .modal-radio-group label {
    background: var(--bg-tertiary);
}

[data-theme="light"] .modal-radio-group label.active {
    background: var(--accent-primary);
    color: var(--text-white);
}

[data-theme="light"] .modal-cancel-btn {
    border-color: var(--border-secondary);
}

[data-theme="light"] .modal-qty-controls .qty-btn {
    border-color: var(--border-secondary);
}

/* Light theme: Custom Strategy styles moved to src/custom-strategy-modal.css */


