/* /testers and /testers/add: the tester card (RidgeWill/platform#56).
   The frame is chrome.css and the form pieces are support-forms.css; this is
   what a tester card adds to them. */
:root { --dusk: #c9845a; }

/* The form on the left, the card on the right. */
.page { grid-template-columns: minmax(0, 660px) minmax(0, 1fr); }

.card h2.part { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card h2.part small { font-size: 13px; font-weight: 400; color: var(--ink-3); }
.intro { color: var(--ink-2); margin: -4px 0 18px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.loading { color: var(--ink-3); font-size: 15px; }
.gate { max-width: 620px; }
.gate .lead { font-size: 17px; }

/* Stage chips, the home page's project chips at form size. */
.stage { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); white-space: nowrap; color: var(--ink); }
.stage i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--teal-ink); }
.stage.in-dev i { background: #f6c9a8; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--dusk); }
.stage.alpha i { background: #b9c9f7; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--blue-600); }

/* Segmented answers: one tap, the choice stays visible. */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 15px; color: var(--ink); background: #fff; transition: border-color .15s, background-color .15s; }
.seg label:hover span { border-color: var(--blue-600); }
.seg input:checked + span { border-color: var(--blue-600); background: #eef3ff; color: var(--blue-700); font-weight: 600; box-shadow: inset 0 0 0 1px var(--blue-600); }
.seg input:focus-visible + span { outline: 2px solid var(--blue-700); outline-offset: 2px; }
.seg svg { flex: none; }
.seg.stack { flex-direction: column; }
.seg.stack span { width: 100%; }

.detect-note { font-size: 13.5px; color: var(--ink-2); }
.detect-note:empty { display: none; }

/* Where an answer came from, beside its label. */
.src { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.src::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.src.detected { color: var(--teal-ink); }
.src.detected::before { background: var(--teal); box-shadow: 0 0 0 1px var(--teal-ink); }
.src.guess { color: #8a5a22; }
.src.guess::before { background: #f6c9a8; box-shadow: 0 0 0 1px var(--dusk); }
.src.check::before, .src.skip::before { background: #fff; box-shadow: 0 0 0 1px var(--ink-3); }
.field > label .src, .field > .lbl .src { margin-left: auto; }
.in.filled { background: #f6fbfa; border-color: #9fdcd4; }
.in.filled.guess { background: #fffaf3; border-color: #ecc9a4; }
select.in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }

.check { margin-bottom: 12px; }
.checks { display: grid; gap: 4px; }
.pill-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-checks label { position: relative; cursor: pointer; }
.pill-checks input { position: absolute; opacity: 0; }
.pill-checks span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; color: var(--ink-2); background: #fff; }
.pill-checks input:checked + span { background: #eef3ff; border-color: var(--blue-600); color: var(--blue-700); font-weight: 600; }
.pill-checks input:focus-visible + span { outline: 2px solid var(--blue-700); outline-offset: 2px; }

.linkish { all: unset; cursor: pointer; color: var(--blue-700); font-weight: 600; font-size: 14.5px; }
.linkish:hover { text-decoration: underline; }
.linkish:focus-visible { outline: 2px solid var(--blue-700); outline-offset: 3px; border-radius: 4px; }

/* App tiles, now saying which devices each app needs. */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; cursor: pointer; border: 1px solid var(--line-2); border-radius: 12px; padding: 18px 18px 14px; background: #fff; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.tile:hover { border-color: var(--blue-600); box-shadow: 0 6px 20px rgba(43, 99, 232, .12); }
.tile input { position: absolute; top: 18px; right: 18px; width: 18px; height: 18px; accent-color: var(--blue-600); margin: 0; }
.tile .stage { align-self: flex-start; }
.tile b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 12px 0 4px; color: var(--ink); }
.tile .d { display: block; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.tile .needs { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 12px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); margin-top: 14px; }
.tile .needs svg { flex: none; }
.tile .needs.ok { color: var(--teal-ink); }
.tile .needs.miss { color: #8a4b12; }
.tile:has(input:checked) { border-color: var(--blue-600); box-shadow: inset 0 0 0 1px var(--blue-600); background: #f7f9ff; }
.tile:has(input:focus-visible) { outline: 2px solid var(--blue-700); outline-offset: 2px; }
.tile.all { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; padding: 14px 18px; background: var(--wash); }
.tile.all b { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: 0; }
.tile.all input { position: static; }

/* Devices on the card. */
.devices { list-style: none; display: grid; gap: 10px; margin-bottom: 12px; }
.devices:empty { display: none; }
.device { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; background: #fff; }
.device .ico { width: 44px; height: 44px; border-radius: 10px; background: var(--wash); display: grid; place-items: center; color: var(--blue-700); }
.device b { display: block; font-size: 16px; color: var(--ink); }
.device .spec { display: block; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.device .from { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.device .acts { display: flex; gap: 14px; }
.device.fresh { animation: arrive 1.2s cubic-bezier(.16, 1, .3, 1); }
@keyframes arrive { 0% { opacity: .001; transform: translateY(-6px); box-shadow: 0 0 0 4px rgba(64, 224, 208, .45); } 30% { opacity: 1; transform: none; } 100% { box-shadow: 0 0 0 0 rgba(64, 224, 208, 0); } }

/* Adding one: two ways in, then the editor. */
.adder { margin-bottom: 8px; }
.add-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.add-choice { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 16px; transition: border-color .15s, background-color .15s; }
.add-choice:hover { border-color: var(--blue-600); background: #f7f9ff; }
.add-choice:focus-visible { outline: 2px solid var(--blue-700); outline-offset: 2px; }
.add-choice .ico { width: 40px; height: 40px; border-radius: 10px; background: #eef3ff; color: var(--blue-700); display: grid; place-items: center; }
.add-choice b { display: block; font-size: 15.5px; color: var(--ink); }
.add-choice .d { display: block; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }

.other, .editor { border: 1px solid var(--line-2); border-radius: 12px; padding: 20px; background: #fff; }
.other { display: grid; grid-template-columns: 168px 1fr; gap: 22px; align-items: center; }
.qr-box { width: 168px; height: 168px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qr-box #qr img, .qr-box #qr canvas { width: 142px !important; height: 142px !important; }
.other b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.other p { font-size: 14px; color: var(--ink-2); margin: 0 0 10px !important; }
.other .short { font-size: 13.5px; color: var(--ink-3); }
.other .mono { font-size: 13px; color: var(--ink); background: var(--wash); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.other .code { letter-spacing: .12em; font-weight: 500; }
.other-actions, .editor-actions { display: flex; align-items: center; gap: 18px; margin-top: 6px; flex-wrap: wrap; }
.editor-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.editor-head b { font-size: 17px; color: var(--ink); }
.editor-head .detect-note { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* The card, with saving state and what is left before it can be sent. */
.side { position: sticky; top: 88px; }
.tcard { border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(18, 48, 127, .12), 0 18px 50px -18px rgba(18, 48, 127, .4); }
.tcard-top { position: relative; color: #fff; padding: 20px 22px 18px; background: #26365a center 62% / cover no-repeat; }
.tcard-top::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(18, 48, 127, .94) 0%, rgba(30, 79, 208, .82) 60%, rgba(30, 79, 208, .45) 100%); }
.tcard-top > * { position: relative; }
.tcard-brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.saved { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; opacity: .92; }
.saved::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.saved.saving::before { background: #fff; animation: blink .8s ease-in-out infinite alternate; }
.saved:empty { display: none; }
@keyframes blink { to { opacity: .3; } }
.tcard-who { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.tcard-who .rw-avatar { width: 44px; height: 44px; font-size: 18px; }
.tcard-who b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.tcard-who span.e { font-size: 13.5px; opacity: .92; }
.tcard dl { padding: 6px 22px 10px; }
.tcard dl > div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.tcard dl > div:first-child { border-top: 0; }
.tcard dt { color: var(--ink-3); }
.tcard dd { color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.tcard dd.empty { color: var(--ink-3); font-weight: 400; }
.tcard dd .stage { margin: 0 6px 6px 0; }
.tcard dd .dev { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.tcard dd .dev + .dev { margin-top: 6px; }
.tcard dd .dev svg { color: var(--blue-700); width: 18px; height: 18px; flex: none; }
.tcard dd.pop { animation: pop .7s cubic-bezier(.16, 1, .3, 1); }
@keyframes pop { from { background: #e6faf8; } to { background: transparent; } }
.tcard-send { padding: 16px 22px 20px; background: var(--wash); border-top: 1px solid var(--line); }
.todo { list-style: none; display: grid; gap: 8px; margin-bottom: 14px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.todo li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; }
.todo li::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--ink-3); }
.todo li.warn { color: #7a3f0c; }
.todo li.warn::before { background: #f6c9a8; box-shadow: 0 0 0 1px var(--dusk); }
.todo li.done { color: var(--teal-ink); font-weight: 600; }
.todo li.done::before { background: var(--teal); box-shadow: 0 0 0 1px var(--teal-ink); }
.tcard-send .btn { width: 100%; }
/* Not ready yet: still readable, clearly not pressable. */
.tcard-send .btn:disabled { background: var(--wash-2); color: var(--ink-3) !important; box-shadow: inset 0 0 0 1px var(--line-2); }
.tag { font-size: 11px; }

.toast { position: fixed; z-index: 55; left: 50%; top: 80px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; font: 600 14px var(--sans); padding: 11px 16px; border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 22, 38, .3); animation: drop .5s cubic-bezier(.16, 1, .3, 1); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
@keyframes drop { from { opacity: .001; transform: translate(-50%, -10px); } }

@media (prefers-reduced-motion: reduce) {
  .device.fresh, .tcard dd.pop, .toast, .saved.saving::before { animation: none; }
}
@media (max-width: 860px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
}
@media (max-width: 640px) {
  .tiles, .add-choices { grid-template-columns: 1fr; }
  .other { grid-template-columns: 1fr; }
  .device { grid-template-columns: 40px 1fr; }
  .device .acts { grid-column: 2; }
}

/* Saving went wrong, sent, and a code that has run out. */
.saved.error::before { background: #f6a8a8; }
.sent-on { display: grid; gap: 2px; margin: 0 0 14px; padding: 0 0 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.sent-on b { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--teal-ink); }
.sent-on b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1px var(--teal-ink); }
.todo:empty { display: none; }
.tcard-send .problem { margin-bottom: 14px; }
.editor .problem { margin: 4px 0 14px; }
.other .expiry { margin-top: -4px !important; }
.other .expiry.over { color: #8a4b12; font-weight: 600; }
#qr.spent { opacity: .15; }
#qr:empty { width: 142px; height: 142px; border-radius: 6px; background: var(--wash); }

/* /testers/add: the page a scanned code opens. One device, already described. */
.page.single { grid-template-columns: minmax(0, 560px); justify-content: center; }
.found { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center; border: 1px solid var(--line-2); border-radius: 14px; padding: 18px; margin-bottom: 22px; }
.found .ico { width: 56px; height: 56px; border-radius: 14px; background: #eef3ff; color: var(--blue-700); display: grid; place-items: center; }
.found .ico svg { width: 28px; height: 28px; }
.found b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.015em; color: var(--ink); }
.found span { font-size: 14px; color: var(--ink-2); }
.found .linkish { font-size: 13.5px; }
.done-state { text-align: center; padding: 12px 0 8px; }
.done-state .okmark { margin: 0 auto 18px; }
.done-state h2 { border: 0 !important; padding: 0 !important; margin: 0 0 10px !important; font-size: 28px !important; font-weight: 800 !important; letter-spacing: -.02em; }
.done-state p { color: var(--ink-2); max-width: 40ch; margin: 0 auto 22px !important; }
.stack-actions { display: grid; gap: 10px; }
.stack-actions .btn { text-align: center; justify-content: center; }
.code-entry .row { align-items: end; }
.code-entry .in { font-family: 'IBM Plex Mono', monospace; font-size: 20px; letter-spacing: .14em; text-transform: uppercase; }
