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

.nw-sc-noscript {
  margin: 0;
  padding: 0.75rem 1rem;
  background: #fef3c7;
  color: #78350f;
  border-bottom: 1px solid #fcd34d;
  font-size: 0.88rem;
  line-height: 1.4;
}

html[data-theme="dark"] .nw-sc-noscript {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
  border-bottom-color: rgba(251, 191, 36, 0.35);
}

.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-boot {
  margin: 0;
  padding: 0.4rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted, #5c5c5c);
  background: rgba(77, 196, 224, 0.14);
  border-bottom: 1px solid var(--border, #d9dee3);
}

.nw-sc-shell--mode-a .nw-sc-boot {
  display: none;
}

.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 max(10rem, 30vh);
  text-align: center;
  color: var(--text-muted, #5c5c5c);
}

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

/* ─── App container (Startscreen + Varianten) ─── */
.nw-sc-app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.nw-sc-shell--mode-a {
  min-height: 100vh;
  min-height: 100dvh;
  /* Feste Viewport-Höhe: sonst kollabiert die Kamera-Zone auf iOS (flex + dynamic toolbar) */
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.nw-sc-shell--mode-a .nw-sc-topbar {
  display: none;
}

.nw-sc-shell--mode-a .nw-sc-app {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  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);
}

/* Startscreen: Moduswahl */
.nw-sc-start {
  flex: 1;
  padding: 1rem 1.25rem max(10rem, 30vh);
  max-width: 26rem;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

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

.nw-sc-start__err {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius, 8px);
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
  font-size: 0.88rem;
}

html[data-theme="dark"] .nw-sc-start__err {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.nw-sc-variant-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.nw-sc-variant-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  min-height: 3.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius, 12px);
  border: 1px solid var(--border, #d9dee3);
  background: var(--bg-card, #fff);
  color: var(--text, #1a1a1a);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(77, 196, 224, 0.25);
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  position: relative;
  z-index: 1;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.nw-sc-variant-card:active:not(:disabled) {
  transform: scale(0.985);
}

.nw-sc-variant-card:hover:not(:disabled) {
  border-color: var(--accent, #4dc4e0);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
}

.nw-sc-variant-card__tap-hint {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent, #0088a8);
  letter-spacing: 0.02em;
}

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

.nw-sc-variant-card--primary {
  border-color: var(--accent, #4dc4e0);
  background: linear-gradient(
    145deg,
    rgba(77, 196, 224, 0.1),
    var(--bg-card, #fff)
  );
}

.nw-sc-variant-card__kicker {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent, #0088a8);
  margin-bottom: 0.35rem;
}

.nw-sc-variant-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.nw-sc-variant-card__desc {
  font-size: 0.82rem;
  color: var(--text-muted, #5c5c5c);
  line-height: 1.4;
}

/* Modus A: Mobil Hochkant (~⅓ Kamera, ~⅔ Panel) */
.nw-sc-mode-a {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  background: var(--bg-page, #f2f5f7);
}

.nw-sc-mode-a__top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: var(--bg-header, #fff);
  border-bottom: 1px solid var(--border, #d9dee3);
}

.nw-sc-mode-a__back {
  padding: 0.4rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.nw-sc-mode-a__back:hover {
  background: rgba(77, 196, 224, 0.12);
}

.nw-sc-mode-a__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #5c5c5c);
  flex: 1;
  text-align: center;
  min-width: 0;
}

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

.nw-sc-mode-a__torch:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nw-sc-mode-a__torch.is-on {
  border-color: var(--accent);
  background: rgba(77, 196, 224, 0.15);
  color: var(--accent);
}

.nw-sc-mode-a__camera {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0b0b0c;
  padding: 0 0.45rem 0.35rem;
  box-sizing: border-box;
}

/* Gleiche Zeilenhöhe wie Scanfenster → Schnellaktionen-Spalte kann Tasten symmetrisch verteilen */
.nw-sc-mode-a__camera-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.45rem;
  width: 100%;
}

/* Kein min-width: 0 — sonst frisst die Aktions-Spalte die Scanner-Spalte (~68 px Reader). */
.nw-sc-mode-a__scanner-col {
  flex: 1 1 56%;
  min-width: min(58vw, 15rem);
  max-width: min(72vw, 22rem);
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.nw-sc-mode-a__reader-wrap {
  position: relative;
  flex: 0 1 auto;
  min-height: 120px;
  max-height: min(60vh, 34rem);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Sichtbares Fenster: nur Cropping (overflow), Breite/Höhe kommen aus JS — kein width:100% (sonst Balken) */
.nw-sc-mode-a__reader-viewport {
  position: relative;
  overflow: hidden;
  display: block;
  width: auto;
  max-width: 100%;
  margin: 0;
  flex-shrink: 0;
  min-height: 100px;
  border-radius: 8px;
}

.nw-sc-mode-a__quick-actions {
  flex: 1 1 44%;
  min-width: 5.25rem;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0;
  min-height: 0;
}

.nw-sc-mode-a__quick-actions-kicker {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
}

/* Resthöhe = Höhe des Scanfensters: Tasten mit space-evenly symmetrisch (oben/unten/zwischen gleich) */
.nw-sc-mode-a__quick-actions-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  justify-content: space-evenly;
  align-items: stretch;
  gap: 0;
}

/* Faktor 2 gegenüber kompakter Ausgangshöhe (~0,42 Padding, eine Zeile Text) */
.nw-sc-mode-a__quick-btn {
  width: 100%;
  box-sizing: border-box;
  padding: 0.84rem 0.5rem;
  min-height: 2.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  -webkit-tap-highlight-color: transparent;
}

.nw-sc-mode-a__quick-btn:hover:not(:disabled) {
  border-color: rgba(77, 196, 224, 0.55);
  background: rgba(77, 196, 224, 0.14);
}

.nw-sc-mode-a__quick-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* Maße ausschließlich per JS (Track-Seitenverhältnis) — kein width:100%/aspect-ratio (Mini-Bild + Balken) */
.nw-sc-mode-a__reader,
#nw-sc-mode-a-reader {
  display: block;
  position: relative;
  background: #000;
  overflow: hidden;
  flex: 0 0 auto;
  box-sizing: border-box;
}

/*
 * Voller Frame im Reader, linear auf Kasten gemappt (html5-qrcode); nur Viewport cropt vertikal.
 * !important: Bibliothek setzt eigene Video-Styles — sonst contain/scale und schwarze Ränder.
 */
#nw-sc-mode-a-reader video {
  position: absolute;
  left: 0;
  top: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: fill !important;
  object-position: center center;
  z-index: 0;
}

#nw-sc-mode-a-reader canvas {
  position: relative;
  z-index: 1;
}

/* Treffer-Feedback: Blitz + Verschluss über der Vorschau (pointer-events: none) */
.nw-sc-mode-a__scan-fx {
  position: absolute;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.nw-sc-mode-a__scan-fx__flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
}

.nw-sc-mode-a__scan-fx__blade {
  position: absolute;
  left: 0;
  right: 0;
  height: 52%;
  background: #0a0a0b;
  transform: translateY(0);
  opacity: 0;
}

.nw-sc-mode-a__scan-fx__blade--top {
  top: 0;
  transform-origin: top center;
}

.nw-sc-mode-a__scan-fx__blade--bottom {
  bottom: 0;
  transform-origin: bottom center;
}

.nw-sc-mode-a__scan-fx--active .nw-sc-mode-a__scan-fx__flash {
  animation: nw-sc-scan-flash 320ms ease-out forwards;
}

.nw-sc-mode-a__scan-fx--active .nw-sc-mode-a__scan-fx__blade--top {
  animation: nw-sc-scan-blade-top 380ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.nw-sc-mode-a__scan-fx--active .nw-sc-mode-a__scan-fx__blade--bottom {
  animation: nw-sc-scan-blade-bottom 380ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

@keyframes nw-sc-scan-blade-top {
  0% {
    opacity: 0;
    transform: translateY(-102%);
  }
  22% {
    opacity: 1;
    transform: translateY(0);
  }
  55% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-102%);
  }
}

@keyframes nw-sc-scan-blade-bottom {
  0% {
    opacity: 0;
    transform: translateY(102%);
  }
  22% {
    opacity: 1;
    transform: translateY(0);
  }
  55% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(102%);
  }
}

@keyframes nw-sc-scan-flash-reduced {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nw-sc-mode-a__scan-fx--active .nw-sc-mode-a__scan-fx__flash {
    animation: nw-sc-scan-flash-reduced 120ms ease-out forwards;
  }

  .nw-sc-mode-a__scan-fx--active .nw-sc-mode-a__scan-fx__blade--top,
  .nw-sc-mode-a__scan-fx--active .nw-sc-mode-a__scan-fx__blade--bottom {
    animation: none;
    opacity: 0;
  }
}

.nw-sc-mode-a__cam-hint {
  flex-shrink: 0;
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
}

.nw-sc-mode-a__panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 1rem max(6rem, 28vh);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-sizing: border-box;
}

.nw-sc-mode-a__status {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted, #5c5c5c);
}

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

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

.nw-sc-mode-a__result {
  padding: 0.85rem 1rem;
  border-radius: var(--radius, 10px);
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #d9dee3);
}

.nw-sc-mode-a__result-h {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #5c5c5c);
}

.nw-sc-mode-a__kind {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent, #0088a8);
}

.nw-sc-mode-a__payload {
  margin: 0;
  max-height: 12rem;
  overflow: auto;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  background: var(--bg-page, #f2f5f7);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text, #1a1a1a);
}

.nw-sc-mode-a__action-placeholder {
  padding: 0.75rem 1rem;
  border-radius: var(--radius, 10px);
  border: 1px dashed var(--border, #c5cad0);
  background: rgba(77, 196, 224, 0.06);
}

.nw-sc-mode-a__action-h {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #5c5c5c);
}

.nw-sc-mode-a__action-note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-muted, #5c5c5c);
}

.nw-sc-mode-a__actions {
  margin-top: auto;
  padding-top: 0.25rem;
}

.nw-sc-mode-a__reset {
  width: 100%;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 10px;
}
