/* Front page. Mobile first: the base rules are the phone layout, wider screens only add on top. */

:root {
    --navy: #1f2a44;
    --muted: #6b7280;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --green: #22c55e;
    --cream: #fff3cc;
    --sand: #ffd98a;
    --field: #fff8e1;
    --field-border: #e8d9a8;
}

body.home {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--navy);
    background: linear-gradient(180deg, var(--cream) 0%, var(--sand) 100%) fixed;
    -webkit-text-size-adjust: 100%;
}

.home-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
}

/* ---- Hero ---- */

.hero {
    text-align: center;
    padding: 8px 16px 0;
}

/* ---- Language switch, upper left ---- */

.lang-switch {
    display: flex;
    justify-content: flex-start;
    gap: 2px;
    margin: 0 0 0 -8px;
}

.lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.lang svg {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    box-shadow: 0 0 0 1.5px rgba(31, 42, 68, 0.25);
    opacity: 0.9;
}

.lang.is-active svg {
    opacity: 1;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4.5px var(--blue);
}

.lang:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: -2px;
}

.hero-title {
    margin: 0;
    font-size: clamp(28px, 9vw, 40px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-tagline {
    margin: 6px 0 0;
    font-size: 16px;
    color: #4b5563;
}

.hero-art {
    display: block;
    width: 100%;
    height: auto;
    margin: 4px auto 0;
}

/* ---- Login sheet: rises from the bottom over the kids' shoulders ---- */

.login-sheet {
    position: relative;
    flex: 1;
    margin-top: -14px;
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
    background: #fff;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -6px 24px rgba(31, 42, 68, 0.08);
}

.sheet-handle {
    display: block;
    width: 40px;
    height: 5px;
    margin: 0 auto 10px;
    border-radius: 3px;
    background: #e5ddc2;
}

.login-sheet h2 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
}

.field {
    margin-bottom: 8px;
}

.field label {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
    font-weight: 600;
}

/* 16px text keeps iOS Safari from zooming in when a field gets focus. */
.field input {
    width: 100%;
    height: 40px;
    padding: 0 11px;
    border: 1.5px solid var(--field-border);
    border-radius: 9px;
    background: var(--field);
    font: inherit;
    font-size: 16px;
    color: var(--navy);
    box-sizing: border-box;
}

.field input::placeholder {
    color: var(--muted);
}

.field input:focus-visible,
.btn:focus-visible,
.forgot:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 46px;
}

/* The eye button sits inside the right end of the field and is a full-height touch target. */
.eye-toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    padding: 0;
    border: 0;
    border-radius: 0 9px 9px 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.eye-toggle[hidden] {
    display: none;
}

.eye-toggle svg {
    width: 22px;
    height: 22px;
}

.eye-toggle:hover {
    color: var(--navy);
}

.eye-toggle:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: -3px;
}

/* Pressed = the password is visible: blue, and a slash through the eye. */
.eye-toggle[aria-pressed="true"] {
    color: var(--blue);
}

.eye-slash {
    display: none;
}

.eye-toggle[aria-pressed="true"] .eye-slash {
    display: block;
}

.options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 0 0 12px;
    font-size: 12px;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    cursor: pointer;
}

.remember input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--green);
}

.forgot {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    color: var(--blue);
    font-weight: 500;
}

/* ---- Messages and small texts (login errors, notices, account pages) ---- */

.message {
    margin: 0 0 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.message.notice {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.intro {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #4b5563;
}

.hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--muted);
}

/* ---- Buttons ---- */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none;
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn + .btn {
    margin-top: 8px;
}

.btn-primary {
    border: 2px solid var(--blue);
    background: var(--blue);
    color: #fff;
}

.btn-primary:active {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
}

.btn-secondary {
    border: 2px solid var(--blue);
    background: #fff;
    color: var(--blue);
}

.btn-secondary:active {
    background: #eff4ff;
}

/* ---- Larger screens: same column, the sheet becomes a floating card ---- */

@media (min-width: 560px) {
    .home-page {
        justify-content: center;
    }

    .hero {
        padding-top: 40px;
    }

    .login-sheet {
        flex: 0 0 auto;
        margin-bottom: 40px;
        padding-bottom: 28px;
        border-radius: 30px;
    }

    .sheet-handle {
        display: none;
    }
}

/* ---- Desktop: illustration on the left, login card on the right, all within one screen ---- */

