/**
 * Shared calculator styles for all strategy pages.
 * Load this first; strategy-specific overrides can go in each strategy's styles.css.
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

h1 {
    color: #4e4445;
    margin-bottom: 30px;
    font-size: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #6c757d;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-top: 10px;
}

.help-icon:hover {
    background-color: #5a6268;
}

.help-icon.active {
    background-color: #0031FF;
}

.help-icon.active:hover {
    background-color: #0026CC;
}

.strategy-pills {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.strategy-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.strategy-pill.bearish {
    background-color: #dc3545;
    color: white;
}

.strategy-pill.limited-profit {
    background-color: #ffc107;
    color: #856404;
}

.strategy-pill.limited-loss {
    background-color: #d4edda;
    color: #155724;
}

.strategy-pill-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.help-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    padding: 12px;
    background-color: #333;
    color: white;
    border-radius: 4px;
    font-size: 13px;
    font-weight: normal;
    white-space: normal;
    width: 340px;
    max-width: calc(100vw - 40px);
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.help-tooltip-text {
    margin-bottom: 10px;
}

.help-tooltip-section {
    margin-top: 12px;
    margin-bottom: 8px;
}

.help-tooltip-section-title {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 6px;
    color: #fff;
}

.help-tooltip-item {
    margin-bottom: 4px;
    font-size: 12px;
    padding-left: 8px;
}

.help-tooltip-item-label {
    font-weight: 600;
    display: inline-block;
    min-width: 80px;
}

.help-tooltip-fundamentals {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #555;
}

.help-tooltip-fundamentals-item {
    margin-bottom: 6px;
    font-size: 12px;
}

.help-tooltip-graph {
    width: 100%;
    height: 120px;
    background-color: white;
    border-radius: 3px;
    margin-top: 8px;
}

.help-icon:hover .help-tooltip,
.help-icon.active .help-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.help-tooltip-read-more {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #555;
    text-align: center;
}

.help-tooltip-read-more a {
    display: inline-block;
    padding: 8px 16px;
    background-color: #0031FF;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.help-tooltip-read-more a:hover {
    background-color: #0026CC;
}

.help-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #333;
}

.calculator-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

input[type="number"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

input[type="number"]:focus {
    outline: none;
    border-color: #0031FF;
}

input[type="number"]:invalid {
    border-color: #c33;
}

.terms-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.terms-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.terms-checkbox label {
    margin: 0;
}

.terms-checkbox a {
    color: #0031FF;
    text-decoration: none;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

button {
    padding: 12px 30px;
    background-color: #0031FF;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

button:hover {
    background-color: #0026CC;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

button:hover:not(:disabled) {
    opacity: 0.9;
}

#resetModifiersBtn {
    padding: 8px 16px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

#resetModifiersBtn:hover {
    background-color: #5a6268;
}

.probability-placeholder {
    cursor: pointer;
    transition: opacity 0.2s;
}

.probability-placeholder:hover {
    opacity: 0.8;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    background-color: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.results-container {
    margin-top: 30px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    color: #333;
    font-size: 12px;
    border: none;
    table-layout: fixed;
}

.results-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa;
}

.results-table th {
    padding: 8px 6px;
    text-align: center;
    border: none;
    font-weight: 600;
    background-color: #f8f9fa;
    color: #333;
    min-width: 90px;
    width: 90px;
}

.results-table th.row-header {
    min-width: 70px;
    width: 70px;
}

.results-table td {
    padding: 6px 4px;
    text-align: center;
    border: none;
    color: #333;
    background-color: white;
    min-width: 90px;
    width: 90px;
}

.results-table tbody tr:hover {
    background-color: #f5f5f5;
}

.results-table .row-header {
    font-weight: 600;
    background-color: #f8f9fa;
    text-align: right;
    padding-right: 8px;
    color: #333;
    min-width: 70px;
    width: 70px;
}

.pop-cell {
    font-weight: 500;
}

.pop-low,
.pop-medium,
.pop-high {
    color: #333;
    font-weight: 500;
}

.stats-container {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.stats-container h3 {
    margin-bottom: 15px;
    color: #4e4445;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.stat-item {
    padding: 10px;
    background: white;
    border-radius: 4px;
    border-left: 4px solid #0031FF;
    position: relative;
    cursor: help;
}

.stat-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    color: #333;
    font-weight: bold;
}

.stat-item .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background-color: #333;
    color: #fff;
    text-align: left;
    padding: 12px 16px;
    border-radius: 6px;
    white-space: pre-wrap;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.5;
    z-index: 1000;
    min-width: 250px;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    pointer-events: none;
}

.stat-item .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.stat-item:hover .tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.tooltip-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 6px;
}

.tooltip-equation {
    font-family: 'Courier New', monospace;
    background-color: rgba(255,255,255,0.1);
    padding: 8px;
    border-radius: 4px;
    margin-top: 6px;
}

.probability-stat-locked {
    opacity: 0.7;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left-color: #9c27b0;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.probability-stat-locked:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.2);
    border-left-color: #9c27b0;
}

.edge-stat-stability.probability-stat-locked {
    border-left-color: #FF6B35;
}
.edge-stat-stability.probability-stat-locked:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
    border-left-color: #FF6B35;
}
.edge-stat-velocity.probability-stat-locked {
    border-left-color: #4ECDC4;
}
.edge-stat-velocity.probability-stat-locked:hover {
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.2);
    border-left-color: #4ECDC4;
}
.edge-stat-reliability.probability-stat-locked {
    border-left-color: #95E1D3;
}
.edge-stat-reliability.probability-stat-locked:hover {
    box-shadow: 0 4px 12px rgba(149, 225, 211, 0.2);
    border-left-color: #95E1D3;
}

.chart-controls-container {
    width: 360px;
    margin: 15px auto 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.chart-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chart-controls-row-1 {
    margin-bottom: 10px;
}
.chart-controls-row-1 #viewToggleBtn {
    flex: 1 1 0;
    min-width: 0;
}
.chart-controls-row-1 .chart-controls-export-cell {
    flex: 0 0 40px;
    position: relative;
}
.chart-controls-row-1 #exportBtn {
    width: 40px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chart-controls-row-2-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chart-controls-row-2 #returnToggleBtn,
.chart-controls-row-2 #probabilityToggleBtn {
    flex: 0 0 150px;
}
.chart-controls-row-2 #edgeMetricsDropdownWrapper {
    flex: 0 0 40px;
}
#edgeMetricsDropdownBtn {
    width: 40px;
    height: 38px;
    min-width: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

@media (max-width: 768px) {
    .chart-controls-container {
        display: grid;
        grid-template-columns: 1fr 40px;
        grid-template-rows: auto auto;
        gap: 10px;
    }
    .chart-controls-row-1,
    .chart-controls-row-2 {
        display: contents;
    }
    .chart-controls-row-1 #viewToggleBtn {
        grid-column: 1;
        grid-row: 1;
    }
    .chart-controls-row-1 .chart-controls-export-cell {
        grid-column: 2;
        grid-row: 1;
    }
    .chart-controls-row-2-left {
        grid-column: 1;
        grid-row: 2;
    }
    .chart-controls-row-2 #edgeMetricsDropdownWrapper {
        grid-column: 2;
        grid-row: 2;
    }
}

#edgeMetricsDropdownWrapper {
    display: inline-block;
}
.edge-metrics-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    min-width: 180px;
    overflow: hidden;
}

/* On mobile, anchor edge metrics dropdown to the right of its wrapper so it doesn't run off-screen */
@media (max-width: 768px) {
    .edge-metrics-dropdown {
        left: auto;
        right: 0;
    }
}
.edge-metrics-dropdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: white;
    width: 100%;
    text-align: left;
}
.edge-metrics-dropdown-row:hover {
    background-color: #f8f9fa;
}
.edge-metrics-dropdown-row.edge-metrics-row-stability { border-left: 4px solid #FF6B35; }
.edge-metrics-dropdown-row.edge-metrics-row-velocity { border-left: 4px solid #4ECDC4; }
.edge-metrics-dropdown-row.edge-metrics-row-reliability { border-left: 4px solid #95E1D3; }
.edge-metrics-dropdown-icon {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-left: 10px;
}

.probability-placeholder {
    color: #6c757d;
    font-style: italic;
    font-size: 14px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.chart-container {
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 0;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow-x: hidden;
    width: 100%;
}

.chart-container h3 {
    margin-bottom: 15px;
    color: #4e4445;
}

.chart-wrapper {
    position: relative;
    height: 500px;
    width: 100%;
    background-color: white;
}

#profitLossLegend {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: #333;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#profitLossLegend .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    white-space: nowrap;
}

#profitLossLegend .legend-item:last-child {
    margin-bottom: 0;
}

#profitLossLegend .legend-line {
    width: 35px;
    height: 3px;
    margin-right: 10px;
    flex-shrink: 0;
}

#profitLossLegend .legend-line.thin {
    height: 2px;
}

