/* ============================================ */
/* OPTIONS / GEX PAGE                           */
/* ============================================ */
.options-layout {
    display: none;
    flex-direction: column;
    height: 100dvh;
    background: #0a0a0a;
    overflow-y: auto;
    padding-bottom: calc(env(safe-area-inset-bottom, 0) + 60px);
}
.options-top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #141414;
    border-bottom: 1px solid #2a2a2a;
    flex-wrap: wrap;
}
.options-ticker-search {
    position: relative;
    flex-shrink: 0;
}
.options-ticker-search input {
    width: 180px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
}
.options-ticker-search input:focus {
    border-color: #555;
}
.options-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 240px;
    max-height: 240px;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    margin-top: 4px;
    z-index: 100;
}
.options-search-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #e0e0e0;
    display: flex;
    justify-content: space-between;
}
.options-search-item:hover {
    background: #2a2a2a;
}
.options-search-item .ticker {
    font-weight: 600;
    color: #fff;
}
.options-search-item .name {
    color: #666;
    font-size: 11px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.options-quick-btns {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.options-quick-btns button {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #8a8a8a;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.options-quick-btns button:hover {
    background: #2a2a2a;
    color: #e0e0e0;
}
.options-quick-btns button.active {
    background: #0A84FF;
    color: #fff;
    border-color: #0A84FF;
}
.options-toggle-group {
    display: flex;
    border-radius: 6px;
    border: 1px solid #333;
    overflow: hidden;
    flex-shrink: 0;
}
.options-toggle-btn {
    padding: 6px 14px;
    border: none;
    background: #1a1a1a;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.5px;
}
.options-toggle-btn:not(:last-child) {
    border-right: 1px solid #333;
}
.options-toggle-btn:hover {
    color: #aaa;
}
.options-toggle-btn.active {
    background: #2a2a2a;
    color: #e0e0e0;
}
.options-main {
    display: grid;
    grid-template-columns: 220px 1fr;
    flex: 1;
    min-height: 0;
}
.options-hud {
    background: #141414;
    border-right: 1px solid #2a2a2a;
    padding: 16px 14px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
}
.options-hud-section {
    margin-bottom: 16px;
}
.options-hud-title {
    font-size: 10px;
    font-weight: 700;
    color: #666;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding-bottom: 6px;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 8px;
}
.options-hud-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    line-height: 1.6;
}
.options-hud-label {
    color: #8a8a8a;
}
.options-hud-value {
    color: #e0e0e0;
    font-weight: 500;
    text-align: right;
}
.options-chart-panel {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    min-height: 0;
}
.options-chart-title {
    font-size: 14px;
    font-weight: 700;
    color: #e0e0e0;
    text-align: center;
    margin-bottom: 8px;
}
.options-chart-svg-wrap {
    flex: 1;
    min-height: 400px;
    max-height: calc(100vh - 200px);
    position: relative;
}
.options-chart-svg-wrap svg {
    width: 100%;
    height: 100%;
}
.gex-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(20,20,20,0.95);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: #e0e0e0;
    white-space: nowrap;
    z-index: 20;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    font-family: 'SF Mono', 'Consolas', monospace;
    line-height: 1.5;
}
.gex-tooltip .tt-strike { color: #fff; font-weight: 700; font-size: 13px; }
.gex-tooltip .tt-pos { color: #32D74B; }
.gex-tooltip .tt-neg { color: #FF453A; }
.gex-tooltip .tt-label { color: #8E8E93; }
.options-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 10px 0 4px;
    border-top: 1px solid #2a2a2a;
    margin-top: 8px;
}
.options-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #8a8a8a;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s;
}
.options-legend-item.dimmed {
    opacity: 0.35;
}
.options-legend-dot {
    width: 10px;
    height: 3px;
    border-radius: 1px;
    flex-shrink: 0;
}
.options-legend-dot.dashed {
    background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px);
    height: 2px;
}
.options-legend-value {
    color: #e0e0e0;
    font-weight: 500;
}
.options-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 14px;
}
.options-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex-direction: column;
    gap: 8px;
    color: #666;
}
.options-no-data .ticker-name {
    font-size: 18px;
    font-weight: 700;
    color: #8a8a8a;
}

/* Mobile */
@media (max-width: 768px) {
    .options-main {
        grid-template-columns: 1fr;
    }
    .options-hud {
        border-right: none;
        border-bottom: 1px solid #2a2a2a;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 10px 12px;
        overflow-y: visible;
        max-height: none;
    }
    .options-hud-section {
        padding: 8px 0;
        margin-bottom: 0;
        border-bottom: 1px solid #1a1a1a;
    }
    .options-hud-section:last-child {
        border-bottom: none;
    }
    .options-hud-title {
        font-size: 9px;
    }
    .options-hud-row {
        font-size: 11px;
        padding: 1px 0;
    }
    .options-top-bar {
        padding: 8px 12px;
        gap: 6px;
        flex-wrap: wrap;
    }
    .options-ticker-search input {
        width: 100%;
    }
    .options-toggle-group {
        flex-wrap: wrap;
    }
    .options-chart-panel {
        padding: 8px 10px;
    }
    .options-chart-svg-wrap {
        min-height: 250px;
        max-height: 50vh;
    }
    .options-chart-svg-wrap svg {
        width: 100%;
        height: auto;
        touch-action: pan-y;  /* 1-finger vertical = page scroll; 2-finger handled by JS */
    }
    .options-chart-title {
        font-size: 13px;
    }
    /* Safe area for iOS — prevent elastic overscroll dead zone */
    .options-main {
        padding-bottom: 0;
        overscroll-behavior: none;
    }
}
