/* Focused payment and AI-detector interaction fixes. */

.payment-qr-original {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.payment-qr-viewer[hidden] { display: none; }

.payment-qr-viewer {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(72px, calc(env(safe-area-inset-top) + 64px)) 16px max(28px, env(safe-area-inset-bottom));
  color: #fff;
  background: rgba(5, 5, 5, .96);
}

.payment-qr-viewer img {
  display: block;
  max-width: min(100%, 900px);
  max-height: calc(100vh - 126px);
  max-height: calc(100dvh - 126px);
  object-fit: contain;
  touch-action: pinch-zoom;
}

.payment-qr-viewer-close {
  position: fixed;
  z-index: 2;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, .76);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.payment-qr-viewer-close b {
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.payment-close {
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 0;
  line-height: 1;
}

.payment-close::before,
.payment-close::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform-origin: center;
}

.payment-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.payment-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.payment-global-status {
  margin: -8px 0 -6px;
  padding: 10px 12px;
}

@media (max-width: 720px) {
  .payment-close::before,
  .payment-close::after { width: 12px; }

  .payment-qr-original {
    min-height: 34px;
    font-size: 10px;
    text-underline-offset: 3px;
  }

  .detector-page .detector-progress-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .detector-page .detector-progress-steps li {
    min-width: 0;
    padding-top: 7px;
    font-size: clamp(8px, 2.25vw, 10px);
    letter-spacing: -.02em;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
  }

  .detector-page .detector-workspace-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .detector-page .detector-workspace-head > div {
    min-width: 0;
  }

  .detector-page .detector-workspace-head strong,
  .detector-page .detector-version {
    white-space: nowrap;
  }

  .detector-page .detector-workspace-head strong {
    font-size: clamp(9px, 2.7vw, 12px);
  }

  .detector-page .detector-version {
    flex: 0 0 auto;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    margin: 0;
    font-size: clamp(8px, 2.25vw, 10px);
  }

  .detector-page .detector-result-summary {
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
    row-gap: 7px;
    padding: 16px 14px;
  }

  .detector-page .detector-score {
    grid-column: 1;
    grid-row: 1 / 4;
    width: 92px;
    height: 92px;
    justify-self: start;
    align-self: center;
  }

  .detector-page .detector-score::before {
    width: 70px;
    height: 70px;
  }

  .detector-page .detector-score strong {
    display: inline;
    font-size: 30px;
    line-height: 1;
    letter-spacing: -.055em;
  }

  .detector-page .detector-score span {
    display: inline;
    margin-left: 2px;
    font-size: 9px;
    line-height: 1;
  }

  .detector-page .detector-score > div {
    display: flex;
    align-items: baseline;
    justify-content: center;
    white-space: nowrap;
  }

  .detector-page .detector-result-copy {
    display: contents;
  }

  .detector-page .detector-result-copy > .eyebrow {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    margin: 0;
    text-align: left;
  }

  .detector-page .detector-result-copy h2 {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    font-size: clamp(17px, 4.8vw, 19px);
    line-height: 1.18;
    text-align: left;
  }

  .detector-page .detector-result-copy > p:not(.eyebrow) {
    grid-column: 2;
    grid-row: 3;
    max-width: none;
    margin: 0;
    font-size: 9px;
    line-height: 1.45;
    text-align: left;
  }

  .detector-page .detector-result-metrics {
    grid-column: 1 / -1;
    grid-row: 4;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px;
    width: 100%;
    margin-top: 8px;
    text-align: left;
  }

  .detector-page .detector-result-metrics span {
    flex: 0 0 auto;
    min-width: 0;
    padding: 6px 8px;
    font-size: clamp(8px, 2.15vw, 9px);
    line-height: 1.15;
    white-space: nowrap;
  }

  .detector-page .detector-result-metrics span:last-child {
    padding: 5px 10px;
  }

  .detector-page .detector-result-actions {
    grid-column: 1 / -1;
    grid-row: 5;
    width: 100%;
    max-width: none;
    justify-self: stretch;
    gap: 8px;
  }

  .detector-page .detector-result-actions > * {
    flex: none;
    width: 100%;
  }

  .detector-page .detector-download {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    min-height: 50px;
  }

  .detector-page .detector-rescan { min-height: 42px; }

  .detector-page .detector-download > span { display: grid; }
  .detector-page .detector-download strong,
  .detector-page .detector-download small { white-space: nowrap; }
}
