.face-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--well);
}

.face-compare figure { margin: 0; }
.face-compare img {
  width: 100%;
  height: 168px;
  object-fit: cover;
  border-radius: 6px;
  background: #dfe7f0;
}
.face-compare figcaption { margin-top: 6px; color: var(--muted); font-size: 12px; text-align: center; }

.match-badge {
  min-width: 132px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.match-badge.likely_match { background: #e8f7ee; color: var(--green); }
.match-badge.likely_different { background: #fff1f0; color: var(--danger); }
.match-badge.uncertain, .match-badge.needs_review { background: var(--amber-bg); color: var(--amber); }

.camera-preview.selfie-preview video { transform: scaleX(-1); }

.camera-guide {
  position: absolute;
  pointer-events: none;
  border: 2px dashed rgb(255 255 255 / 72%);
}

.camera-guide-card {
  top: 14%;
  right: 10%;
  bottom: 14%;
  left: 10%;
  border-radius: 10px;
}

.camera-guide-oval {
  top: 50%;
  left: 50%;
  width: 28%;
  height: 58%;
  z-index: 2;
  border-radius: 50%;
  border-width: 3px;
  border-style: dashed;
  transform: translate(-50%, -50%);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.camera-guide-oval.is-searching { border-color: rgb(255 255 255 / 48%); }
.camera-guide-oval.is-found {
  border-style: solid;
  border-color: #f4d35e;
  box-shadow: 0 0 0 3px rgb(244 211 94 / 28%);
}
.camera-guide-oval.is-confirming {
  border-style: solid;
  border-color: #7ee0ff;
  box-shadow: 0 0 0 3px rgb(126 224 255 / 28%);
}
.camera-guide-oval.is-locked {
  border-style: solid;
  border-color: #5ee0c5;
  box-shadow: 0 0 0 3px rgb(94 224 197 / 32%);
}

.camera-face-box {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  border: 2px solid #7ee0ff;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 40%);
}
.camera-face-box::after {
  position: absolute;
  left: 0;
  top: -20px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgb(7 22 55 / 82%);
  color: #7ee0ff;
  content: "Tracking";
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.4;
}
.camera-face-box.is-locked {
  border-color: #5ee0c5;
}
.camera-face-box.is-locked::after {
  background: rgb(8 48 40 / 86%);
  color: #5ee0c5;
  content: "Registered";
}

.face-print { margin: 0 0 22px; }
.face-print canvas {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1730;
}
.face-print p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.face-geometry {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.face-geometry canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.face-geometry i {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #7ee0ff;
  box-shadow: 0 0 0 2px rgb(7 22 55 / 55%);
}
.face-geometry i[data-point="nose"] { background: #5ee0c5; }
.face-geometry i[data-point="mouth"] { background: #f4d35e; }

.liveness-meter {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 4;
  padding: 10px 12px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 6px;
  background: rgb(7 22 55 / 82%);
  color: #fff;
}
.liveness-meter[data-state="tracking"] { border-color: rgb(244 211 94 / 55%); }
.liveness-meter[data-state="confirming"] { border-color: rgb(126 224 255 / 60%); }
.liveness-meter[data-state="holding"] { border-color: rgb(94 224 197 / 70%); }
.liveness-meter[data-state="lost"] { border-color: rgb(255 168 160 / 55%); }

.liveness-meter p { margin: 0 0 6px; font-size: 14px; font-weight: 650; }
.liveness-track { color: #7ee0ff; font-size: 13px !important; }
.liveness-meter[data-state="searching"] .liveness-track { color: rgb(255 255 255 / 72%); }
.liveness-meter[data-state="holding"] .liveness-track { color: #5ee0c5; }
.liveness-meter[data-state="lost"] .liveness-track { color: #ffb4ae; }
.liveness-hint { margin: 0 0 8px !important; color: rgb(255 255 255 / 82%); font-size: 12px !important; font-weight: 520 !important; }

.liveness-lock {
  display: flex;
  gap: 6px;
  margin: 0 0 8px;
}
.liveness-lock i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(255 255 255 / 24%);
}
.liveness-lock i.is-on { background: #5ee0c5; }

.liveness-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgb(255 255 255 / 22%);
}

.liveness-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: #5ee0c5;
  transition: width 90ms linear;
}

.debug-film { margin: 0 0 22px; }
.debug-film-list, .debug-film-inline {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}
.debug-film-list figure, .debug-film-inline figure {
  flex: 0 0 148px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--well);
}
.debug-still { position: relative; display: block; }
.debug-scan-box {
  position: absolute;
  border: 2px solid #2f9d4a;
  box-shadow: 0 0 0 1px #fff;
  pointer-events: none;
}
.debug-film-list img, .debug-film-inline img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 5px;
  background: #dfe7f0;
}
.debug-film-list figcaption, .debug-film-inline figcaption {
  margin: 6px 0 2px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}
.debug-film-list p, .debug-film-inline p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.debug-integrity {
  margin: 0 0 10px;
  color: #33405a;
  font-size: 13px;
}
.debug-integrity[data-state="clear"] { color: var(--green); }
.debug-integrity[data-state="watch"] { color: var(--amber); }
.debug-integrity[data-state="flag"] { color: var(--danger); }
.debug-film-list .is-pass, .debug-film-inline .is-pass { border-color: #7ec89a; background: #e8f7ee; }
.debug-film-list .is-warn, .debug-film-inline .is-warn { border-color: #e2b56b; background: var(--amber-bg); }
.debug-film-list .is-fail, .debug-film-inline .is-fail { border-color: #e3a09b; background: #fff1f0; }
.debug-film-list .is-flag, .debug-film-inline .is-flag { border-color: #d97706; background: #fff6e8; }
.debug-film-inline {
  margin: 0 0 12px;
  padding-top: 4px;
}
.debug-film-inline figure { flex-basis: 118px; background: #fff; }
.debug-film-inline img { height: 84px; }

@media (max-width: 680px) {
  .face-compare { grid-template-columns: minmax(0, 1fr); }
  .face-compare img { height: 150px; }
  .camera-guide-oval { right: 16%; left: 16%; }
}
