:root {
  --bg: #020706;
  --bg-2: #06120f;
  --panel: rgba(6, 23, 20, 0.86);
  --panel-2: rgba(5, 14, 13, 0.94);
  --line: rgba(54, 255, 159, 0.22);
  --line-strong: rgba(54, 255, 159, 0.55);
  --neon: #36ff9f;
  --cyan: #66e6ff;
  --gold: #ffcc66;
  --danger: #ff5470;
  --warn: #ffb84d;
  --text: #eafff7;
  --muted: #94bdb1;
  --shadow: 0 0 34px rgba(54, 255, 159, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max: 1220px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, rgba(54,255,159,.16), transparent 34rem),
    radial-gradient(circle at 100% 4%, rgba(102,230,255,.12), transparent 28rem),
    linear-gradient(180deg, #010302, var(--bg) 45%, #020403);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(54,255,159,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54,255,159,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 0 55%, transparent 90%);
  z-index: -3;
}

.background-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  opacity: .45;
  background:
    repeating-linear-gradient(90deg, transparent 0 90px, rgba(102,230,255,.08) 91px, transparent 92px),
    radial-gradient(circle at center, rgba(54,255,159,.08), transparent 42rem);
}

.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .08;
  background: linear-gradient(to bottom, transparent 0, rgba(54,255,159,.16) 50%, transparent 100%);
  height: 18vh;
  animation: scanline 8s linear infinite;
}

@keyframes scanline {
  from { transform: translateY(-25vh); }
  to { transform: translateY(125vh); }
}

img { max-width: 100%; display: block; }

a { color: var(--neon); text-decoration: none; }
a:hover { color: var(--cyan); }

button, input, textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem clamp(1rem, 4vw, 2.2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(1, 5, 4, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
  color: var(--text);
}

.brand strong {
  display: block;
  letter-spacing: .02em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: .78rem;
}

.brand-orb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 18px rgba(54,255,159,.25), inset 0 0 18px rgba(54,255,159,.12);
  position: relative;
}

.brand-orb::before,
.brand-orb::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  inset: 7px;
  border: 1px dashed rgba(102,230,255,.65);
}

.brand-orb::after {
  inset: 16px;
  border-style: solid;
  background: var(--neon);
  box-shadow: 0 0 18px var(--neon);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.main-nav a {
  color: var(--muted);
  border: 1px solid transparent;
  padding: .55rem .78rem;
  border-radius: 999px;
  font-size: .92rem;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(54,255,159,.08);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(54,255,159,.06);
  color: var(--text);
  padding: .55rem;
}

.menu-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--neon);
  box-shadow: 0 0 8px var(--neon);
}

main {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  min-height: clamp(600px, calc(100vh - 72px), 900px);
  display: grid;
  grid-template-columns: minmax(0, 1.26fr) minmax(320px, .74fr);
  gap: 1.2rem;
  align-items: center;
  padding: clamp(2rem, 5vw, 5rem) 0 1rem;
}

.hero-copy,
.status-card,
.scanner-panel,
.results-section,
.submit-panel,
.data-section {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(6, 24, 21, .92), rgba(2, 7, 6, .9)),
    radial-gradient(circle at top left, rgba(54,255,159,.14), transparent 20rem);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 0 30px rgba(54,255,159,.035);
  overflow: hidden;
}

.hero-copy::after,
.status-card::after,
.scanner-panel::after,
.results-section::after,
.submit-panel::after,
.data-section::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(102,230,255,.08);
  border-radius: calc(var(--radius-lg) - 10px);
  pointer-events: none;
}

.hero-copy {
  padding: clamp(1.3rem, 4vw, 3rem);
}

.eyebrow {
  margin: 0 0 .55rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 800;
  font-size: .76rem;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 14ch;
  margin-bottom: 1rem;
  font-size: clamp(2.4rem, 8vw, 5.9rem);
  line-height: .92;
  letter-spacing: -.07em;
  text-shadow: 0 0 20px rgba(54,255,159,.18);
}

h2 {
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -.045em;
}

h3 {
  color: var(--text);
  letter-spacing: -.02em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 66ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.05rem;
}

.search-shell {
  margin-top: 1.5rem;
  display: grid;
  gap: .8rem;
}

.search-shell label,
.console-card label {
  color: var(--muted);
  font-weight: 800;
  font-size: .92rem;
}

.search-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .7rem;
}

input, textarea {
  width: 100%;
  border: 1px solid rgba(54,255,159,.25);
  border-radius: 16px;
  background: rgba(0,0,0,.34);
  color: var(--text);
  outline: none;
  padding: .95rem 1rem;
  box-shadow: inset 0 0 18px rgba(54,255,159,.035);
}

input:focus, textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(54,255,159,.12), inset 0 0 18px rgba(54,255,159,.04);
}

