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

body {
    background: #131722;
    color: #d1d4dc;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    padding: 10px 16px;
    background: #1e222d;
    border-bottom: 1px solid #2a2e39;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

header h1 {
    font-size: 16px;
    font-weight: 600;
    color: #e1e3e8;
}

header .trade-meta {
    font-size: 12px;
    color: #787b86;
    display: flex;
    gap: 14px;
}

header .trade-meta span.loss {
    color: #f44336;
    font-weight: 600;
}

header .trade-meta span.win {
    color: #4caf50;
    font-weight: 600;
}

.timeframe-selector {
    display: flex;
    gap: 4px;
    background: #1e222d;
    padding: 4px;
    border-radius: 6px;
}

.timeframe-selector button {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #787b86;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeframe-selector button:hover {
    color: #d1d4dc;
    background: #2a2e39;
}

.timeframe-selector button.active {
    color: #ffffff;
    background: #2962ff;
}

.chart-wrapper {
    flex: 1;
    position: relative;
    background: #131722;
    min-height: 0;
}

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

.unavailable-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(19, 23, 34, 0.88);
    color: #787b86;
    font-size: 13px;
    font-weight: 500;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}

.unavailable-overlay.visible {
    display: flex;
}

.unavailable-overlay span.icon {
    font-size: 28px;
    opacity: 0.5;
}

.unavailable-overlay span.message {
    text-align: center;
    max-width: 80%;
}

/* Header controls */
#broker-select {
    margin-left: auto;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #d1d4dc;
    background: #2a2e39;
    border: 1px solid #363a45;
    border-radius: 4px;
    cursor: pointer;
}

#btn-load-csv,
#btn-refresh {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #d1d4dc;
    background: #2a2e39;
    border: 1px solid #363a45;
    border-radius: 4px;
    cursor: pointer;
}

#csv-status {
    font-size: 11px;
    color: #4caf50;
    display: none;
}
