/* PulseDrivers camera scan v1 (STATIC_VERSION 2.0.145, pdfix105).
   Camera button in the search bar (touch devices only), full-screen dark
   viewfinder / photo crop step, and the confirm bottom sheet.
   Tokens come from pd-theme.css (fallbacks kept so it never renders light). */

html.pd-scan-lock, html.pd-scan-lock body { overflow: hidden; }

/* ---------- camera button inside .pd-search-field ---------- */
.pd-scan-btn[hidden] { display: none !important; }
.pd-scan-btn {
  position: absolute; right: .2rem; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.1rem; padding: 0; margin: 0;
  border: 0; border-radius: var(--pd-radius-sm, .3rem);
  background: transparent; color: var(--pd-silver, #b9bec4);
  font-size: 1.15rem; line-height: 1; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s ease, background-color .15s ease;
}
.pd-scan-btn:hover, .pd-scan-btn:focus-visible { color: #fff; background: var(--pd-accent-soft, rgba(208,24,32,.14)); }
.pd-scan-btn:focus-visible { outline: 2px solid var(--pd-accent-text, #ff5a5f); outline-offset: 1px; }
.pd-scan-btn:active { color: var(--pd-accent-text, #ff5a5f); }
.pd-search-field.has-scan .form-control { padding-right: 2.7rem; }
/* hide the native search "x" so it doesn't sit under the camera */
.pd-search-field.has-scan input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

/* ---------- full-screen scanner ---------- */
.pd-scan {
  --pd-g-w: min(84vw, 24rem); --pd-g-h: min(42vw, 11rem); --pd-g-cy: 44%;
  position: fixed; inset: 0; z-index: 1080;
  background: #000; color: var(--pd-text, #eceef0);
  font-family: var(--pd-font-body, system-ui, sans-serif);
  overscroll-behavior: contain; touch-action: none;
}
.pd-scan[hidden], .pd-scan [hidden] { display: none !important; }
.pd-scan button { font: inherit; }
.pd-scan svg { width: 1.35rem; height: 1.35rem; flex: 0 0 auto; }

/* The stage does not use overflow + border-radius + transform together: that
   combination can hide or freeze a <video> on iOS Safari. The video itself
   has no transform, filter, opacity animation, will-change or border-radius. */
.pd-scan-stage { position: absolute; inset: 0; background: var(--pd-bg, #0e0f11); }
.pd-scan-video, .pd-scan-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  user-select: none; -webkit-user-select: none; pointer-events: none;
}
.pd-scan-video {
  object-fit: cover; background: #000;
  transform: none; filter: none; opacity: 1; -webkit-transform: none;
}
.pd-scan-photo { object-fit: contain; background: var(--pd-bg, #0e0f11); }
/* Live mirror of the video (only shown when the frames are confirmed non-black). */
.pd-scan-mirror {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  pointer-events: none; background: transparent;
}
/* Debug probe: elementsFromPoint ignores pointer-events:none, so make the media hit-testable for that one call. */
.pd-scan.pd-scan-probe .pd-scan-video, .pd-scan.pd-scan-probe .pd-scan-mirror,
.pd-scan.pd-scan-probe .pd-scan-photo, .pd-scan.pd-scan-probe .pd-scan-mask { pointer-events: auto !important; }

/* Dim area: four plain panels around the guide. No box-shadow spread, no transform on
   the guide: a huge spread shadow on a translate()d element over a hardware video
   layer is a known way to blank the <video> on iOS WebKit (it was the 2.0.141 mask). */
.pd-scan-shade { position: absolute; inset: 0; pointer-events: none; }
.pd-scan-mask { position: absolute; display: block; background: rgba(5, 6, 8, .62); pointer-events: none; }
.pd-scan-mask.t { left: 0; right: 0; top: 0; height: calc(var(--pd-g-cy) - var(--pd-g-h) / 2); }
.pd-scan-mask.b { left: 0; right: 0; bottom: 0; top: calc(var(--pd-g-cy) + var(--pd-g-h) / 2); }
.pd-scan-mask.l { left: 0; top: calc(var(--pd-g-cy) - var(--pd-g-h) / 2); height: var(--pd-g-h); width: calc(50% - var(--pd-g-w) / 2); }
.pd-scan-mask.r { right: 0; top: calc(var(--pd-g-cy) - var(--pd-g-h) / 2); height: var(--pd-g-h); width: calc(50% - var(--pd-g-w) / 2); }

/* guide box (taller, about 2:1 and nearer square for labels) */
.pd-scan-guide {
  position: absolute;
  left: calc(50% - var(--pd-g-w) / 2); top: calc(var(--pd-g-cy) - var(--pd-g-h) / 2);
  width: var(--pd-g-w); height: var(--pd-g-h);
  border-radius: var(--pd-radius, .5rem);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
  touch-action: none;
}
.pd-scan-corner { position: absolute; width: 1.6rem; height: 1.6rem; border: 0 solid var(--pd-accent, #d01820); }
.pd-scan-corner.tl { left: -3px; top: -3px; border-left-width: 4px; border-top-width: 4px; border-top-left-radius: var(--pd-radius, .5rem); }
.pd-scan-corner.tr { right: -3px; top: -3px; border-right-width: 4px; border-top-width: 4px; border-top-right-radius: var(--pd-radius, .5rem); }
.pd-scan-corner.bl { left: -3px; bottom: -3px; border-left-width: 4px; border-bottom-width: 4px; border-bottom-left-radius: var(--pd-radius, .5rem); }
.pd-scan-corner.br { right: -3px; bottom: -3px; border-right-width: 4px; border-bottom-width: 4px; border-bottom-right-radius: var(--pd-radius, .5rem); }
.pd-scan-line {
  position: absolute; left: 6%; right: 6%; top: 50%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--pd-accent-hover, #e11d26), transparent);
  box-shadow: 0 0 12px rgba(225, 29, 38, .8);
  opacity: .9;
}
.pd-scan[data-mode="live"] .pd-scan-line { animation: pd-scan-sweep 2.2s var(--pd-ease, cubic-bezier(.2,.7,.2,1)) infinite alternate; }
.pd-scan:not([data-mode="live"]) .pd-scan-line { opacity: 0; animation: none; }
.pd-scan.is-reading .pd-scan-guide { box-shadow: inset 0 0 0 2px rgba(225, 29, 38, .75); }
@keyframes pd-scan-sweep { from { top: 12%; } to { top: 88%; } }

/* photo crop step: the box can be dragged, and resized from its corner handle */
.pd-scan[data-mode="photo"] .pd-scan-guide { cursor: move; }
.pd-scan-handle {
  position: absolute; right: -14px; bottom: -14px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--pd-accent, #d01820); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.6);
  cursor: nwse-resize;
}
.pd-scan[data-mode="photo"] .pd-scan-line { opacity: 0; }

/* top bar */
.pd-scan-top {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: calc(.6rem + env(safe-area-inset-top, 0px)) .75rem .9rem 1rem;
  background: linear-gradient(180deg, rgba(5,6,8,.85), rgba(5,6,8,0));
}
.pd-scan-title {
  margin: 0; color: #fff;
  font-family: var(--pd-font-display, "Barlow Condensed", sans-serif);
  font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .04em;
  font-size: 1.45rem; line-height: 1;
}
.pd-scan-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18); background: rgba(21,23,26,.72); color: #fff;
}
.pd-scan-icon-btn:hover, .pd-scan-icon-btn:focus-visible { background: var(--pd-accent, #d01820); border-color: var(--pd-accent, #d01820); }

/* status pill + hint */
.pd-scan-status {
  position: absolute; left: 50%; top: calc(4.2rem + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  max-width: calc(100% - 2rem); margin: 0; padding: .45rem .9rem;
  border-radius: 999px; background: rgba(21, 23, 26, .9); border: 1px solid var(--pd-line-2, #3a3f46);
  color: var(--pd-text, #eceef0); font-size: .92rem; text-align: center; line-height: 1.3;
}
.pd-scan-status:empty { display: none; }
.pd-scan-status[data-tone="warn"] { border-color: rgba(255, 204, 51, .55); color: #ffe08a; }
.pd-scan-hint {
  position: absolute; left: 1rem; right: 1rem; bottom: calc(6.6rem + env(safe-area-inset-bottom, 0px));
  margin: 0 auto; max-width: 26rem; padding: .7rem .9rem;
  border-radius: var(--pd-radius, .5rem);
  background: rgba(29, 32, 36, .94); border: 1px solid var(--pd-line-2, #3a3f46);
  border-left: 4px solid var(--pd-pre, #ffcc33);
  font-size: .95rem;
}
.pd-scan-hint p { margin: 0; }

/* bottom tool bar */
.pd-scan-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-around; gap: .5rem;
  padding: 1rem .75rem calc(.9rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, rgba(5,6,8,.92), rgba(5,6,8,0));
}
.pd-scan-tool {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
  min-width: 4.5rem; min-height: 3.6rem; padding: .35rem .6rem;
  border: 1px solid rgba(255,255,255,.14); border-radius: var(--pd-radius, .5rem);
  background: rgba(29, 32, 36, .82); color: var(--pd-text, #eceef0);
  font-size: .8rem; font-weight: 600; letter-spacing: .02em;
}
.pd-scan-tool:hover, .pd-scan-tool:focus-visible { border-color: var(--pd-accent, #d01820); color: #fff; }
.pd-scan-tool[aria-pressed="true"] { background: var(--pd-pre, #ffcc33); color: var(--pd-status-contrast, #0e0f11); border-color: var(--pd-pre, #ffcc33); }
.pd-scan-tool.pd-btn-race { flex-direction: row; min-height: 3.2rem; padding: .6rem 1.4rem; border: 0; background: none; font-size: 1.05rem; color: #fff; }
.pd-scan :focus-visible { outline: 2px solid var(--pd-accent-text, #ff5a5f); outline-offset: 2px; }

/* ---------- photo intro (HTTP / no camera / denied) ---------- */
.pd-scan-intro {
  position: absolute; inset: 0; overflow-y: auto; touch-action: pan-y;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  padding: calc(5rem + env(safe-area-inset-top, 0px)) 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
  background:
    radial-gradient(ellipse at 85% 0%, rgba(217, 130, 43, .14), transparent 55%),
    radial-gradient(ellipse at 10% 100%, rgba(208, 24, 32, .16), transparent 55%),
    var(--pd-bg, #0e0f11);
}
.pd-scan-intro-art {
  position: relative; width: min(78vw, 18rem); aspect-ratio: 3 / 2;
  border-radius: var(--pd-radius, .5rem);
  background: linear-gradient(180deg, #2a2e33, #1b1e22);
  border: 1px solid var(--pd-line-2, #3a3f46);
  display: flex; align-items: center; justify-content: center;
}
.pd-scan-intro-art::before {
  content: ""; position: absolute; inset: 22% 10%;
  border-radius: 4px; background: #f3f3ef;
}
.pd-scan-intro-art::after {
  content: ""; position: absolute; inset: calc(22% - 8px) calc(10% - 8px);
  border: 3px solid var(--pd-accent, #d01820); border-radius: var(--pd-radius, .5rem);
  -webkit-mask: linear-gradient(#000 0 0) top left / 22% 30% no-repeat, linear-gradient(#000 0 0) top right / 22% 30% no-repeat,
                linear-gradient(#000 0 0) bottom left / 22% 30% no-repeat, linear-gradient(#000 0 0) bottom right / 22% 30% no-repeat;
          mask: linear-gradient(#000 0 0) top left / 22% 30% no-repeat, linear-gradient(#000 0 0) top right / 22% 30% no-repeat,
                linear-gradient(#000 0 0) bottom left / 22% 30% no-repeat, linear-gradient(#000 0 0) bottom right / 22% 30% no-repeat;
}
.pd-scan-intro-art span {
  position: relative; z-index: 1; color: #111;
  font-family: var(--pd-font-display, "Barlow Condensed", sans-serif); font-weight: 800; font-size: 1.7rem; letter-spacing: .04em;
}
.pd-scan-intro-lead { margin: 0; max-width: 22rem; font-size: 1.05rem; color: var(--pd-text, #eceef0); line-height: 1.45; }
.pd-scan-intro-lead strong { color: #fff; font-weight: 700; }
.pd-scan-intro-note:empty { display: none; }
.pd-scan-intro-note {
  margin: 0; max-width: 22rem; padding: .6rem .85rem;
  border-radius: var(--pd-radius, .5rem); background: var(--pd-surface-2, #1d2024);
  border-left: 4px solid var(--pd-pre, #ffcc33); color: var(--pd-text-2, #c9cdd2);
  font-size: .92rem; text-align: left;
}
.pd-scan-take { width: min(100%, 20rem); min-height: 3.6rem; font-size: 1.35rem; cursor: pointer; margin-top: .25rem; }
.pd-scan-take svg { width: 1.6rem; height: 1.6rem; }
.pd-scan-link {
  border: 0; background: none; color: var(--pd-text-2, #c9cdd2); padding: .6rem 1rem;
  text-decoration: underline; text-underline-offset: 3px; font-size: 1rem;
}
.pd-scan-link:hover, .pd-scan-link:focus-visible { color: #fff; }
.pd-scan-privacy { margin: 0; color: var(--pd-muted, #9aa1a9); font-size: .85rem; }
.pd-scan-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: -9999px; }

/* ---------- confirm bottom sheet ---------- */
.pd-scan-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.pd-scan-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  margin: 0 auto; max-width: 34rem;
  padding: .55rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  background: var(--pd-surface, #15171a);
  border: 1px solid var(--pd-line, #2c3036); border-bottom: 0;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -14px 34px rgba(0, 0, 0, .6), inset 0 3px 0 var(--pd-accent, #d01820);
  animation: pd-scan-up .32s var(--pd-ease, cubic-bezier(.2,.7,.2,1));
}
@keyframes pd-scan-up { from { transform: translateY(100%); } to { transform: none; } }
.pd-scan-grip { width: 2.6rem; height: 4px; border-radius: 4px; background: var(--pd-line-2, #3a3f46); margin: .2rem auto .7rem; }
.pd-scan-sheet-title {
  margin: 0 0 .7rem; color: #fff;
  font-family: var(--pd-font-display, "Barlow Condensed", sans-serif);
  font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .03em;
  font-size: 1.6rem; line-height: 1.05; word-break: break-word;
}
.pd-scan-label { display: block; margin-bottom: .3rem; color: var(--pd-text-2, #c9cdd2); font-size: .85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pd-scan-code {
  display: block; width: 100%; height: 3.3rem; padding: 0 .9rem;
  border: 1px solid var(--pd-line-2, #3a3f46); border-radius: var(--pd-radius, .5rem);
  background: var(--pd-bg, #0e0f11); color: #fff;
  font-family: var(--pd-font-display, "Barlow Condensed", sans-serif); font-weight: 700;
  font-size: 1.7rem; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5);
}
.pd-scan-code:focus { outline: none; border-color: var(--pd-accent, #d01820); box-shadow: 0 0 0 .2rem rgba(208, 24, 32, .3); }
.pd-scan-help { margin: .35rem 0 0; color: var(--pd-muted, #9aa1a9); font-size: .82rem; }

.pd-scan-alts { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .6rem; }
.pd-scan-alts-label { color: var(--pd-muted, #9aa1a9); font-size: .82rem; margin-right: .1rem; }
.pd-scan-alt {
  min-height: 2.25rem; padding: .2rem .75rem;
  border: 1px solid var(--pd-line-2, #3a3f46); border-radius: 999px;
  background: var(--pd-surface-2, #1d2024); color: var(--pd-text, #eceef0);
  font-family: var(--pd-font-display, "Barlow Condensed", sans-serif); font-weight: 700; font-size: 1rem; letter-spacing: .05em;
}
.pd-scan-alt:hover, .pd-scan-alt:focus-visible { border-color: var(--pd-accent, #d01820); color: #fff; }
/* brand chip row (bare card numbers only) */
.pd-scan-brands { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .65rem; }
.pd-scan-brands-label { flex: 0 0 100%; color: var(--pd-muted, #9aa1a9); font-size: .78rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.pd-scan-brands-note { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--pd-own, #34d27b); }
.pd-scan-brand {
  min-height: 2.25rem; padding: .15rem .7rem;
  border: 1px solid var(--pd-line-2, #3a3f46); border-radius: 999px;
  background: var(--pd-surface-2, #1d2024); color: var(--pd-text-2, #c9cdd2);
  font-size: .88rem; font-weight: 600;
}
.pd-scan-brand:hover, .pd-scan-brand:focus-visible { border-color: var(--pd-accent, #d01820); color: #fff; }
.pd-scan-brand.is-on { background: var(--pd-accent, #d01820); border-color: var(--pd-accent, #d01820); color: #fff; }
.pd-scan-brands[hidden] { display: none !important; }
.pd-scan-result { margin-top: .85rem; }
.pd-scan-result:empty { display: none; }
.pd-scan-result p { margin: 0 0 .5rem; }
.pd-scan-match { color: var(--pd-own, #34d27b); font-weight: 700; font-size: .92rem; letter-spacing: .02em; }
.pd-scan-result[data-kind="candidates"] .pd-scan-match { color: var(--pd-wish, #4aa3ff); }
.pd-scan-note { color: var(--pd-text-2, #c9cdd2); font-size: .92rem; line-height: 1.4; }
.pd-scan-result[data-kind="wait"] .pd-scan-note {
  padding: .55rem .75rem; border-radius: var(--pd-radius, .5rem);
  background: rgba(255, 204, 51, .1); border-left: 4px solid var(--pd-pre, #ffcc33); color: #ffe08a;
}
.pd-scan-result[data-kind="loading"] .pd-scan-note::before {
  content: ""; display: inline-block; width: .9rem; height: .9rem; margin-right: .5rem; vertical-align: -2px;
  border: 2px solid var(--pd-line-2, #3a3f46); border-top-color: var(--pd-accent, #d01820); border-radius: 50%;
  animation: pd-scan-spin .8s linear infinite;
}
@keyframes pd-scan-spin { to { transform: rotate(360deg); } }
.pd-scan-chip {
  display: inline-block; padding: .25rem .65rem;
  border-radius: 999px; background: var(--pd-surface-3, #262a2f); border: 1px solid var(--pd-line-2, #3a3f46);
  color: var(--pd-silver, #b9bec4); font-size: .85rem; font-weight: 600;
}
/* candidate pick list grouped by brand */
.pd-scan-group { margin-top: .7rem; }
.pd-scan-group:first-of-type { margin-top: .35rem; }
.pd-scan-group-title {
  display: flex; align-items: center; gap: .5rem; margin: 0 0 .4rem; color: #fff;
  font-family: var(--pd-font-display, "Barlow Condensed", sans-serif);
  font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .04em; font-size: 1.15rem; line-height: 1.1;
}
.pd-scan-group-title span {
  font-family: var(--pd-font-body, system-ui, sans-serif); font-style: normal; font-weight: 700; text-transform: none; letter-spacing: 0;
  font-size: .72rem; padding: .1rem .5rem; border-radius: 999px; background: rgba(52, 210, 123, .16); color: var(--pd-own, #34d27b);
}
.pd-scan-group.is-hint .pd-scan-row { border-color: rgba(52, 210, 123, .35); }
.pd-scan-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.pd-scan-row {
  display: flex; align-items: center; gap: .75rem; padding: .5rem;
  border-radius: var(--pd-radius, .5rem); background: var(--pd-surface-2, #1d2024);
  border: 1px solid var(--pd-line, #2c3036); color: var(--pd-text, #eceef0); text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.pd-scan-row:hover, .pd-scan-row:focus-visible { border-color: var(--pd-accent, #d01820); background: var(--pd-surface-3, #262a2f); color: #fff; }
.pd-scan-thumb { flex: 0 0 auto; width: 4.2rem; height: 3rem; border-radius: 4px; overflow: hidden; background: #fff; display: flex; align-items: center; justify-content: center; }
.pd-scan-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-scan-noimg { color: var(--pd-muted, #9aa1a9); font-size: 1.4rem; background: var(--pd-surface-3, #262a2f); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pd-scan-row-text { min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.pd-scan-row-title { font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pd-scan-row-meta { color: var(--pd-muted, #9aa1a9); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pd-scan-actions { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; }
.pd-scan-go { flex: 1 1 auto; min-height: 3.1rem; font-size: 1.2rem; }
.pd-scan-go[disabled] { opacity: .45; cursor: not-allowed; }
.pd-scan-go[disabled]::before { background: var(--pd-metal, #5c636b); box-shadow: none; }
.pd-scan-ghost {
  flex: 0 0 auto; min-height: 3.1rem; padding: 0 1.15rem;
  border: 1px solid var(--pd-line-2, #3a3f46); border-radius: var(--pd-radius-sm, .3rem);
  background: var(--pd-surface-3, #262a2f); color: var(--pd-text, #eceef0);
  font-family: var(--pd-font-display, "Barlow Condensed", sans-serif); font-weight: 700; font-size: 1.05rem;
  letter-spacing: .06em; text-transform: uppercase;
}
.pd-scan-ghost:hover, .pd-scan-ghost:focus-visible { border-color: var(--pd-accent, #d01820); color: #fff; }

@media (min-width: 576px) {
  .pd-scan-sheet { bottom: 1rem; border-radius: 1rem; border-bottom: 1px solid var(--pd-line, #2c3036); }
}


/* Camera error panels (getUserMedia / play() / preview watchdog). Sits over the
   stage; no opacity animation from 0, no transform on the video. */
.pd-scan-camerr {
  position: absolute; inset: 0; margin: auto; height: fit-content; height: -webkit-fit-content;
  width: min(22rem, calc(100% - 2rem));
  padding: 1.1rem 1.15rem 1.2rem;
  border-radius: var(--pd-radius, .5rem);
  background: rgba(21, 23, 26, .96);
  border: 1px solid var(--pd-line-2, #3a3f46);
  border-left: 4px solid var(--pd-pre, #ffcc33);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .55);
  text-align: center; z-index: 2;
}
.pd-scan-camerr-title {
  margin: 0 0 .4rem; color: #fff;
  font-family: var(--pd-font-display, "Barlow Condensed", sans-serif);
  font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .03em;
  font-size: 1.35rem; line-height: 1.15; word-break: break-word;
}
.pd-scan-camerr-detail { margin: 0 0 .95rem; color: var(--pd-text-2, #c9cdd2); font-size: .95rem; line-height: 1.4; }
.pd-scan-camerr-detail:empty { display: none; }
.pd-scan-camerr-actions { display: flex; flex-direction: column; align-items: stretch; gap: .65rem; }
.pd-scan-camerr-actions .pd-btn-race { min-height: 3.1rem; width: 100%; font-size: 1.15rem; }

/* ?scandebug=1 overlay: top-left, small, clear of the hint and the guide */
.pd-scan-debug {
  position: absolute; left: .25rem; top: calc(3.7rem + env(safe-area-inset-top, 0px));
  width: calc(100% - .5rem); max-width: 34rem; z-index: 3; margin: 0; padding: .25rem .35rem;
  border-radius: .25rem; background: rgba(0, 0, 0, .6);
  color: #c9cdd2; font: 8px/1.25 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  -webkit-text-size-adjust: 100%;
  white-space: pre-wrap; word-break: break-all; text-align: left;
  pointer-events: none; max-height: 32vh; overflow: hidden;
}
/* with the debug overlay on, park the status pill ("Line up the maker code...") just below the guide so the overlay never covers it */
.pd-scan.pd-scan-dbg[data-mode="live"] .pd-scan-status { top: calc(var(--pd-g-cy) + var(--pd-g-h) / 2 + .8rem); }

@media (prefers-reduced-motion: reduce) {
  .pd-scan-btn, .pd-scan-row, .pd-scan-line { transition: none; }
  .pd-scan[data-mode="live"] .pd-scan-line { animation: none; top: 50%; }
  .pd-scan-sheet { animation: none; }
  .pd-scan-result[data-kind="loading"] .pd-scan-note::before { animation-duration: 2.4s; }
}