textarea {
  resize: vertical;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.upload-btn,
.chip-row button {
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  padding: .88rem 1.08rem;
  font-weight: 900;
  color: var(--text);
  background: rgba(54,255,159,.09);
  box-shadow: 0 0 18px rgba(54,255,159,.10);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.primary-btn {
  background: linear-gradient(135deg, rgba(54,255,159,.95), rgba(102,230,255,.68));
  color: #00120d;
  border-color: transparent;
  text-shadow: none;
}

.secondary-btn {
  background: rgba(102,230,255,.12);
  border-color: rgba(102,230,255,.45);
}

.ghost-btn {
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.12);
  color: var(--muted);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.upload-btn:hover,
.chip-row button:hover {
  transform: translateY(-1px);
  background: rgba(54,255,159,.16);
}

.primary-btn:hover {
  background: linear-gradient(135deg, rgba(54,255,159,1), rgba(102,230,255,.85));
}

button:disabled {
  cursor: not-allowed;
  opacity: .5;
  transform: none !important;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.chip-row button {
  padding: .55rem .8rem;
  color: var(--muted);
  font-size: .88rem;
}

.status-card {
  padding: 1.35rem;
  min-height: 420px;
  display: grid;
  align-content: center;
}



.hero-brain {
  width: min(100%, 270px);
  height: 270px;
  margin: 0 auto 1.25rem;
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.hero-brain__svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(118,255,31,.42)) drop-shadow(0 0 24px rgba(0,255,195,.18));
}

.status-card h2 {
  color: var(--neon);
  margin-bottom: .55rem;
}

.status-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}

.metric-list span {
  display: grid;
  align-content: center;
  min-height: 86px;
  gap: .22rem;
  border: 1px solid rgba(54,255,159,.2);
  background:
    linear-gradient(180deg, rgba(54,255,159,.08), rgba(0,0,0,.24)),
    rgba(0,0,0,.2);
  border-radius: 14px;
  padding: .9rem .75rem;
  color: var(--muted);
  text-align: center;
  font-size: .82rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.metric-list strong {
  color: var(--text);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1;
  text-shadow: 0 0 18px rgba(102,230,255,.28);
}

.cover-section {
  padding: 0 0 1.5rem;
}

.cover-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(54,255,159,.28);
  box-shadow: var(--shadow);
  background: #010302;
}

.cover-frame img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.cover-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(102,230,255,.18);
  border-radius: inherit;
  box-shadow: inset 0 0 34px rgba(54,255,159,.1);
}

.cover-glow {
  position: absolute;
  inset: auto 16% -32px;
  height: 80px;
  background: radial-gradient(ellipse, rgba(54,255,159,.35), transparent 70%);
  filter: blur(24px);
}

.scanner-panel,
.results-section,
.submit-panel,
.data-section {
  margin: 1.5rem 0;
  padding: clamp(1.1rem, 4vw, 2rem);
}

.section-head {
  position: relative;
  z-index: 1;
  max-width: 850px;
  margin-bottom: 1.1rem;
}

.section-head p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

.scanner-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 1rem;
}

.scanner-card,
.console-card,
.empty-state,
.match-result,
.submit-form,
.local-submissions,
.info-grid article,
.logic-grid article {
  border: 1px solid rgba(54,255,159,.18);
  border-radius: var(--radius-md);
  background: rgba(0,0,0,.22);
  box-shadow: inset 0 0 20px rgba(54,255,159,.03);
}

.scanner-card,
.console-card {
  padding: 1rem;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .55rem;
}

.mode-grid label {
  display: flex;
  gap: .45rem;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  padding: .65rem;
  background: rgba(255,255,255,.025);
}

.mode-grid input {
  width: auto;
  accent-color: var(--neon);
}

.scanner-actions,
.console-actions {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 1rem 0;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
}


.manual-barcode-box {
  margin: .75rem 0 1rem;
  padding: .85rem;
  border: 1px solid rgba(54,255,159,.18);
  border-radius: 16px;
  background: rgba(54,255,159,.045);
}

.manual-barcode-box label {
  display: block;
  margin-bottom: .45rem;
  color: var(--text);
  font-weight: 700;
}

.manual-barcode-row {
  display: flex;
  gap: .6rem;
  align-items: stretch;
}

.manual-barcode-row input {
  flex: 1 1 220px;
  min-width: 0;
}

.manual-barcode-box small {
  display: block;
  margin-top: .4rem;
  color: var(--muted);
}

.camera-frame {
  min-height: 330px;
  position: relative;
  display: grid;
  place-items: stretch;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(54,255,159,.24);
  background:
    linear-gradient(rgba(54,255,159,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54,255,159,.05) 1px, transparent 1px),
    #010302;
  background-size: 34px 34px;
}

.barcode-reader {
  min-height: 330px;
}

.barcode-reader video {
  width: 100% !important;
  min-height: 330px;
  object-fit: cover;
}

#previewCanvas:not([hidden]) {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  background: #010302;
}

.hud-scan-overlay {
  position: absolute;
  inset: 22px;
  border: 1px dashed rgba(54,255,159,.45);
  border-radius: 20px;
  pointer-events: none;
  display: grid;
  place-items: center;
  color: rgba(54,255,159,.58);
  letter-spacing: .22em;
  text-shadow: 0 0 12px rgba(54,255,159,.5);
}

.hud-scan-overlay span {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--neon);
  border-style: solid;
  filter: drop-shadow(0 0 8px rgba(54,255,159,.5));
}

.hud-scan-overlay span:nth-child(1) { left: -1px; top: -1px; border-width: 2px 0 0 2px; }
.hud-scan-overlay span:nth-child(2) { right: -1px; top: -1px; border-width: 2px 2px 0 0; }
.hud-scan-overlay span:nth-child(3) { right: -1px; bottom: -1px; border-width: 0 2px 2px 0; }
.hud-scan-overlay span:nth-child(4) { left: -1px; bottom: -1px; border-width: 0 0 2px 2px; }

.console-card {
  display: grid;
  gap: .75rem;
  align-content: start;
}

.console-line {
  border-left: 3px solid var(--neon);
  color: var(--neon);
  background: rgba(54,255,159,.07);
  padding: .78rem 1rem;
  border-radius: 13px;
}

.detected-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
}

.detected-grid article {
  border: 1px solid rgba(102,230,255,.13);
  border-radius: 14px;
  padding: .75rem;
  background: rgba(102,230,255,.04);
  min-width: 0;
}

.detected-grid small {
  display: block;
  color: var(--muted);
  margin-bottom: .25rem;
}

.detected-grid strong {
  display: block;
  color: var(--text);
  overflow-wrap: anywhere;
  font-size: .9rem;
}

#ocrOutput {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  min-height: 180px;
}

.empty-state {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .35rem;
  padding: 1.5rem;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.results-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
}

.match-result {
  overflow: hidden;
}

.match-result__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(54,255,159,.14);
  background: rgba(54,255,159,.045);
}

.match-result__head h3 {
  margin: 0;
  color: var(--neon);
}

.score-pill {
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle, rgba(54,255,159,.22), rgba(54,255,159,.04));
  box-shadow: 0 0 24px rgba(54,255,159,.18), inset 0 0 22px rgba(54,255,159,.08);
}

