.handoff-modal {
    z-index: 10020;
    padding: 20px;
    overflow-y: auto;
    background: rgba(9, 27, 48, .38);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
}

.handoff-card {
    width: min(620px, 100%);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(5, 26, 57, .22);
}

.handoff-head {
    align-items: center;
    padding: 25px 34px 0;
    border: 0;
}

.handoff-logo { display: block; width: 92px; height: auto; }
.handoff-close { width: 34px; height: 34px; flex: 0 0 34px; font-size: 21px; }
.handoff-body { padding: 36px 40px 40px; }
.handoff-body-code { padding-top: 23px; padding-bottom: 25px; }
.handoff-intro { margin-bottom: 30px; }
.handoff-intro h2, .handoff-code-intro h2 {
    margin: 0;
    color: #0c2c50;
    font-size: clamp(30px, 4.2vw, 39px);
    font-weight: 650;
    line-height: 1.12;
    letter-spacing: -.045em;
}
.handoff-intro p, .handoff-code-intro p {
    margin: 12px 0 0;
    color: #66788a;
    font-size: 15px;
    line-height: 1.5;
}

.handoff-choices { display: grid; gap: 12px; }
.handoff-choice {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 96px;
    gap: 18px;
    padding: 17px 19px;
    border: 1px solid #dce4ed;
    border-radius: 17px;
    background: #fff;
    color: #153957;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.handoff-choice:hover, .handoff-choice:focus-visible {
    border-color: #8bb5dc;
    background: #f8fbfe;
    box-shadow: 0 8px 22px rgba(12, 53, 96, .07);
    transform: translateY(-2px);
    outline: none;
}
.handoff-choice:active { transform: scale(.99); }
.handoff-choice:disabled { opacity: .6; cursor: wait; }
.handoff-device {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border: 1px solid #e3eaf1;
    border-radius: 13px;
    background: #f6f9fc;
    color: #24639b;
}
.handoff-device svg { width: 29px; height: 29px; }
.handoff-choice-copy { display: grid; gap: 3px; min-width: 0; }
.handoff-choice-copy strong { color: #12395e; font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.handoff-choice-copy small { color: #6c7f91; font-size: 13px; line-height: 1.35; }
.handoff-arrow { width: 21px; height: 21px; flex: 0 0 21px; margin-left: auto; color: #7e99b1; transition: transform .18s ease, color .18s ease; }
.handoff-choice:hover .handoff-arrow { transform: translateX(3px); color: #0068d7; }

.handoff-code-view { text-align: center; }
.handoff-code-intro { margin-bottom: 22px; }
.handoff-code-frame {
    display: grid;
    place-items: center;
    width: 232px;
    height: 232px;
    margin: 0 auto;
    padding: 12px;
    border: 1px solid #e1e7ee;
    border-radius: 18px;
    background: #fff;
}
.handoff-code-frame img { display: block; width: 100%; height: 100%; }
.handoff-code-hint { margin: 17px 0 0; color: #66788a; font-size: 13px; }
.handoff-code-copy { display: flex; justify-content: center; margin-top: 16px; }
.handoff-code-copy .handoff-link { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.handoff-code-copy button {
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: #eff5fb;
    color: #236091;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.handoff-code-copy button:hover { background: #e2effa; }
.handoff-code-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 25px;
    padding-top: 22px;
    border-top: 1px solid #edf1f5;
}
.handoff-code-actions button { min-height: 44px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; }
.handoff-back { border: 0; background: transparent; color: #356180; }
.handoff-back:hover { background: #f1f6fa; }
.handoff-next { border: 0; background: #0b5fad; color: #fff; }
.handoff-next:hover { background: #064d91; }
.handoff-next span { margin-left: 8px; }

@media (max-width: 560px) {
    .handoff-modal { align-items: start; padding: 12px; }
    .handoff-card { max-height: none; min-height: calc(100dvh - 24px); overflow: visible; border-radius: 20px; }
    .handoff-head { padding: 23px 23px 0; }
    .handoff-body { padding: 36px 23px 30px; }
    .handoff-body-code { padding-top: 26px; padding-bottom: 24px; }
    .handoff-intro { margin-bottom: 27px; }
    .handoff-choice { min-height: 88px; gap: 13px; padding: 13px 14px; }
    .handoff-device { width: 45px; height: 45px; flex-basis: 45px; }
    .handoff-choice-copy strong { font-size: 16px; }
    .handoff-choice-copy small { font-size: 12px; }
    .handoff-code-frame { width: min(232px, 100%); height: auto; aspect-ratio: 1; }
    .handoff-code-actions { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
    .handoff-modal.show, .handoff-card { animation: none; }
    .handoff-choice, .handoff-arrow { transition: none; }
}
/* Registro de prueba: opciones solo para administradores con sesión. */
.handoff-test { margin-top: 18px; padding: 4px; border: 1px dashed #c9d6e2; border-radius: 16px; background: #f8fafc; }
.handoff-test.is-on { border-color: #e7b45a; background: #fff8ec; }
.handoff-test-main { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
.handoff-test-copy { display: grid; gap: 3px; min-width: 0; }
.handoff-test-copy strong { color: #12395e; font-size: 14px; font-weight: 700; }
.handoff-test-copy small { color: #6c7f91; font-size: 12px; line-height: 1.35; }
.handoff-test-switch { position: relative; flex: 0 0 40px; width: 40px; height: 24px; margin-left: auto; border-radius: 999px; background: #c9d6e2; transition: background .18s ease; }
.handoff-test-switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(18,57,94,.25); transition: transform .18s ease; }
.handoff-test.is-on .handoff-test-switch { background: #d48a12; }
.handoff-test.is-on .handoff-test-switch span { transform: translateX(16px); }
.handoff-test-options { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 14px 12px; }
.handoff-test-options button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid #ead2a6; border-radius: 10px; background: #fff; color: #6b4a12; font-size: 13px; font-weight: 700; cursor: pointer; }
.handoff-test-check { display: grid; width: 16px; height: 16px; place-items: center; border: 1.5px solid #c99a48; border-radius: 4px; }
.handoff-test-options button.is-on .handoff-test-check { border-color: #d48a12; background: #d48a12; }
.handoff-test-options button.is-on .handoff-test-check::after { content: ""; width: 8px; height: 4px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.handoff-test-main:focus-visible, .handoff-test-options button:focus-visible { outline: 3px solid rgba(0,104,215,.2); outline-offset: 2px; }
.test-record-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; padding: 8px 14px; background: #fff3dc; border-bottom: 1px solid #f0d29c; color: #6b4a12; font-size: 12px; }
.test-record-banner b { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
