:root {
    /* === LIGHT ENTERPRISE THEME === */

    /* Background Colors */
    --bg-primary: #F3F4F6;
    /* Light gray app background */
    --bg-secondary: #FFFFFF;
    /* White panels/cards */
    --bg-tertiary: #E5E7EB;
    /* Subtle contrast areas */

    /* Text Colors */
    --text-primary: #1F2937;
    /* Dark gray - high contrast */
    --text-secondary: #6B7280;
    /* Medium gray */
    --text-muted: #9CA3AF;
    /* Light gray muted */

    /* Accent Colors (from Structurize Logo) */
    --accent-blue: #0696D7;
    /* Primary blue/teal */
    --accent-blue-gradient: linear-gradient(135deg, #0696D7, #0077B6);
    --accent-teal: #0CC0DF;
    /* Bright teal */
    --accent-green: #10B981;
    /* Success/installed */
    --accent-green-dark: #059669;
    --accent-green-gradient: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --accent-orange: #F36C25;
    /* Procore-style warning */

    /* Components */
    --card-bg: #FFFFFF;
    --card-border: #E2E8F0;
    --card-border-active: #0696D7;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --hud-bg: rgba(255, 255, 255, 0.95);
    --hud-blur: 12px;

    /* Typography */
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: monospace;
}

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-stack);
    background: var(--bg-primary);
    color: var(--text-primary);
    touch-action: none;
}

/* UI Utilities */
.hud-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: max(12px, env(safe-area-inset-top)) 12px 12px 12px;
    -webkit-backdrop-filter: blur(var(--hud-blur));
    backdrop-filter: blur(var(--hud-blur));
    z-index: 10;
    transform: translateZ(0);
    pointer-events: none;
    /* Pass through clicks to canvas */
}

/* Enable pointer events for interactive children */
.hud-header,
.hud-status,
#fileList,
.file-card,
button {
    pointer-events: auto !important;
}

/* === TABLET SCALING (50% larger) === */
@media (min-width: 768px) {
    .hud-panel {
        padding: max(18px, env(safe-area-inset-top)) 18px 18px 18px;
    }

    .hud-header {
        gap: 15px;
    }

    /* Logo and brand */
    .hud-header img {
        height: 45px !important;
    }

    .hud-header span {
        font-size: 15px !important;
    }

    /* Dropdowns and buttons */
    .hud-select,
    #roleSelect,
    #intentSelect {
        font-size: 18px !important;
        padding: 12px 18px !important;
    }

    .btn-primary,
    #sensorBtn {
        font-size: 16px !important;
        padding: 9px 18px !important;
    }

    /* Coordinates and compass */
    #coords,
    #compass {
        font-size: 18px !important;
    }

    /* Settings gear */
    .settings-gear svg {
        width: 27px !important;
        height: 27px !important;
    }

    .hud-status {
        gap: 18px;
        font-size: 18px;
    }
}

/* === TAG/DISCIPLINE BADGE STYLING === */
.csi-tag,
.discipline-tag,
.file-card .file-meta {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    font-weight: 600;
}

.file-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 3px solid #9CA3AF;
    padding: 8px 10px;
    min-width: 120px;
    flex: 1 1 0;
    font-size: 11px;
    opacity: 0.9;
    transition: all 0.25s ease;
    border-radius: 6px;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
}

.file-card.active {
    background: var(--accent-green-gradient);
    border-left: 3px solid var(--accent-green);
    opacity: 1.0;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.3);
    color: #FFFFFF;
}

.file-card .file-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card .file-meta {
    font-size: 9px;
    color: var(--text-secondary);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controls */
button.btn-primary {
    padding: 6px 12px;
    font-size: 11px;
    background: var(--accent-blue-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s;
}

button.btn-primary:hover {
    transform: scale(1.05);
}

button.btn-primary.active {
    background: linear-gradient(135deg, var(--accent-green-dark), #009624);
}

input[type=range] {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    height: 24px;
    cursor: pointer;
}

input[type=range]::-webkit-slider-track {
    background: var(--bg-tertiary);
    height: 6px;
    border-radius: 3px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #4FC3F7;
    border-radius: 50%;
    margin-top: -6px;
}

/* Canvas */
canvas.full-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #FFFFFF;
}