.tool-main,
.serial-row {
  cursor: pointer;
}

.tool-main:focus-visible,
.serial-row:focus-visible {
  outline: 3px solid rgba(7, 55, 111, 0.3);
  outline-offset: -3px;
}

.detail-unit.selected {
  border: 2px solid #07376f;
  background: #f2f7fc;
  box-shadow: 0 0 0 3px rgba(7, 55, 111, 0.08);
}

.modal-backdrop {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 23, 43, 0.72);
  backdrop-filter: blur(4px);
}

.qr-modal {
  position: relative;
  width: min(100%, 470px);
  max-height: calc(100svh - 36px);
  overflow: auto;
  padding: 28px;
  border-radius: 24px;
  background: #fff;
  text-align: center;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.3);
}

.qr-modal h2 {
  margin: 7px 34px 16px;
  color: #07376f;
  font-size: 23px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #edf3fa;
  color: #07376f;
  font-size: 28px;
}

#qrCanvas {
  display: block;
  width: min(100%, 340px);
  height: auto;
  margin: auto;
  border: 1px solid #e2e6ea;
  background: #fff;
}

.qr-serial {
  margin: 14px 0 18px;
  color: #59636d;
  font-weight: 700;
}

.qr-modal .primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.scanner-modal {
  position: relative;
  width: min(100%, 540px);
  max-height: calc(100svh - 24px);
  overflow: auto;
  padding: 20px;
  border-radius: 24px;
  background: #fff;
}

.scanner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.scanner-header h2 {
  margin: 4px 0 0;
  color: #07376f;
}

.scanner-close {
  position: static;
  flex: 0 0 42px;
}

.camera-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  max-height: 66svh;
  border-radius: 18px;
  background: #071625;
}

#scannerVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-target {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(68%, 290px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  border-radius: 20px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.25);
}

.scanner-status {
  margin: 13px 0;
  text-align: center;
  color: #59636d;
}

.manual-scan {
  padding-top: 12px;
  border-top: 1px solid #e1e6eb;
}

.manual-scan label {
  display: block;
  margin-bottom: 8px;
  color: #59636d;
  font-size: 13px;
}

.manual-scan > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.manual-scan input {
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #9ca6af;
  border-radius: 11px;
}

.manual-scan button {
  border: 0;
  border-radius: 11px;
  padding: 0 16px;
  background: #07376f;
  color: #fff;
  font-weight: 800;
}

@media (min-width: 900px) {
  .camera-frame {
    aspect-ratio: 4 / 3;
    max-height: 560px;
  }
}
