/* TrueScan. Plain and big. Every touch target is 64px or taller. */

:root {
  --bg: #101418;
  --card: #1b2129;
  --text: #f4f6f8;
  --dim: #aeb8c2;
  --accent: #ffd23f;   /* warm yellow, easy to spot */
  --accent-ink: #1a1a1a;
  --danger: #ff8a8a;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 20px;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #0b0e11;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.talk-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 0 18px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  background: var(--card);
  border: 2px solid #39434e;
  border-radius: 999px;
  cursor: pointer;
}

.talk-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6b7683;
}

.talk-toggle[aria-pressed="true"] .talk-dot { background: #35d07f; }

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 18px 60px;
}

.screen.hidden { display: none; }

.tagline {
  font-size: 28px;
  font-weight: 700;
  margin: 26px 0 30px;
}

.big-btn {
  display: block;
  width: 100%;
  min-height: 72px;
  margin: 0 0 16px;
  padding: 14px 20px;
  font-size: 23px;
  font-weight: 700;
  color: var(--text);
  background: var(--card);
  border: 2px solid #39434e;
  border-radius: var(--radius);
  cursor: pointer;
}

.big-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  min-height: 84px;
  font-size: 26px;
}

.big-btn:active { transform: scale(0.98); }

.small-btn {
  min-height: 64px;
  width: auto;
  margin: 0;
  font-size: 21px;
  flex: 0 0 auto;
}

.note {
  color: var(--dim);
  font-size: 18px;
  margin: 14px 0;
}

.hidden { display: none !important; }

.typein { margin-top: 34px; }

.typein label {
  display: block;
  font-weight: 700;
  font-size: 21px;
  margin-bottom: 10px;
}

.typein-row {
  display: flex;
  gap: 10px;
}

.typein-row input {
  flex: 1 1 auto;
  min-height: 64px;
  min-width: 0;
  padding: 10px 14px;
  font-size: 20px;
  color: var(--text);
  background: #0b0e11;
  border: 2px solid #39434e;
  border-radius: var(--radius);
}

.section-title {
  font-size: 22px;
  margin: 36px 0 12px;
}

.history {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.history .h-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 19px;
}

.history .h-time {
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 16px;
}

.del-btn {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 64px;
  padding: 0 14px;
  font-size: 19px;
  font-weight: 700;
  color: var(--danger);
  background: transparent;
  border: 2px solid #4a3a3a;
  border-radius: var(--radius);
  cursor: pointer;
}

.link-btn {
  display: block;
  width: 100%;
  min-height: 64px;
  background: transparent;
  border: none;
  color: var(--dim);
  font-size: 20px;
  text-decoration: underline;
  cursor: pointer;
}

.foot {
  margin-top: 44px;
  color: var(--dim);
  font-size: 17px;
  border-top: 1px solid #2a323b;
  padding-top: 18px;
}

/* Scan screen */

.scan-help {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
}

.viewfinder {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}

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

.frame {
  position: absolute;
  inset: 12%;
  border: 4px solid var(--accent);
  border-radius: 12px;
  pointer-events: none;
}

/* Result screen */

.result-text {
  background: #0b0e11;
  border: 2px solid #39434e;
  border-radius: var(--radius);
  padding: 22px;
  font-size: 24px;
  word-break: break-all;
  margin: 6px 0 20px;
}

.safety {
  background: #2a2116;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 22px;
}

.safety-head {
  font-size: 23px;
  font-weight: 800;
  margin: 0 0 8px;
}

.safety-body { font-size: 19px; margin: 0 0 10px; }

.safety-host {
  font-size: 21px;
  font-weight: 700;
  word-break: break-all;
  margin: 0;
  color: var(--accent);
}

.result-actions .big-btn { margin-bottom: 14px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 20px;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 999px;
  min-height: 56px;
}