#profitLossLegend .legend-line.dashed {
    border-top: 2px dashed #000000;
    height: 0;
}

#profitLossLegend .legend-text {
    color: #333;
    font-size: 12px;
}

.probability-legend {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: #333;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.probability-legend .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    white-space: nowrap;
}

.probability-legend .legend-item:last-child {
    margin-bottom: 0;
}

.probability-legend .legend-bullet {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 10px;
    flex-shrink: 0;
}

.probability-legend .legend-line {
    width: 35px;
    height: 3px;
    margin-right: 10px;
    flex-shrink: 0;
}

.probability-legend .legend-text {
    color: #333;
    font-size: 12px;
}

#cursorLegend {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: #333;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    box-sizing: border-box;
}

#cursorLegend .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    white-space: nowrap;
}

#cursorLegend .legend-item:last-child {
    margin-bottom: 0;
}

#cursorLegend .legend-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

#cursorLegend .legend-text {
    color: #333;
    font-size: 12px;
}

#tableWrapper {
    position: relative;
    height: 500px;
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    border: none;
    border-radius: 4px;
    background-color: white;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#tableWrapper::-webkit-scrollbar {
    display: none;
}

#probabilityWrapper {
    position: relative;
    height: 500px;
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    border: none;
    border-radius: 4px;
    background-color: white;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#probabilityWrapper::-webkit-scrollbar {
    display: none;
}

