/* Device pairing: generous targets, restrained motion and a camera-safe QR. */
.pair-page { --muted: var(--dim); max-width: 58rem; margin: 0 auto; padding: .6rem var(--pad) 3rem; }
.pair-page *, .pair-page *::before, .pair-page *::after { box-sizing: border-box; }
.pair-page [hidden] { display: none !important; }
.pair-page svg { width: 24px; height: 24px; flex: none; }
.pair-heading { display: grid; gap: 8px; text-align: center; margin: 0 auto 1.1rem; }
.pair-eyebrow { font-size: .66rem; line-height: 1.4; letter-spacing: .16em; font-weight: 750; color: #9ab7ed; }
.pair-heading h1 { margin: 0; font-size: clamp(1.8rem, 3.3vw, 2.4rem); line-height: 1.1; letter-spacing: -.045em; font-weight: 650; }
.pair-heading p { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.7; }
.pair-directions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1.15rem; }
.pair-direction { display: flex; align-items: center; gap: 14px; padding: 15px 18px; min-height: 80px; border: 1px solid #ffffff12; border-radius: 16px; background: #ffffff03; color: var(--fg); text-align: left; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.pair-direction:hover { background: #ffffff08; border-color: #ffffff29; }
.pair-direction[aria-pressed=true] { border-color: #819dd45c; background: linear-gradient(115deg, #728fce1f, #7a93c008); box-shadow: inset 0 1px #ffffff08; }
.pair-direction i, .pair-service-choice i, .pair-incoming i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: #9da9d915; color: #b5c5eb; flex: none; }
.pair-direction[data-mode=receive] i { color: #8bd9c6; background: #70c8ac13; }
.pair-direction strong { display: block; font-size: .94rem; font-weight: 600; line-height: 1.5; }
.pair-direction small { display: block; font-size: .77rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.pair-workspace { border: 1px solid #ffffff12; border-radius: 24px; background: radial-gradient(ellipse at 80% 0%, #5476990d, transparent 65%), #ffffff03; padding: 1rem 1.6rem; box-shadow: 0 20px 60px #00000015; }
.pair-worktop { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 26px; }
.pair-connection { display: inline-flex; align-items: center; gap: 9px; font-size: .78rem; color: var(--muted); }
.pair-connection b { display: block; width: 7px; height: 7px; border-radius: 50%; background: #8c99b1; box-shadow: 0 0 0 4px #8c99b10c; }
.pair-connection[data-kind=ok] { color: #96d9c0; }
.pair-connection[data-kind=ok] b { background: #81d7b6; box-shadow: 0 0 0 4px #81d7b60c; }
.pair-connection[data-kind=error] { color: #e5a79e; }
.pair-connection[data-kind=error] b { background: #e5a79e; }
.pair-connection[data-kind=pending] b { animation: pair-breathe 2s ease-in-out infinite; }
.pair-timer { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .72rem; }
.pair-steps { list-style: none; padding: .8rem 0; margin: 0 0 .8rem; display: flex; border-bottom: 1px solid #ffffff0d; }
.pair-steps li { display: flex; align-items: center; gap: 8px; flex: 1; font-size: .75rem; color: var(--muted); }
.pair-steps li:last-child { flex: none; }
.pair-steps li:not(:last-child)::after { content: ''; flex: 1; height: 1px; background: #ffffff10; margin: 0 20px 0 12px; }
.pair-steps b { display: grid; place-items: center; border: 1px solid #ffffff1c; border-radius: 8px; width: 25px; height: 25px; font-size: .7rem; flex: none; }
.pair-steps [aria-current=step] { color: #ccdaf4; }
.pair-steps [aria-current=step] b { background: #9cbaf620; border-color: #9cbaf652; }
.pair-steps [data-done=true] b { color: #89d5b7; background: #89d5b710; border-color: #89d5b72d; }
.pair-body { animation: pair-enter .36s cubic-bezier(.2,.75,.2,1) both; }
.pair-body h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.17; margin: .6rem 0 .9rem; }
.pair-body p { color: var(--muted); line-height: 1.75; font-size: .84rem; margin: 0; }
.pair-body p strong { color: #c7cbd5; font-weight: 550; }
.pair-receive-grid { display: grid; grid-template-columns: minmax(200px, 228px) 1fr; gap: 2rem; align-items: center; padding: .3rem 0 .6rem; }
.pair-qr-card { padding: 13px 13px 20px; background: #fff; border-radius: 23px; box-shadow: 0 10px 35px #0000001f, 0 0 0 6px #aabce806; text-align: center; color: #283750; }
.pair-qr-card > span { display: block; font-size: .5rem; letter-spacing: .16em; font-weight: 750; margin-top: 4px; }
.pair-qr svg { display: block; width: 100%; height: auto; }
.pair-qr-loading { aspect-ratio: 1; display: grid; place-items: center; }
.pair-code-copy { width: 100%; margin: 1.2rem 0 .55rem; padding: 13px 16px; border: 1px solid #b9cced24; border-radius: 12px; color: #dde7fa; background: #aabce807; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.pair-code-copy > span { font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1.2; font-weight: 550; letter-spacing: .1em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pair-code-copy svg { width: 18px; color: #a3b3cf; }
.pair-code-copy:hover { background: #aabce812; }
.pair-copy-note { color: var(--muted); font-size: .72rem; }
.pair-feedback { font-size: .79rem; color: var(--muted); line-height: 1.7; margin: 1rem 0 0; }
.pair-feedback:empty { display: none; }
.pair-feedback[data-kind=error], .pair-key-note[data-kind=error] { color: #e5a79e; }
.pair-key-note[data-kind=ok] { color: #8cd7b8; }
.pair-security { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: .7rem; margin: 1.2rem 0 0; line-height: 1.6; }
.pair-security svg { width: 16px; height: 16px; }
.pair-connect-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8rem; align-items: end; margin-bottom: .5rem; }
.pair-connect-form:has(.pair-connected-code) { display: block; margin-bottom: 1.2rem; }
.pair-connect-form h2 { font-size: 1.75rem; }
.pair-connect-form form > label { display: block; font-size: .73rem; color: var(--muted); margin-bottom: 9px; }
.pair-connect-form form > div { display: flex; gap: 8px; }
.pair-page .btn { border-radius: 12px; min-height: 48px; padding: 12px 20px; font-size: .82rem; }
.pair-page input:not([type=checkbox]) { border: 1px solid #ffffff20; border-radius: 10px; background: #00000014; color: var(--fg); padding: 12px 13px; min-height: 48px; min-width: 0; width: 100%; font: inherit; font-size: .85rem; }
.pair-page #pair-code-entry { font-size: 1.3rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.pair-page input:focus-visible, .pair-page button:focus-visible, .pair-page a:focus-visible { outline: 2px solid #a0b9ec; outline-offset: 4px; }
.pair-page input[type=checkbox] { appearance: auto; width: 20px; height: 20px; flex: none; accent-color: #9fbbed; margin: 0; cursor: pointer; }
.pair-verification { display: flex; gap: 12px; align-items: center; background: #91c1b20a; border: 1px solid #91c1b221; border-radius: 14px; padding: 16px 18px; margin-bottom: 1.8rem; color: #96ceba; animation: pair-enter .3s ease both; }
.pair-verification > svg { width: 21px; }
.pair-verification > div { flex: 1; }
.pair-verification strong { font-size: .8rem; font-weight: 600; }
.pair-verification p { font-size: .71rem; line-height: 1.5; margin-top: 3px; }
.pair-checkcode { white-space: nowrap; font-size: 1.45rem; letter-spacing: .06em; font-weight: 600; font-variant-numeric: tabular-nums; }
.pair-connected-code { display: flex; align-items: center; gap: 9px; font-size: .77rem; color: var(--muted); }
.pair-connected-code > svg { width: 18px; }
.pair-connected-code strong { color: var(--fg); font-variant-numeric: tabular-nums; font-weight: 550; }
.pair-change, .pair-paste, .pair-validate { border: 0; background: none; color: #acc4ee; font: inherit; font-size: .72rem; padding: 10px 8px; min-height: 44px; cursor: pointer; border-radius: 8px; }
.pair-change { margin-left: auto; }
.pair-page button:disabled { cursor: default; opacity: .45; }
.pair-selection-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: .5rem 0 1.35rem; }
.pair-selection-head h2 { font-size: 1.85rem; }
.pair-selected-count { white-space: nowrap; color: #a0aec6; font-size: .72rem; padding-top: 8px; }
.pair-services { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair-service { border: 1px solid #ffffff10; border-radius: 15px; background: #ffffff02; overflow: hidden; transition: border-color .2s, background .2s; }
.pair-service:has(.pair-service-choice input:checked) { border-color: #93b0e540; background: #93b0e507; }
.pair-service-choice { display: flex; align-items: center; gap: 12px; min-height: 89px; padding: 16px; cursor: pointer; }
.pair-service-choice i { width: 38px; height: 38px; border-radius: 10px; }
.pair-service-choice i svg { width: 20px; height: 20px; }
.pair-service-choice strong, .pair-incoming strong { font-size: .85rem; font-weight: 600; display: block; }
.pair-service-choice small, .pair-incoming small { color: var(--muted); font-size: .68rem; display: block; line-height: 1.5; margin-top: 4px; }
.pair-service-edit { border-top: 1px solid #ffffff09; margin: 0 16px; padding: 2px 0 8px; animation: pair-enter .22s ease both; }
.pair-key-source { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 44px; font-size: .65rem; color: var(--muted); }
.pair-paste { font-size: .65rem; padding-left: 2px; padding-right: 0; }
.pair-key-field { display: block; margin: 4px 0 8px; }
.pair-key-field > span { display: block; color: var(--muted); font-size: .66rem; margin-bottom: 6px; }
.pair-key-validation { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pair-key-note { font-size: .67rem; color: var(--muted); line-height: 1.5; }
.pair-validate { padding-right: 0; }
[data-service=torbox] { color: #b5c4f5 !important; background: #91a5ef15 !important; }
[data-service=pmdb] { color: #b8a4e7 !important; background: #b99aee13 !important; }
[data-service=flick] { color: #e0b484 !important; background: #ddaf8512 !important; }
[data-service=stremio] { color: #b2a5f1 !important; background: #ab91ec13 !important; }
[data-service=openrouter] { color: #8ed1c0 !important; background: #91d9bf13 !important; }
.pair-send-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 1.5rem; }
.pair-send-footer p { display: flex; align-items: center; gap: 8px; max-width: 290px; font-size: .72rem; }
.pair-send-footer p svg { width: 18px; }
.pair-send-button { flex: none; }
.pair-result { text-align: center; padding: 1.2rem 0 2rem; max-width: 31rem; margin: 0 auto; animation: pair-enter .35s ease both; }
.pair-result > i { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; background: #9abbe90c; color: #aac6ee; margin: 0 auto 1.5rem; border: 1px solid #a7bde51c; }
.pair-result > i svg { width: 34px; height: 34px; }
.pair-result > .btn, .pair-result-actions { margin-top: 1.7rem; }
.pair-result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.pair-result-success > i { color: #95d8b9; background: #94d9b90e; border-color: #95d8b92d; }
.pair-waiting { display: flex; gap: 10px; align-items: center; justify-content: center; color: #b5c6e6; font-size: .8rem; margin-top: 1.6rem; }
.pair-spinner { display: inline-block; width: 19px; height: 19px; border: 2px solid #9aaece44; border-top-color: #7792ba; border-radius: 50%; animation: pair-spin 1s linear infinite; flex: none; }
.pair-review { max-width: 34rem; margin: auto; animation: pair-enter .3s ease both; }
.pair-incoming { list-style: none; padding: 0; margin: 1.3rem 0; }
.pair-incoming li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #ffffff0d; }
.pair-incoming li > span { flex: 1; }
.pair-incoming li > svg { color: #92c9b2; width: 19px; }
.pair-consent { display: flex; align-items: center; gap: 12px; min-height: 52px; line-height: 1.6; font-size: .78rem; cursor: pointer; padding: 6px 0; }
.pair-review-actions { display: flex; gap: 10px; margin-top: 1rem; }
@keyframes pair-spin { to { transform: rotate(360deg); } }
@keyframes pair-breathe { 50% { opacity: .4; } }
@keyframes pair-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 680px) {
  .pair-page { padding-top: 1.5rem; }
  .pair-heading { margin-bottom: 1.5rem; }
  .pair-heading p { font-size: .82rem; }
  .pair-directions { gap: 9px; }
  .pair-direction { display: block; padding: 14px 12px; border-radius: 13px; }
  .pair-direction i { width: 35px; height: 35px; margin-bottom: 10px; border-radius: 10px; }
  .pair-direction i svg { width: 21px; height: 21px; }
  .pair-direction strong { font-size: .8rem; }
  .pair-direction small { font-size: .66rem; margin-top: 6px; }
  .pair-workspace { padding: 1.1rem; border-radius: 18px; }
  .pair-steps { padding: 1rem 0; margin-bottom: 1.35rem; }
  .pair-steps li { gap: 5px; font-size: .64rem; }
  .pair-steps b { width: 22px; height: 22px; border-radius: 7px; }
  .pair-steps li:not(:last-child)::after { margin: 0 7px; }
  .pair-receive-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .pair-qr-card { width: 228px; max-width: 100%; margin: 0 auto; }
  .pair-receive-copy { text-align: center; max-width: 26rem; margin: auto; grid-row: 1; }
  .pair-receive-copy h2 br { display: none; }
  .pair-code-copy { max-width: 290px; margin-left: auto; margin-right: auto; }
  .pair-connect-form { grid-template-columns: 1fr; gap: 1.2rem; }
  .pair-page #pair-code-entry { font-size: 1.15rem; }
  .pair-connect-form .btn { padding-left: 14px; padding-right: 14px; }
  .pair-verification { flex-wrap: wrap; padding: 14px; gap: 9px; }
  .pair-verification > div { min-width: 150px; }
  .pair-checkcode { flex-basis: 100%; text-align: center; margin-top: 3px; }
  .pair-services { grid-template-columns: 1fr; }
  .pair-selection-head { flex-wrap: wrap; gap: 2px; }
  .pair-selection-head h2 { font-size: 1.7rem; }
  .pair-send-footer { flex-direction: column; align-items: stretch; gap: 14px; }
  .pair-send-footer p { max-width: none; }
  .pair-security { font-size: .63rem; align-items: flex-start; text-align: left; }
  .pair-connected-code { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .pair-page *, .pair-page *::before, .pair-page *::after { animation: none !important; transition: none !important; }
}
