@font-face {
  font-family: JetBrains;
  src: url("/demo/r/20261113-I8500-v8/font.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --background: oklch(0.141 0.005 285.823);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.21 0.006 285.885);
  --primary: oklch(0.606 0.25 292.717);
  --border: oklch(1 0 0 / 15%);
  --muted: oklch(0.75 0.015 286);
  font:
    14px/1.6 JetBrains,
    ui-monospace,
    monospace;
  background: var(--background);
  color: var(--foreground);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
}
h2 {
  font-size: 22px;
  line-height: 1.35;
  margin: 0 0 16px;
}
nav {
  display: flex;
  gap: 8px;
}
a {
  color: inherit;
}
nav a {
  padding: 10px 12px;
  text-decoration: none;
  border-radius: 10px;
}
nav a[aria-current] {
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--border);
}
button,
.action {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
button:hover,
.action:hover {
  border-color: var(--primary);
}
button[aria-pressed="true"],
.primary {
  background: var(--primary);
  color: white;
}
button:disabled {
  opacity: 0.65;
  cursor: wait;
}
:focus-visible {
  outline: 3px solid #b4a0ff;
  outline-offset: 3px;
}
.neural-camera-page nav {
  flex-wrap: wrap;
  min-width: 0;
}
.neural-camera-page nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.neural-camera-page #camera-status {
  margin-top: 16px;
}
.neural-camera-page .guide-label {
  bottom: 0;
  padding: 12px 16px;
  background: var(--background);
}
p {
  margin: 0 0 16px;
}
.geometry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: calc(100svh - 80px);
}
.viewport {
  position: relative;
  min-height: 580px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 50%, #292735, #141318);
}
#scene {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
.viewport-label {
  position: absolute;
  bottom: 8px;
  left: 24px;
  right: 24px;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}
.controls {
  padding: 32px 24px;
}
.controls > p {
  color: var(--muted);
}
.views {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 20px;
}
dl {
  border-block: 1px solid var(--border);
  padding: 16px 0;
  margin: 16px 0;
}
dt {
  color: var(--muted);
  font-size: 12px;
}
dd {
  margin: 0 0 12px;
}
dd:last-child {
  margin: 0;
}
.action {
  margin-top: 8px;
}
.camera-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: calc(100svh - 80px);
}
.camera-viewport {
  position: relative;
  background: #08080a;
  min-height: 580px;
  overflow: hidden;
}
#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
}
.guide {
  position: absolute;
  height: 62%;
  max-width: 70%;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  opacity: 0.65;
  filter: drop-shadow(0 1px 2px #000);
}
.guide-label {
  position: absolute;
  bottom: 12%;
  width: 100%;
  text-align: center;
  font-size: 12px;
  text-shadow: 0 1px 4px #000;
  padding: 0 16px;
}
#camera-empty {
  position: absolute;
  top: 15px;
  left: 20px;
  color: var(--muted);
  font-size: 12px;
}
.camera-controls {
  padding: 24px;
}
.notice {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 13px;
}
.metrics {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
  overflow-wrap: anywhere;
}
.primary {
  width: 100%;
}
@media (max-width: 760px) {
  header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  h1 {
    font-size: 14px;
  }
  nav a {
    padding: 10px;
  }
  .geometry,
  .camera-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .viewport {
    min-height: 440px;
    height: 56svh;
  }
  .controls {
    padding: 24px 20px;
  }
  .camera-viewport {
    min-height: 360px;
    height: 54svh;
  }
  .camera-controls {
    padding: 20px;
  }
  .viewport-label {
    left: 16px;
    right: 16px;
  }
  .guide {
    height: 65%;
  }
  .camera-page .note {
    margin-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

/* Keep the diagnostic label in its own strip, clear of geometry at narrow widths. */
.viewport-label {
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 10px 16px;
  background: rgba(20, 19, 24, 0.9);
}
#scene {
  height: calc(100% - 42px);
}
.orbit-help {
  font-size: 12px;
}
.tracking-overlay,
.tracking-contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.tracking-overlay {
  z-index: 2;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.95))
    drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8));
}
.tracking-contours {
  z-index: 3;
}
.pixel-source {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.camera-viewport .guide-label {
  z-index: 4;
}
.camera-viewport #camera-empty {
  z-index: 4;
}
#pixel-details {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  max-height: 320px;
  overflow: auto;
}
.calibration {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.calibration input[type="range"] {
  width: 100%;
  min-height: 44px;
}
.check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.check-option input {
  width: 18px;
  height: 18px;
}
.panel-modes {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 16px 0;
  padding: 8px 14px;
}
.panel-modes legend {
  padding: 0 6px;
  font-size: 13px;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
}

/* Keep the complete camera frame visible while the adjacent controls scroll. */
@media (min-width: 761px) and (max-height: 600px) and (orientation: landscape) {
  .camera-page .camera-main {
    height: calc(100svh - 80px);
    min-height: 0;
  }
  .camera-page .camera-viewport {
    height: 100%;
    min-height: 0;
  }
  .camera-page .camera-controls {
    height: 100%;
    overflow-y: auto;
  }
}

.proxy-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 16px 0;
  font-size: 12px;
}
.proxy-legend span::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 1px solid currentColor;
  background: currentColor;
  opacity: 0.7;
}
.body-key {
  color: #72e69d;
}
.screen-key {
  color: #6ce5ff;
}
.panel-key {
  color: #c6b0ff;
}
.select-option {
  display: grid;
  gap: 6px;
  margin: 14px 0;
}
select {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--foreground);
  font: inherit;
}
.frame-controls {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.frame-controls legend {
  padding: 0 6px;
  font-size: 12px;
}
.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.case-grid button {
  font-size: 11px;
  text-align: left;
  padding: 8px;
}
.case-grid .case-pass {
  border-color: #72e69d;
}
.case-grid .case-miss {
  border-color: #e8b46d;
}
@media (min-width: 761px) {
  .inspection-page .geometry,
  .inspection-page .camera-main {
    height: calc(100svh - 80px);
    min-height: 0;
  }
  .inspection-page .viewport,
  .inspection-page .camera-viewport {
    height: 100%;
    min-height: 0;
  }
  .inspection-page .controls,
  .inspection-page .camera-controls {
    overflow-y: auto;
    min-height: 0;
  }
}
.case-grid button {
  white-space: pre-line;
}

.inspection-caption {
  position: absolute;
  z-index: 5;
  bottom: 8px;
  left: 8px;
  right: 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(8, 8, 10, 0.85);
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
}
@media (max-width: 760px) {
  .neural-camera-page .camera-controls :is(input, button, summary, a, label) {
    scroll-margin-top: calc(max(260px, 42svh) + 16px);
  }
  .inspection-page .viewport,
  .inspection-page .camera-viewport {
    position: sticky;
    top: 0;
    z-index: 5;
    height: 42svh;
    min-height: 260px;
    flex-shrink: 0;
  }
  .inspection-page .controls,
  .inspection-page .camera-controls {
    position: relative;
    z-index: 0;
  }
}
@media (max-width: 760px) and (max-height: 500px) and (orientation: landscape) {
  .neural-camera-page .camera-main {
    grid-template-rows: minmax(0, 1fr);
  }
  .inspection-page .geometry,
  .inspection-page .camera-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    height: calc(100svh - 80px);
  }
  .inspection-page .viewport,
  .inspection-page .camera-viewport {
    position: relative;
    height: 100%;
    min-height: 0;
  }
  .inspection-page .controls,
  .inspection-page .camera-controls {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
  }
}

.reference-key {
  color: #ffb454;
}