#probabilityWrapper.has-overlay {
    overflow: hidden;
}

#stabilityWrapper.has-overlay,
#velocityWrapper.has-overlay,
#reliabilityWrapper.has-overlay {
    overflow: hidden;
}

#probabilityTableContainer {
    position: relative;
}

#probabilityChartAndSubplotsContainer {
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

#probabilityChartAndSubplotsContainer .probability-main-chart {
    min-height: 200px;
}

#probabilitySubplotsContainer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.probability-subplot {
    position: relative;
    border-top: 1px solid #ddd;
    background: #fff;
}

.probability-subplot .subplot-label {
    position: absolute;
    left: 8px;
    top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    z-index: 2;
    display: none;
}

.probability-subplot canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.probability-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.probability-overlay-text {
    color: #6c757d;
    font-style: italic;
    font-size: 14px;
    font-weight: bold;
    animation: pulse 2s ease-in-out infinite;
    cursor: pointer;
    transition: opacity 0.2s;
    text-align: center;
}

.probability-overlay-text:hover {
    opacity: 0.8;
}

.probability-overlay:hover {
    background: rgba(255, 255, 255, 0.6);
}

#stabilityWrapper,
#velocityWrapper,
#reliabilityWrapper {
    position: relative;
    height: 500px;
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    border: none;
    border-radius: 4px;
    background-color: white;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#stabilityWrapper::-webkit-scrollbar,
#velocityWrapper::-webkit-scrollbar,
#reliabilityWrapper::-webkit-scrollbar {
    display: none;
}

#stabilityTableContainer,
#velocityTableContainer,
#reliabilityTableContainer {
    position: relative;
}

#profitLossTable {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    color: #333;
    font-size: 12px;
    border: none;
    table-layout: fixed;
}

#profitLossTable thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa;
}

#profitLossTable th {
    padding: 8px 6px;
    text-align: center;
    border: none;
    font-weight: 600;
    background-color: #f8f9fa;
    color: #333;
    min-width: 90px;
    width: 90px;
}

#profitLossTable th.row-header {
    min-width: 70px;
    width: 70px;
}

#profitLossTable td {
    padding: 6px 4px;
    text-align: center;
    border: none;
    color: #333;
    background-color: white;
    min-width: 90px;
    width: 90px;
}

#profitLossTable tbody tr:hover {
    background-color: #f5f5f5;
}

#profitLossTable tbody tr[style*="dashed"] {
    border-top: 2px dashed #000 !important;
}

#profitLossTable .row-header {
    font-weight: 600;
    background-color: #f8f9fa;
    text-align: right;
    padding-right: 8px;
    color: #333;
    min-width: 70px;
    width: 70px;
}

#profitLossTable .positive-value {
    color: #28a745;
    font-weight: 500;
}

#profitLossTable .negative-value {
    color: #dc3545;
    font-weight: 500;
}

#profitLossTable .zero-value {
    color: #333;
}

.range-slider-container,
.date-slider-container,
.volatility-slider-container,
.color-distribution-slider-container,
.probability-range-filter-container {
    margin-top: 20px;
}

