/* Select Tool · Code-Scanner (QR / Barcode) */

.nw-sc-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page, #f2f5f7);
}

.nw-sc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height, 56px);
  padding: 0 1rem;
  background: var(--bg-header, #fff);
  border-bottom: 1px solid var(--border, #d9dee3);
  box-shadow: var(--shadow, 0 1px 3px rgba(0, 0, 0, 0.08));
}

.nw-sc-topbar__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text, #1a1a1a);
}

.nw-sc-topbar a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}

.nw-sc-topbar a:hover {
  text-decoration: underline;
}

.nw-sc-main {
  flex: 1;
  padding: 1rem 1.25rem 2rem;
  max-width: 36rem;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.nw-sc-lead {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted, #5c5c5c);
  line-height: 1.45;
}

.nw-sc-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.nw-sc-mode__btn {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border, #d9dee3);
  background: var(--bg-card, #fff);
  color: var(--text-muted, #5c5c5c);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.nw-sc-mode__btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nw-sc-mode__btn.is-active {
  border-color: var(--accent);
  background: rgba(77, 196, 224, 0.12);
  color: var(--accent, #0088a8);
}

html[data-theme="dark"] .nw-sc-mode__btn.is-active {
  background: rgba(77, 196, 224, 0.18);
}

.nw-sc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.nw-sc-btn {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border, #d9dee3);
  background: var(--bg-card, #fff);
  color: var(--text, #1a1a1a);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.nw-sc-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nw-sc-btn--primary {
  border: none;
  background: var(--accent);
  color: #fff;
}

.nw-sc-btn--primary:hover {
  background: var(--accent-hover, #0088a8);
  color: #fff;
}

.nw-sc-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nw-sc-last {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius, 8px);
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #d9dee3);
}

.nw-sc-last h2 {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #5c5c5c);
}

.nw-sc-last pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--text, #1a1a1a);
}

.nw-sc-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
}

.nw-sc-list-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #1a1a1a);
}

.nw-sc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: var(--radius, 8px);
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #d9dee3);
  max-height: min(50vh, 22rem);
  overflow: auto;
}

.nw-sc-list li {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border, #e8eaed);
  font-size: 0.85rem;
}

.nw-sc-list li:last-child {
  border-bottom: none;
}

.nw-sc-list time {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted, #5c5c5c);
  margin-bottom: 0.25rem;
}

.nw-sc-list code {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text, #1a1a1a);
}

.nw-sc-status {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted, #5c5c5c);
}

.nw-sc-status--err {
  color: #b45309;
}

html[data-theme="dark"] .nw-sc-status--err {
  color: #fbbf24;
}

.nw-sc-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

.nw-sc-overlay[hidden] {
  display: none !important;
}

.nw-sc-overlay__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.75rem;
  flex-shrink: 0;
}

.nw-sc-overlay__hint {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1 1 8rem;
  min-width: 0;
}

.nw-sc-overlay__bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.nw-sc-overlay__bar-actions > button {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.nw-sc-overlay__bar-actions > button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.nw-sc-overlay__column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.nw-sc-overlay__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 0.5rem 0.35rem;
}

.nw-sc-overlay__viewer {
  position: relative;
  width: 100%;
  max-width: min(100vw - 1rem, 28rem);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

#nw-sc-reader {
  width: 100%;
  max-width: min(100vw - 1rem, 28rem);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

/* Auslöser-Blitz über der Kamera */
.nw-sc-flash {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: 12px;
  background: #fff;
  opacity: 0;
}

.nw-sc-flash.nw-sc-flash--go {
  animation: nw-sc-flash-pulse 0.48s ease-out;
}

.nw-sc-flash.nw-sc-flash--soft {
  animation: nw-sc-flash-soft 0.32s ease-out;
}

@keyframes nw-sc-flash-pulse {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
  }
}

@keyframes nw-sc-flash-soft {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 0.45;
  }
  100% {
    opacity: 0;
  }
}

/* Manuell: Steuerleiste unter der Kamera */
.nw-sc-manual-dock {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1rem 1rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
}

.nw-sc-manual-dock__hint {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.88);
  max-width: 22rem;
}

.nw-sc-shutter {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.nw-sc-shutter__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.nw-sc-shutter__inner {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease, background 0.12s ease;
}

.nw-sc-shutter.is-arming .nw-sc-shutter__ring {
  transform: scale(0.94);
  box-shadow: 0 0 0 3px rgba(77, 196, 224, 0.65), 0 0 18px rgba(77, 196, 224, 0.45);
}

.nw-sc-shutter.is-arming .nw-sc-shutter__inner {
  transform: scale(0.88);
  background: rgba(77, 196, 224, 0.45);
}

.nw-sc-shutter:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nw-sc-capture-panel {
  width: 100%;
  max-width: min(100vw - 1.5rem, 26rem);
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(20, 24, 28, 0.92);
  border: 1px solid rgba(77, 196, 224, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 28px rgba(0, 0, 0, 0.45);
  animation: nw-sc-capture-in 0.22s ease-out;
}

@keyframes nw-sc-capture-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nw-sc-capture-panel__label {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(77, 196, 224, 0.95);
}

.nw-sc-capture-panel__code {
  margin: 0 0 0.65rem;
  max-height: 6rem;
  overflow: auto;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: #f8fafc;
  white-space: pre-wrap;
  word-break: break-word;
}

.nw-sc-capture-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.nw-sc-capture-panel .nw-sc-btn {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nw-sc-capture-panel .nw-sc-btn--primary {
  border: none;
  background: var(--accent, #4dc4e0);
  color: #fff;
}

.nw-sc-capture-panel__discard:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
}

.nw-sc-denied {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted, #5c5c5c);
}

.nw-sc-denied a {
  color: var(--accent);
}
