.checkin-page {
    min-width: 0;
    background: #f4f7fb;
}

.checkin-shell {
    width: min(100% - 24px, 1120px);
    min-height: calc(100vh - 65px);
    margin: 0 auto;
    padding: 18px 0 48px;
    outline: none;
}

.checkin-header {
    margin-bottom: 20px;
}

.checkin-back {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 750;
}

.checkin-back svg {
    width: 19px;
    height: 19px;
}

.checkin-eyebrow,
.checkin-result-label {
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.checkin-header h1 {
    margin: 5px 0 7px;
    color: var(--text-primary);
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.checkin-event-meta {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

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

.checkin-stat {
    min-width: 0;
    padding: 15px 8px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 5px 14px rgb(15 23 42 / 5%);
    text-align: center;
}

.checkin-stat strong {
    display: block;
    color: #153e75;
    font-size: clamp(24px, 8vw, 36px);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.checkin-stat span {
    display: block;
    margin-top: 7px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.2;
}

.checkin-live-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin: 10px 2px 22px;
    color: var(--text-secondary);
    font-size: 12px;
}

.checkin-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #15803d;
}

.checkin-workspace {
    display: grid;
    gap: 16px;
}

.checkin-panel,
.checkin-roster,
.checkin-result,
.checkin-page-error {
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgb(15 23 42 / 7%);
}

.checkin-panel {
    min-width: 0;
    padding: 20px 16px;
}

.checkin-panel-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.checkin-panel-heading > svg {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    color: #1d4ed8;
}

.checkin-panel-heading h2,
.checkin-roster h2,
.checkin-result h2 {
    color: var(--text-primary);
    font-size: 20px;
    line-height: 1.25;
}

.checkin-panel-heading p {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.checkin-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: 2px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.checkin-button svg {
    width: 19px;
    height: 19px;
}

.checkin-button-primary {
    background: #1d4ed8;
    color: #ffffff;
}

.checkin-button-primary:hover {
    background: #1e40af;
    color: #ffffff;
    text-decoration: none;
}

.checkin-button-secondary {
    border-color: #93c5fd;
    background: #ffffff;
    color: #1e40af;
}

.checkin-button-secondary:hover {
    border-color: #2563eb;
    background: #eff6ff;
    text-decoration: none;
}

.checkin-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

#camera-start {
    width: 100%;
}

.checkin-camera {
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
    border: 3px solid #2563eb;
    border-radius: 14px;
    background: #0f172a;
}

.checkin-camera[hidden] {
    display: none;
}

.checkin-camera video {
    display: block;
    width: 100%;
    min-height: 220px;
    max-height: 420px;
    background: #0f172a;
    object-fit: cover;
}

.checkin-camera-stop {
    position: absolute;
    right: 10px;
    bottom: 10px;
    border-color: #ffffff;
    background: rgb(15 23 42 / 90%);
    color: #ffffff;
}

.checkin-camera-message {
    min-height: 20px;
    margin-top: 9px;
    color: #854d0e;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
}

.checkin-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 17px 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.checkin-divider::before,
.checkin-divider::after {
    height: 1px;
    background: #dbe4ef;
    content: "";
    flex: 1;
}

.checkin-form {
    display: grid;
    gap: 7px;
}

.checkin-form label,
.checkin-search-label {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 750;
}

.checkin-form input,
.checkin-form textarea,
.checkin-search input {
    width: 100%;
    min-height: 48px;
    padding: 11px 12px;
    border: 1.5px solid #aebdcd;
    border-radius: 9px;
    background: #ffffff;
    color: var(--text-primary);
    font: inherit;
    font-size: 16px;
}

.checkin-form textarea {
    min-height: 82px;
    resize: vertical;
}

.checkin-form input:focus,
.checkin-form textarea:focus,
.checkin-search input:focus {
    border-color: #2563eb;
    outline: 3px solid #bfdbfe;
    outline-offset: 1px;
}

.checkin-form .checkin-button {
    width: 100%;
    margin-top: 5px;
}

.checkin-field-help {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.checkin-field-error {
    min-height: 20px;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}

.checkin-result {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 16px;
    padding: 20px 16px;
    outline: none;
}

.checkin-result[hidden] {
    display: none;
}

.checkin-result > svg {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
}

.checkin-result > div {
    min-width: 0;
}

.checkin-result h2 {
    margin: 3px 0 6px;
    overflow-wrap: anywhere;
}

.checkin-result p:last-child {
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
}

.checkin-result[data-result="valid"] {
    border-color: #86efac;
    background: #f0fdf4;
}

.checkin-result[data-result="valid"] > svg,
.checkin-result[data-result="valid"] .checkin-result-label {
    color: #166534;
}

.checkin-result[data-result="used"] {
    border-color: #fbbf24;
    background: #fffbeb;
}

.checkin-result[data-result="used"] > svg,
.checkin-result[data-result="used"] .checkin-result-label {
    color: #92400e;
}

.checkin-result[data-result="not-found"],
.checkin-result[data-result="error"] {
    border-color: #fca5a5;
    background: #fef2f2;
}

.checkin-result[data-result="not-found"] > svg,
.checkin-result[data-result="error"] > svg,
.checkin-result[data-result="not-found"] .checkin-result-label,
.checkin-result[data-result="error"] .checkin-result-label {
    color: #991b1b;
}

.checkin-roster {
    margin-top: 18px;
    padding: 20px 16px;
}

.checkin-roster-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.checkin-roster-header .checkin-button span {
    display: none;
}

.checkin-search-label {
    display: block;
    margin-bottom: 6px;
}

.checkin-search {
    position: relative;
}

.checkin-search > svg {
    position: absolute;
    top: 14px;
    left: 12px;
    width: 20px;
    height: 20px;
    color: #64748b;
    pointer-events: none;
}

.checkin-search input {
    padding-left: 40px;
}

.checkin-roster-warning {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    line-height: 1.45;
}

.checkin-attendees {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.checkin-attendee {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #dbe4ef;
    border-radius: 11px;
    background: #ffffff;
}

.checkin-attendee-main,
.checkin-attendee-details {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.checkin-attendee-main strong {
    overflow-wrap: anywhere;
}

.checkin-attendee-main span,
.checkin-attendee-details {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.checkin-attendee-details code {
    color: #475569;
    font-size: 11px;
}

.checkin-attendee-status {
    justify-self: start;
    padding: 6px 9px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 800;
}

.checkin-attendee-status[data-checked-in="true"] {
    background: #dcfce7;
    color: #166534;
}

.checkin-empty {
    margin-top: 16px;
    padding: 30px 16px;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    background: #f8fafc;
    text-align: center;
}

.checkin-empty > svg {
    width: 36px;
    height: 36px;
    color: #1d4ed8;
}

.checkin-empty h3 {
    margin: 10px 0 6px;
    font-size: 18px;
}

.checkin-empty p {
    max-width: 520px;
    margin: 0 auto 17px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.checkin-page-error {
    max-width: 620px;
    margin: 36px auto;
    padding: 42px 22px;
    text-align: center;
}

.checkin-page-error > svg {
    width: 48px;
    height: 48px;
    color: #b91c1c;
}

.checkin-page-error h1 {
    margin: 13px 0 8px;
    font-size: 27px;
}

.checkin-page-error p {
    margin-bottom: 22px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.checkin-back:focus-visible,
.checkin-button:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 3px;
}

@media (min-width: 768px) {
    .checkin-shell {
        width: min(100% - 48px, 1120px);
        padding-top: 30px;
    }

    .checkin-stats {
        gap: 14px;
    }

    .checkin-stat {
        padding: 20px 14px;
    }

    .checkin-stat span {
        font-size: 13px;
    }

    .checkin-workspace {
        grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
        align-items: start;
    }

    .checkin-panel,
    .checkin-roster {
        padding: 26px;
    }

    .checkin-roster-header .checkin-button span {
        display: inline;
    }

    .checkin-attendee {
        grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1fr) auto;
        align-items: center;
    }

    .checkin-attendee-status {
        justify-self: end;
    }
}

@media (min-width: 1024px) {
    .checkin-shell {
        padding-bottom: 72px;
    }

    .checkin-header {
        margin-bottom: 26px;
    }

    .checkin-workspace {
        gap: 22px;
    }
}

@media (min-width: 1440px) {
    .checkin-shell {
        width: 1120px;
    }
}

@media (min-width: 1920px) {
    .checkin-shell {
        padding-top: 42px;
    }
}

@media (min-width: 2560px) {
    .checkin-shell {
        width: 1180px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .checkin-live-dot {
        animation: none;
    }
}
