:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #142033;
  --muted: #5f6f85;
  --border: #d8e0ea;
  --primary: #0b67c2;
  --success: #14853f;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}

.shell {
  min-height: 100dvh;
  padding: 1rem;
}

.scanner {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 22rem;
  margin: 0 auto;
  max-width: 78rem;
}

.camera-card {
  aspect-ratio: 4 / 3;
  background: #0d121a;
  border: 1px solid #0d121a;
  border-radius: .5rem;
  min-height: 18rem;
  overflow: hidden;
  position: relative;
}

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

.guide {
  height: var(--guide-size, 34vmin);
  left: 50%;
  max-height: 58%;
  max-width: 58%;
  min-height: 9rem;
  min-width: 9rem;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--guide-size, 34vmin);
}

.guide::before {
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 999px rgba(13, 18, 26, .24);
  content: "";
  inset: 0;
  position: absolute;
}

.guide span {
  border-color: #00e676;
  border-style: solid;
  height: 22%;
  position: absolute;
  width: 22%;
}

.guide span:nth-child(1) {
  border-width: 4px 0 0 4px;
  left: 0;
  top: 0;
}

.guide span:nth-child(2) {
  border-width: 4px 4px 0 0;
  right: 0;
  top: 0;
}

.guide span:nth-child(3) {
  border-width: 0 0 4px 4px;
  bottom: 0;
  left: 0;
}

.guide span:nth-child(4) {
  border-width: 0 4px 4px 0;
  bottom: 0;
  right: 0;
}

.camera-status {
  background: rgba(13, 18, 26, .78);
  border-radius: .4rem;
  bottom: .75rem;
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  left: .75rem;
  padding: .45rem .65rem;
  position: absolute;
}

.panel {
  align-content: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .5rem;
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.eyebrow {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.15;
  margin: .25rem 0 0;
}

.result {
  border: 1px solid #b6dec6;
  border-radius: .5rem;
  background: #f0fbf4;
  padding: .9rem;
}

.result.empty {
  background: #f8fafc;
  border-color: var(--border);
}

.result.error {
  background: #fff3f0;
  border-color: #f0b8b0;
}

.result-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tag-serial {
  color: var(--success);
  font-size: 2.2rem;
  font-weight: 850;
  line-height: 1.1;
  margin-top: .25rem;
}

.result.empty .tag-serial {
  color: var(--muted);
}

.result.error .tag-serial {
  color: var(--danger);
}

.tag-details {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.35;
  margin-top: .35rem;
}

.controls {
  display: grid;
  gap: .5rem;
  grid-template-columns: 1fr 1fr;
}

button,
.file-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: .45rem;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 750;
  justify-content: center;
  min-height: 2.6rem;
  padding: .55rem .8rem;
}

button:first-child {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.file-button {
  grid-column: 1 / -1;
}

.file-button input {
  display: none;
}

.range-row {
  color: var(--muted);
  display: grid;
  font-size: .9rem;
  font-weight: 700;
  gap: .35rem;
}

.hint {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .scanner {
    grid-template-columns: 1fr;
  }

  .panel {
    order: -1;
  }
}
