.identity-camera-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px #071a3650;
  color: var(--ink);
}

.identity-camera-dialog::backdrop {
  background: #071a36c7;
}

.identity-camera-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.identity-camera-body h2,
.identity-camera-instruction,
.identity-camera-state {
  margin: 0;
}

.identity-camera-instruction {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.identity-camera-stage {
  position: relative;
  width: 100%;
  height: min(58dvh, 540px);
  min-height: 320px;
  overflow: hidden;
  border-radius: 14px;
  background: #020712;
}

.identity-camera-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity-camera-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 86%;
  aspect-ratio: var(--identity-camera-ratio, 1.5858);
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 0 100vmax rgba(2, 7, 18, 0.66), inset 0 0 0 2px rgba(223, 189, 118, 0.9);
  pointer-events: none;
}

.identity-camera-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: var(--gold);
  border-style: solid;
}

.identity-camera-corner.top-left {
  top: -5px;
  left: -5px;
  border-width: 5px 0 0 5px;
  border-radius: 8px 0 0;
}

.identity-camera-corner.top-right {
  top: -5px;
  right: -5px;
  border-width: 5px 5px 0 0;
  border-radius: 0 8px 0 0;
}

.identity-camera-corner.bottom-left {
  bottom: -5px;
  left: -5px;
  border-width: 0 0 5px 5px;
  border-radius: 0 0 0 8px;
}

.identity-camera-corner.bottom-right {
  right: -5px;
  bottom: -5px;
  border-width: 0 5px 5px 0;
  border-radius: 0 0 8px;
}

.identity-camera-state {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.identity-camera-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.identity-camera-actions button {
  width: 100%;
}

.identity-camera-capture {
  grid-column: 1 / -1;
}

.identity-camera-dialog[data-state="error"] .identity-camera-stage {
  height: 220px;
  min-height: 220px;
}

.identity-camera-dialog[data-state="error"] .identity-camera-video,
.identity-camera-dialog[data-state="error"] .identity-camera-guide {
  display: none;
}

@media (max-width: 520px) {
  .identity-camera-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
  }

  .identity-camera-body {
    gap: 10px;
    padding: 14px;
  }

  .identity-camera-stage {
    height: min(52dvh, 430px);
    min-height: 280px;
  }

  .identity-camera-actions {
    grid-template-columns: 1fr;
  }

  .identity-camera-capture {
    grid-column: auto;
  }
}

@media (max-height: 700px) {
  .identity-camera-stage {
    height: 42dvh;
    min-height: 220px;
  }
}
