:root {
  color-scheme: dark;
  --bg: #000;
  --text: #f4f8ff;
  --accent: #46e2a8;
  --border: rgba(255, 255, 255, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body {
  overflow: hidden;
}

.app-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.scanner-stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #010203;
}

.reader,
#reader__scan_region {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.reader video,
.reader canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#reader__scan_region,
#reader__dashboard {
  background: transparent !important;
  border: 0 !important;
}

#reader__scan_region > *:not(video):not(canvas),
#reader__scan_region img {
  display: none !important;
}

.scanner-stage.success::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  box-shadow:
    inset 0 0 0 3px rgba(70, 226, 168, 0.9),
    inset 0 0 64px rgba(70, 226, 168, 0.22);
}

.torch-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 7;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  background: rgba(8, 14, 20, 0.72);
  color: var(--text);
  padding: 0;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  touch-action: manipulation;
}

.torch-button svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

.torch-button.on {
  border-color: rgba(255, 214, 90, 0.9);
  background: rgba(66, 56, 18, 0.74);
  color: #ffe8a3;
}

.torch-button:disabled {
  opacity: 0.6;
}

.torch-button:focus-visible {
  outline: 2px solid rgba(70, 226, 168, 0.95);
  outline-offset: 2px;
}

.result-chip {
  position: relative;
  margin: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 9, 14, 0.7);
  backdrop-filter: blur(10px);
  padding: 12px 14px;
}

.result-value {
  font-size: 1.04rem;
  line-height: 1.3;
  word-break: break-word;
}

.result-format {
  margin-top: 4px;
  min-height: 16px;
  color: rgba(242, 248, 255, 0.72);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.scanner-stage.error::after {
  box-shadow:
    inset 0 0 0 3px rgba(255, 111, 102, 0.9),
    inset 0 0 64px rgba(255, 111, 102, 0.18);
}
