* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: #000000;
    overflow: hidden;
    color: #ffffff;
}

.viewport-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    background-color: #000000;
}

.telemetry-header {
    width: 100%;
    text-align: left;
    margin-bottom: 10px;
}

.telemetry-header h2 {
    color: #00ffaa;
    font-size: 1.2rem;
    letter-spacing: 2px;
    display: inline-block;
}

.telemetry-header .sub-header {
    color: #8a8a93;
    font-size: 0.8rem;
    margin-top: 4px;
}

.status-indicator.live {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #00ffaa;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px #00ffaa;
}

.capture-matrix {
    position: relative;
    width: 100%;
    max-width: 640px;
    height: 55vh;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background-color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#camera-stream {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.corner {
    position: absolute;
    width: 25px;
    height: 25px;
    border: 2px solid #00ffaa;
    z-index: 10;
}
.top-left { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.top-right { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.bottom-left { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.bottom-right { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.control-bar {
    width: 100%;
    max-width: 640px;
    background-color: #1F1F23;
    border: 1px solid #28282D;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 20;
}

.control-dropdown {
    background-color: #000000;
    color: #00ffaa;
    border: 1px solid #28282D;
    padding: 8px 12px;
    font-size: 0.8rem;
    width: 100%;
    max-width: 300px;
    text-align: center;
    outline: none;
}

.control-dropdown.persona-accent {
    color: #ffffff;
    border-color: #00ffaa;
}

.shutter-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid #00ffaa;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 5px;
}

.shutter-btn:active {
    background-color: rgba(0, 255, 170, 0.2);
}

.shutter-icon {
    width: 24px;
    height: 18px;
    background-color: transparent;
    border: 2px solid #00ffaa;
    border-radius: 3px;
    position: relative;
}

.shutter-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 6px;
    width: 8px;
    height: 4px;
    background-color: #00ffaa;
}

.target-readout {
    font-size: 0.7rem;
    color: #8a8a93;
    letter-spacing: 1px;
    text-align: center;
    margin-top: 5px;
}

.scanner-line {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to bottom, rgba(0, 255, 170, 0), rgba(0, 255, 170, 1));
    box-shadow: 0 0 12px #00ffaa, 0 0 4px #00ffaa;
    z-index: 5;
}

.scanner-line.active {
    display: block;
    animation: laserScan 2.0s infinite linear;
}

@keyframes laserScan {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

/* ==========================================================================
   HIGH-IMPACT MOBILE OVERRIDE (CRITICAL FOR THRIFT-STORE ENVIRONMENT)
   ========================================================================== */
@media screen and (max-width: 768px) {
    .viewport-container {
        padding: 0;
    }

    .telemetry-header {
        position: absolute;
        top: 0;
        left: 0;
        padding: 15px;
        z-index: 30;
        background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0));
        pointer-events: none;
    }

    .capture-matrix {
        height: 100vh;
        max-width: 100%;
        border: none;
    }

    .control-bar {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        background: linear-gradient(to top, rgba(18,18,20,1) 75%, rgba(18,18,20,0.4) 100%);
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 0;
        padding: 20px 15px env(safe-area-inset-bottom) 15px;
    }
    
    .corner {
        display: none;
    }
}