.add-workspace {
  max-width: 920px;
}

.web-scanner {
  margin-top: 30px;
  max-width: 720px;
  overflow: hidden;
  border: 1px solid rgba(108, 203, 232, .28);
  background:
    radial-gradient(circle at 12% 15%, rgba(65, 210, 223, .12), transparent 28%),
    linear-gradient(145deg, #0d1d38, #081222);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .32);
}

.scanner-intro {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 22px;
}

.scanner-symbol {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(65, 210, 223, .48);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 25px;
  box-shadow: 0 0 28px rgba(65, 210, 223, .14);
}

.scanner-intro b {
  display: block;
  font: 600 25px/1 var(--serif);
}

.scanner-intro p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.scanner-intro button,
.isbn-entry button {
  border: 1px solid rgba(230, 189, 114, .55);
  background: rgba(230, 189, 114, .08);
  color: var(--gold);
  white-space: nowrap;
}

.scanner-intro button:hover,
.scanner-intro button:focus-visible,
.isbn-entry button:hover,
.isbn-entry button:focus-visible {
  background: rgba(230, 189, 114, .16);
  outline: none;
}

.scanner-intro button:disabled,
.isbn-entry button:disabled {
  cursor: wait;
  opacity: .55;
}

.camera-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #02050a;
  overflow: hidden;
}

.camera-stage[hidden] {
  display: none;
}

.camera-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.barcode-guide {
  position: absolute;
  inset: 23% 16%;
  background: linear-gradient(90deg, transparent, rgba(65, 210, 223, .08), transparent);
}

.barcode-guide i {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--cyan);
  border-style: solid;
  filter: drop-shadow(0 0 8px rgba(65, 210, 223, .75));
}

.barcode-guide i:nth-child(1) { top: 0; left: 0; border-width: 2px 0 0 2px; }
.barcode-guide i:nth-child(2) { top: 0; right: 0; border-width: 2px 2px 0 0; }
.barcode-guide i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.barcode-guide i:nth-child(4) { right: 0; bottom: 0; border-width: 0 2px 2px 0; }

.barcode-guide span {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 16px 3px rgba(65, 210, 223, .55);
  animation: barcode-sweep 2.4s ease-in-out infinite;
}

.stop-camera {
  position: absolute;
  right: 15px;
  bottom: 15px;
  background: rgba(4, 8, 16, .85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
  padding: 10px 13px;
  backdrop-filter: blur(10px);
}

.scanner-status {
  min-height: 18px;
  margin: 0;
  padding: 12px 22px;
  border-top: 1px solid rgba(209, 225, 255, .1);
  color: #aebbd0;
  font-size: 11px;
}

.scanner-status[data-state="active"] { color: #c8fbff; }
.scanner-status[data-state="success"] { color: #bff5d7; }
.scanner-status[data-state="error"] { color: #ffd1c7; }

.scanner-book-form {
  max-width: 720px;
  margin-top: 18px;
}

.isbn-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  margin-top: 7px;
}

.isbn-entry button {
  padding: 0 17px;
}

.lookup-preview {
  display: flex;
  gap: 17px;
  align-items: center;
  margin: 20px 0 6px;
  padding: 15px;
  border: 1px solid rgba(65, 210, 223, .22);
  background: rgba(65, 210, 223, .06);
}

.lookup-preview[hidden] { display: none; }
.lookup-preview img { width: 58px; aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 5px 8px 15px #0009; }
.lookup-preview small { display: block; color: var(--cyan); font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.lookup-preview b { display: block; margin: 6px 0 3px; font: 600 22px/1 var(--serif); }
.lookup-preview span { color: var(--muted); font-size: 11px; }

@keyframes barcode-sweep {
  0%, 100% { transform: translateY(-55px); opacity: .35; }
  50% { transform: translateY(55px); opacity: 1; }
}

@media (max-width: 680px) {
  .portal-shell { grid-template-columns: minmax(0, 1fr) !important; width: 100%; }
  .portal-nav,
  .portal-nav nav,
  .portal-main,
  .workspace { min-width: 0; width: 100%; max-width: 100%; }
  .portal-nav { overflow: hidden; }
  .portal-nav nav { overflow-x: auto; }
  .web-scanner,
  .scanner-book-form { width: 100%; max-width: 100%; }
  .scanner-intro { grid-template-columns: auto 1fr; }
  .scanner-intro button { grid-column: 1 / -1; width: 100%; }
  .camera-stage { aspect-ratio: 4 / 3; }
  .barcode-guide { inset: 24% 8%; }
  .isbn-entry { grid-template-columns: 1fr; }
  .isbn-entry button { min-height: 45px; }
}

@media (prefers-reduced-motion: reduce) {
  .barcode-guide span { animation: none; }
}