.score-pill strong {
  display: block;
  font-size: 1.35rem;
}

.score-pill span {
  display: block;
  color: var(--muted);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: .8rem;
  padding: 1rem;
}

.product-mini {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255,255,255,.025);
}

.product-mini .label {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 800;
}

.product-mini h4 {
  margin: .4rem 0;
  font-size: 1.3rem;
}

.product-meta {
  color: var(--muted);
  line-height: 1.55;
}

.price {
  margin-top: .7rem;
  font-weight: 1000;
  color: var(--text);
  font-size: 1.4rem;
}

.vs-node {
  align-self: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(102,230,255,.45);
  background: rgba(102,230,255,.06);
  font-weight: 1000;
}

.evidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
  gap: .8rem;
  padding: 0 1rem 1rem;
}

.evidence-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .5rem;
}

.evidence-list li {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  color: var(--muted);
  border: 1px solid rgba(54,255,159,.1);
  border-radius: 12px;
  padding: .65rem;
  background: rgba(54,255,159,.03);
}

.evidence-list li::before {
  content: "✓";
  color: var(--neon);
  font-weight: 1000;
}

.saving-box {
  border: 1px solid rgba(255,204,102,.18);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255,204,102,.055);
}

.saving-box strong {
  display: block;
  color: var(--gold);
  font-size: 2rem;
}

.saving-box span {
  color: var(--muted);
}

.warning-box {
  margin-top: .75rem;
  color: #ffe9bd;
  border-left: 3px solid var(--warn);
  padding: .7rem .85rem;
  background: rgba(255,184,77,.08);
  border-radius: 10px;
  line-height: 1.5;
}

.logic-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .75rem;
}

.logic-grid article {
  padding: 1rem;
  display: grid;
  gap: .35rem;
  min-height: 130px;
  align-content: center;
  text-align: center;
}

.logic-grid strong {
  color: var(--neon);
  font-size: 2.3rem;
}

.logic-grid span {
  color: var(--muted);
}

.submit-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .85rem;
  padding: 1rem;
}

.submit-form label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-weight: 800;
}

.submit-form label:last-of-type,
.submit-form button {
  grid-column: 1 / -1;
}

.local-submissions {
  position: relative;
  z-index: 1;
  margin-top: .85rem;
  padding: 1rem;
  color: var(--muted);
  display: grid;
  gap: .55rem;
}

.local-submissions:empty {
  display: none;
}

.local-item {
  border: 1px solid rgba(54,255,159,.12);
  border-radius: 12px;
  padding: .75rem;
  background: rgba(255,255,255,.025);
}

.local-item strong {
  color: var(--text);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 3rem;
}

.info-grid article {
  padding: 1.2rem;
}

.info-grid h3 {
  color: var(--neon);
}

.info-grid p {
  color: var(--muted);
  line-height: 1.6;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 1rem 2rem;
  color: var(--muted);
  text-align: center;
  background: rgba(0,0,0,.2);
}

.site-footer p {
  margin: .25rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 100;
  transform: translateX(-50%) translateY(120px);
  opacity: 0;
  max-width: min(92vw, 760px);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .85rem 1.15rem;
  background: rgba(1, 7, 6, .92);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: .22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1050px) {
  .hero,
  .scanner-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 12ch;
  }

  .logic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .menu-toggle { display: block; }

  .main-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 1rem;
    right: 1rem;
    display: none;
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: .55rem;
    background: rgba(2, 9, 8, .96);
    box-shadow: var(--shadow);
  }

  .main-nav.open { display: grid; }

  .main-nav a {
    border-radius: 12px;
  }

  main {
    width: min(100% - 1rem, var(--max));
  }

  .hero {
    padding-top: 1rem;
    min-height: auto;
  }

  .search-line,
  .comparison,
  .submit-form,
  .info-grid,
  .detected-grid {
    grid-template-columns: 1fr;
  }

  .vs-node {
    justify-self: center;
  }

  .metric-list {
    grid-template-columns: 1fr;
  }

  .status-card {
    min-height: unset;
  }


  .logic-grid {
    grid-template-columns: 1fr;
  }

  .cover-frame img {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding: .7rem .8rem;
  }

  .brand strong {
    font-size: .9rem;
  }

  .brand small {
    font-size: .7rem;
  }

  .brand-orb {
    width: 36px;
    height: 36px;
  }

  h1 {
    font-size: clamp(2.25rem, 15vw, 4rem);
  }

  .hero-copy,
  .scanner-panel,
  .results-section,
  .submit-panel,
  .data-section {
    border-radius: 22px;
  }

  .scanner-actions,
  .console-actions {
    display: grid;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .upload-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .match-result__head {
    align-items: flex-start;
  }

  .score-pill {
    width: 78px;
    height: 78px;
  }
}

/* --- Erweiterungen: Live-Daten, Quellen, Leads, Ergebnis-HUD --- */
.toolbar-row {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 280px);
  gap: .8rem;
  margin: 1rem 0 1.25rem;
}

.toolbar-row input,
.toolbar-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,.28);
  color: var(--text);
  padding: .85rem 1rem;
  outline: none;
}

.lead-section,
.sources-section {
  margin: 1.4rem 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(4, 18, 16, .9), rgba(2, 8, 7, .94));
  box-shadow: var(--shadow);
}

.lead-list,
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.lead-card,
.source-card,
.result-card,
.submission-card {
  border: 1px solid rgba(54,255,159,.18);
  border-radius: var(--radius-md);
  background: rgba(0,0,0,.26);
  padding: 1rem;
  box-shadow: inset 0 0 20px rgba(54,255,159,.035);
}

.lead-card h3,
.source-card h3,
.result-card h3 {
  margin: .6rem 0 .35rem;
}

.lead-card p,
.source-card p,
.result-card p {
  color: var(--muted);
}

