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

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

/* --- Controls Bar --- */
.controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #12121f;
    border-bottom: 1px solid #1a1a2e;
    flex-shrink: 0;
}

.controls label {
    font-size: 13px;
    color: #888;
}

.controls select {
    background: #1a1a2e;
    color: #ccc;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    min-width: 180px;
}

.controls button {
    background: #1a1a2e;
    color: #ccc;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.controls button:hover:not(:disabled) {
    background: #252540;
}

.controls button:disabled {
    opacity: 0.4;
    cursor: default;
}

.controls button.start {
    border-color: #4caf50;
    color: #4caf50;
}

.controls button.stop {
    border-color: #f44336;
    color: #f44336;
}

.controls .spacer {
    flex: 1;
}

/* --- Viz Panels --- */
.viz-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 4px;
    gap: 4px;
}

.viz-panel {
    position: relative;
    background: #0d0d1a;
    border: 1px solid #1a1a2e;
    border-radius: 4px;
    overflow: hidden;
}

.viz-panel canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.viz-panel .label {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 11px;
    color: #555;
    pointer-events: none;
    z-index: 1;
}

.panel-top { flex: 3; }
.panel-bottom { flex: 2; }

#view-select {
    min-width: 100px;
}

/* --- Status Bar --- */
.status-bar {
    display: flex;
    align-items: center;
    padding: 4px 12px;
    background: #12121f;
    border-top: 1px solid #1a1a2e;
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
}

/* --- Detection Flash --- */
.detection-flash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.1s;
}

.detection-flash.active {
    opacity: 1;
    border: 3px solid #4caf50;
    animation: flash-fade 0.8s ease-out forwards;
}

@keyframes flash-fade {
    0% { opacity: 1; border-color: #4caf50; }
    100% { opacity: 0; border-color: transparent; }
}

/* --- Hidden file input --- */
#file-input {
    display: none;
}
