* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: #f4f5f7;
    color: #1b1e23;
}

.app-header {
    background: #1b1e23;
    color: #fff;
    padding: 16px 20px;
}

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

.app-main {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    max-width: 480px;
}

.notice {
    background: #fff4e5;
    border: 1px solid #f0c36d;
    color: #7a5200;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.video-wrap {
    width: 100%;
    max-height: 60vh;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    position: relative;
    display: none;
}

/* Quagga2 injects its own <video> and overlay <canvas> elements into this
   container; both need to be stacked and scaled to fill it. */
.video-wrap video,
.video-wrap canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.controls {
    display: flex;
    gap: 10px;
    margin: 14px 0;
}

button {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #2563eb;
    color: #fff;
}

button:disabled {
    background: #b9c2d0;
    cursor: not-allowed;
}

#stopScanBtn {
    background: #dc2626;
}

.status {
    min-height: 1.2em;
    font-size: 0.9rem;
    color: #4b5563;
}

.form-group {
    margin-top: 12px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

#barcodeResult {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
}
