html, body {
    margin: 0;
    height: 100%;
    font-family: Arial, sans-serif;
    overflow: clip;
}

#toolbar {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: #ffffff;
    
    border-radius: 4px;
    color: #d1d4dc;
    align-items: center;
    box-sizing: border-box;
}

    #toolbar input, #toolbar button {
        padding: 6px 10px;
    }
/* chart type picker */
.chart-type-picker {
    position: relative;
}

#chartTypeBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    padding: 0;
    background: #ffffff;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    cursor: pointer;
}

    #chartTypeBtn svg {
        display: block;
        color: #000000;
    }

.chart-type-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    min-width: 210px;
    background: #1e222d;
    border: 1px solid #434651;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    overflow: hidden;
}

    .chart-type-menu.hidden {
        display: none;
    }

.chart-type-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #d1d4dc;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}

    .chart-type-item:hover, .chart-type-item.active {
        background: #2a2e39;
        color: #ffffff;
    }

    .chart-type-item svg {
        flex: 0 0 18px;
        color: #d1d4dc;
    }
/* indicator picker */
.indicator-picker {
    position: relative;
}

#indicatorBtn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 10px;
    background: #ffffff;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    color: #000000;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.indicator-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    min-width: 190px;
    background: #1e222d;
    border: 1px solid #434651;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    overflow: hidden;
}

    .indicator-menu.hidden {
        display: none;
    }

.indicator-separator {
    height: 1px;
    background: #2a2e39;
    margin: 2px 0;
}

.indicator-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: #d1d4dc;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    box-sizing: border-box;
}

    .indicator-item:hover {
        background: #2a2e39;
        color: #ffffff;
    }

    .indicator-item .check {
        width: 14px;
        text-align: center;
        color: #d1d4dc;
        font-size: 12px;
    }

#chart {
    width: 100%;
    height: calc(100% - 42px);
    position: relative;
}

#ohlcLegend {
    position: absolute;
    top: 6px;
    left: 10px;
    z-index: 10;
    font-size: 12px;
    font-family: Arial, sans-serif;
    color: #333333;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    #ohlcLegend .legend-row {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    #ohlcLegend span {
        white-space: nowrap;
    }

    #ohlcLegend .lbl {
        color: #555555;
    }

#timeRangeBar {
    position: absolute;
    bottom: 28px;
    left: 50px;
    z-index: 10;
    display: flex;
    gap: 2px;
    background: #ffffff;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    padding: 2px;
}

.range-btn {
    padding: 3px 8px;
    border: none;
    background: transparent;
    color: #000000;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    line-height: 1.4;
}

    .range-btn:hover {
        background: #2a2e39;
        color: #ffffff;
    }

    .range-btn.active {
        background: #2962ff;
        color: #ffffff;
    }

    .range-btn:disabled,
    #chartTypeBtn:disabled,
    #indicatorBtn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

        .range-btn:disabled:hover {
            background: transparent;
            color: #d1d4dc;
        }

    .range-btn.active:disabled {
        opacity: 1;
        background: #2962ff;
        color: #ffffff;
    }

body.chart-busy #chartTypeMenu,
body.chart-busy #indicatorMenu {
    display: none !important;
}

#error {
    color: #ef5350;
}
