body {
    margin: 0;
    background-color: #111;
    color: white;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    overflow: hidden;
}
#container {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}
#left-panel {
    width: 320px;
    min-width: 280px;
    max-width: 420px;
    height: 100vh;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.65);
    border-right: 1px solid rgba(255,255,255,0.08);
    box-sizing: border-box;
    padding: 10px;
    z-index: 3;
}
#main-vis {
    flex: 1;
    position: relative;
    overflow: hidden; /* keep player controls within center panel */
    z-index: 2;
}
#renderer-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1; /* behind panels */
    pointer-events: none; /* let center UI receive interactions; controls attach to center panel */
}
#plots-container {
    flex: 0.5; /* 50% of previous (0.66 -> 0.33) */
    display: flex;
    flex-direction: row;
    background-color: rgba(0, 0, 0, 0.65); /* match left panel translucency */
    padding: 10px;
    box-sizing: border-box;
    z-index: 3;
    border-left: 1px solid rgba(255,255,255,0.08); /* subtle separator like left panel */
}
.plot-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0 5px;
}
.plot-wrapper {
    flex: 1;
    min-height: 0;
}
#info { display: none; }
#legend {
    margin-top: 10px;
    font-size: 12px;
}
.legend-section {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 3px 0;
}
.legend-text { color: #ddd; }
.legend-line {
    display: inline-block;
    width: 28px;
    height: 0;
    border-top-width: 2px;
    border-top-style: solid;
    border-top-color: #ccc;
}
.legend-line.dashed { border-top-style: dashed; }
.legend-line.solid { border-top-style: solid; }
.legend-line.dashdot {
    border-top: none;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        currentColor 0 6px,
        transparent 6px 10px,
        currentColor 10px 12px,
        transparent 12px 16px
    );
}
.legend-colors { gap: 10px; }
.legend-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 3px;
}
.legend-color.x { background-color: #ff0000; }
.legend-color.y { background-color: #00ff00; }
.legend-color.z { background-color: #0000ff; }
.legend-axis-label { margin-right: 8px; color: #ddd; }
.legend-note { color: #aeb6c2; font-size: 11px; margin-top: 6px; }

/* Modern player controls at bottom center */
.player-controls {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(720px, 92%);
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    padding: 10px 12px;
    border-radius: 12px;
    backdrop-filter: blur(6px);
    z-index: 4;
}
.play-pause-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #006896, #0091c7);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 999px;
}
.play-pause-btn .icon { pointer-events: none; }
.play-pause-btn .icon-play { display: block; }
.play-pause-btn .icon-pause { display: none; }
.play-pause-btn.playing .icon-play { display: none; }
.play-pause-btn.playing .icon-pause { display: block; }

.timeline-slider {
    flex: 1 1 auto;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #30343a;
    outline: none;
    border-radius: 999px;
}
.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #00a3ff;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #cfefff22;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.timeline-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #00a3ff;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #cfefff22;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.time-label {
    font-size: 12px;
    color: #d5dde8;
    min-width: 120px;
    text-align: right;
}

#site-logo {
    display: block;
    max-height: 75px;
    margin-bottom: 8px;
}

/* Logo row with config button */
#logo-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
#logo-row #site-logo { margin: 0; max-height: 60px; }
.config-btn {
    background: linear-gradient(135deg, #006896, #0091c7);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}
.config-btn:hover { filter: brightness(1.08); }

/* View toggle below logo */
.view-toggle { display: inline-flex; border: 1px solid #1f242b; border-radius: 10px; overflow: hidden; margin: 6px 0 10px 0; }
.view-toggle .toggle-segment {
    background: #0f1318;
    color: #aeb6c2;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 600;
}
.view-toggle .toggle-segment + .toggle-segment { border-left: 1px solid #1f242b; }
.view-toggle .toggle-segment.active { background: linear-gradient(135deg, #0b2a3a, #123244); color: #e6eefc; }

/* Tabs for left panel */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid #1f242b; margin: 8px 0 12px 0; overflow-x: auto; }
.tab { background: transparent; border: none; color: #aeb6c2; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500; border-top-left-radius: 8px; border-top-right-radius: 8px; }
.tab:hover { color: #e6eefc; }
.tab.active { color: #ffffff; border-bottom-color: #006896; background: #12161b; }
.panels { padding-top: 4px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }