:root {
    color-scheme: dark;
    --event-accent: #8b5cf6;
    --ink: #f8f8fb;
    --muted: rgba(248, 248, 251, 0.64);
    --glass: rgba(15, 15, 21, 0.7);
    --line: rgba(255, 255, 255, 0.13);
    --danger: #ff5b70;
    --success: #37e6a1;
    --warning: #ffcf5a;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    background: #07070a;
    color: var(--ink);
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible + .consent-check__box {
    outline: 3px solid color-mix(in srgb, var(--event-accent) 75%, white);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

svg {
    display: block;
}

.visually-hidden,
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.brand__mark {
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    box-shadow: 0 8px 28px rgba(92, 107, 255, 0.28);
}

.brand__mark img {
    display: block;
    width: 100%;
    height: 100%;
}

.brand--large {
    font-size: 20px;
}

.brand--large .brand__mark {
    width: 46px;
    height: 46px;
    border-radius: 15px;
}

.eyebrow {
    color: color-mix(in srgb, var(--event-accent) 70%, white);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.18em;
}

.button {
    position: relative;
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    transition: transform 180ms var(--ease), opacity 180ms ease, background 180ms ease;
}

.button:active:not(:disabled) {
    transform: scale(0.975);
}

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

.button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.button--primary {
    color: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--event-accent) 82%, white), var(--event-accent));
    box-shadow: 0 14px 36px color-mix(in srgb, var(--event-accent) 28%, transparent), inset 0 1px rgba(255, 255, 255, 0.25);
}

.button--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, color-mix(in srgb, var(--event-accent) 72%, white), color-mix(in srgb, var(--event-accent) 92%, black));
}

.button--ghost {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
}

.button--light {
    color: #101014;
    background: #fff;
}

.button--small {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 11px;
    font-size: 12px;
}

.button--wide {
    width: 100%;
}

.text-button {
    padding: 8px;
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.25);
    text-underline-offset: 3px;
}

/* Root landing and non-active states */
.landing-page,
.state-page {
    min-height: 100dvh;
    background:
        radial-gradient(circle at 18% 5%, color-mix(in srgb, var(--event-accent) 26%, transparent), transparent 35%),
        radial-gradient(circle at 84% 92%, rgba(37, 211, 255, 0.12), transparent 32%),
        #08080d;
}

.landing-shell {
    display: grid;
    width: min(100% - 36px, 580px);
    min-height: 100dvh;
    margin: 0 auto;
    place-content: center;
    gap: 34px;
    padding: 54px 0;
}

.landing-card,
.state-card {
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(15, 15, 22, 0.72);
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(22px);
}

.landing-card {
    padding: clamp(28px, 7vw, 48px);
}

