.handoff-modal {
    z-index: 120;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.handoff-box {
    --box-pad: 26px;
    position: relative;
    width: 100%;
    max-width: 560px;
    padding: 26px var(--box-pad) 18px;
}

.handoff-x {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.handoff-x:hover {
    background: var(--surface-2);
    color: var(--text);
}

.handoff-box h2 {
    padding-right: 36px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.handoff-sub {
    margin-top: 4px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-2);
}

.handoff-body {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
    margin-top: 20px;
}

.handoff-qr {
    position: relative;
    width: 176px;
    aspect-ratio: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.handoff-qr svg {
    display: block;
    width: 100%;
    height: 100%;
}

.handoff-qr.is-loading,
.handoff-modal.is-expired .handoff-qr,
.handoff-modal.is-claimed .handoff-qr {
    opacity: 0.25;
    filter: blur(2px);
}

.handoff-side {
    min-width: 0;
}

.handoff-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: handoff;
}

.handoff-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--text);
    counter-increment: handoff;
}

.handoff-steps li::before {
    content: counter(handoff);
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 600;
}

.handoff-manual {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-3);
}

.handoff-url {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 4px 4px 4px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
}

.handoff-url-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--text-2);
    user-select: all;
}

.handoff-copy {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border: 0;
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 560;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.handoff-copy.is-copied {
    color: var(--text-3);
}

.is-expired .handoff-url-text {
    text-decoration: line-through;
    color: var(--danger);
}

.is-expired .handoff-copy {
    pointer-events: none;
    opacity: 0.5;
}

.handoff-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 20px calc(-1 * var(--box-pad, 0px)) 0;
    padding: 14px var(--box-pad, 0px) 0;
    border-top: 1px solid var(--border);
}

.handoff-status {
    display: inline-flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
    color: var(--text-2);
}

.handoff-status i {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-3);
}

.handoff-status[data-state="wait"] i {
    background: color-mix(in srgb, var(--text) 22%, transparent);
}

.handoff-status[data-state="claimed"] i {
    background: var(--success);
}

.handoff-status[data-state="expired"] i,
.handoff-status[data-state="failed"] i {
    background: var(--danger);
}

.handoff-status[data-state="expired"],
.handoff-status[data-state="failed"] {
    color: var(--danger);
}

.handoff-timer {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--text-3);
}

.handoff-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 560;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.handoff-link.is-danger {
    color: var(--danger);
}

.handoff-link:disabled {
    opacity: 0.5;
}

@media (max-width: 560px) {
    .handoff-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .handoff-qr {
        justify-self: center;
    }

    .handoff-box {
        --box-pad: 18px;
        padding: 22px var(--box-pad) 16px;
    }
}

.handoff-local {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 18px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-2);
    font-family: inherit;
    font-size: 13px;
    font-weight: 520;
    cursor: pointer;
}

.handoff-local span {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.handoff-local:hover {
    color: var(--text);
}

.handoff-local[hidden] {
    display: none;
}
