:root {
    color-scheme: dark;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #0b0f15;
    color: #edf2f7;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(
            circle at top,
            #172236,
            #0b0f15 48%
        );
}

button,
input,
select,
.button {
    font: inherit;
}

.page {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 24px;

    display: flex;
    flex-direction: column;
    gap: 24px;
}

.panel,
.displayPanel,
.cameraPanel {
    padding: 24px;

    border: 1px solid #2a3441;
    border-radius: 16px;

    background: rgba(18, 24, 33, 0.96);
}

.headerRow {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;
}

h1,
h2 {
    margin-top: 0;
}

p {
    color: #afbac7;
    line-height: 1.55;
}

.controls {
    display: flex;
    flex-wrap: wrap;

    align-items: end;

    gap: 16px;

    margin-top: 22px;
}

.controls label {
    display: flex;
    flex-direction: column;
    gap: 7px;

    min-width: 150px;

    color: #c9d4df;
}

input,
select {
    min-height: 42px;

    padding: 9px 11px;

    border: 1px solid #344050;
    border-radius: 9px;

    background: #0b0f15;
    color: #edf2f7;
}

input[type="number"] {
    width: 120px;
}

button,
.button {
    display: inline-flex;

    min-height: 42px;

    align-items: center;
    justify-content: center;

    padding: 9px 16px;

    border: 1px solid transparent;
    border-radius: 9px;

    background: #238636;
    color: white;

    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    filter: brightness(1.1);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.button.secondary {
    background: #202833;
    border-color: #344050;
}

.button.download {
    margin-top: 22px;
    background: #1f6feb;
}

.buttonRow {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 18px;
}

.status {
    min-height: 46px;

    margin-top: 20px;
    padding: 12px;

    border: 1px solid #344050;
    border-radius: 9px;

    background: #0b0f15;
}

.statsGrid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(170px, 1fr)
        );

    gap: 12px;

    margin-top: 20px;
}

.statsGrid > div {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 4px;

    padding: 12px;

    border: 1px solid #2a3441;
    border-radius: 9px;

    background: #0b0f15;

    overflow-wrap: anywhere;
}

.statLabel {
    color: #8996a6;
    font-size: 0.8rem;
}

.mono {
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 0.82rem;
}

.displayPanel {
    min-height: 500px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    background: #000000;
}

.displayPanel:fullscreen {
    width: 100vw;
    height: 100vh;

    padding: 0;

    border: 0;
    border-radius: 0;

    background: #000000;
}

.qrWrap {
    display: flex;

    align-items: center;
    justify-content: center;

    max-width: 100%;
}

#qrCanvas {
    display: block;

    max-width: min(90vw, 90vh, 1200px);
    max-height: min(90vw, 90vh, 1200px);

    width: auto;
    height: auto;

    image-rendering: pixelated;

    background: #ffffff;
}

.frameInfo {
    display: flex;
    gap: 10px;

    margin-top: 12px;

    color: #aab5c1;
}

.displayPanel:fullscreen .frameInfo {
    position: fixed;

    left: 14px;
    bottom: 12px;

    padding: 6px 10px;

    border-radius: 7px;

    background: rgba(0, 0, 0, 0.72);
}

.progressOuter {
    width: 100%;
    height: 14px;

    margin-top: 20px;

    overflow: hidden;

    border: 1px solid #344050;
    border-radius: 999px;

    background: #0b0f15;
}

.progressBar {
    width: 0;
    height: 100%;

    background: #238636;

    transition: width 0.12s linear;
}

#cameraContainer {
    position: relative;

    width: min(960px, 100%);

    aspect-ratio: 16 / 9;

    margin: 0 auto;

    overflow: hidden;

    border-radius: 12px;

    background: #000000;
}

#cameraVideo,
#overlayCanvas {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;
}

#cameraVideo {
    object-fit: fill;
}

#overlayCanvas {
    pointer-events: none;
}

.cameraHint {
    position: absolute;

    left: 50%;
    bottom: 12px;

    transform: translateX(-50%);

    padding: 7px 11px;

    border-radius: 8px;

    background: rgba(0, 0, 0, 0.68);
    color: white;

    white-space: nowrap;

    pointer-events: none;
}

.hidden {
    display: none !important;
}

@media (max-width: 720px) {
    .page {
        padding: 12px;
    }

    .panel,
    .displayPanel,
    .cameraPanel {
        padding: 15px;
    }

    .headerRow {
        flex-direction: column;
    }

    .headerRow .button {
        width: 100%;
    }

    .controls {
        align-items: stretch;
    }

    .controls label {
        width: 100%;
    }

    .buttonRow {
        width: 100%;
    }

    .buttonRow button {
        flex: 1;
    }

    #cameraContainer {
        aspect-ratio: 4 / 3;
    }
}

.bandResults {
    display: flex;
    flex-direction: column;
    gap: 8px;

    margin-top: 14px;
}

.bandResultRow {
    padding: 10px 12px;

    border: 1px solid #2a3441;
    border-radius: 9px;

    background: #0b0f15;
    color: #c6d0db;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 0.86rem;
}

/* Serverless File Transfer landing/navigation additions */
.heroPanel {
    padding-block: 36px;
}

.heroCopy {
    max-width: 760px;
    font-size: 1.08rem;
}

.eyebrow {
    margin: 0 0 8px;
    color: #8db9ff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.choiceGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.transferChoice {
    display: flex;
    min-height: 290px;
    flex-direction: column;
    justify-content: space-between;
}

.choiceButtons,
.modeNav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modeNav {
    margin-top: 0;
}

@media (max-width: 760px) {
    .choiceGrid {
        grid-template-columns: 1fr;
    }

    .choiceButtons .button,
    .modeNav .button {
        width: 100%;
    }
}