.lead-card meter {
  width: 100%;
  height: 10px;
  margin-top: .8rem;
  accent-color: var(--gold);
}

.result-card {
  margin-bottom: 1rem;
}

.result-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  color: var(--muted);
  font-size: .9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  padding: .28rem .65rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
}

.badge.live { color: var(--cyan); border-color: rgba(102,230,255,.46); background: rgba(102,230,255,.08); }
.badge.seed { color: var(--neon); border-color: rgba(54,255,159,.42); background: rgba(54,255,159,.08); }
.badge.ok { color: var(--neon); border-color: rgba(54,255,159,.54); background: rgba(54,255,159,.1); }
.badge.lead { color: var(--gold); border-color: rgba(255,204,102,.42); background: rgba(255,204,102,.08); }
.badge.warn { color: var(--warn); border-color: rgba(255,184,77,.42); background: rgba(255,184,77,.08); }

.comparison-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  margin: 1rem 0;
}

.mini-product {
  border: 1px solid rgba(54,255,159,.16);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255,255,255,.03);
}

.mini-product small {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
}

.mini-product dl {
  display: grid;
  gap: .4rem;
  margin: .8rem 0 0;
}

.mini-product dl div {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: .4rem;
}

.mini-product dt {
  color: var(--muted);
}

.mini-product dd {
  margin: 0;
  word-break: break-word;
}

.score-orb {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  place-self: center;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    conic-gradient(var(--neon) var(--score), rgba(54,255,159,.08) 0),
    radial-gradient(circle at center, rgba(2, 8, 7, .96) 0 58%, transparent 60%);
  box-shadow: 0 0 28px rgba(54,255,159,.2);
}

.score-orb strong {
  display: block;
  font-size: 2rem;
  line-height: .9;
}

.score-orb span {
  display: block;
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .18em;
}

.evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: .9rem 0;
}

.evidence-list span {
  border: 1px solid rgba(54,255,159,.16);
  border-radius: 999px;
  padding: .45rem .7rem;
  background: rgba(54,255,159,.055);
  color: var(--text);
  font-size: .88rem;
}

.saving-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .8rem;
  border: 1px solid rgba(255,204,102,.26);
  border-radius: 16px;
  padding: .85rem;
  background: rgba(255,204,102,.07);
  margin: .8rem 0;
}

.saving-banner strong {
  color: var(--gold);
  font-size: 1.1rem;
}

.warning {
  border-left: 3px solid var(--warn);
  padding-left: .8rem;
  color: #ffe1b0 !important;
}

.single-product {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  align-items: start;
  margin: 1rem 0;
}

.single-product img,
.product-placeholder {
  width: 110px;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
}

.product-placeholder {
  display: grid;
  place-items: center;
  color: var(--neon);
  font-weight: 900;
}

.nutrition-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .7rem;
}

.nutrition-row span {
  border: 1px solid rgba(102,230,255,.18);
  border-radius: 12px;
  padding: .45rem .6rem;
  color: var(--cyan);
  background: rgba(102,230,255,.06);
}

.source-card a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .6rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(102,230,255,.35);
}

.source-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
}

.source-card-topline small {
  color: var(--muted);
  font-size: .76rem;
  text-align: right;
}

.source-card .source-meta {
  display: block;
  margin-top: .75rem;
  color: var(--muted);
  word-break: break-word;
}

.source-use-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  margin-top: .75rem;
}

.source-use-tags span {
  border: 1px solid rgba(102,230,255,.16);
  border-radius: 999px;
  background: rgba(102,230,255,.055);
  color: var(--cyan);
  padding: .32rem .5rem;
  font-size: .74rem;
  line-height: 1.2;
}

.submission-card {
  display: grid;
  gap: .25rem;
  margin-top: .6rem;
}

.muted {
  color: var(--muted);
}

#previewCanvas {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: rgba(0,0,0,.38);
}

.console-line[data-mode="warn"] {
  color: var(--warn);
}

.console-line[data-mode="ok"] {
  color: var(--neon);
}

@media (max-width: 820px) {
  .toolbar-row,
  .comparison-layout,
  .single-product {
    grid-template-columns: 1fr;
  }

  .score-orb {
    width: 112px;
    height: 112px;
  }
}

/* v2 · Login, Allergieprofil, Zutaten-HUD */
.auth-panel,
.health-panel {
  max-width: var(--max);
  margin: 2rem auto;
  padding: clamp(1rem, 3vw, 1.35rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(6, 24, 21, .92), rgba(2, 7, 6, .9)),
    radial-gradient(circle at top right, rgba(102,230,255,.10), transparent 24rem);
  box-shadow: var(--shadow), inset 0 0 30px rgba(54,255,159,.035);
}

.auth-grid,
.health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.auth-card,
.health-card {
  border: 1px solid rgba(54,255,159,.18);
  border-radius: 22px;
  padding: 1rem;
  background: rgba(255,255,255,.035);
  box-shadow: inset 0 0 18px rgba(54,255,159,.025);
}

.auth-card h3,
.health-card h3 {
  margin: .2rem 0 1rem;
  color: var(--text);
}

.auth-card label,
.health-card label,
.submit-form label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-weight: 700;
}

.auth-card input,
.health-card input,
.health-card textarea,
.health-card select,
.submit-form input,
.submit-form textarea {
  width: 100%;
  border: 1px solid rgba(54,255,159,.22);
  border-radius: 14px;
  background: rgba(0,0,0,.28);
  color: var(--text);
  padding: .82rem .9rem;
  outline: none;
}

.auth-card input:focus,
.health-card textarea:focus,
.health-card input:focus,
.health-card select:focus,
.submit-form input:focus,
.submit-form textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(54,255,159,.08);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.auth-state {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .8rem;
  border: 1px solid rgba(54,255,159,.16);
  border-radius: 18px;
  background: rgba(0,0,0,.22);
}

.auth-state span,
.auth-hint,
.allergy-summary span,
.allergy-summary small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.auth-orb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: radial-gradient(circle, var(--neon), rgba(54,255,159,.08) 62%, transparent 65%);
  box-shadow: 0 0 22px rgba(54,255,159,.42);
}

