.barcode-scanner {
    position: fixed;
    inset: 0;
    z-index: 1500;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: Roboto, Arial, sans-serif;
}

.barcode-scanner-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.barcode-scanner-still {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.barcode-scanner-guide {
    position: absolute;
    left: 10%;
    top: 37%;
    width: 80%;
    height: 26%;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 4px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

.barcode-scanner-highlight {
    position: absolute;
    box-sizing: border-box;
    border: 4px solid #53e876;
    border-radius: 6px;
    box-shadow: 0 0 0 2px #173e21, 0 0 18px #53e876;
    pointer-events: none;
}

.barcode-scanner-highlight[hidden] { display: none; }

.barcode-scanner-flash {
    position: absolute;
    top: calc(16px + env(safe-area-inset-top));
    right: 16px;
    padding: 8px 16px;
    border: 0;
    border-radius: 5px;
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    font-size: 14px;
}

.barcode-scanner-flash:disabled { opacity: .6; }

.barcode-scanner-settings-button {
    position: absolute;
    top: calc(16px + env(safe-area-inset-top));
    left: 16px;
    width: 40px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    color: #fff;
    background: rgba(0, 0, 0, .65);
    font-size: 22px;
    line-height: 36px;
}

.barcode-scanner-settings {
    position: absolute;
    top: calc(60px + env(safe-area-inset-top));
    right: 16px;
    left: 16px;
    max-height: calc(100dvh - 160px);
    overflow: auto;
    padding: 14px;
    border-radius: 6px;
    color: #fff;
    background: rgba(0, 0, 0, .94);
    z-index: 1;
}

.barcode-scanner-settings-heading { display: flex; justify-content: space-between; align-items: center; }
.barcode-scanner-settings-heading button { background: transparent; border: 0; color: #fff; font-size: 24px; padding: 0 4px; }
.barcode-scanner-settings select { color: #111; background: #fff; }

.barcode-scanner-footer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    background: #000;
}

.barcode-scanner-status {
    display: block;
    min-height: 20px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 14px;
}

.barcode-scanner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 12px;
}

.barcode-scanner-actions button,
.barcode-scanner-actions span {
    display: block;
    min-height: 44px;
    border: 0;
    border-radius: 5px;
    background: #f5f5f5;
    color: #111;
    font-size: 15px;
    text-align: center;
    line-height: 44px;
}

.barcode-scanner-actions span {
    background: #222;
    color: #fff;
}

/* Match the PWA camera page: preview above a separate black control bar. */
.barcode-scanner--component {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.barcode-scanner--component .barcode-scanner-viewport {
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.barcode-scanner--component .barcode-scanner-status {
    position: absolute;
    right: 16px;
    bottom: 16px;
    left: 16px;
    min-height: 0;
    margin: 0;
    padding: 6px 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 14px;
}

.barcode-scanner--component .barcode-scanner-footer {
    position: relative;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    background: #000;
}

.barcode-scanner--component .barcode-scanner-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 5px;
    background: #f5f5f5;
    color: #111;
    font: 15px Roboto, Arial, sans-serif;
    line-height: normal;
}

.barcode-scanner--component .barcode-scanner-actions button:disabled {
    opacity: .55;
}