.landing-card h1,
.landing-card h2 {
    margin: 9px 0 10px;
    font-size: clamp(25px, 6vw, 38px);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.landing-card h2 {
    font-size: clamp(22px, 5vw, 31px);
}

.landing-card p,
.state-card p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.landing-divider {
    height: 1px;
    margin: 30px 0;
    background: var(--line);
}

.state-page {
    display: grid;
    place-items: center;
    padding: 22px;
}

.state-card {
    width: min(100%, 480px);
    padding: 42px 34px;
    text-align: center;
}

.state-card__icon {
    display: block;
    width: 70px;
    height: 70px;
    margin: 0 auto 24px;
    border-radius: 22px;
    box-shadow: 0 16px 46px rgba(92, 107, 255, 0.25);
}

.state-card__icon img {
    display: block;
    width: 100%;
    height: 100%;
}

.state-card h1 {
    margin: 0 0 12px;
    font-size: clamp(25px, 6vw, 34px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.state-card__languages {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}

.state-card__languages a {
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.state-card__languages span {
    color: rgba(255, 255, 255, 0.3);
}

/* Live camera */
.capture-page {
    position: fixed;
    inset: 0;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.capture-app,
.camera-stage {
    position: relative;
    width: 100%;
    height: 100dvh;
    min-height: 100%;
    overflow: hidden;
}

.camera-stage {
    isolation: isolate;
    background: #09090d;
}

.camera-video,
.camera-backdrop,
.camera-vignette {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.camera-video {
    z-index: -3;
    object-fit: cover;
    opacity: 0;
    transition: opacity 500ms ease;
}

.camera-video.is-mirrored {
    transform: scaleX(-1);
}

.camera-live .camera-video {
    opacity: 1;
}

.camera-backdrop {
    z-index: -4;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--event-accent) 34%, transparent), transparent 32%),
        radial-gradient(circle at 87% 68%, rgba(34, 211, 238, 0.2), transparent 30%),
        linear-gradient(145deg, #171521 0%, #08080c 58%, #11101a 100%);
}

.camera-backdrop span {
    position: absolute;
    border-radius: 999px;
    filter: blur(1px);
    opacity: 0.22;
    animation: drift 10s var(--ease) infinite alternate;
}

.camera-backdrop span:nth-child(1) {
    top: 17%;
    left: -18%;
    width: 62vw;
    height: 62vw;
    background: var(--event-accent);
}

.camera-backdrop span:nth-child(2) {
    right: -22%;
    bottom: 20%;
    width: 70vw;
    height: 70vw;
    background: #16b7d5;
    animation-delay: -4s;
}

.camera-backdrop span:nth-child(3) {
    top: 42%;
    left: 30%;
    width: 38vw;
    height: 38vw;
    background: #fff;
    opacity: 0.05;
    animation-delay: -7s;
}

@keyframes drift {
    to { transform: translate3d(10%, -8%, 0) scale(1.15); }
}

.camera-vignette {
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.66) 0%, transparent 24%, transparent 56%, rgba(0, 0, 0, 0.84) 100%),
        radial-gradient(circle, transparent 35%, rgba(0, 0, 0, 0.18) 100%);
}

.capture-flash {
    position: absolute;
    z-index: 90;
    inset: 0;
    pointer-events: none;
    background: #fff;
    opacity: 0;
}

.capture-flash.is-active {
    animation: flash 360ms ease-out;
}

@keyframes flash {
    0% { opacity: 0; }
    12% { opacity: 0.82; }
    100% { opacity: 0; }
}

.capture-header {
    position: absolute;
    z-index: 10;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
}

.capture-header__brand {
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.language-switch {
    display: flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(8, 8, 12, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
}

.language-switch button {
    min-width: 38px;
    height: 32px;
    padding: 0 9px;
    border: 0;
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.56);
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    font-weight: 850;
}

.language-switch button[aria-pressed="true"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.event-chip {
    position: absolute;
    z-index: 8;
    top: calc(72px + env(safe-area-inset-top));
    left: 50%;
    display: flex;
    max-width: calc(100% - 32px);
    align-items: center;
    gap: 10px;
    padding: 9px 13px 9px 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 15px;
    background: rgba(8, 8, 12, 0.54);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.26);
    transform: translateX(-50%);
    backdrop-filter: blur(16px);
}

.event-chip__pulse {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(55, 230, 161, 0.12), 0 0 16px rgba(55, 230, 161, 0.7);
    animation: live-pulse 1.8s ease-out infinite;
}

@keyframes live-pulse {
    70%, 100% { box-shadow: 0 0 0 10px rgba(55, 230, 161, 0), 0 0 14px rgba(55, 230, 161, 0.6); }
}

.event-chip__text {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.event-chip strong,
.event-chip small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-chip strong {
    font-size: 11px;
}

.event-chip small {
    color: var(--muted);
    font-size: 9px;
}

.camera-alert {
    position: absolute;
    z-index: 15;
    top: 50%;
    left: 50%;
    display: grid;
    width: min(calc(100% - 36px), 430px);
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 13px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 22px;
    background: rgba(14, 14, 20, 0.88);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
    transform: translate(-50%, -50%);
    backdrop-filter: blur(22px);
}

.camera-alert__icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    color: #16120b;
    background: var(--warning);
    font-weight: 900;
}

.camera-alert strong {
    display: block;
    margin-top: 1px;
    font-size: 14px;
}

.camera-alert p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.camera-alert .button {
    grid-column: 1 / -1;
}

/* Queue */
.upload-dock {
    position: absolute;
    z-index: 12;
    right: 12px;
    bottom: calc(118px + env(safe-area-inset-bottom));
    left: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    background: rgba(8, 8, 12, 0.58);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(20px) saturate(125%);
}

.upload-dock__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 13px;
}

.upload-dock__summary > div:first-child {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.upload-dock__summary strong,
.upload-dock__summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-dock__summary strong {
    font-size: 11px;
}

.upload-dock__summary > div:first-child span {
    color: var(--muted);
    font-size: 9px;
}

.slot-dots {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
}

.slot-dots span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    transition: background 180ms ease, box-shadow 180ms ease;
}

.slot-dots .is-free {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.slot-dots .is-used {
    background: var(--event-accent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--event-accent) 70%, transparent);
}

.upload-list {
    display: none;
    gap: 8px;
    overflow-x: auto;
    padding: 0 9px 9px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.upload-list::-webkit-scrollbar {
    display: none;
}

.upload-list.has-items {
    display: flex;
}

.upload-card {
    display: grid;
    min-width: min(270px, calc(100vw - 42px));
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.065);
    scroll-snap-align: start;
}

.upload-card--failed {
    border-color: rgba(255, 91, 112, 0.28);
    background: rgba(255, 91, 112, 0.1);
}

.upload-card--uploaded {
    border-color: rgba(55, 230, 161, 0.23);
}

.upload-card__thumbnail {
    position: relative;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.04));
}