.auth-orb.offline {
  background: radial-gradient(circle, var(--warn), rgba(255,184,77,.08) 62%, transparent 65%);
  box-shadow: 0 0 22px rgba(255,184,77,.24);
}

.auth-hint {
  min-height: 2.8rem;
  margin: 1rem 0 0;
  border-left: 3px solid var(--line-strong);
  padding-left: .75rem;
}

.auth-hint[data-mode="warn"] { border-color: var(--warn); color: #ffe1b0; }
.auth-hint[data-mode="ok"] { border-color: var(--neon); color: var(--muted); }

.allergen-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  max-height: 560px;
  overflow: auto;
  padding-right: .2rem;
}

.allergen-tile {
  display: flex !important;
  align-items: flex-start;
  gap: .55rem !important;
  padding: .7rem;
  border: 1px solid rgba(54,255,159,.16);
  border-radius: 16px;
  background: rgba(255,255,255,.026);
}

.allergen-tile input {
  width: auto;
  margin-top: .2rem;
  accent-color: var(--neon);
}

.allergen-tile strong,
.allergen-tile small {
  display: block;
}

.allergen-tile small {
  color: var(--muted);
  font-weight: 500;
  font-size: .78rem;
  margin-top: .18rem;
}

.allergy-summary,
.ingredient-test-output,
.scan-alert-box {
  margin-top: .9rem;
  border: 1px solid rgba(102,230,255,.16);
  border-radius: 18px;
  padding: .85rem;
  background: rgba(102,230,255,.045);
}

.ingredient-hud {
  border: 1px solid rgba(54,255,159,.16);
  border-radius: 18px;
  padding: .9rem;
  background: rgba(0,0,0,.18);
  margin: .9rem 0;
}

.ingredient-hud.compact {
  margin: .8rem 0 0;
  padding: .75rem;
}

.ingredient-alert-head {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
  color: var(--muted);
}

.ingredient-alert-head strong {
  color: var(--text);
}

.alert-chip-row,
.mini-alerts {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-top: .65rem;
}

.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  padding: .38rem .62rem;
  font-size: .82rem;
  font-weight: 800;
  background: rgba(255,255,255,.04);
}

.alert-chip.danger {
  color: #ffd7df;
  border-color: rgba(255,84,112,.45);
  background: rgba(255,84,112,.12);
}

.alert-chip.warn {
  color: #ffe1b0;
  border-color: rgba(255,184,77,.45);
  background: rgba(255,184,77,.1);
}

.alert-chip.watch {
  color: var(--gold);
  border-color: rgba(255,204,102,.35);
  background: rgba(255,204,102,.075);
}

.alert-chip.info {
  color: var(--cyan);
  border-color: rgba(102,230,255,.35);
  background: rgba(102,230,255,.075);
}

.alert-chip.ok {
  color: var(--neon);
  border-color: rgba(54,255,159,.28);
  background: rgba(54,255,159,.07);
}

.ingredient-text {
  line-height: 1.8;
  color: var(--text);
}

mark {
  color: #04110d;
  background: linear-gradient(135deg, var(--gold), var(--neon));
  border-radius: .35rem;
  padding: .05rem .22rem;
  box-shadow: 0 0 14px rgba(255,204,102,.2);
}

.daily-guidance {
  margin-top: 1rem;
}

.daily-guidance h4 {
  margin: 0 0 .75rem;
  color: var(--gold);
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
}

.daily-card {
  border: 1px solid rgba(54,255,159,.16);
  border-radius: 16px;
  padding: .8rem;
  background: rgba(255,255,255,.03);
}

.daily-card.high {
  border-color: rgba(255,184,77,.42);
  background: rgba(255,184,77,.08);
}

.daily-card strong,
.daily-card span,
.daily-card small,
.daily-card em {
  display: block;
}

.daily-card span {
  color: var(--text);
  margin-top: .25rem;
}

.daily-card small,
.daily-card em,
.daily-note {
  color: var(--muted);
  line-height: 1.45;
}

.daily-card em {
  margin-top: .5rem;
  font-style: normal;
  color: var(--cyan);
}

@media (max-width: 1020px) {
  .auth-grid,
  .health-grid,
  .daily-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .two-col,
  .allergen-options {
    grid-template-columns: 1fr;
  }
}


.auth-note {
  margin: .4rem 0 .8rem;
  padding: .75rem .85rem;
  border: 1px solid rgba(54, 255, 159, .18);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(54, 255, 159, .06);
  font-size: .92rem;
}

/* v2.2 · Rechnungszentrale-kompatibles Auth-HUD */
.auth-focus-target:target {
  border-color: rgba(54,255,159,.56);
  box-shadow: 0 0 42px rgba(54,255,159,.18), inset 0 0 36px rgba(54,255,159,.06);
}

.auth-shell {
  grid-column: span 2;
}

.auth-tabs {
  display: inline-flex;
  gap: .45rem;
  padding: .35rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(54,255,159,.18);
  border-radius: 999px;
  background: rgba(0,0,0,.28);
}

.auth-tabs button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: .62rem .95rem;
  color: var(--muted);
  font-weight: 900;
  background: transparent;
}

.auth-tabs button.active {
  color: #00120d;
  background: linear-gradient(135deg, rgba(54,255,159,.96), rgba(102,230,255,.72));
  box-shadow: 0 0 18px rgba(54,255,159,.18);
}

.auth-shell form {
  display: grid;
  gap: .85rem;
}

.auth-note {
  color: var(--muted);
  border-left: 3px solid rgba(102,230,255,.45);
  padding-left: .75rem;
  line-height: 1.5;
}

.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.auth-hint[data-mode="error"] {
  border-color: var(--danger);
  color: #ffd7df;
}

code {
  color: var(--neon);
  background: rgba(54,255,159,.08);
  border: 1px solid rgba(54,255,159,.16);
  border-radius: .4rem;
  padding: .08rem .28rem;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-column: auto;
  }
}

