:root {
  --neutral-bg: #f4f6f8;
  --neutral-text: #1d2733;
  --box-bg: #ffffff;
  --line: #d8dee5;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  background: var(--neutral-bg);
  color: var(--neutral-text);
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.brand-logo {
  width: auto;
  height: 56px;
  display: block;
}

.result-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90%, 760px);
  z-index: 2;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(3px);
  opacity: 1;
  transition: opacity 140ms ease;
}

.result-box.hidden {
  display: none;
}

.result-box.ok {
  background: rgba(15, 143, 83, 0.9);
  color: #ffffff;
  border-color: rgba(14, 126, 74, 0.95);
}

.result-box.warn,
.result-box.bad {
  background: rgba(219, 138, 31, 0.92);
  color: #ffffff;
  border-color: rgba(198, 120, 16, 0.95);
}

.result-label {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: inherit;
  opacity: 0.95;
}

.result-text {
  margin: 6px 0;
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.05;
}

.result-meta {
  margin: 0;
  color: inherit;
  opacity: 0.95;
}

.scanner-box {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

#preview {
  width: 100%;
  height: min(56vh, 500px);
  object-fit: cover;
  display: block;
}

/* Hide native play UI overlays in Safari/iOS video element. */
#preview::-webkit-media-controls {
  display: none !important;
}

#preview::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button,
select {
  border-radius: 8px;
  border: 1px solid #c7d0db;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

button {
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

button:disabled,
select:disabled {
  opacity: 0.55;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.recent-list li {
  padding: 8px 10px;
  border-bottom: 1px solid #edf1f4;
  font-size: 13px;
}

.recent-list li:last-child {
  border-bottom: 0;
}

.footer-actions {
  display: flex;
  justify-content: center;
}

.danger-btn {
  border: 1px solid #c44a3b;
  background: #fff2f0;
  color: #a62f24;
  font-weight: 700;
}

@media (max-width: 620px) {
  .app {
    padding: 10px;
  }

  .controls > * {
    flex: 1 1 46%;
  }
}