.upload-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-card__thumbnail img.is-unavailable {
    visibility: hidden;
}

.upload-card__details {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.upload-card__details strong {
    font-size: 10px;
}

.upload-card__details > span {
    overflow: hidden;
    color: var(--muted);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-card--failed .upload-card__details > span {
    color: #ffb5be;
}

.upload-card__progress {
    height: 3px;
    margin-top: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.upload-card__progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--event-accent), color-mix(in srgb, var(--event-accent) 52%, white));
    transition: width 180ms ease;
}

.upload-card--failed .upload-card__progress span {
    background: var(--danger);
}

.upload-card--uploaded .upload-card__progress span {
    background: var(--success);
}

.upload-card__end {
    display: flex;
    align-items: center;
    gap: 5px;
}

.upload-card__percentage {
    min-width: 29px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 8px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.upload-card__check {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 999px;
    color: #07160f;
    background: var(--success);
    font-size: 12px;
    font-weight: 900;
}

.upload-card__retry,
.upload-card__remove {
    border: 0;
    cursor: pointer;
}

.upload-card__retry {
    padding: 6px 8px;
    border-radius: 8px;
    color: #171014;
    background: #ffb2bd;
    font-size: 8px;
    font-weight: 900;
}

.upload-card__remove {
    width: 24px;
    height: 24px;
    padding: 0;
    color: #fff;
    background: transparent;
    font-size: 18px;
}

/* Camera buttons */
.camera-controls {
    position: absolute;
    z-index: 11;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: 1fr 96px 1fr;
    align-items: center;
    justify-items: center;
    padding: 8px max(26px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(26px, env(safe-area-inset-left));
}

.round-action {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 17px;
    color: #fff;
    background: rgba(8, 8, 12, 0.56);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
    cursor: pointer;
    backdrop-filter: blur(16px);
    transition: transform 180ms var(--ease), opacity 180ms ease;
}

.round-action:active:not(:disabled) {
    transform: scale(0.93);
}

.round-action:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.round-action svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.round-action span {
    position: absolute;
    margin: 31px 0 0 29px;
    padding: 2px 4px;
    border: 2px solid #09090d;
    border-radius: 6px;
    color: #0e0e14;
    background: #fff;
    font-size: 6px;
    font-weight: 950;
    letter-spacing: 0.03em;
}

.shutter {
    display: grid;
    width: 86px;
    height: 86px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35));
    transition: transform 180ms var(--ease), opacity 180ms ease;
}

.shutter:active:not(:disabled) {
    transform: scale(0.92);
}

.shutter:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.shutter__ring {
    display: grid;
    width: 80px;
    height: 80px;
    place-items: center;
    border: 3px solid rgba(255, 255, 255, 0.96);
    border-radius: inherit;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.shutter__core {
    width: 65px;
    height: 65px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: inherit;
    background: #fff;
    transition: background 180ms ease;
}

.shutter.is-disabled .shutter__core {
    background: rgba(255, 255, 255, 0.7);
}

/* Welcome */
.welcome-overlay,
.preview-overlay,
.privacy-overlay {
    position: fixed;
    z-index: 50;
    inset: 0;
}

.welcome-overlay {
    display: grid;
    overflow-y: auto;
    place-items: center;
    padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 50% 14%, color-mix(in srgb, var(--event-accent) 20%, transparent), transparent 38%),
        rgba(5, 5, 8, 0.8);
    backdrop-filter: blur(22px);
}