/* v2.4 · Account-HUD + Mobile UX Feinschliff */
section,
.auth-panel,
.health-panel,
.scanner-panel,
.results-section,
.lead-section,
.sources-section,
.submit-panel,
.data-section {
  scroll-margin-top: 96px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  min-width: 0;
}

.header-user-pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  max-width: 320px;
  border: 1px solid rgba(54,255,159,.28);
  border-radius: 999px;
  padding: .35rem .4rem .35rem .6rem;
  background: rgba(54,255,159,.075);
  box-shadow: 0 0 18px rgba(54,255,159,.09), inset 0 0 16px rgba(54,255,159,.035);
}

.header-user-pill[hidden] {
  display: none !important;
}

.user-dot {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--neon);
  box-shadow: 0 0 14px rgba(54,255,159,.85);
}

.user-copy {
  min-width: 0;
  display: grid;
  line-height: 1.05;
}

.user-copy strong,
.user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  color: var(--text);
  font-size: .86rem;
}

.user-copy small {
  color: var(--muted);
  font-size: .7rem;
}

.mini-logout {
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: .42rem .62rem;
  color: var(--muted);
  background: rgba(0,0,0,.24);
  font-size: .75rem;
  font-weight: 900;
}

.mini-logout:hover {
  color: var(--text);
  border-color: rgba(54,255,159,.38);
  background: rgba(54,255,159,.08);
}

.auth-panel.auth-collapsed {
  display: none;
}

.mobile-dock {
  display: none;
}

@media (max-width: 1050px) {
  .header-user-pill {
    max-width: 240px;
  }

  .mini-logout {
    display: none;
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: 78px;
  }

  .site-header {
    gap: .55rem;
  }

  .header-actions {
    flex: 0 0 auto;
  }

  .header-user-pill {
    max-width: 168px;
    padding: .32rem .55rem;
  }

  .user-copy small {
    display: none;
  }

  .main-nav {
    left: .7rem;
    right: .7rem;
    max-height: min(74vh, 580px);
    overflow: auto;
  }

  .main-nav a {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: .82rem .9rem;
  }

  .mobile-dock {
    position: fixed;
    left: .6rem;
    right: .6rem;
    bottom: .6rem;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .25rem;
    padding: .36rem;
    border: 1px solid rgba(54,255,159,.24);
    border-radius: 22px;
    background: rgba(1, 5, 4, .92);
    backdrop-filter: blur(18px);
    box-shadow: 0 0 28px rgba(54,255,159,.16);
  }

  .mobile-dock a {
    display: grid;
    place-items: center;
    gap: .14rem;
    min-height: 48px;
    border-radius: 16px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 900;
  }

  .mobile-dock a:active,
  .mobile-dock a:hover {
    color: var(--text);
    background: rgba(54,255,159,.09);
  }

  .mobile-dock span {
    font-size: 1rem;
    line-height: 1;
  }

  .hero {
    gap: .85rem;
  }

  .hero-copy,
  .status-card,
  .scanner-panel,
  .results-section,
  .submit-panel,
  .data-section,
  .auth-panel,
  .health-panel {
    border-radius: 20px;
  }

  .hero-copy {
    padding: 1.05rem;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.1rem, 11vw, 3.4rem);
    letter-spacing: -.055em;
  }

  h2 {
    letter-spacing: -.035em;
  }

  input,
  textarea,
  select,
  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .upload-btn,
  .chip-row button,
  .auth-tabs button {
    min-height: 48px;
  }

  .chip-row {
    gap: .45rem;
  }

  .chip-row button {
    flex: 1 1 calc(50% - .5rem);
    padding-inline: .65rem;
  }

  .cover-section {
    margin-block: 1rem;
  }

  .cover-frame img {
    aspect-ratio: 16 / 9;
    max-height: 280px;
    object-fit: cover;
  }

  #previewCanvas,
  #barcodeReader {
    max-height: 300px;
  }

  .scan-alert-box,
  .ingredient-hud,
  .allergy-summary,
  .ingredient-test-output {
    font-size: .94rem;
  }
}

@media (max-width: 520px) {
  main {
    width: calc(100% - .85rem);
  }

  .brand small {
    display: none;
  }

  .brand strong {
    max-width: 15ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-user-pill {
    max-width: 126px;
  }

  .site-header {
    padding: .62rem .65rem;
  }

  .menu-toggle {
    width: 42px;
    height: 40px;
    flex: 0 0 auto;
  }

  .search-line {
    gap: .55rem;
  }

  .scanner-actions,
  .console-actions,
  .scan-mode-grid,
  .auth-actions {
    gap: .55rem;
  }

  .status-card {
    padding: 1rem;
  }

  .metric-list span {
    min-height: 44px;
  }

  .mobile-dock {
    left: .35rem;
    right: .35rem;
    bottom: .35rem;
    border-radius: 18px;
  }

  .mobile-dock a {
    min-height: 46px;
    font-size: .62rem;
  }
}


.cover-frame picture {
  display: block;
  position: relative;
  z-index: 1;
}


/* v2.8 Cover-Fix: Banner komplett sichtbar, ohne harte Außen-Beschneidung */
.cover-section {
  max-width: 1680px;
  margin-inline: auto;
}

.cover-frame {
  aspect-ratio: 16 / 9;
  min-height: unset;
  display: grid;
  place-items: center;
  overflow: visible;
}

.cover-frame picture,
.cover-frame img {
  width: 100%;
  height: 100%;
}

.cover-frame img {
  object-fit: contain;
  object-position: center center;
  border-radius: 22px;
}

@media (max-width: 760px) {
  .cover-section {
    padding-inline: 0.7rem;
  }

  .cover-frame {
    aspect-ratio: 16 / 9;
  }
}


/* --- Jarvis Final Table View --- */
.table-section {
  max-width: var(--max);
  margin: 1.4rem auto;
  padding: clamp(1rem, 2.2vw, 1.35rem);
  border: 1px solid rgba(54, 255, 159, 0.18);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(4, 18, 16, 0.94), rgba(2, 7, 6, 0.92));
  box-shadow: var(--shadow);
}