@media (min-width: 900px) {
    .home-page {
        max-width: 1000px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 390px;
        gap: 48px;
        align-items: center;
        padding: 28px 40px;
        box-sizing: border-box;
    }

    /* Pinned to the real upper-left corner of the page rather than the column. */
    .lang-switch {
        position: fixed;
        top: 10px;
        left: 14px;
        margin: 0;
    }

    .hero {
        padding: 0;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-tagline {
        margin-top: 6px;
        font-size: 18px;
    }

    /* Nothing covers the kids' shoulders here, so fade them out instead of a hard edge. */
    .hero-art {
        max-width: 460px;
        -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
        mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
    }

    /* Controls sized for a mouse pointer: smaller than the phone ones, larger than a dense desktop form. */
    .login-sheet {
        margin: 0;
        padding: 30px 28px;
        border-radius: 28px;
        box-shadow: 0 16px 48px rgba(31, 42, 68, 0.17);
    }

    .login-sheet h2 {
        margin-bottom: 12px;
        font-size: 23px;
    }

    .field {
        margin-bottom: 12px;
    }

    .field label {
        margin-bottom: 5px;
        font-size: 14px;
    }

    .field input {
        height: 50px;
        border-radius: 12px;
        font-size: 16px;
    }

    .password-wrap input {
        padding-right: 48px;
    }

    .eye-toggle {
        width: 46px;
    }

    .eye-toggle svg {
        width: 24px;
        height: 24px;
    }

    .options {
        margin: 2px 0 16px;
        font-size: 14px;
    }

    .remember {
        gap: 10px;
        min-height: 38px;
    }

    .remember input {
        width: 21px;
        height: 21px;
    }

    .forgot {
        min-height: 38px;
    }

    .btn {
        min-height: 52px;
        border-radius: 14px;
        font-size: 17px;
    }

    .btn + .btn {
        margin-top: 12px;
    }
}
/* ---- Form guard: the hidden trap field (see Services/FormGuard.cs) is invisible to people, bots still fill it in ---- */

.form-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---- Cloudflare Turnstile widget (see Pages/Shared/_Turnstile.cshtml) ---- */

.cf-turnstile {
    margin: 0 0 12px;
    min-height: 65px;
}

/* ---- Start page: the page after login, two big halves (see Pages/Start.cshtml) ---- */

.start-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 1280px;
    margin: 0 auto;
}

.start-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 4px;
}

/* The flags sit in the header here, not pinned to the corner of the window. */
.start-header .lang-switch {
    position: static;
    margin: 0 0 0 -8px;
}

.start-title {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.start-brand {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

/* Narrow phones: flags, name, saved cards icon and Log out all share one row, so the name gives a little. */
@media (max-width: 420px) {
    .start-header {
        gap: 6px;
        padding: 6px 10px 4px;
    }

    .start-header .lang {
        width: 38px;
        height: 38px;
    }

    .start-brand {
        font-size: 15px;
        letter-spacing: -0.2px;
    }

    .btn-logout {
        padding: 0 10px;
        font-size: 13px;
    }
}

/* Very small phones: no room for the name, the "signed in as" line stays. */
@media (max-width: 350px) {
    .start-brand {
        display: none;
    }
}

.start-user {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--muted);
}

.start-logout {
    margin: 0;
}

.btn-logout {
    min-height: 44px;
    padding: 0 14px;
    border: 2px solid var(--blue);
    border-radius: 12px;
    background: transparent;
    color: var(--blue-dark);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.start-modes {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 10px 12px;
}

.mode {
    --mode-bg: #cfe3ff;
    --mode-blob: #9cc2ff;
    --mode-ink: #12306b;
    --mode-cta: #1d4ed8;
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border-radius: 24px;
    background: var(--mode-bg);
    color: var(--mode-ink);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.mode-swap {
    --mode-bg: #ffd9a0;
    --mode-blob: #ffb866;
    --mode-ink: #7a3e00;
    --mode-cta: #c2410c;
}

/* The big soft circle behind the picture. */
.mode::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 4%;
    width: 120%;
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background: var(--mode-blob);
}

.mode-art {
    position: relative;
    display: block;
    width: 100%;
    max-width: 460px;
    height: auto;
    /* Phone: both halves should fit on one screen, so the picture gives way before the text does. */
    max-height: max(120px, calc(50dvh - 222px));
    margin: 12px auto 0;
}

.mode-text {
    position: relative;
    display: block;
    padding: 4px 18px 18px;
}

.mode-text h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.mode-text p {
    margin: 4px 0 12px;
    font-size: 14px;
    line-height: 1.4;
}

.mode-go {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 22px;
    border-radius: 20px;
    background: var(--mode-cta);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
}

.mode:focus-visible {
    outline: 4px solid var(--navy);
    outline-offset: -4px;
}

/* Not a link yet: a little paler, nothing to press. */
.mode.is-soon .mode-go {
    background: transparent;
    border: 2px dashed var(--mode-cta);
    color: var(--mode-ink);
}

@media (min-width: 560px) {
    .mode-art {
        max-height: none;
    }

    .start-modes {
        max-width: 720px;
        width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }

    .start-user {
        font-size: 13px;
    }
}

@media (min-width: 900px) {
    .start-header {
        padding: 10px 24px 6px;
    }

    .start-brand {
        font-size: 26px;
    }

    /* A fixed, calm height: on a tall window the halves would otherwise stretch into two long strips. */
    .start-modes {
        flex: none;
        width: 100%;
        max-width: 1120px;
        height: clamp(420px, calc(100dvh - 150px), 560px);
        box-sizing: border-box;
        margin: auto;
        flex-direction: row;
        gap: 16px;
        padding: 6px 24px 24px;
    }

    .mode {
        justify-content: space-between;
        transition: flex-grow 0.25s ease, filter 0.25s ease;
    }

    .mode::before {
        top: 8%;
        width: 100%;
    }

    .mode-art {
        margin-top: 8%;
    }

    .mode-text {
        padding: 8px 32px 32px;
    }

    .mode-text h2 {
        font-size: 34px;
    }

    .mode-text p {
        margin: 6px 0 18px;
        font-size: 17px;
    }

    .mode-go {
        min-height: 48px;
        padding: 0 30px;
        font-size: 17px;
        border-radius: 24px;
    }

    /* The half under the pointer grows a little, the other one steps back. */
    a.mode:hover {
        flex-grow: 1.25;
    }

    .start-modes:hover .mode:not(:hover) {
        filter: saturate(0.85);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mode {
        transition: none;
    }
}

/* ---- Check a card page (see Pages/Check.cshtml) ---- */

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

.check-page [hidden] {
    display: none !important;
}

.check-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 1120px;
    margin: 0 auto;
}

.check-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 4px;
}

/* The flags sit at the left of the header, like on the front page and Start, not pinned to the corner of the window. */
.check-header .lang-switch {
    position: static;
    margin: 0 0 0 -8px;
}

.check-back {
    width: 44px;
    height: 44px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 2px solid var(--blue);
    border-radius: 50%;
    background: #fff;
    color: var(--blue-dark);
}

.check-back svg {
    width: 22px;
    height: 22px;
}

/* Narrow phones: flags, title, saved cards icon and back button share one row. */
@media (max-width: 420px) {
    .check-header {
        gap: 6px;
        padding: 6px 10px 4px;
    }

    .check-header .lang {
        width: 38px;
        height: 38px;
    }
}

.check-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
}