.range-slider-label,
.date-slider-label,
.volatility-slider-label,
.color-distribution-slider-label,
.probability-range-filter-label {
    font-size: 12px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.range-slider-label span,
.date-slider-label span,
.volatility-slider-label span {
    color: #0031FF;
    font-weight: 600;
}

.color-distribution-slider-label span,
.probability-range-filter-label span {
    color: #9c27b0;
    font-weight: 600;
}

.range-slider-wrapper,
.date-slider-wrapper,
.volatility-slider-wrapper,
.color-distribution-slider-wrapper,
.probability-range-filter-wrapper {
    position: relative;
    width: 100%;
    height: 40px;
    margin-bottom: 10px;
    padding: 0 10px;
    box-sizing: border-box;
}

.range-slider-track,
.date-slider-track,
.volatility-slider-track {
    position: relative;
    width: 100%;
    height: 6px;
    background-color: #d0d0d0;
    border-radius: 3px;
    margin-top: 17px;
}

.color-distribution-slider-track {
    position: relative;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #dc3545 0%, #ffc107 50%, #28a745 100%);
    border-radius: 3px;
    margin-top: 17px;
}

.probability-range-filter-track {
    position: relative;
    width: 100%;
    height: 6px;
    background-color: #d0d0d0;
    border-radius: 3px;
    margin-top: 17px;
}

.range-slider-fill,
.date-slider-fill,
.volatility-slider-fill {
    position: absolute;
    height: 100%;
    background-color: #0031FF;
    border-radius: 3px;
    left: 0%;
    width: 0%;
}

.range-slider-handle,
.date-slider-handle,
.volatility-slider-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border: 2px solid #0031FF;
    border-radius: 3px;
    cursor: grab;
    top: -7px;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

.color-distribution-slider-handle,
.probability-range-filter-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border: 2px solid #9c27b0;
    border-radius: 3px;
    cursor: grab;
    top: -7px;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 3;
}

.range-slider-handle:active,
.date-slider-handle:active,
.volatility-slider-handle:active,
.color-distribution-slider-handle:active,
.probability-range-filter-handle:active {
    cursor: grabbing;
}

.range-slider-handle-grip,
.date-slider-handle-grip,
.volatility-slider-handle-grip,
.color-distribution-slider-handle-grip,
.probability-range-filter-handle-grip {
    position: absolute;
    width: 2px;
    height: 10px;
    background-color: #0031FF;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 1px;
}

.color-distribution-slider-handle-grip,
.probability-range-filter-handle-grip {
    background-color: #9c27b0;
}

.range-slider-labels,
.date-slider-labels,
.volatility-slider-labels,
.color-distribution-slider-labels,
.probability-range-filter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.color-distribution-slider-value,
.probability-range-filter-value {
    font-weight: 600;
    color: #9c27b0;
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    h1 {
        display: block;
        gap: 0;
    }

    .help-tooltip {
        left: 50%;
        transform: translateX(-50%);
    }

    .help-tooltip::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .calculator-form {
        grid-template-columns: 1fr;
    }

    .container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .chart-wrapper {
        height: 70vh;
        max-height: 70vh;
    }

    #tableWrapper {
        height: 70vh;
        max-height: 70vh;
    }

    #probabilityWrapper {
        height: 70vh;
        max-height: 70vh;
    }

    #profitLossTable .row-header,
    #profitLossTable th.row-header {
        min-width: 70px;
        width: 70px;
        padding-right: 4px;
        font-size: 11px;
    }

    #profitLossTable td,
    #profitLossTable th {
        min-width: 70px;
        width: 70px;
        font-size: 11px;
    }

    .results-table .row-header,
    .results-table th.row-header {
        min-width: 70px;
        width: 70px;
        padding-right: 4px;
        font-size: 11px;
    }

    .results-table td,
    .results-table th {
        min-width: 70px;
        width: 70px;
        font-size: 11px;
    }

    #viewToggleBtn,
    #profitLossToggleBtn,
    #probabilityToggleBtn {
        padding: 6px 10px !important;
        font-size: 14px !important;
        min-width: 120px !important;
        height: 38px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #viewToggleBtn i {
        font-size: 11px !important;
    }

    #viewToggleBtn span {
        font-size: 14px !important;
    }

    #resetModifiersBtn,
    #profitLossDisplayToggleBtn {
        padding: 6px 10px !important;
        font-size: 11px !important;
        height: 38px !important;
    }
}