.table-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 210px auto;
  gap: 0.8rem;
  align-items: end;
  margin: 1rem 0;
}

.table-toolbar label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.table-toolbar input,
.table-toolbar select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(54, 255, 159, 0.22);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  padding: 0.75rem 0.85rem;
  outline: none;
}

.table-toolbar input:focus,
.table-toolbar select:focus {
  border-color: rgba(54, 255, 159, 0.75);
  box-shadow: 0 0 0 3px rgba(54, 255, 159, 0.12);
}

.table-summary {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.table-summary span {
  border: 1px solid rgba(102, 230, 255, 0.18);
  background: rgba(102, 230, 255, 0.07);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.65rem;
  font-size: 0.86rem;
}

.table-summary strong {
  color: var(--neon);
}

.jarvis-table-wrap {
  overflow: auto;
  border: 1px solid rgba(54, 255, 159, 0.17);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  -webkit-overflow-scrolling: touch;
}

.jarvis-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  color: var(--text);
  font-size: 0.88rem;
}

.jarvis-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 0.8rem 0.75rem;
  color: var(--neon);
  background: rgba(4, 20, 18, 0.98);
  border-bottom: 1px solid rgba(54, 255, 159, 0.24);
  white-space: nowrap;
}

.jarvis-table td {
  vertical-align: top;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(234, 255, 247, 0.9);
}

.jarvis-table tr:hover td {
  background: rgba(54, 255, 159, 0.045);
}

.jarvis-table td strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.jarvis-table td small {
  color: var(--muted);
}

.table-badge {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  border-radius: 999px;
  padding: 0.34rem 0.55rem;
  border: 1px solid rgba(54, 255, 159, 0.25);
  background: rgba(54, 255, 159, 0.08);
  color: var(--neon);
  font-size: 0.78rem;
  font-weight: 800;
}

.table-badge.lead {
  border-color: rgba(255, 204, 102, 0.35);
  background: rgba(255, 204, 102, 0.09);
  color: var(--gold);
}

.table-badge.seed {
  border-color: rgba(102, 230, 255, 0.35);
  background: rgba(102, 230, 255, 0.08);
  color: var(--cyan);
}

.table-badge.ok {
  border-color: rgba(54, 255, 159, 0.55);
  background: rgba(54, 255, 159, 0.12);
  color: var(--neon);
}

.table-action {
  min-height: 38px;
  border: 1px solid rgba(54, 255, 159, 0.35);
  border-radius: 999px;
  background: rgba(54, 255, 159, 0.1);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.table-action:hover {
  border-color: var(--neon);
  box-shadow: 0 0 18px rgba(54, 255, 159, 0.12);
}

@media (max-width: 920px) {
  .table-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .table-toolbar .table-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .mobile-dock {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .mobile-dock a {
    font-size: 0.66rem;
    padding-inline: 0.25rem;
  }

  .jarvis-table {
    min-width: 0;
  }

  .jarvis-table thead {
    display: none;
  }

  .jarvis-table,
  .jarvis-table tbody,
  .jarvis-table tr,
  .jarvis-table td {
    display: block;
    width: 100%;
  }

  .jarvis-table tr {
    margin: 0.75rem;
    border: 1px solid rgba(54, 255, 159, 0.14);
    border-radius: 16px;
    background: rgba(4, 14, 13, 0.82);
    overflow: hidden;
  }

  .jarvis-table td {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 0.7rem;
    padding: 0.62rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  }

  .jarvis-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .table-toolbar {
    grid-template-columns: 1fr;
  }

  .table-summary {
    gap: 0.45rem;
  }

  .table-summary span {
    width: 100%;
    justify-content: space-between;
  }
}

/* v3.0.1 More Results: schneller an Scan, Tabelle, Prüfliste und Quellen */
.quick-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .8rem;
  margin: 0 0 1.2rem;
}

.quick-hub a {
  display: grid;
  gap: .25rem;
  min-height: 92px;
  padding: .95rem 1rem;
  border: 1px solid rgba(54,255,159,.22);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(54,255,159,.09), rgba(0,0,0,.24));
  color: var(--text);
  text-decoration: none;
  box-shadow: inset 0 0 18px rgba(54,255,159,.035);
}

.quick-hub a:hover,
.quick-hub a:focus-visible {
  border-color: rgba(54,255,159,.65);
  box-shadow: 0 0 20px rgba(54,255,159,.12), inset 0 0 18px rgba(54,255,159,.05);
}

.quick-hub strong {
  color: var(--neon);
  font-size: .98rem;
}

.quick-hub span {
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.35;
}

.source-ref-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .75rem 0;
}

.source-ref-row span,
.lead-saving-mini {
  border: 1px solid rgba(102,230,255,.18);
  border-radius: 999px;
  background: rgba(102,230,255,.07);
  color: var(--text);
  padding: .35rem .55rem;
  font-size: .78rem;
}

.source-ref-row.compact {
  margin: .55rem 0 0;
}

.source-ref-row.compact span {
  font-size: .72rem;
  color: var(--muted);
}

.lead-saving-mini {
  display: inline-flex;
  margin-top: .6rem;
  color: var(--gold);
  border-color: rgba(255,210,106,.24);
  background: rgba(255,210,106,.08);
}

@media (max-width: 760px) {
  .quick-hub {
    grid-template-columns: 1fr 1fr;
  }
  .quick-hub a {
    min-height: 86px;
    padding: .8rem;
  }
}


/* v3.0.4: Gehirn bleibt an der bisherigen Status-Position, aber ohne Radar-Ring. */
@media (max-width: 720px) {
  .hero-brain {
    width: min(76vw, 230px);
    height: min(76vw, 230px);
    margin-bottom: 1rem;
  }
}