.check-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    padding: 4px 10px 12px;
}

.check-panel {
    position: relative;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
    padding: 10px 18px 20px;
    border-radius: 24px;
    background: #cfe3ff;
    color: #12306b;
}

/* The big soft circle behind the picture, like on the Start page. */
.check-panel::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 120%;
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #9cc2ff;
}

.check-intro {
    position: relative;
    text-align: center;
}

.check-art {
    display: block;
    width: min(100%, 230px);
    height: auto;
    max-height: max(110px, calc(40dvh - 90px));
    margin: 0 auto;
}

.check-panel.is-previewing .check-intro {
    display: none;
}

.check-heading {
    margin: 4px 0;
    font-size: 22px;
    line-height: 1.2;
}

.check-lead {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.4;
}

.check-actions {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.check-choose {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dropzone {
    display: none;
}

.check-actions .btn {
    min-height: 48px;
    gap: 10px;
    border-radius: 14px;
    font-size: 16px;
}

.check-actions .btn svg {
    width: 22px;
    height: 22px;
    flex: none;
}

.btn-camera {
    --btn-bg: var(--blue);
    border: 2px solid var(--blue);
    background: var(--btn-bg);
    color: #fff;
}

.btn-upload {
    --btn-bg: #fff;
    border: 2px solid var(--blue);
    background: var(--btn-bg);
    color: var(--blue);
}

.label-desktop {
    display: none;
}

.check-tips {
    display: grid;
    gap: 6px;
    margin: 6px 0 0;
    padding: 10px 14px;
    list-style: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    font-size: 13px;
}

.check-tips li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-tips li::before {
    content: "\2713";
    flex: none;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.check-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* The photo, and while the card is being found a scan that runs over it (a light bar with a glow, plus a faint blue tint). */
.scan-frame {
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
}

.scan-frame img {
    display: block;
    max-width: 100%;
    max-height: 42dvh;
    width: auto;
    height: auto;
}

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 22%;
    display: none;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0) 0%, rgba(59, 130, 246, 0.35) 70%, rgba(147, 197, 253, 0.8) 100%);
    border-bottom: 3px solid #fff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.8);
    transform: translateY(-100%);
}

.check-preview.is-scanning .scan-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(37, 99, 235, 0.12);
}

.check-preview.is-scanning .scan-line {
    display: block;
    animation: check-scan 1.7s ease-in-out infinite alternate;
}

/* Only the picture stays; the buttons make room for the text below it. */
.check-preview.is-scanning .btn {
    display: none;
}

@keyframes check-scan {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(455%);
    }
}

