:root {
    color-scheme: dark;
    --paper: #0d1421;
    --panel: #172438;
    --line: #4c617a;
    --text: #f5f7fb;
    --muted: #b6c6dc;
    --mint: #85f0c5;
    font-family: system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: radial-gradient(ellipse at top right, #1a3444, var(--paper) 60%); min-height: 100vh; }
a { color: var(--mint); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #9fe3ff; outline-offset: 3px; }
.masthead { display: flex; align-items: center; gap: 1.1rem; padding: 1rem clamp(1rem, 4vw, 4rem); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.25rem; }
.badge { border: 1px solid var(--line); border-radius: 2rem; padding: .2rem .55rem; color: var(--muted); font-size: .82rem; }
.operator, .guest { max-width: 108rem; margin: 0 auto; padding: clamp(1rem, 3.4vw, 4rem); }
.intro { margin-bottom: 1.1rem; }
.guest-heading { text-align: center; max-width: 58rem; margin: 0 auto 1rem; }
.eyebrow { color: var(--mint); text-transform: uppercase; font-weight: 800; font-size: .78rem; letter-spacing: .14em; margin: 0 0 .6rem; }
h1 { font-size: clamp(2.1rem, 5vw, 4.6rem); line-height: 1.04; margin: 0 0 .6rem; overflow-wrap: anywhere; }
h2 { margin: 0 0 .65rem; font-size: clamp(1.25rem, 2.4vw, 1.8rem); }
p { line-height: 1.55; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 2vw, 1.65rem); min-width: 0; }
.panel p { margin: .5rem 0 1rem; overflow-wrap: anywhere; }
.hint, .status { color: var(--muted); font-size: .95rem; min-height: 1.5em; }
.status[data-error="true"] { color: #ffb2a6; }
.operator-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; margin-top: 1rem; align-items: start; }
.selectors, .field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
label { display: grid; gap: .4rem; font-weight: 650; min-width: 0; }
fieldset label, #pb-pairing label { margin-bottom: .8rem; }
input, select, textarea, button, .button { font: inherit; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 2.75rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--paper); color: var(--text); }
textarea { resize: vertical; }
.brief-actions, #pb-backdrop-import { margin-top: .7rem; }
input[type="color"] { max-width: 6rem; }
input[type="checkbox"] { width: 1.3rem; height: 1.3rem; accent-color: var(--mint); }
button, .button {
    display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 44px;
    border: 1px solid var(--line); border-radius: .55rem; padding: .55rem .85rem; font-weight: 700;
    background: var(--paper); color: var(--text); text-decoration: none; cursor: pointer;
}
button:not(:disabled):hover, .button:hover { border-color: var(--mint); }
button:disabled, fieldset:disabled { opacity: .6; cursor: default; }
.primary { background: var(--mint); color: #101d21; border-color: var(--mint); }
.actions, .slots { display: flex; gap: .65rem; flex-wrap: wrap; }
.station-list { list-style: none; padding: 0; margin-bottom: 0; }
.station-list li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; align-items: center; padding-block: .5rem; border-top: 1px solid var(--line); }
#pb-pairing { margin: .8rem 0; }
#pb-welcome { max-width: 42rem; margin-inline: auto; }
.check { display: flex; gap: .6rem; align-items: center; margin: .8rem 0; }
.check input { flex: none; }
.capture-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, .45fr); gap: 1rem; align-items: start; }
.camera-stage { background: #070c13; position: relative; border-radius: 1rem; border: 1px solid var(--line); overflow: hidden; }
.camera-stage video { width: 100%; height: clamp(14rem, 48vh, 48rem); object-fit: contain; display: block; }
.camera-stage video.mirror { transform: scaleX(-1); }
.frame-guide {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    pointer-events: none; border: 2px solid var(--mint); border-radius: .35rem;
    box-shadow: 0 0 0 100vmax #07111b66, inset 0 0 0 1px #07111b;
}
.countdown { position: absolute; inset: 0; display: grid; place-content: center; background: #07111b8c; font-weight: 850; font-size: clamp(5rem, 20vw, 12rem); }
.capture-controls > * + * { margin-top: .7rem; }
.slots button[aria-pressed="true"] { border-color: var(--mint); color: var(--mint); }
.scene-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6rem), 1fr)); gap: .45rem; }
.scene-choices button { flex-direction: column; gap: .3rem; overflow-wrap: anywhere; }
.scene-choices button[aria-pressed="true"] { border-color: var(--mint); color: var(--mint); }
.scene-choices img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .35rem; }
.review { max-width: 57rem; margin-inline: auto; text-align: center; }
.review img { height: auto; width: auto; max-width: 100%; max-height: 56vh; border: 1px solid var(--line); margin-bottom: .8rem; }
.review .actions { justify-content: center; }
.deliveries { margin-top: 1rem; }
.delivery-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .65rem; }
.delivery-summary > div { padding: .7rem; border: 1px solid var(--line); border-radius: .55rem; }
.delivery-summary dt { color: var(--muted); }
.delivery-summary dd { margin: .25rem 0 0; color: var(--mint); font-weight: 750; font-size: 1.4rem; }
.layout-proof { margin: 1rem 0; }
.layout-proof img { width: min(100%, 15rem); height: auto; display: block; }
.layout-proof figcaption { color: var(--muted); margin-top: .4rem; font-size: .9rem; }
.slot-designer { margin: .65rem 0 1rem; }
.slot-sheet {
    display: block; width: min(100%, 16rem); height: auto; margin: .65rem auto 1rem;
    background: var(--paper); border: 1px solid var(--line); border-radius: .4rem; touch-action: none;
}
.slot-safe { fill: none; stroke: var(--muted); stroke-width: 7; stroke-dasharray: 18 14; }
.slot-cut { stroke: var(--mint); stroke-width: 8; stroke-dasharray: 25 20; }
.slot-box { fill: #32465f; stroke: var(--muted); stroke-width: 6; }
.slot-box[data-slot] { cursor: grab; }
.slot-box[data-selected="true"] { fill: #355f69; stroke: var(--mint); stroke-width: 10; }
.slot-number { fill: var(--text); font-weight: 800; font-size: 66px; pointer-events: none; }
.slot-footer { fill: var(--muted); font-size: 43px; pointer-events: none; }
.delivery-options { margin: .7rem auto; max-width: 32rem; text-align: left; }
.delivery-options label + .actions { margin-top: .6rem; }
.delivery-options .pickup-qr { display: block; max-width: min(100%, 13rem); margin: .7rem auto; }
#pb-pickup-box { text-align: center; }
@media (max-width: 700px) {
    .capture-grid, .selectors { grid-template-columns: minmax(0, 1fr); }
    .camera-stage video { height: clamp(12rem, 35vh, 25rem); }
}
