/* The scan screen (ScanView.tsx): the founder's design, 28 Oct 2026. Sizes are rem, which carries the app's text size (--ts). */
.scn {
  position: fixed;
  inset: 0;
  background: #000;
  color: #fff;
  overflow: hidden;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.scn-u {
  position: absolute;
  left: 0;
  top: 0;
  width: 1rem;
  height: 0;
  visibility: hidden;
  pointer-events: none;
}
.scn-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.scn-video[data-off] {
  display: none;
}
.scn-shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 35%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.scn button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.scn button:focus-visible {
  outline: 0.125rem solid #d4e85c;
  outline-offset: 0.125rem;
}

/* The hint pill */
.scn-pill {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 6.94rem);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 2rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(0.5rem);
  backdrop-filter: blur(0.5rem);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
}
.scn-pill svg {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}

/* Close, top left */
.scn-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 0.75rem);
  left: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
}
.scn-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* The three round buttons */
.scn-row {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10.42rem);
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  padding: 0 0.5rem;
}
.scn-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 5.5rem;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
}
.scn-dot {
  width: 5.28rem;
  height: 5.28rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(0.25rem);
  backdrop-filter: blur(0.25rem);
  display: grid;
  place-items: center;
  transition: color 0.15s ease;
}
.scn-dot svg {
  width: 1.67rem;
  height: 1.67rem;
}
.scn-btn[data-on] .scn-dot {
  color: #d4e85c;
}
.scn-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.scn-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Enter code: a small sheet over the camera */
.scn-sheet-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
}
.scn-sheet {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
  border-radius: 1.25rem 1.25rem 0 0;
  background: #fff;
  color: #0b3d2e;
}
.scn-sheet b {
  font-size: 1.125rem;
  font-weight: 650;
}
.scn-sheet p {
  margin: -0.5rem 0 0;
  font-size: 0.9375rem;
  color: #5b6b63;
}
.scn-code {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 0.0625rem solid #d9ddd6;
  border-radius: 0.875rem;
  background: #fff;
  color: #0b3d2e;
  font: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
}
.scn-code:focus {
  outline: 0.125rem solid #0b3d2e;
  outline-offset: 0;
}
.scn-sheet-err {
  color: #b3261e;
  font-size: 0.9375rem;
}
.scn .scn-join {
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 0.875rem;
  background: #0b3d2e;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}
.scn .scn-join:disabled {
  background: #9db3a8;
}

/* No camera: a calm full screen, the two other buttons still there */
.scn-off {
  position: absolute;
  inset: 0 0 auto 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 17rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 2rem;
  text-align: center;
}
.scn:has(.scn-off) {
  background: #0b3d2e;
}
.scn:has(.scn-off) .scn-shade {
  display: none;
}
.scn-off-i {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  margin-bottom: 0.75rem;
}
.scn-off-i svg {
  width: 1.75rem;
  height: 1.75rem;
}
.scn-off b {
  font-size: 1.25rem;
  font-weight: 650;
}
.scn-off p {
  margin: 0;
  max-width: 19rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.scn-off .scn-off-note {
  margin-top: 0.75rem;
  color: #d4e85c;
  font-weight: 500;
}

/* The tracker: four lime brackets that come and go with the QR. */
.scn-trk {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform-origin: var(--cx, 50%) var(--cy, 50%);
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
.scn-trk[data-on] {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
  animation: scn-in 0.2s ease-out;
}
.scn-trk svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.scn-trk path {
  fill: none;
  stroke: #d4e85c;
  stroke-width: 0.3125rem;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.scn-trk[data-on][data-ok] {
  animation: scn-ok 0.5s ease-out forwards;
}
@keyframes scn-in {
  from {
    opacity: 0;
    transform: scale(1.18);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes scn-ok {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(212, 232, 92, 0));
  }
  45% {
    transform: scale(0.93);
    filter: drop-shadow(0 0 0.75rem #d4e85c);
  }
  100% {
    transform: scale(0.96);
    filter: drop-shadow(0 0 0.4rem rgba(212, 232, 92, 0.7));
  }
}
@media (prefers-reduced-motion: reduce) {
  .scn-trk,
  .scn-trk[data-on],
  .scn-trk[data-on][data-ok] {
    animation: none;
    transition: none;
  }
  .scn-dot {
    transition: none;
  }
}