.check-wait {
    margin: 20px 0;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

/* The camera screen: full screen, black, the picture with the card outline on top. */

body.camera-open {
    overflow: hidden;
}

.camera {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #000;
    color: #fff;
}

.camera[hidden] {
    display: none;
}

.camera-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* The video (object-fit: contain) and the overlay (an SVG whose viewBox is the picture's own size, drawn with "meet") fit the
   same box in the same way, so the outline always lines up with the picture. */
.camera-stage video,
.camera-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.camera-stage video {
    object-fit: contain;
    background: #000;
}

.camera-overlay {
    pointer-events: none;
    --line: 3px;
}

.camera-overlay .shade {
    fill: rgba(0, 0, 0, 0.55);
}

.camera-overlay .frame {
    fill: none;
    stroke: #fff;
    stroke-width: var(--line);
    stroke-dasharray: none;
}

.camera-overlay .fill {
    fill: rgba(34, 197, 94, 0);
    transition: fill 0.2s ease;
}

.camera-overlay.ok .fill {
    fill: rgba(34, 197, 94, 0.32);
}

.camera-overlay.ok .frame {
    stroke: #22c55e;
}

.camera-hint {
    margin: 0;
    padding: 10px 16px 4px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

.camera-bar {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 24px calc(18px + env(safe-area-inset-bottom, 0px));
}

.camera-cancel,
.camera-spacer {
    width: 48px;
    height: 48px;
}

.camera-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
}

.camera-cancel svg {
    width: 24px;
    height: 24px;
}

.camera-shutter {
    width: 72px;
    height: 72px;
    padding: 0;
    border: 5px solid #fff;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 4px #000;
    cursor: pointer;
}

.camera-shutter:active {
    background: #d1d5db;
}

/* The answer */

.check-result {
    align-items: stretch;
}

.result-image {
    position: relative;
    display: block;
    width: min(60%, 240px);
    height: auto;
    margin: 6px auto 12px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(31, 42, 68, 0.25);
}

.result-body {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.result-body h2 {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.2;
    text-align: center;
}

.result-facts {
    display: grid;
    gap: 4px;
    margin: 0 0 10px;
    font-size: 14px;
}

.result-facts div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.result-facts dt {
    font-weight: 600;
}

.result-facts dd {
    margin: 0;
    text-align: right;
}

.result-price-label {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
}

.result-price {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
}

.result-note {
    margin: 6px 0;
    font-size: 12.5px;
    line-height: 1.4;
    opacity: 0.85;
}

.result-finishes {
    display: grid;
    gap: 4px;
    margin: 4px 0 8px;
    padding: 10px 14px;
    list-style: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}

.result-finishes li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.result-buttons {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.result-buttons .btn {
    min-height: 48px;
    border-radius: 14px;
    font-size: 16px;
}

@media (min-width: 560px) {
    .check-stage {
        max-width: 640px;
        margin: 0 auto;
    }
}

@media (min-width: 900px) {
    .check-header {
        padding: 10px 24px 6px;
    }

    .check-title {
        font-size: 26px;
    }

    .check-stage {
        max-width: none;
        justify-content: center;
        padding: 6px 24px 24px;
    }

    .check-panel {
        flex: none;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 48px;
        width: 100%;
        max-width: 1000px;
        margin: 0 auto;
        padding: 40px;
    }

    .check-panel::before {
        top: -10%;
        width: 70%;
        left: 30%;
    }

    .check-intro,
    .check-panel.is-previewing .check-intro {
        display: block;
        flex: 1;
        text-align: left;
    }

    .check-art {
        width: 100%;
        max-width: 320px;
        max-height: none;
        margin: 0 0 8px;
    }

    .check-heading {
        font-size: 32px;
    }

    .check-lead {
        margin: 0;
        font-size: 17px;
    }

    /* The right side becomes its own white panel with the drop box. */
    .check-actions {
        flex: none;
        width: 340px;
        padding: 14px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.85);
    }

    .dropzone {
        order: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 130px;
        box-sizing: border-box;
        padding: 14px;
        border: 2px dashed var(--blue);
        border-radius: 14px;
        text-align: center;
        font-size: 14px;
        color: #12306b;
    }

    .dropzone svg {
        width: 34px;
        height: 34px;
        color: var(--blue);
    }

    .dropzone span {
        font-size: 13px;
    }

    .dropzone.is-over {
        background: #eff4ff;
        border-style: solid;
    }

    .label-phone {
        display: none;
    }

    .label-desktop {
        display: inline;
    }

    .btn-upload {
        --btn-bg: var(--blue);
        order: 1;
        color: #fff;
    }

    .btn-camera {
        --btn-bg: #fff;
        order: 2;
        color: var(--blue);
    }

    .check-tips {
        order: 3;
        margin-top: 2px;
        padding: 6px 4px 0;
        background: transparent;
    }

    .check-result {
        align-items: center;
        gap: 56px;
    }

    .result-image {
        flex: none;
        width: 260px;
        margin: 0;
    }

    .result-body {
        flex: 1;
        margin: 0;
    }

    .result-body h2 {
        font-size: 32px;
        text-align: left;
    }

    .result-price {
        font-size: 42px;
    }

    .result-buttons {
        grid-auto-flow: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .check-preview.is-scanning .scan-line {
        animation: none;
        transform: translateY(160%);
    }
}

/* ---- The "saved cards" icon in the header of the logged-in pages (see Pages/Shared/_SavedCardsIcon.cshtml) ---- */

.saved-icon {
    width: 44px;
    height: 44px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 2px solid var(--blue);
    border-radius: 50%;
    background: #fff;
    color: var(--blue-dark);
}

.saved-icon svg {
    width: 24px;
    height: 24px;
}

/* "Add to album" under the answer */

.result-add {
    margin: 14px 0 0;
}

.result-add .btn {
    min-height: 48px;
    border-radius: 14px;
    font-size: 16px;
}

.result-add + .result-buttons {
    margin-top: 10px;
}

.result-body .message {
    margin: 12px 0 0;
}

/* ---- Album page (see Pages/Album.cshtml) ---- */

.saved-icon {
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

a.saved-icon:active {
    background: #eff4ff;
}

.album-panel {
    flex: none;
    margin: 4px 10px 12px;
    padding: 14px 12px 18px;
    border-radius: 24px;
    background: #cfe3ff;
    color: #12306b;
}

.album-count {
    margin: 0 4px 12px;
    font-size: 14px;
    font-weight: 600;
}

/* Small thumbnails, as many in a row as fit: three on a normal phone, never fewer than two (a thumbnail is at least 100 px wide). */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 14px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.album-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.album-thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 63 / 88;
    object-fit: cover;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(31, 42, 68, 0.22);
}

.album-thumb.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #9cc2ff;
    box-shadow: none;
    font-size: 22px;
    font-weight: 700;
    color: #9cc2ff;
}

/* An empty slot: the last row is filled up with these (see wwwroot/js/album.js). */
.album-thumb.empty {
    border: 2px dashed rgba(29, 78, 216, 0.28);
    background: rgba(255, 255, 255, 0.35);
    box-shadow: none;
}

.album-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
}

.album-empty {
    padding: 24px 8px 8px;
    text-align: center;
}

.album-empty p {
    margin: 0 0 14px;
    font-size: 15px;
}

.album-empty .btn {
    width: auto;
    padding: 0 24px;
    display: inline-flex;
}

.album-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.album-pages a,
.album-pages span {
    min-width: 40px;
    min-height: 40px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 2px solid var(--blue);
    border-radius: 12px;
    background: #fff;
    color: var(--blue-dark);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.album-pages a:active {
    background: #eff4ff;
}

.album-pages .is-current {
    background: var(--blue);
    color: #fff;
}

.album-pages .is-disabled {
    opacity: 0.45;
}

.album-pages .gap {
    min-width: 0;
    padding: 0 2px;
    border: 0;
    background: transparent;
}

@media (min-width: 560px) {
    .album-panel {
        width: calc(100% - 20px);
        max-width: 760px;
        box-sizing: border-box;
        margin: 4px auto 12px;
        padding: 18px;
    }

    .album-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 16px 14px;
    }

    .album-name {
        font-size: 13px;
    }
}

@media (min-width: 900px) {
    .album-panel {
        max-width: 1000px;
        padding: 24px;
        margin-bottom: 24px;
    }

    .album-grid {
        grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
        gap: 18px 16px;
    }
}

/* Which version of the card do you have? (Normal, holofoil, reverse holofoil, with the icons from the design.) */

.finish-choice {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.finish-choice legend {
    padding: 0;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
}

.finish-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.finish-option {
    position: relative;
    display: block;
    cursor: pointer;
}

/* The real radio button stays for keyboards and screen readers; the tile is what you see. */
.finish-option input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.finish-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    box-sizing: border-box;
    padding: 10px 4px 8px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.finish-icon {
    width: 33px;
    height: 46px;
    flex: none;
}

.finish-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.finish-option input:checked + .finish-tile {
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 2px var(--blue);
}

.finish-option input:focus-visible + .finish-tile {
    outline: 3px solid var(--navy);
    outline-offset: 2px;
}

/* The version of the card (normal, holofoil, reverse holofoil) as a small icon in the corner of its thumbnail. */
.album-pic {
    position: relative;
    display: block;
}

.album-finish {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 18px;
    height: 25px;
    padding: 2px;
    display: flex;
    box-sizing: content-box;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(31, 42, 68, 0.4);
}

.album-finish svg {
    width: 100%;
    height: 100%;
}

/* The disclaimer popup on the Create user page (see Pages/Account/Register.cshtml and wwwroot/js/disclaimer.js). */

.disclaimer {
    width: calc(100% - 24px);
    max-width: 520px;
    max-height: calc(100dvh - 24px);
    box-sizing: border-box;
    margin: auto;
    padding: 18px 18px 16px;
    border: 0;
    border-radius: 22px;
    background: #fff8e1;
    color: var(--navy);
    box-shadow: 0 18px 50px rgba(31, 42, 68, 0.4);
}

.disclaimer[open] {
    display: flex;
    flex-direction: column;
}

.disclaimer::backdrop {
    background: rgba(31, 42, 68, 0.62);
}

.disclaimer h2 {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.25;
}

/* The text scrolls inside the popup. It has to be read to the end before "accept" can be pressed. */
.disclaimer-text {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 52dvh;
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid var(--field-border);
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    line-height: 1.5;
}

.disclaimer-text:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

.disclaimer-text p {
    margin: 0 0 10px;
}

.disclaimer-text h3 {
    margin: 14px 0 4px;
    font-size: 14px;
}

.disclaimer-text .disclaimer-close {
    margin: 14px 0 0;
}

.disclaimer-hint {
    min-height: 18px;
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.disclaimer-buttons {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.disclaimer-buttons .btn {
    min-height: 48px;
    border-radius: 14px;
    font-size: 16px;
}

.disclaimer-buttons .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (min-width: 560px) {
    .disclaimer-buttons {
        grid-template-columns: 1fr 1fr;
        grid-auto-flow: column;
    }

    .disclaimer-buttons .btn-secondary {
        order: -1;
    }
}

/* The card's saved price under its name. The name always takes two lines of room, so the prices line up along a row. */
.album-name {
    min-height: 2.5em;
}

.album-price {
    display: block;
    margin-top: -2px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: var(--blue-dark);
}

.album-price.none {
    font-weight: 600;
    color: var(--muted);
}

@media (min-width: 560px) {
    .album-price {
        font-size: 13px;
    }
}

/* The value of the whole album, at the bottom right of the panel. */
.album-total {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(29, 78, 216, 0.2);
    text-align: right;
}

.album-total-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.album-total-amount {
    display: block;
    font-size: 22px;
    line-height: 1.2;
    color: var(--blue-dark);
}

.album-total-note {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
}

/* A thumbnail is a button that opens the card's popup. */
.album-card-button {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.album-card-button:focus-visible {
    outline: 3px solid var(--navy);
    outline-offset: 3px;
    border-radius: 8px;
}

.album-card-button:hover .album-thumb {
    box-shadow: 0 5px 16px rgba(31, 42, 68, 0.38);
}

/* The count and the "update all" button in one row. */
.album-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 4px 10px;
}

.album-toolbar .album-count {
    margin: 0;
}

.album-update-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border: 2px solid var(--blue);
    border-radius: 12px;
    background: #fff;
    color: var(--blue-dark);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.album-update-all svg {
    width: 18px;
    height: 18px;
}

.album-update-all:disabled {
    opacity: 0.55;
    cursor: progress;
}

.album-update-status {
    margin: 0 4px 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 600;
}

.album-update-status[hidden] {
    display: none;
}

.album-update-status.is-error {
    background: #fef2f2;
    color: #991b1b;
}

.update-bar {
    display: block;
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(29, 78, 216, 0.18);
}

.update-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 3px;
    background: var(--blue);
    transition: width 0.3s ease;
}

/* The card popup. */
.card-dialog {
    width: calc(100% - 24px);
    max-width: 560px;
    max-height: calc(100dvh - 24px);
    box-sizing: border-box;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: #fff8e1;
    color: var(--navy);
    box-shadow: 0 18px 50px rgba(31, 42, 68, 0.4);
    overflow: hidden;
}

.card-dialog[open] {
    display: flex;
    flex-direction: column;
}

.card-dialog::backdrop {
    background: rgba(31, 42, 68, 0.62);
}

.card-dialog-body {
    overflow-y: auto;
    padding: 18px;
}

/* The close icon in the top right corner; it stays put while the popup scrolls. */
.card-dialog-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(31, 42, 68, 0.78);
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.card-dialog-close svg {
    width: 22px;
    height: 22px;
}

.card-dialog-close:hover {
    background: rgba(31, 42, 68, 0.95);
}

.card-dialog-close:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

.detail-loading {
    margin: 30px 0;
    text-align: center;
    font-weight: 600;
}

.detail-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-right: 30px;
}

.detail-image {
    flex: none;
    width: 38%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(31, 42, 68, 0.3);
}

.detail-title {
    min-width: 0;
}

.detail-title h3 {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.detail-title h3:focus {
    outline: none;
}

.detail-setlogo {
    display: block;
    max-width: 120px;
    max-height: 44px;
    margin: 0 0 4px;
}

.detail-set {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--muted);
}

.detail-version {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.detail-version svg {
    width: 22px;
    height: 31px;
    flex: none;
}

.detail-price {
    margin: 14px 0 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #cfe3ff;
    color: #12306b;
}

.detail-price-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.detail-price-amount {
    display: block;
    font-size: 28px;
    line-height: 1.15;
}

.detail-price-checked {
    display: block;
    font-size: 12px;
    opacity: 0.85;
}

.detail-facts {
    display: grid;
    gap: 4px;
    margin: 0 0 10px;
    font-size: 14px;
}

.detail-facts > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.detail-facts dt {
    font-weight: 600;
}

.detail-facts dd {
    margin: 0;
    text-align: right;
    overflow-wrap: anywhere;
}

.detail-desc {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.45;
    font-style: italic;
}

.detail-buttons {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.detail-buttons .btn {
    min-height: 48px;
    border-radius: 14px;
    font-size: 16px;
}

.detail-buttons .btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

@media (min-width: 560px) {
    .detail-buttons {
        grid-template-columns: 1fr auto;
    }

    .detail-buttons .btn-secondary {
        padding: 0 24px;
    }
}

/* Room for the footer: the pages that fill the screen are a footer's height shorter, so the footer is on screen too. */
:root {
    --footer-h: 52px;
}

.home-page,
.start-page,
.check-page {
    min-height: calc(100vh - var(--footer-h));
    min-height: calc(100dvh - var(--footer-h));
}

/* The privacy and cookie policy pages (Pages/Privacy.cshtml, Pages/Cookies.cshtml). */
.doc-page {
    max-width: 820px;
    margin: 0 auto;
}

.doc-card {
    margin: 4px 10px 16px;
    padding: 18px 18px 22px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(31, 42, 68, 0.12);
    font-size: 15px;
    line-height: 1.55;
}

.doc-card h2 {
    margin: 22px 0 6px;
    font-size: 18px;
    line-height: 1.3;
}

.doc-card p,
.doc-card ul {
    margin: 0 0 12px;
}

.doc-card ul {
    padding-left: 20px;
}

.doc-card li {
    margin-bottom: 8px;
}

.doc-card a {
    color: var(--blue-dark);
}

.doc-updated {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--muted);
}

.doc-table-wrap {
    overflow-x: auto;
    margin: 0 0 12px;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.doc-table th,
.doc-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.doc-table thead th {
    font-size: 13px;
    color: var(--muted);
}

.doc-table code {
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

/* Phones: each cookie is a small block (name above its description) instead of two cramped columns. */
@media (max-width: 559px) {
    .doc-table thead {
        display: none;
    }

    .doc-table tr {
        display: block;
        padding: 8px 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .doc-table th,
    .doc-table td {
        display: block;
        padding: 2px 0;
        border: 0;
    }
}

@media (min-width: 560px) {
    .doc-card {
        margin: 4px 16px 20px;
        padding: 26px 30px 30px;
    }
}

/* ---- Fair swap (Pages/Swap.cshtml, wwwroot/js/swap.js) ----
   Two halves cut by a slanted seam with a VS badge: stacked on a phone, side by side from 900 px. Blue is "You give", orange "You get". */

.swap {
    flex: 1;
    width: 100%;
    max-width: 720px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 4px 10px 12px;
}

.swap-sides {
    display: flex;
    flex-direction: column;
}

.swap-side {
    --side-bg: #cfe3ff;
    --side-ink: #12306b;
    --side-cta: #1d4ed8;
    position: relative;
    padding: 14px 14px 18px;
    background: var(--side-bg);
    color: var(--side-ink);
}

.swap-get {
    --side-bg: #ffd9a0;
    --side-ink: #7a3e00;
    --side-cta: #c2410c;
}

/* Stacked: the seam runs slightly downhill, with a thin gap of page colour along it. */
.swap-give {
    padding-bottom: 48px;
    border-radius: 24px 24px 0 0;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), 0 100%);
}

.swap-get {
    margin-top: -18px;
    padding-top: 40px;
    border-radius: 0 0 24px 24px;
    clip-path: polygon(0 22px, 100% 0, 100% 100%, 0 100%);
}

.swap-vs {
    position: relative;
    z-index: 2;
    height: 0;
    display: flex;
    justify-content: center;
}

.swap-vs span {
    position: absolute;
    top: -34px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    box-sizing: border-box;
    border: 4px solid var(--cream);
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 3px 10px rgba(31, 42, 68, 0.35);
}

.swap-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.swap-head h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
}

/* The "how many cards" stepper. */
.swap-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.swap-step {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid var(--side-cta);
    border-radius: 50%;
    background: #fff;
    color: var(--side-cta);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.swap-step svg {
    width: 20px;
    height: 20px;
}

.swap-step:disabled {
    opacity: 0.35;
    cursor: default;
}

.swap-step:focus-visible,
.swap-slot-btn:focus-visible,
.swap-remove:focus-visible {
    outline: 3px solid var(--navy);
    outline-offset: 2px;
}

.swap-num {
    min-width: 28px;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
}

.swap-slots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.swap-slot {
    position: relative;
    flex: none;
    width: 96px;
    min-width: 0;
}

.swap-slot-btn {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.swap-slot-btn:disabled {
    cursor: default;
}

/* An empty slot: a dashed card-shaped box that says "Add card". */
.swap-slot-btn.is-empty {
    align-items: center;
    justify-content: center;
    gap: 2px;
    aspect-ratio: 63 / 88;
    box-sizing: border-box;
    border: 2px dashed var(--side-cta);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.45);
}

.swap-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--side-cta);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.swap-slot-label {
    padding: 0 4px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.swap-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.5em;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.swap-price {
    display: block;
    margin-top: -2px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.swap-price.none {
    font-weight: 600;
    opacity: 0.7;
}

/* Where the card came from: my cards (album icon) or the camera. */
.swap-source {
    position: absolute;
    left: 4px;
    bottom: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--side-cta);
    color: #fff;
    box-shadow: 0 1px 4px rgba(31, 42, 68, 0.4);
}

.swap-source svg {
    width: 14px;
    height: 14px;
}

.swap-source svg use {
    color: #fff;
}

/* The little cross that takes a card out of its slot again. */
.swap-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    cursor: pointer;
}

.swap-remove svg {
    width: 14px;
    height: 14px;
}

/* A card being read: the photo with the scan running over it. */
.swap-slot.is-scanning .album-pic {
    overflow: hidden;
    border-radius: 6px;
}

.swap-slot.is-scanning .album-pic::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(37, 99, 235, 0.12);
}

.swap-slot.is-scanning .scan-line {
    display: block;
    animation: check-scan 1.7s ease-in-out infinite alternate;
}

.swap-message {
    margin: 10px 0 0;
}

/* The answer under the two halves. */
.swap-result {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 20px;
    background: #fff;
    text-align: center;
    box-shadow: 0 6px 20px rgba(31, 42, 68, 0.12);
}

.swap-status {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
}

.swap-result.is-problem .swap-status {
    color: #9a3412;
}

.swap-verdict h2 {
    margin: 0 0 4px;
    font-size: 21px;
    line-height: 1.25;
}

.swap-verdict p {
    margin: 0;
    font-size: 15px;
}

.swap-result.is-fair {
    background: #dcfce7;
    color: #14532d;
}

.swap-result.is-favorsYou {
    background: #dbeafe;
    color: #1e3a8a;
}

.swap-result.is-favorsThem {
    background: #ffedd5;
    color: #7c2d12;
}

.swap-totals {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin: 12px 0 0;
}

.swap-totals div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.swap-totals dt {
    font-size: 13px;
    font-weight: 600;
}

.swap-totals dd {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.swap-verdict .swap-note {
    margin-top: 12px;
    font-size: 12px;
    opacity: 0.8;
}

/* The popups: where does the card come from, and the user's own cards. */
.swap-sheet {
    max-width: 400px;
}

.swap-sheet-title {
    margin: 4px 40px 14px 0;
    font-size: 20px;
    line-height: 1.2;
}

.swap-choice {
    gap: 10px;
    min-height: 50px;
    font-size: 17px;
}

.swap-choice svg {
    width: 24px;
    height: 24px;
}

.swap-choice use {
    color: inherit;
}

.swap-upload {
    display: block;
    width: 100%;
    margin: 10px 0 0;
    padding: 8px;
    border: 0;
    background: transparent;
    color: var(--blue-dark);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.swap-sheet-hint {
    margin: 6px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.swap-picker {
    max-width: 640px;
}

.swap-picker-status {
    margin: 0 0 10px;
    font-weight: 600;
}

.swap-picker-status:empty {
    display: none;
}

.swap-picker-grid .album-card.is-used {
    opacity: 0.4;
}

.swap-more {
    margin-top: 16px;
}

@media (min-width: 560px) {
    .swap-slot {
        width: 112px;
    }

    .swap-head h2 {
        font-size: 22px;
    }
}

/* Wide screens: the halves side by side, the seam runs top to bottom. */
@media (min-width: 900px) {
    .swap {
        max-width: 1040px;
        padding: 8px 24px 20px;
    }

    .swap-sides {
        flex-direction: row;
        align-items: stretch;
    }

    .swap-side {
        flex: 1;
        min-width: 0;
        padding: 22px 28px 26px;
    }

    .swap-give {
        padding-bottom: 26px;
        padding-right: 44px;
        border-radius: 28px 0 0 28px;
        clip-path: polygon(0 0, 100% 0, calc(100% - 26px) 100%, 0 100%);
    }

    .swap-get {
        margin-top: 0;
        margin-left: -22px;
        padding-top: 22px;
        padding-left: 52px;
        border-radius: 0 28px 28px 0;
        clip-path: polygon(26px 0, 100% 0, 100% 100%, 0 100%);
    }

    .swap-vs {
        flex: none;
        width: 0;
        height: auto;
        align-items: center;
    }

    .swap-vs span {
        top: auto;
        width: 64px;
        height: 64px;
        font-size: 24px;
        transform: translateX(-2px);
    }

    .swap-slot {
        width: 124px;
    }

    .swap-result {
        margin-top: 18px;
        padding: 18px 24px;
    }
}
