:root {
  color-scheme: dark;
  --bg: #0e1722;
  --panel: #182735;
  --muted: #9cafc3;
  --ink: #e4edf4;
  --accent: #5ed9c9;
  --line: #293a49;
  font-family: system-ui, sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
button,
input,
select {
  font: inherit;
}
button,
select,
input {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #1c2b3a;
  color: var(--ink);
}
button {
  cursor: pointer;
  font-weight: 650;
  padding: 8px 12px;
}
button:hover {
  background: #2b4051;
}
button[aria-pressed="true"] {
  background: #204c50;
  border-color: #347371;
  color: var(--accent);
}
button:disabled,
select:disabled {
  opacity: 0.5;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a {
  color: var(--accent);
}
[hidden] {
  display: none !important;
}
header {
  padding: 8px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 2px;
}
h1 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0;
}
.metrics {
  display: grid;
  text-align: right;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  max-width: 55%;
}
.metrics > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metrics small {
  font-size: 11px;
}
nav {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  overflow-x: auto;
}
nav button {
  padding: 6px 16px;
  white-space: nowrap;
}
.divider {
  width: 8px;
  flex: none;
}
.recording {
  font-size: 12px;
  margin-left: auto;
  white-space: nowrap;
  padding: 6px;
}
main {
  height: calc(100dvh - 125px);
  min-height: 350px;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
}
aside {
  overflow: auto;
  padding: 16px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
aside section + section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}
h2 {
  font-size: 14px;
  margin: 0 0 10px;
}
p {
  line-height: 1.5;
  margin: 8px 0;
}
form {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
input[type="search"] {
  min-width: 0;
  flex: 1;
  padding: 8px;
}
select {
  width: 100%;
  padding: 8px;
  text-overflow: ellipsis;
}
.quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.quick button {
  font-size: 12px;
  padding: 7px 4px;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  margin: 0 0 4px;
}
.details h2 {
  font-size: 20px;
  color: var(--accent);
}
#selection-note {
  color: var(--muted);
  font-size: 12px;
}
dl {
  margin: 12px 0;
  font-size: 12px;
}
dt {
  color: var(--muted);
  margin-top: 8px;
}
dd {
  margin: 2px 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
#counts {
  font-size: 12px;
  font-weight: 650;
}
#net-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 230px;
  overflow: auto;
  font-size: 12px;
}
#net-list li {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 4px;
  flex: none;
}
.suppressed {
  opacity: 0.6;
}
.net-text {
  min-width: 0;
}
#clear {
  padding: 6px 8px;
  font-size: 12px;
}
.options label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 9px 0;
  font-size: 12px;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  margin: 0;
  flex: none;
}
kbd {
  font-family: inherit;
  color: var(--muted);
  font-size: 10px;
  margin-left: auto;
}
.features {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.features label {
  gap: 4px;
}
.features kbd {
  margin-left: 2px;
}
.layer-label {
  color: var(--muted);
}
fieldset {
  border: 1px solid var(--line);
  margin: 12px 0 0;
  padding: 8px 12px;
}
legend {
  font-size: 12px;
}
.help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}
.help summary {
  color: var(--ink);
  cursor: pointer;
}
.help p {
  margin: 10px 0;
}
#viewport {
  position: relative;
  overflow: hidden;
  background: #070d13;
  min-width: 0;
  min-height: 300px;
  touch-action: none;
}
canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#highlights {
  pointer-events: none;
}
.camera-tools {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 6px;
}
.camera-tools button {
  background: #152534e8;
}
.hint {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  pointer-events: none;
  max-width: calc(100% - 190px);
}
#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: #152534f2;
  padding: 24px;
  border: 1px solid var(--line);
  width: min(90%, 360px);
  border-radius: 6px;
}
#loading p {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
progress {
  width: 100%;
  accent-color: var(--accent);
}
#retry {
  margin-top: 12px;
}
footer {
  height: 28px;
  padding: 6px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  gap: 8px;
}
.skip {
  position: absolute;
  left: 8px;
  top: -80px;
  z-index: 10;
  background: var(--panel);
  padding: 12px;
}
.skip:focus {
  top: 8px;
}
.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;
}
@media (max-width: 760px) {
  header {
    padding: 8px;
  }
  .metrics {
    max-width: 45%;
    font-size: 10px;
  }
  h1 {
    font-size: 20px;
  }
  nav {
    gap: 6px;
  }
  nav button {
    padding: 6px 10px;
  }
  .recording {
    display: none;
  }
  main {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 55dvh auto;
  }
  #viewport {
    grid-row: 1;
    min-height: 300px;
  }
  aside {
    grid-row: 2;
    border-right: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .choose .quick {
    grid-template-columns: repeat(4, 1fr);
  }
  .details {
    min-height: 100px;
  }
  footer {
    height: auto;
  }
  .hint {
    font-size: 10px;
    left: 8px;
    bottom: 12px;
  }
  .camera-tools {
    right: 8px;
    bottom: 8px;
  }
  .camera-tools button {
    padding: 7px 10px;
  }
  #net-list {
    max-height: 190px;
  }
}
@media (min-width: 761px) {
  body {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  header,
  footer {
    flex: none;
  }
  main {
    flex: 1;
    height: auto;
    min-height: 0;
  }
  #viewport {
    min-height: 0;
  }
}

#processing {
  position: absolute;
  top: 12px;
  left: 12px;
  width: min(calc(100% - 24px), 300px);
  padding: 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #152534f2;
  box-sizing: border-box;
}
#processing strong { font-size: 14px; }
#processing p { font-size: 12px; margin: 6px 0; }
#processing progress { display: block; margin-top: 10px; }