/* v3.0.5: Real-Daten zuerst, Demo-Fallback nur bei fehlenden Echtdaten */
.data-mode-box {
  margin-top: 1rem;
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  padding: .85rem;
  border: 1px solid rgba(255, 204, 102, .25);
  border-radius: 18px;
  background: rgba(255, 204, 102, .07);
}

.data-mode-box strong {
  display: block;
  color: var(--text);
}

.data-mode-box small {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
  line-height: 1.45;
}

.table-badge.live {
  border-color: rgba(102, 230, 255, 0.45);
  background: rgba(102, 230, 255, 0.11);
  color: var(--cyan);
}


/* v3.0.6: Geschäfte/Verfügbarkeit + klarere Datenmodus-Texte */
.inline-count {
  display: inline-flex;
  vertical-align: middle;
  margin-left: .55rem;
  padding: .25rem .55rem;
  border: 1px solid rgba(54,255,159,.25);
  border-radius: 999px;
  color: var(--neon);
  font-size: .78rem;
  letter-spacing: .03em;
  background: rgba(54,255,159,.07);
}

.source-breakdown {
  display: inline-block;
  margin-bottom: .35rem;
  color: var(--gold);
  font-weight: 800;
}

.store-info {
  margin-top: .85rem;
  padding: .75rem;
  border: 1px solid rgba(102,230,255,.18);
  border-radius: 14px;
  background: rgba(102,230,255,.055);
}

.store-info > strong {
  display: block;
  color: var(--cyan);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .45rem;
}

.store-info.muted {
  color: var(--muted);
}

.store-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.store-chip-row span {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .35rem .55rem;
  border: 1px solid rgba(54,255,159,.18);
  border-radius: 999px;
  background: rgba(0,0,0,.28);
  color: var(--text);
  font-size: .78rem;
}

.source-meta {
  display: inline-block;
  margin-top: .55rem;
  color: var(--muted);
  font-size: .76rem;
}

@media (max-width: 760px) {
  .manual-barcode-row {
    display: grid;
  }
}


/* v3.0.9 · sichtbarer EAN-Scanner-Status */
.barcode-reader video,
.barcode-reader canvas,
#barcodeReader video,
#barcodeReader canvas {
  width: 100% !important;
  min-height: 330px !important;
  max-height: 430px;
  object-fit: cover !important;
  display: block !important;
  border-radius: 18px;
}

.scan-live-debug {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 6;
  display: grid;
  gap: .2rem;
  padding: .72rem .9rem;
  border: 1px solid rgba(54,255,159,.42);
  border-radius: 14px;
  background: rgba(1, 8, 6, .82);
  backdrop-filter: blur(8px);
  color: var(--neon);
  box-shadow: 0 0 24px rgba(54,255,159,.12);
}

.scan-live-debug strong {
  font-size: .84rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scan-live-debug span {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}

.scan-attempt-log {
  display: grid;
  gap: .35rem;
  max-height: 9.2rem;
  overflow: auto;
  padding: .7rem;
  border: 1px solid rgba(54,255,159,.16);
  border-radius: 13px;
  background: rgba(255,255,255,.03);
  font-size: .82rem;
  color: var(--muted);
}

.scan-attempt-log span:first-child {
  color: var(--neon);
}

.hud-scan-overlay strong {
  transform: translateY(-2.4rem);
}

@media (max-width: 720px) {
  .scan-live-debug {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: .62rem .7rem;
  }

  .barcode-reader,
  .camera-frame {
    min-height: 280px;
  }

  .barcode-reader video,
  .barcode-reader canvas,
  #barcodeReader video,
  #barcodeReader canvas {
    min-height: 280px !important;
  }
}


/* v3.0.10 · EAN-Boost für schwierige 1D-Barcodes */
.scanner-actions #boostBarcodeFrameBtn {
  border-color: rgba(255, 212, 90, .42);
  color: var(--gold);
}

.scanner-actions #boostBarcodeFrameBtn::before {
  content: '▣ ';
}

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

/* v3.0.15 · Scanner-Kandidaten erst nach manueller Bestätigung übernehmen */
.scanner-candidate-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .85rem 0;
  padding: .85rem 1rem;
  border: 1px solid rgba(255, 212, 90, .35);
  border-radius: 16px;
  background: rgba(255, 212, 90, .075);
  box-shadow: inset 0 0 24px rgba(255, 212, 90, .06);
}

.scanner-candidate-panel[hidden] {
  display: none !important;
}

.scanner-candidate-panel small {
  display: block;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scanner-candidate-panel strong {
  display: block;
  margin: .2rem 0;
  color: var(--text);
  font-size: 1.25rem;
  letter-spacing: .07em;
}

.scanner-candidate-panel span {
  display: block;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.35;
}

.scanner-candidate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .scanner-candidate-panel {
    display: grid;
  }

  .scanner-candidate-actions {
    justify-content: stretch;
  }

  .scanner-candidate-actions button {
    width: 100%;
  }
}


/* v3.0.16 · Scanner-Fenster: Quagga drawingBuffer darf keinen leeren schwarzen Block erzeugen */
.camera-frame {
  height: clamp(320px, 48vw, 520px);
  min-height: 0;
}

#barcodeReader,
.barcode-reader,
#barcodeReader .quagga-target,
.barcode-reader .quagga-target {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-radius: 18px;
}

#barcodeReader video,
.barcode-reader video,
#barcodeReader .quagga-target video,
.barcode-reader .quagga-target video {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  object-fit: cover !important;
}

#barcodeReader canvas.drawingBuffer,
.barcode-reader canvas.drawingBuffer,
#barcodeReader .quagga-target canvas.drawingBuffer,
.barcode-reader .quagga-target canvas.drawingBuffer {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  display: block !important;
  object-fit: cover !important;
  pointer-events: none !important;
  z-index: 2 !important;
  opacity: 0 !important;
  background: transparent !important;
}

@media (max-width: 720px) {
  .camera-frame {
    height: clamp(300px, 68vw, 460px);
  }
}