.welcome-glow {
    position: fixed;
    top: -15vw;
    left: 50%;
    width: min(90vw, 620px);
    height: min(90vw, 620px);
    border-radius: 999px;
    pointer-events: none;
    background: color-mix(in srgb, var(--event-accent) 28%, transparent);
    filter: blur(80px);
    transform: translateX(-50%);
}

.welcome-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 450px);
    padding: clamp(24px, 6vw, 38px);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 32px;
    background: linear-gradient(160deg, rgba(25, 24, 34, 0.94), rgba(11, 11, 16, 0.94));
    box-shadow: 0 36px 110px rgba(0, 0, 0, 0.55), inset 0 1px rgba(255, 255, 255, 0.08);
    text-align: center;
}

.welcome-panel__language {
    position: absolute;
    top: 15px;
    right: 15px;
}

.welcome-panel__camera {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 22px;
    box-shadow: 0 18px 44px rgba(92, 107, 255, 0.3);
    transform: rotate(-3deg);
}

.welcome-panel__camera img {
    display: block;
    width: 100%;
    height: 100%;
}

.welcome-panel h1 {
    margin: 9px 0 0;
    font-size: clamp(31px, 9vw, 47px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.welcome-panel__event {
    margin: 12px 0 0;
    color: color-mix(in srgb, var(--event-accent) 68%, white);
    font-size: 13px;
    font-weight: 800;
}

.welcome-panel__intro {
    max-width: 340px;
    margin: 14px auto 22px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.welcome-feature-list {
    display: grid;
    gap: 7px;
    margin: 0 0 18px;
    text-align: left;
}

.welcome-feature-list > div {
    display: grid;
    grid-template-columns: 35px 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
}

.welcome-feature-list > div > span {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 9px;
    color: color-mix(in srgb, var(--event-accent) 65%, white);
    background: color-mix(in srgb, var(--event-accent) 13%, transparent);
    font-size: 8px;
    font-weight: 900;
}

.welcome-feature-list p {
    display: grid;
    gap: 1px;
    margin: 0;
}

.welcome-feature-list strong {
    font-size: 11px;
}

.welcome-feature-list small {
    color: var(--muted);
    font-size: 9px;
}

.consent-check {
    display: grid;
    grid-template-columns: 21px 1fr;
    align-items: start;
    gap: 10px;
    margin: 0 2px 16px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 10px;
    line-height: 1.45;
    text-align: left;
}

.consent-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.consent-check__box {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    transition: background 160ms ease, border 160ms ease;
}

.consent-check__box svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: white;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
    opacity: 0;
    transform: scale(0.65);
    transition: opacity 160ms ease, transform 160ms var(--ease);
}

.consent-check input:checked + .consent-check__box {
    border-color: var(--event-accent);
    background: var(--event-accent);
}

.consent-check input:checked + .consent-check__box svg {
    opacity: 1;
    transform: scale(1);
}

.welcome-panel .text-button {
    margin-top: 6px;
}

/* Preview */
.preview-overlay {
    z-index: 60;
    display: grid;
    min-height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 14px;
    padding: calc(20px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
    background: rgba(5, 5, 8, 0.96);
    backdrop-filter: blur(24px);
}

.preview-header {
    text-align: center;
}

.preview-header h2 {
    margin: 5px 0 0;
    font-size: 22px;
    letter-spacing: -0.035em;
}

.preview-media {
    position: relative;
    display: grid;
    min-height: 0;
    overflow: hidden;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    background:
        linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
        #101016;
    background-size: 24px 24px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.4);
}

.preview-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-placeholder {
    display: grid;
    place-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.preview-placeholder svg {
    width: 54px;
    height: 54px;
    fill: none;
    stroke: rgba(255, 255, 255, 0.55);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.2;
}

.preview-details {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 650;
}

.preview-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    gap: 10px;
}

/* Privacy dialog */
.privacy-overlay {
    z-index: 70;
    display: grid;
    overflow-y: auto;
    place-items: center;
    padding: 22px;
    background: rgba(3, 3, 5, 0.84);
    backdrop-filter: blur(20px);
}

.privacy-card {
    position: relative;
    width: min(100%, 440px);
    padding: 32px 28px 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: #111117;
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.55);
}

.privacy-card h2 {
    margin: 7px 0 18px;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.privacy-card p {
    margin: 0 0 13px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.privacy-card .button {
    margin-top: 12px;
}

.dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-size: 23px;
    font-weight: 300;
}

.toast {
    position: fixed;
    z-index: 100;
    top: calc(88px + env(safe-area-inset-top));
    left: 50%;
    width: max-content;
    max-width: calc(100% - 34px);
    padding: 11px 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 13px;
    color: #fff;
    background: rgba(16, 16, 22, 0.92);
    box-shadow: 0 15px 48px rgba(0, 0, 0, 0.42);
    opacity: 0;
    transform: translate(-50%, -12px);
    backdrop-filter: blur(18px);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.35;
    text-align: center;
    transition: opacity 200ms ease, transform 250ms var(--ease);
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast[data-tone="success"] {
    border-color: rgba(55, 230, 161, 0.32);
    color: #bdffe3;
}

.toast[data-tone="error"] {
    border-color: rgba(255, 91, 112, 0.35);
    color: #ffc0c8;
}

.toast[data-tone="warning"] {
    border-color: rgba(255, 207, 90, 0.35);
    color: #ffeab4;
}

.noscript-message {
    position: fixed;
    z-index: 999;
    inset: 0;
    display: grid;
    padding: 30px;
    place-items: center;
    color: #fff;
    background: #09090d;
    text-align: center;
}

@media (min-width: 720px) {
    .capture-header {
        padding-right: 24px;
        padding-left: 24px;
    }

    .upload-dock {
        right: 24px;
        left: 24px;
    }

    .preview-overlay {
        padding-right: max(16px, calc((100vw - 680px) / 2));
        padding-left: max(16px, calc((100vw - 680px) / 2));
    }
}

@media (max-height: 700px) {
    .welcome-overlay {
        place-items: start center;
    }

    .welcome-panel {
        padding-top: 22px;
        padding-bottom: 22px;
    }

    .welcome-panel__camera {
        width: 50px;
        height: 50px;
        margin-bottom: 13px;
    }

    .welcome-panel h1 {
        font-size: 30px;
    }

    .welcome-panel__intro {
        margin-top: 9px;
        margin-bottom: 13px;
    }

    .welcome-feature-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .welcome-feature-list > div {
        display: grid;
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .welcome-feature-list small {
        display: none;
    }

    .upload-dock {
        bottom: calc(102px + env(safe-area-inset-bottom));
    }

    .camera-controls {
        grid-template-columns: 1fr 78px 1fr;
        padding-top: 3px;
    }

    .shutter,
    .shutter__ring {
        width: 70px;
        height: 70px;
    }

    .shutter__core {
        width: 57px;
        height: 57px;
    }

    .round-action {
        width: 47px;
        height: 47px;
    }
}

@media (orientation: landscape) and (max-height: 560px) {
    .event-chip {
        top: calc(60px + env(safe-area-inset-top));
    }

    .upload-dock {
        right: calc(116px + env(safe-area-inset-right));
        bottom: calc(14px + env(safe-area-inset-bottom));
        left: calc(116px + env(safe-area-inset-left));
    }

    .camera-controls {
        right: 12px;
        bottom: 50%;
        left: auto;
        width: 86px;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 0;
        transform: translateY(50%);
    }

    .camera-controls .round-action:first-child {
        order: 2;
    }

    .camera-controls .shutter {
        order: 1;
    }

    .camera-controls .round-action:last-child {
        order: 3;
    }

    .preview-overlay {
        grid-template-columns: minmax(0, 1fr) 240px;
        grid-template-rows: auto 1fr auto;
        padding-right: calc(16px + env(safe-area-inset-right));
        padding-left: calc(16px + env(safe-area-inset-left));
    }

    .preview-media {
        grid-row: 1 / -1;
    }

    .preview-header,
    .preview-details,
    .preview-actions {
        grid-column: 2;
    }

    .preview-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
