* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent
}

body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #000;
    overflow: hidden;
    height: 100dvh;
}

.scanner-container {
    height: 100dvh;
    position: relative
}

.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, .8);
    color: #fff;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20
}

.header h1 {
    margin: 0;
    font-size: 1.2rem
}

.logout-btn {
    background: #dc3545;
    border: none;
    color: #fff;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: .9rem;
    cursor: pointer
}

#scanner {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000
}

#scanner video {
    width: 100%;
    height: 100%;
    object-fit: cover
}

canvas.drawingBuffer {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none
}

.scan-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 140px;
    border: 3px solid rgba(255, 255, 255, .5);
    border-radius: 10px;
    pointer-events: none;
    z-index: 11
}

.scan-guide::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -20px;
    right: -20px;
    height: 2px;
    background: rgba(255, 255, 255, .8);
    transform: translateY(-50%)
}

#output {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    margin: 0
}

.success {
    background: rgba(40, 167, 69, .2);
    color: #28a745
}

.error {
    background: rgba(220, 53, 69, .2);
    color: #dc3545
}

.warning {
    background: rgba(255, 193, 7, .2);
    color: #ffc107
}

.excel-status {
    position: absolute;
    top: 60px;
    left: 10px;
    right: 10px;
    padding: 8px;
    border-radius: 5px;
    font-size: .85rem;
    text-align: center;
    z-index: 20
}

.loading {
    background: rgba(240, 240, 240, .9);
    color: #666
}

.loaded {
    background: rgba(212, 237, 218, .9);
    color: #155724
}

.error-status {
    background: rgba(248, 215, 218, .9);
    color: #721c24
}
.result-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,.95) !important;
    color: #000;
    padding: 20px;
    transform: translateY(110%);
    transition: transform .3s ease, visibility .3s ease;
    visibility: hidden;
    pointer-events: none;
}

.result-overlay.show {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}