/* =========================================================
   VIRTUAL EYES AI — Detection Matrix Theme
   Black / Red / Blue gradient system
   ========================================================= */

:root {
  --void: #060306;
  --deep: #0c0510;
  --surface: #170a16;
  --panel: #1d0c1d;
  --edge: #3c1024;

  /* Gradient stops — primary blue family (was cyan) */
  --grad-cyan-start: #7fd4ff;
  --grad-cyan-mid:   #3fa9ff;
  --grad-cyan-end:   #2361ff;

  /* Gradient stops — deep blue family (was violet) */
  --grad-violet-start: #4d8dff;
  --grad-violet-mid:   #2361ff;
  --grad-violet-end:   #0d2a70;

  /* Gradient stops — bright blue family (was green) */
  --grad-green-start: #9fe0ff;
  --grad-green-mid:   #4fc3ff;
  --grad-green-end:   #2f8fff;

  /* Gradient stops — red family */
  --grad-red-start: #ff6b81;
  --grad-red-mid:   #ff2d55;
  --grad-red-end:   #8c0a2a;

  /* Gradient stops — red-orange family (was amber) */
  --grad-amber-start: #ff9466;
  --grad-amber-mid:   #ff5a36;
  --grad-amber-end:   #b3220b;

  /* Shorthand gradients */
  --g-cyan:   linear-gradient(135deg, #7fd4ff 0%, #3fa9ff 50%, #2361ff 100%);
  --g-violet: linear-gradient(135deg, #4d8dff 0%, #2361ff 50%, #0d2a70 100%);
  --g-green:  linear-gradient(135deg, #9fe0ff 0%, #4fc3ff 50%, #2f8fff 100%);
  --g-red:    linear-gradient(135deg, #ff6b81 0%, #ff2d55 50%, #8c0a2a 100%);
  --g-amber:  linear-gradient(135deg, #ff9466 0%, #ff5a36 50%, #b3220b 100%);

  /* Glow colours (for box-shadow) */
  --glow-cyan:   rgba(63,169,255,0.3);
  --glow-violet: rgba(35,97,255,0.28);
  --glow-green:  rgba(79,195,255,0.25);
  --glow-red:    rgba(255,45,85,0.32);

  --text-primary:   #f5eef1;
  --text-secondary: #b08a94;
  --text-dim:       #6e4a56;

  --font-mono:    'Space Mono', monospace;
  --font-body:    'Inter', sans-serif;
  --font-display: 'Syne', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(ellipse 70% 50% at 10% 0%, rgba(255,45,85,0.09) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 95% 15%, rgba(35,97,255,0.10) 0%, transparent 60%),
    linear-gradient(160deg, var(--void) 0%, var(--deep) 40%, var(--surface) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-x: hidden;
}

/* ── SCANLINE OVERLAY ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.045) 3px,
    rgba(0,0,0,0.045) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* =========================================================
   HEADER
   ========================================================= */
.header {
  width: 100%;
  background: linear-gradient(90deg, rgba(6,3,6,0.94) 0%, rgba(29,12,29,0.9) 55%, rgba(9,4,20,0.94) 100%);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(63,169,255,0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2.5rem;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 40px rgba(0,0,0,0.5), 0 1px 0 rgba(63,169,255,0.06);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(63,169,255,0.1) 0%, rgba(35,97,255,0.1) 100%);
  border: 1px solid rgba(63,169,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(63,169,255,0.14), inset 0 0 12px rgba(63,169,255,0.06);
}

.header-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: var(--g-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px rgba(63,169,255,0.45));
}

.header-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-top: 1px;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-nav-link {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: all 0.2s;
}
.header-nav-link:hover {
  color: #2f8fff;
  border-color: rgba(63,169,255,0.3);
  background: rgba(63,169,255,0.05);
  text-shadow: 0 0 10px rgba(63,169,255,0.5);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Status Indicator */
.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
  border: 1px solid var(--edge);
  background: rgba(0,0,0,0.3);
}
.status.loading { color: var(--text-secondary); }
.status.ready {
  color: #9fe0ff;
  border-color: rgba(79,195,255,0.3);
  background: rgba(79,195,255,0.04);
}
.status.error {
  color: #ff6b81;
  border-color: rgba(255,45,85,0.3);
}

.status-pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.dev-badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  border: 1px solid var(--edge);
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  white-space: nowrap;
}
.dev-badge span {
  background: var(--g-violet);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* =========================================================
   BUTTONS — glowing rainbow border style
   ========================================================= */
.btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.55rem 1.35rem;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  border: none;
  outline: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  z-index: 0;
  transition: color 0.2s, transform 0.15s;
}

/* Dark fill behind button */
.btn::after {
  content: "";
  z-index: -1;
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #170a16;
  left: 0;
  top: 0;
  border-radius: 10px;
  transition: background-color 0.2s;
}

/* Glowing animated border */
.btn::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  z-index: -1;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  border-radius: 12px;
  opacity: 0;
  filter: blur(6px);
  background-size: 600%;
  transition: opacity 0.3s ease-in-out;
  animation: btnGlow 20s linear infinite;
}

@keyframes btnGlow {
  0%   { background-position: 0 0; }
  50%  { background-position: 400% 0; }
  100% { background-position: 0 0; }
}

.btn:hover::before { opacity: 1; }
.btn:hover { transform: translateY(-1px); }

.btn:active::after { background: transparent; }
.btn:active { color: #000; font-weight: 900; transform: scale(0.97); }

/* Primary — cyan gradient glow */
.btn-primary {
  color: #3fa9ff;
}
.btn-primary::before {
  background: linear-gradient(45deg,
    #3fa9ff, #2f8fff, #2361ff, #123a8c,
    #2f8fff, #3fa9ff, #2361ff, #3fa9ff
  );
}

/* Ghost — muted cyan glow */
.btn-ghost {
  color: var(--text-secondary);
}
.btn-ghost::before {
  background: linear-gradient(45deg,
    #2f8fff, #2361ff, #3c1024, #3fa9ff,
    #2361ff, #2f8fff, #3fa9ff, #2f8fff
  );
}
.btn-ghost:hover { color: #2f8fff; }

/* Violet — violet/pink glow */
.btn-violet {
  color: #9fc4ff;
}
.btn-violet::before {
  background: linear-gradient(45deg,
    #4d8dff, #123a8c, #2f8fff, #ff2d55,
    #123a8c, #4d8dff, #0d2a70, #4d8dff
  );
}
.btn-violet:hover { color: #cfe4ff; }

/* =========================================================
   MAIN LAYOUT — Two-column grid
   ========================================================= */
.container {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem 2rem 2rem;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  align-items: start;
}

/* =========================================================
   PANEL (Card)
   ========================================================= */
.panel {
  background: linear-gradient(160deg, #1d0c1d 0%, #0c0510 55%, #170a16 100%);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,45,85,0.4), rgba(63,169,255,0.45), transparent);
}
.panel:hover {
  border-color: rgba(63,169,255,0.22);
  box-shadow: 0 0 40px rgba(0,100,200,0.1);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--edge);
}

.panel-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: rgba(63,169,255,0.07);
  border: 1px solid rgba(63,169,255,0.14);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  flex: 1;
}

.panel-status { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; }
.live-dot, .ready-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
.live-dot {
  background: var(--grad-red-mid);
  box-shadow: 0 0 8px var(--grad-red-mid), 0 0 14px rgba(255,45,85,0.4);
}
.ready-dot {
  background: var(--grad-cyan-start);
  box-shadow: 0 0 8px var(--grad-cyan-start), 0 0 14px rgba(63,169,255,0.4);
}
.live-label, .ready-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.live-label {
  background: var(--g-red);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ready-label {
  background: var(--g-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================================================
   VIDEO + SNAPSHOT VIEWPORTS
   ========================================================= */
.video-wrap, .snapshot-wrap {
  position: relative;
  border-radius: 8px;
  background: #000;
  height: 520px;
  overflow: hidden;
  border: 1px solid var(--edge);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.6);
}

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

#overlay {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.snapshot {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
}

/* Corner bracket decorations — gradient tinted */
.corner {
  position: absolute;
  width: 18px; height: 18px;
  z-index: 2;
  pointer-events: none;
}
.corner.tl { top: 8px; left: 8px;  border-top: 2px solid #3fa9ff;  border-left: 2px solid #3fa9ff; }
.corner.tr { top: 8px; right: 8px; border-top: 2px solid #2f8fff;  border-right: 2px solid #2f8fff; }
.corner.bl { bottom: 8px; left: 8px;  border-bottom: 2px solid #2361ff; border-left: 2px solid #2361ff; }
.corner.br { bottom: 8px; right: 8px; border-bottom: 2px solid #123a8c; border-right: 2px solid #123a8c; }

/* Feed scanlines */
.feed-scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom, transparent 0px, transparent 2px,
    rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 3px
  );
  pointer-events: none;
  z-index: 1;
}

/* Snapshot idle state */
.snapshot-idle-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.75rem;
  background: rgba(2,4,8,0.78);
  z-index: 2;
  transition: opacity 0.3s;
}
.snapshot-idle-overlay.hidden { opacity: 0; pointer-events: none; }
.idle-icon {
  font-size: 2.5rem;
  background: var(--g-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: idlePulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(63,169,255,0.5));
}
.idle-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
@keyframes idlePulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* =========================================================
   CONTROLS ROW
   ========================================================= */
.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* =========================================================
   MODEL TOGGLE WRAPPER + NEON PILL SWITCH
   ========================================================= */
.model-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
}
.model-toggle-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.model-name {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--g-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 140px;
  text-align: right;
  transition: filter 0.3s;
}

/* ── NEON PILL TOGGLE SWITCH ── */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }

.slider-thumb {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: linear-gradient(135deg, #170a16 0%, #0c0510 100%);
  border-radius: 30px;
  border: 1.5px solid #3c1024;
  transition: border-color 0.4s, box-shadow 0.4s;
}

/* Knob */
.slider-thumb::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: linear-gradient(135deg, #6e4a56 0%, #170a16 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.4s,
    box-shadow 0.4s;
}

/* OFF label */
.slider-thumb::after {
  content: 'OFF';
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.38rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  transition: opacity 0.3s;
}

/* CHECKED STATE */
input:checked + .slider-thumb {
  background: linear-gradient(135deg, #170a16 0%, #060306 100%);
  border-color: #3fa9ff;
  box-shadow:
    0 0 12px rgba(63,169,255,0.5),
    0 0 28px rgba(63,169,255,0.3),
    inset 0 0 12px rgba(63,169,255,0.06);
}

input:checked + .slider-thumb::before {
  transform: translateX(30px) translateY(-50%);
  background: linear-gradient(135deg, #3fa9ff 0%, #2f8fff 50%, #2361ff 100%);
  box-shadow:
    0 0 10px #3fa9ff,
    0 0 22px rgba(63,169,255,0.7),
    0 0 38px rgba(35,97,255,0.4);
}

input:checked + .slider-thumb::after {
  content: 'ON';
  right: auto;
  left: 8px;
  color: rgba(63,169,255,0.7);
}

/* Camera select */
.select-cam {
  appearance: none;
  background: linear-gradient(135deg, #1d0c1d 0%, #0c0510 70%, rgba(255,45,85,0.05) 100%);
  border: 1px solid rgba(63,169,255,0.2);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  letter-spacing: 0.05em;
  transition: border-color 0.2s, color 0.2s;
}
.select-cam:hover {
  border-color: #2f8fff;
  color: #2f8fff;
}

/* =========================================================
   RESULTS PANEL
   ========================================================= */
.results-panel {
  background: linear-gradient(135deg, rgba(0,0,0,0.28) 0%, rgba(6,13,24,0.4) 100%);
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  min-height: 60px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.results-idle {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text-dim); letter-spacing: 0.06em;
}
.results-idle-icon {
  background: var(--g-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================================================
   DETECTED STRIP FOOTER
   ========================================================= */
.detected-row {
  background: linear-gradient(180deg, rgba(2,4,8,0.94) 0%, rgba(6,13,24,0.98) 100%);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(63,169,255,0.12);
  padding: 1rem 2rem 1.2rem;
}

.detected-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.strip-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  background: var(--g-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.strip-count {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.detected-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  align-items: flex-start;
  scrollbar-width: thin;
  scrollbar-color: rgba(63,169,255,0.25) transparent;
}
.detected-strip::-webkit-scrollbar { height: 3px; }
.detected-strip::-webkit-scrollbar-track { background: transparent; }
.detected-strip::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #3fa9ff, #2361ff);
  border-radius: 2px;
}

.strip-idle {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  padding: 0.5rem 0;
  white-space: nowrap;
}

/* Object Cards in strip */
.obj-card {
  min-width: 200px;
  max-width: 240px;
  background: linear-gradient(135deg, #1d0c1d 0%, #0c0510 60%, rgba(35,97,255,0.06) 100%);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, #3fa9ff, #2361ff) 1;
}
.obj-card:hover {
  transform: translateY(-2px);
  border-color: rgba(63,169,255,0.3);
  box-shadow: 0 4px 24px rgba(0,100,200,0.15);
}

.obj-thumb {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(63,169,255,0.08) 0%, rgba(35,97,255,0.1) 100%);
  border: 1px solid rgba(63,169,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  background-clip: padding-box;
  color: #2f8fff;
  flex-shrink: 0;
}

.obj-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.obj-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.obj-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.obj-confidence {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--g-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .container {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }
  .video-wrap, .snapshot-wrap { height: 400px; }
  .header-center { display: none; }
}

@media (max-width: 700px) {
  .header { padding: 0 1rem; }
  .dev-badge { display: none; }
  .container { padding: 0.75rem; }
  .video-wrap, .snapshot-wrap { height: 300px; }
  .controls { gap: 0.5rem; }
  .model-toggle-wrapper { flex-wrap: wrap; }
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100vw; }
img, svg, video, canvas { max-width: 100%; height: auto; }

@media (max-width: 420px) {
  .video-wrap, .snapshot-wrap { height: 220px; }
  .obj-card { flex-wrap: wrap; }
  .controls { gap: 0.4rem; }
  .model-toggle-wrapper { font-size: 0.8rem; }
}

@media (min-width: 701px) and (max-width: 1100px) {
  .video-wrap, .snapshot-wrap { height: 340px; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .video-wrap, .snapshot-wrap { height: 220px; }
  .header-center { display: none; }
}

@media (hover: none) and (pointer: coarse) {
  button, select, .model-toggle-wrapper, #scanBtn, #startBtn { min-height: 44px; }
}
/* =========================================================
   ── ASK-AI + ACTIVITY LOG ADDITIONS ──
   ========================================================= */

.ask-controls {
  align-items: center;
  flex-wrap: wrap;
}

.ask-input-row {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ask-input {
  flex: 1;
  min-width: 220px;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--edge, #3c1024);
  background: rgba(255, 255, 255, 0.04);
  color: #e8e8ee;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.ask-input::placeholder {
  color: var(--muted, #8a8a9a);
}

.ask-input:focus {
  border-color: var(--grad-cyan-mid);
  box-shadow: 0 0 0 2px rgba(63, 169, 255, 0.25);
}

.ask-btn {
  user-select: none;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.ask-btn.recording {
  filter: brightness(1.3);
  box-shadow: 0 0 0 2px var(--grad-red-mid), 0 0 18px rgba(255, 45, 85, 0.55);
  transform: scale(0.98);
}

.ask-status {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted, #8a8a9a);
  min-height: 1.2em;
}

.ask-status.live {
  color: var(--grad-red-mid);
}

.log-row {
  /* Activity log no longer shows on the detection site — it's saved silently
     in the background and only surfaces as a downloaded file (Ctrl/Cmd+L),
     which also clears it. See app.js exportActivityLog(). */
  display: none;
}

.log-export-btn {
  margin-left: 0.5rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
}

.activity-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 2px;
}

.log-entry {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--grad-cyan-mid);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
  line-height: 1.4;
}

.log-entry .log-time {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted, #8a8a9a);
  white-space: nowrap;
}

.log-entry .log-type {
  font-weight: 600;
  color: var(--grad-cyan-mid);
  white-space: nowrap;
}

.log-entry .log-content {
  color: #e8e8ee;
  word-break: break-word;
}

@media (hover: none) and (pointer: coarse) {
  .ask-btn { min-height: 48px; }
}



/* Complete visual lockdown */
body {
  -webkit-user-select: none;  /* Safari/Chrome iOS */
  -webkit-touch-callout: none; /* Disables the callout menu on long-press (iOS) */
  -moz-user-select: none;     /* Firefox */
  -ms-user-select: none;      /* IE/Edge */
  user-select: none;          /* Standard */
}

/* Prevents users from dragging images off your site onto their desktop */
img {
  -webkit-user-drag: none;
  pointer-events: none;
}
