:root {
    --station-panel-width: 30vw;
    --station-panel-chart-height: 20vh;
    --station-panel-mobile-height: 45vh;
    --mobile-breakpoint: 1200;
    --background-color-dark: #111;
    --text-color-light: #eee;
    --text-color-light-secondary: #aaa;
}

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

body {
    font-family: system-ui, sans-serif;
    background: var(--background-color-dark);
    color: var(--text-color-light);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    padding: 0.75rem 1.25rem;
    background: var(--background-color-dark);
    border-bottom: 1px solid var(--background-color-dark);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

#main-content {
    display: flex;
    flex: 1;
    min-height: 0;
}

#map {
    flex: 1;
    min-width: 0;
}

/* ---- Station panel ---- */

#main-content {
    position: relative;
}

#station-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--station-panel-width);
    background: var(--background-color-dark);
    border-left: 1px solid var(--background-color-dark);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

#station-panel.open {
    transform: translateX(0);
}

#station-panel-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--background-color-dark);
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

#station-panel-close {
    display: block;
    background: none;
    border: none;
    color: var(--text-color-light-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

#station-panel-title {
    font-size: 1rem;
    font-weight: 600;
}

#station-panel-subtitle {
    font-size: 0.75rem;
    color: var(--text-color-light-secondary);
    margin-top: 0.25rem;
}

#station-panel-measured-at {
    font-size: 0.75rem;
    color: var(--text-color-light-secondary);
    margin-top: 0.25rem;
}

#station-panel-body {
    overflow-y: auto;
    padding: 1rem 1rem;
    flex: 1;
    font-size: 1rem;
    text-align: center;
}

.channel-block {
    margin-bottom: 1rem;
}

.channel-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color-light);
    margin-bottom: 0.25rem;
}

.channel-canvas {
    display: block;
    width: 100%;
    height: var(--station-panel-chart-height);
    background: var(--background-color-dark);
}

/* ---- Mobile: bottom drawer ---- */

/* Value must match --mobile-breakpoint in :root */
@media (max-width: 1200px) {
    #station-panel {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: var(--station-panel-mobile-height);
        border-left: none;
        border-top: 1px solid #333;
        transform: translateY(100%);
    }

    #station-panel.open {
        transform: translateY(0);
    }

    #station-panel-body {
        -webkit-overflow-scrolling: touch;
        margin: 0 auto;
        width: 75vw;
    }
}

/* ---- Cluster marker overrides ---- */
.marker-cluster-small,
.marker-cluster-small div {
    background-color: #2a8a9a;
}

.marker-cluster-medium,
.marker-cluster-medium div {
    background-color: #2a4a8a;
}

.marker-cluster-large,
.marker-cluster-large div {
    background-color: #5a2a8a;
}

.marker-cluster {
    color: var(--text-color-light);
    font-weight: 600;
}
