/* ===== SPREAD ANALYZER - NEW 3-TAB UI ===== */
/* OptionStrat-style interface redesign */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #0a0e27;
    color: #e0e6ed;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== DATA CONNECTION HEADER ===== */
.data-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: linear-gradient(135deg, #1a1f3a 0%, #0d1224 100%);
    border-bottom: 1px solid #2d3561;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

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

.symbol-dropdown {
    background: #0a0e27;
    border: 1px solid #667eea;
    color: #e0e6ed;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

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

.current-price {
    font-size: 18px;
    font-weight: bold;
    color: #e0e6ed;
}

.price-change {
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.price-change.positive { background: #22c55e; color: white; }
.price-change.negative { background: #ef4444; color: white; }
.price-change.neutral { background: #6b7280; color: white; }

.data-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #a8b2d1;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.connected { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.status-dot.stale { background: #f59e0b; }
.status-dot.disconnected { background: #ef4444; }
.status-dot.archive { background: #a78bfa; box-shadow: 0 0 8px #a78bfa; }

.source-toggle {
    display: flex;
    gap: 4px;
}

.source-btn {
    padding: 6px 12px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    color: #a8b2d1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.source-btn:hover { border-color: #667eea; }
.source-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.connect-btn {
    padding: 6px 16px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.connect-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.settings-btn {
    padding: 6px 10px;
    background: #1a1f3a;
    border: 1px solid #2d3561;
    color: #a8b2d1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.settings-btn:hover { border-color: #667eea; color: #667eea; }

/* Settings Panel */
.settings-panel {
    position: absolute;
    top: 50px;
    right: 20px;
    background: #1a1f3a;
    border: 1px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    z-index: 200;
    min-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.settings-content h3 {
    color: #667eea;
    margin-bottom: 15px;
}

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

.settings-row label {
    color: #a8b2d1;
    font-size: 13px;
}

.settings-row input {
    width: 80px;
    padding: 6px 10px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    border-radius: 4px;
    color: #e0e6ed;
    font-size: 13px;
}

.settings-hint {
    font-size: 10px;
    color: #5a6785;
    margin-left: 8px;
    white-space: nowrap;
}

.settings-close {
    width: 100%;
    padding: 8px;
    background: #2d3561;
    border: none;
    color: #e0e6ed;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

/* ===== 3-TAB NAVIGATION ===== */
.tab-navigation {
    display: flex;
    background: #1a1f3a;
    border-bottom: 2px solid #2d3561;
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: #a8b2d1;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #e0e6ed;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-icon {
    font-size: 18px;
}

/* ===== TAB CONTENT CONTAINER ===== */
.tab-content-container {
    min-height: calc(100vh - 110px);
    padding: 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* ===== FIND TRADES TAB ===== */
.find-trades-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 130px);
}

.find-controls {
    background: #1a1f3a;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
}

.strategy-type-selector {
    margin-bottom: 20px;
}

.strategy-type-selector label {
    display: block;
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.strategy-type-selector select {
    width: 100%;
    padding: 10px 12px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    border-radius: 6px;
    color: #e0e6ed;
    font-size: 14px;
    cursor: pointer;
}

.find-settings {
    margin-bottom: 20px;
}

.find-winners-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    color: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.find-winners-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.find-results {
    background: #1a1f3a;
    border-radius: 8px;
    overflow: hidden;
}

.find-results-header {
    padding: 15px 20px;
    border-bottom: 1px solid #2d3561;
}

.results-count {
    color: #667eea;
    font-weight: 600;
}

.find-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 20px;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.find-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #a8b2d1;
}

/* Winner Card */
.winner-card {
    background: #0a0e27;
    border: 1px solid #2d3561;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.winner-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.winner-card.top-pick {
    border: 2px solid #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

/* ===== BUILD STRATEGY TAB ===== */
.build-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.build-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #1a1f3a;
    border-radius: 8px;
    margin-bottom: 15px;
}

.strategy-name-input {
    background: transparent;
    border: none;
    color: #e0e6ed;
    font-size: 18px;
    font-weight: 600;
    width: 300px;
}

.strategy-name-input:focus {
    outline: none;
    border-bottom: 2px solid #667eea;
}

.build-actions {
    display: flex;
    gap: 10px;
}

.build-action-btn {
    padding: 8px 16px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    color: #a8b2d1;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.build-action-btn:hover {
    border-color: #667eea;
    color: #e0e6ed;
}

.build-action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* Add Leg Menu */
.add-leg-menu {
    position: absolute;
    background: #1a1f3a;
    border: 1px solid #667eea;
    border-radius: 8px;
    padding: 8px;
    z-index: 150;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.add-leg-menu button {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: #e0e6ed;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
}

.add-leg-menu button:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* Expiration Section - OptionStrat-style horizontal timeline */
.expiration-section {
    background: #1a1f3a;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s ease;
}

.expiration-section.highlight-selection {
    box-shadow: 0 0 0 3px #667eea, 0 0 20px rgba(102, 126, 234, 0.4);
}

/* Excluded leg state button */
.excluded-state {
    background: #22c55e !important;
    color: white !important;
}

.expiration-label {
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.expiration-label span {
    color: #e0e6ed;
    font-size: 16px;
    font-weight: 500;
}

/* Horizontal timeline container */
.expiration-timeline {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    gap: 0;
    scrollbar-width: thin;
    scrollbar-color: #667eea transparent;
}

.expiration-timeline::-webkit-scrollbar {
    height: 4px;
}

.expiration-timeline::-webkit-scrollbar-track {
    background: transparent;
}

.expiration-timeline::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 2px;
}

/* Month section - vertical stack of label + days */
.exp-month-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 4px;
    border-right: 1px solid #2d3561;
}

.exp-month-section:last-child {
    border-right: none;
}

/* Month label above days */
.exp-month-label {
    color: #a8b2d1;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 4px;
    white-space: nowrap;
}

/* Day buttons row within each month */
.exp-days {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
}

/* Individual day button */
.exp-day {
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    background: transparent;
    border: none;
    color: #8892b0;
    font-size: 11px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.exp-day:hover {
    background: #2d3561;
    color: #e0e6ed;
}

.exp-day.selected {
    background: #764ba2;
    color: white;
    font-weight: 600;
}

.exp-day.has-leg {
    background: rgba(34, 197, 94, 0.3);
    color: #22c55e;
    font-weight: 600;
    border: 1px solid #22c55e;
}

.exp-day.has-leg.selected {
    background: #22c55e;
    color: white;
}

/* Legacy support - hide old month/day elements */
.month-tabs, .day-buttons {
    display: none;
}

/* Strike Bar Section */
.strike-bar-section {
    background: #1a1f3a;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.strike-bar-label {
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.strike-bar-container {
    position: relative;
    height: 130px; /* Taller to accommodate stacked chips */
    background: #0a0e27;
    border-radius: 8px;
    overflow: visible; /* Allow chips to overflow */
}

/* Strike scale with tick marks at bottom */
.strike-bar {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    height: 30px;
}

.strike-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.strike-tick-line {
    width: 2px;
    height: 8px;
    background: #667eea;
}

.strike-tick-label {
    font-size: 11px;
    color: #e0e6ed;
    margin-top: 3px;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: 0 0 2px rgba(0,0,0,0.8);
}

/* Current price marker triangle */
.current-price-marker {
    position: absolute;
    bottom: 18px;
    transform: translateX(-50%);
    color: #667eea;
    font-size: 10px;
}

.marker-triangle {
    color: #667eea;
}

/* Option chips row floats above strike bar */
.strike-chips-row {
    position: absolute;
    bottom: 35px; /* Above the strike bar */
    left: 0;
    right: 0;
    height: 100px; /* Tall enough for stacking multiple chips */
    pointer-events: none; /* Allow clicks to pass through to chips */
}

/* Option Chips */
.option-chip {
    position: absolute;
    bottom: 0; /* Stack from bottom up */
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.1s;
    z-index: 10;
    pointer-events: auto; /* Enable clicks even though parent has pointer-events: none */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    min-width: 50px;
}

.option-chip:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

/* Ratio indicator */
.chip-ratio {
    font-size: 9px;
    opacity: 0.9;
    margin-left: 2px;
}

.option-chip:active { cursor: grabbing; }

.option-chip.call.buy { background: #22c55e; color: white; }
.option-chip.call.sell { background: #ef4444; color: white; }
.option-chip.put.buy { background: #3b82f6; color: white; }
.option-chip.put.sell { background: #f59e0b; color: white; }

.option-chip.itm::after {
    content: '!';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    background: #fbbf24;
    color: #000;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Exit leg styling */
.option-chip.exit-leg {
    border: 2px dashed rgba(167, 139, 250, 0.7);
    opacity: 0.85;
    position: absolute;
}

.option-chip.exit-leg::before {
    content: 'EXIT';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: #a78bfa;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Exit leg row in legs table */
.leg-row.exit-leg {
    background-color: rgba(167, 139, 250, 0.08);
}

/* Box Exit button accent style */
.build-action-btn.box-exit {
    border-color: #a78bfa;
    color: #a78bfa;
}

.build-action-btn.box-exit:hover {
    background: rgba(167, 139, 250, 0.15);
    border-color: #c4b5fd;
    color: #c4b5fd;
}

/* Excluded leg styling */
.option-chip.excluded {
    opacity: 0.4;
    text-decoration: line-through;
}

.chip-exp {
    display: block;
    font-size: 9px;
    opacity: 0.8;
    margin-top: 2px;
}

/* Trade Summary */
.trade-summary {
    display: flex;
    justify-content: space-around;
    background: #1a1f3a;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    color: #a8b2d1;
    font-size: 11px;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 16px;
    font-weight: bold;
    color: #e0e6ed;
}

.summary-value.profit { color: #22c55e; }
.summary-value.loss { color: #ef4444; }
.summary-value.credit { color: #4ecdc4; }

/* P&L Graph with Reference Layout */
.build-graph-with-ref {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.strategy-ref-display {
    /* Styling handled by current-strategy-reference class */
}

.build-graph-container {
    background: #1a1f3a;
    border-radius: 8px;
    padding: 15px;
}

.build-graph {
    height: 350px;
    background: #0a0e27;
    border-radius: 8px;
}

/* Date Slider */
.date-slider-section {
    background: #1a1f3a;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.date-slider-label {
    color: #a8b2d1;
    font-size: 13px;
    margin-bottom: 10px;
}

.date-slider-label span {
    color: #e0e6ed;
    font-weight: 600;
}

.date-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #2d3561;
    border-radius: 3px;
    outline: none;
}

.date-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.date-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #667;
    margin-top: 5px;
}

/* IV Slider */
.iv-slider-section {
    background: #1a1f3a;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.iv-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #a8b2d1;
    font-size: 13px;
}

.iv-slider-header span span {
    color: #e0e6ed;
    font-weight: 600;
}

.iv-controls {
    display: flex;
    gap: 6px;
}

.iv-reset-btn, .iv-mult-btn {
    padding: 4px 10px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    color: #a8b2d1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.iv-reset-btn:hover, .iv-mult-btn:hover {
    border-color: #667eea;
    color: #e0e6ed;
}

.iv-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #2d3561;
    border-radius: 3px;
}

.iv-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #764ba2;
    border-radius: 50%;
    cursor: pointer;
}

/* Strategy Library */
.strategy-library-section {
    background: #1a1f3a;
    border-radius: 8px;
    overflow: hidden;
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    color: #a8b2d1;
}

.library-header:hover { background: rgba(102, 126, 234, 0.1); }

.library-toggle {
    transition: transform 0.3s;
}

.library-toggle.open { transform: rotate(180deg); }

.library-content {
    padding: 15px;
    border-top: 1px solid #2d3561;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.library-item {
    background: #0a0e27;
    border: 1px solid #2d3561;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.library-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.library-item-name {
    font-size: 12px;
    color: #e0e6ed;
}

.library-item-thumbnail {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.library-item-thumbnail svg {
    max-width: 100%;
    max-height: 100%;
}

.library-item-badge {
    font-size: 10px;
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 4px;
    display: inline-block;
}

/* ===== ANALYSIS TAB ===== */
.analysis-layout {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.trade-info {
    color: #e0e6ed;
    font-size: 14px;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 8px 16px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    color: #a8b2d1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.view-btn:hover { border-color: #667eea; }
.view-btn.active {
    background: #764ba2;
    color: white;
    border-color: #764ba2;
}

/* Analysis Metrics */
.analysis-metrics {
    display: flex;
    gap: 15px;
    background: #1a1f3a;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.analysis-metrics .metric {
    flex: 1;
    text-align: center;
}

.analysis-metrics .metric-label {
    display: block;
    color: #a8b2d1;
    font-size: 11px;
    margin-bottom: 4px;
}

.analysis-metrics .metric-value {
    font-size: 18px;
    font-weight: bold;
    color: #e0e6ed;
}

/* Time Slider */
.analysis-time-slider {
    background: #1a1f3a;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.time-slider-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #a8b2d1;
}

.time-slider-header span:last-child {
    color: #e0e6ed;
    font-weight: 600;
}

.time-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #667;
    margin-top: 5px;
}

/* Graph Container */
.analysis-graph-container {
    background: #1a1f3a;
    border-radius: 8px;
    padding: 15px;
    min-height: 500px;
    margin-bottom: 15px;
}

/* Strike Variation Controls */
.strike-variation-controls {
    background: #1a1f3a;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.variation-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.variation-row label {
    color: #a8b2d1;
    font-size: 13px;
}

.variation-row input[type="number"] {
    width: 80px;
    padding: 6px 10px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    border-radius: 4px;
    color: #e0e6ed;
    font-size: 13px;
}

.variation-row input[type="range"] {
    width: 150px;
}

.variation-row span {
    color: #667eea;
    font-weight: 600;
}

/* Results Table */
.results-table-container {
    background: #1a1f3a;
    border-radius: 8px;
    overflow: hidden;
}

.results-table-container table {
    width: 100%;
    border-collapse: collapse;
}

.results-table-container th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 500;
}

.results-table-container td {
    padding: 10px 12px;
    border-bottom: 1px solid #2d3561;
}

.results-table-container tr:hover {
    background: #0a0e27;
}

/* ===== OPTION POPUP ===== */
.option-popup {
    position: fixed;
    background: #1a1f3a;
    border: 1px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    z-index: 500;
    min-width: 250px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.popup-title {
    font-size: 18px;
    font-weight: bold;
    color: #e0e6ed;
}

.popup-exp {
    color: #667eea;
    font-size: 14px;
}

.popup-subtitle {
    color: #a8b2d1;
    font-size: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2d3561;
}

.popup-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2d3561;
}

.popup-quantity span:first-child {
    color: #a8b2d1;
    font-size: 12px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    color: #e0e6ed;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover { border-color: #667eea; }

.popup-price {
    margin-left: auto;
    font-size: 16px;
    font-weight: bold;
    color: #22c55e;
}

.popup-greeks {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2d3561;
}

.greek-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
}

.greek-row span:nth-child(odd) { color: #a8b2d1; }
.greek-row span:nth-child(even) { color: #e0e6ed; font-weight: 500; }

.popup-actions button {
    display: block;
    width: 100%;
    padding: 8px;
    background: transparent;
    border: none;
    color: #a8b2d1;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
}

.popup-actions button:hover { background: rgba(102, 126, 234, 0.1); color: #e0e6ed; }
.popup-actions .remove-btn:hover { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1f3a;
    border: 1px solid #667eea;
    color: #e0e6ed;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .find-trades-layout {
        grid-template-columns: 1fr;
    }

    .data-header {
        flex-direction: column;
        gap: 10px;
    }

    .data-header-left, .data-header-right {
        width: 100%;
        justify-content: center;
    }

    .trade-summary {
        flex-wrap: wrap;
        gap: 15px;
    }

    .summary-item {
        flex: 1 1 45%;
    }
}

@media (max-width: 768px) {
    .tab-btn span {
        display: none;
    }

    .tab-icon {
        font-size: 24px;
    }

    .build-header {
        flex-direction: column;
        gap: 15px;
    }

    .build-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ===== GRAPH GRID FOR ANALYSIS ===== */
.graph-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 15px;
}

.graph-cell {
    background: #0a0e27;
    border-radius: 8px;
    padding: 10px;
    min-height: 280px;
}

.graph-cell-title {
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0e27;
}

::-webkit-scrollbar-thumb {
    background: #2d3561;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3d4571;
}

/* ===== UTILITY CLASSES ===== */
.text-profit { color: #22c55e !important; }
.text-loss { color: #ef4444 !important; }
.text-neutral { color: #a8b2d1 !important; }
.text-credit { color: #4ecdc4 !important; }

.bg-profit { background: rgba(34, 197, 94, 0.2) !important; }
.bg-loss { background: rgba(239, 68, 68, 0.2) !important; }

.hidden { display: none !important; }

/* ===== STRATEGY REFERENCE GRAPHICS ===== */
.strategy-reference-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(26, 31, 58, 0.6);
    border-radius: 8px;
    border: 1px solid #2d3561;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.strategy-reference-card:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.reference-graphic {
    flex-shrink: 0;
    background: rgba(10, 14, 39, 0.8);
    border-radius: 6px;
    padding: 4px;
    border: 1px solid #2d3561;
}

.reference-graphic svg {
    display: block;
}

.reference-info {
    flex: 1;
    min-width: 0;
}

.reference-name {
    font-weight: 600;
    font-size: 13px;
    color: #e0e6ed;
    margin-bottom: 4px;
}

.reference-desc {
    font-size: 11px;
    color: #8892b0;
    line-height: 1.4;
}

.reference-characteristics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.reference-char-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(102, 126, 234, 0.2);
    color: #a8b2d1;
}

.reference-char-badge.bullish { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.reference-char-badge.bearish { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.reference-char-badge.neutral { background: rgba(168, 178, 209, 0.2); color: #a8b2d1; }
.reference-char-badge.volatile { background: rgba(155, 89, 182, 0.2); color: #9b59b6; }

/* Strategy Library with Reference Panel */
.strategy-library-with-ref {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
}

.strategy-ref-panel {
    background: rgba(10, 14, 39, 0.5);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #2d3561;
}

.strategy-ref-panel h4 {
    font-size: 11px;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.strategy-library-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.strategy-library-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(26, 31, 58, 0.4);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.strategy-library-item:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.strategy-library-item.selected {
    background: rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

.strategy-library-item .mini-svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.strategy-library-item .strategy-name {
    font-size: 12px;
    color: #e0e6ed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Template thumbnail SVG in library list */
.template-thumbnail-svg {
    flex-shrink: 0;
    background: rgba(10, 14, 39, 0.8);
    border-radius: 4px;
    padding: 2px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-thumbnail-svg svg {
    display: block;
    width: 80px;
    height: 50px;
}

/* Current strategy reference display on left side */
.current-strategy-reference {
    background: linear-gradient(135deg, #1a1f3a 0%, #0a0e27 100%);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #667eea;
}

.current-strategy-reference h4 {
    font-size: 12px;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-strategy-reference h4::before {
    content: '\1F4CA';
    font-size: 14px;
}

.current-strategy-reference .ref-svg-container {
    background: rgba(10, 14, 39, 0.8);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid #2d3561;
    margin-bottom: 10px;
}

.current-strategy-reference .ref-svg-container svg {
    width: 100%;
    max-width: 180px;
    height: auto;
}

.current-strategy-reference .ref-description {
    font-size: 11px;
    color: #8892b0;
    text-align: center;
    line-height: 1.5;
}

.current-strategy-reference .ref-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.current-strategy-reference .ref-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(102, 126, 234, 0.2);
    color: #a8b2d1;
}

.current-strategy-reference .ref-badge.profit-unlimited { color: #22c55e; background: rgba(34, 197, 94, 0.15); }
.current-strategy-reference .ref-badge.loss-limited { color: #3498db; background: rgba(52, 152, 219, 0.15); }
.current-strategy-reference .ref-badge.bullish { color: #22c55e; background: rgba(34, 197, 94, 0.15); }
.current-strategy-reference .ref-badge.bearish { color: #ef4444; background: rgba(239, 68, 68, 0.15); }
.current-strategy-reference .ref-badge.neutral { color: #f59e0b; background: rgba(245, 158, 11, 0.15); }

/* ===== LEAP CYCLE ANALYZER TAB ===== */
.leap-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 140px);
}

.leap-config-panel {
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.leap-section {
    background: linear-gradient(135deg, #1a1f3a 0%, #0d1224 100%);
    border: 1px solid #2d3561;
    border-radius: 8px;
    padding: 16px;
}

.leap-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leap-config-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.config-row label {
    width: 90px;
    font-size: 13px;
    color: #a8b2d1;
}

.config-row input,
.config-row select {
    flex: 1;
    padding: 8px 10px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    border-radius: 4px;
    color: #e0e6ed;
    font-size: 13px;
}

.config-row input:focus,
.config-row select:focus {
    border-color: #667eea;
    outline: none;
}

.config-row .hint {
    font-size: 11px;
    color: #666;
    flex-shrink: 0;
}

/* Value Breakdown Box */
.value-breakdown {
    margin-top: 16px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
}

.breakdown-title {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
    text-transform: uppercase;
}

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

.breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.breakdown-item .label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
}

.breakdown-item .value {
    font-size: 16px;
    font-weight: 600;
    color: #e0e6ed;
}

.breakdown-item .percent {
    font-size: 11px;
    color: #a8b2d1;
}

.breakdown-item .value.moneyness.itm {
    color: #22c55e;
}

.breakdown-item .value.moneyness.otm {
    color: #f59e0b;
}

.breakdown-item .value.moneyness.atm {
    color: #3498db;
}

/* LEAP Greeks Display */
.leap-greeks {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.leap-greeks .greek {
    font-size: 12px;
    color: #a8b2d1;
}

.leap-greeks .greek span {
    font-weight: 600;
    color: #e0e6ed;
}

/* DTE Comparison Section */
.leap-dte-section {
    grid-column: 2;
    background: linear-gradient(135deg, #1a1f3a 0%, #0d1224 100%);
    border: 1px solid #2d3561;
    border-radius: 8px;
    padding: 16px;
}

.leap-dte-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
}

.leap-dte-section h3 .subtitle {
    font-size: 11px;
    font-weight: normal;
    color: #666;
    margin-left: 10px;
}

.dte-checkboxes {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.dte-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #a8b2d1;
    cursor: pointer;
}

.dte-checkboxes input[type="checkbox"] {
    accent-color: #667eea;
}

.dte-comparison-table {
    overflow-x: auto;
}

.dte-comparison-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dte-comparison-table th {
    text-align: left;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    color: #667eea;
    font-weight: 600;
    border-bottom: 1px solid #2d3561;
}

.dte-comparison-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(45, 53, 97, 0.5);
    color: #e0e6ed;
}

.dte-comparison-table tr:hover td {
    background: rgba(102, 126, 234, 0.1);
}

.dte-comparison-table tr.recommended td {
    background: rgba(34, 197, 94, 0.1);
}

.dte-comparison-table tr.recommended td:first-child {
    color: #22c55e;
    font-weight: 600;
}

.dte-comparison-table .placeholder {
    text-align: center;
    color: #666;
    font-style: italic;
}

.dte-comparison-table .risk-bar {
    font-family: monospace;
    font-size: 11px;
    color: #f59e0b;
}

.dte-recommendation {
    margin-top: 12px;
    padding: 10px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 4px;
    font-size: 13px;
    color: #a8b2d1;
}

.dte-recommendation strong {
    color: #22c55e;
}

/* Projection Section */
.leap-projection-section {
    grid-column: 2;
    background: linear-gradient(135deg, #1a1f3a 0%, #0d1224 100%);
    border: 1px solid #2d3561;
    border-radius: 8px;
    padding: 16px;
}

.leap-projection-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
}

.projection-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: 12px;
    color: #a8b2d1;
}

.control-group select,
.control-group input {
    padding: 6px 10px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    border-radius: 4px;
    color: #e0e6ed;
    font-size: 13px;
}

.projection-chart {
    height: 300px;
    margin-bottom: 16px;
    border-radius: 6px;
    overflow: hidden;
}

.projection-summary {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 16px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.summary-item {
    text-align: center;
}

.summary-item .label {
    display: block;
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.summary-item .value {
    font-size: 18px;
    font-weight: 600;
    color: #e0e6ed;
}

.summary-item .value.positive {
    color: #22c55e;
}

.summary-item .value.negative {
    color: #ef4444;
}

/* Volatility Scenarios */
.leap-vol-section {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #1a1f3a 0%, #0d1224 100%);
    border: 1px solid #2d3561;
    border-radius: 8px;
    padding: 16px;
}

.leap-vol-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
}

.vol-scenario-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.vol-scenario-table th,
.vol-scenario-table td {
    padding: 10px 16px;
    text-align: center;
}

.vol-scenario-table th {
    background: rgba(0, 0, 0, 0.3);
    color: #667eea;
    font-weight: 600;
}

.vol-scenario-table td {
    border-bottom: 1px solid rgba(45, 53, 97, 0.5);
}

.vol-scenario-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: #a8b2d1;
}

.vol-scenario-table .positive {
    color: #22c55e;
}

.vol-scenario-table .negative {
    color: #ef4444;
}

.vol-scenario-table .total-row td {
    font-weight: 600;
    border-top: 2px solid #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .leap-layout {
        grid-template-columns: 1fr;
    }

    .leap-config-panel {
        grid-row: auto;
    }

    .leap-dte-section,
    .leap-projection-section {
        grid-column: 1;
    }

    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== SPREAD GROUP FEATURES ===== */

/* Multi-select highlight on chips */
.option-chip.chip-selected {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

/* Group Selected floating bar */
.group-selected-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #1a1f3a 0%, #0d1224 100%);
    border: 1px solid #fbbf24;
    border-radius: 6px;
    margin-bottom: 10px;
    animation: fadeIn 0.2s ease;
}

.group-selected-count {
    color: #fbbf24;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.group-name-input {
    flex: 1;
    padding: 5px 10px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    border-radius: 4px;
    color: #e0e6ed;
    font-size: 12px;
    min-width: 120px;
}

.group-name-input:focus {
    border-color: #667eea;
    outline: none;
}

.group-confirm-btn {
    padding: 5px 14px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.group-confirm-btn:hover {
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.group-cancel-btn {
    padding: 5px 12px;
    background: transparent;
    border: 1px solid #2d3561;
    color: #a8b2d1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.group-cancel-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Group submenu in popup */
.group-submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.group-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    color: #a8b2d1;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
}

.group-option:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #e0e6ed;
}

.group-option.active {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    font-weight: 600;
}

.group-option.new-group {
    color: #22c55e;
    border-top: 1px solid #2d3561;
    margin-top: 4px;
    padding-top: 10px;
}

.group-option.back-btn {
    color: #a8b2d1;
    border-top: 1px solid #2d3561;
    margin-top: 4px;
    padding-top: 10px;
}

.group-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Box Exit Dropdown */
.box-exit-dropdown {
    background: #1a1f3a;
    border: 1px solid #a78bfa;
    border-radius: 8px;
    padding: 6px;
    z-index: 500;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.box-exit-dropdown-title {
    padding: 6px 10px;
    color: #a78bfa;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.box-exit-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    color: #e0e6ed;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
}

.box-exit-option:hover {
    background: rgba(167, 139, 250, 0.15);
}

.box-exit-option-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== RESEARCH TAB ===== */

/* Research tab layout */
.research-tab-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 20px;
}

.research-left {
    /* Symbol selector + calendar heatmap */
}

.research-right {
    /* Snapshot detail + storage monitor */
}

/* Research controls */
.research-controls {
    margin-bottom: 12px;
}

/* Symbol selector for research tab */
.research-symbol-select {
    background: #2a2a3e;
    border: 1px solid #444;
    color: #ccc;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 12px;
}

/* Month navigation */
.heatmap-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.heatmap-nav button {
    background: #2a2a3e;
    border: 1px solid #444;
    color: #ccc;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.heatmap-nav button:hover {
    background: #3a3a52;
    border-color: #667eea;
}

.heatmap-nav .month-label {
    font-size: 14px;
    font-weight: 600;
    min-width: 160px;
    text-align: center;
    color: #e0e6ed;
}

/* Calendar Heatmap */
.calendar-heatmap {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    max-width: 400px;
    margin: 0 auto 12px;
}

.heatmap-header {
    text-align: center;
    font-size: 11px;
    color: #888;
    padding: 4px 0;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    transition: transform 0.1s;
    position: relative;
}

.heatmap-cell:hover {
    transform: scale(1.2);
    z-index: 1;
}

.heatmap-cell.empty {
    visibility: hidden;
    cursor: default;
}

/* Intensity levels (GitHub-style greens on dark background) */
.heatmap-cell.level-0 { background: #1a1a2e; color: #555; }
.heatmap-cell.level-1 { background: #0e4429; color: #aaa; }
.heatmap-cell.level-2 { background: #006d32; color: #ddd; }
.heatmap-cell.level-3 { background: #26a641; color: #fff; }
.heatmap-cell.level-4 { background: #39d353; color: #fff; }

.heatmap-cell.selected {
    outline: 2px solid #58a6ff;
    outline-offset: 1px;
}

/* Heatmap legend */
.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
}

.heatmap-legend .legend-label {
    font-size: 10px;
    color: #888;
    margin: 0 4px;
}

.heatmap-cell.legend-cell {
    width: 12px;
    height: 12px;
    aspect-ratio: auto;
    cursor: default;
    font-size: 0;
}

.heatmap-cell.legend-cell:hover {
    transform: none;
}

/* Snapshot day detail panel */
.snapshot-detail {
    padding: 12px;
    background: #1e1e2e;
    border-radius: 8px;
    border: 1px solid #333;
    min-height: 200px;
}

.snapshot-detail-placeholder {
    color: #666;
    text-align: center;
    padding: 40px 20px;
    font-size: 13px;
}

.snapshot-detail-loading {
    color: #888;
    text-align: center;
    padding: 40px 20px;
}

.snapshot-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a2a3e;
    margin-bottom: 8px;
    color: #e0e6ed;
}

.snapshot-count {
    font-size: 12px;
    color: #667eea;
}

.snapshot-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
    max-height: 400px;
    overflow-y: auto;
}

.snapshot-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid #2a2a3e;
    gap: 8px;
}

.snapshot-list li:hover {
    background: rgba(102, 126, 234, 0.05);
}

.snapshot-time {
    font-family: monospace;
    font-size: 12px;
    color: #ccc;
    min-width: 70px;
}

.snapshot-price {
    font-size: 12px;
    color: #22c55e;
    min-width: 60px;
}

.snapshot-size {
    font-size: 11px;
    color: #888;
    min-width: 50px;
}

.snapshot-load-btn {
    background: #667eea;
    border: none;
    color: white;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
}

.snapshot-load-btn:hover {
    background: #5570d6;
}

/* Snapshot type badges */
.snapshot-type-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.badge-open { background: #1e40af; color: #93c5fd; }
.badge-close { background: #7c2d12; color: #fed7aa; }
.badge-0dte { background: #065f46; color: #6ee7b7; }
.badge-0dte-lasthour { background: #854d0e; color: #fde68a; }

/* Snapshot day stats */
.snapshot-day-stats {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    margin-top: 8px;
    border-top: 1px solid #2a2a3e;
    font-size: 11px;
    color: #888;
}

/* Storage monitor */
.storage-monitor {
    margin-top: 20px;
    padding: 12px;
    background: #1e1e2e;
    border-radius: 8px;
    border: 1px solid #333;
}

.storage-monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.storage-title {
    font-size: 13px;
    font-weight: 600;
    color: #e0e6ed;
}

.storage-info {
    font-size: 11px;
    color: #888;
}

.storage-bar {
    height: 12px;
    background: #2a2a3e;
    border-radius: 6px;
    overflow: hidden;
    margin: 8px 0;
}

.storage-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s;
}

.storage-bar-fill.green { background: #22c55e; }
.storage-bar-fill.yellow { background: #eab308; }
.storage-bar-fill.red { background: #ef4444; }

.storage-text {
    font-size: 12px;
    color: #ccc;
    text-align: center;
}

.storage-alert {
    padding: 8px 12px;
    background: #7c2d12;
    border: 1px solid #ef4444;
    border-radius: 4px;
    color: #fca5a5;
    font-size: 12px;
    margin-top: 8px;
}

/* No-data state */
.research-no-data {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.research-no-data code {
    display: block;
    margin-top: 12px;
    padding: 8px 16px;
    background: #1a1a2e;
    border-radius: 4px;
    font-size: 12px;
    color: #58a6ff;
}

/* Responsive: stack on smaller screens */
@media (max-width: 900px) {
    .research-tab-layout {
        grid-template-columns: 1fr;
    }
}
