:root {
  --bg: #0d1013;
  --panel: #12161a;
  --line: #222a31;
  --line2: #2f3941;
  --ink: #c3cbd2;
  --ink-dim: #7d8992;
  --ink-hi: #eaf0f4;
  --good: #4a8fc7;
  --defect: #d1803b;
  --alarm: #c1493f;
  --ok: #4f9d69;
  --mark: #d8dee3;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  --sans: "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
}

/* the day the model lands this comes off. until then it is the first thing anyone reads. */
.shell-note {
  padding: 8px 12px;
  background: #2a2216;
  border-bottom: 1px solid #4a3a2c;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
}
.shell-note b { color: var(--defect); }

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #0a0d10;
  border-bottom: 1px solid var(--line2);
  padding: 8px 12px;
}
.bar-id { display: flex; align-items: center; gap: 12px; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.mark {
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.22em;
  color: var(--mark);
  border: 1px solid var(--line2);
  padding: 6px 8px;
}
.sub { color: var(--ink-dim); font-size: 12px; }
.stat { font: 12px/1 var(--mono); color: var(--ink-dim); }

.pill {
  padding: 3px 9px;
  border: 1px solid var(--line2);
  font: 10px/1.6 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}
.pill.off { opacity: 0.65; }
.pill.live { border-color: var(--ok); color: var(--ok); }
.pill.bad { border-color: var(--alarm); color: var(--alarm); }

main { padding: 12px; display: flex; flex-direction: column; gap: 12px; max-width: 900px; margin: 0 auto; }

.panel { background: var(--panel); border: 1px solid var(--line); padding: 12px 14px 12px; }
.panel.warn { border-color: #4a3a2c; }
.panel-head { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.panel-head h2 {
  margin: 0;
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-hi);
}
h3 { margin: 0 0 6px; font: 600 11px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.lede { margin: 0 0 10px; max-width: 78ch; }
.hint { margin: 6px 0 0; font-size: 11px; color: var(--ink-dim); }
.note { margin: 10px 0 0; font-size: 12px; color: var(--ink-dim); max-width: 82ch; }

/* the stage. the video is object-fit cover so a portrait phone does not letterbox. */
.stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 60vh;
  background: #000;
  border: 1px solid var(--line);
  overflow: hidden;
}
.stage-wrap video,
.stage-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.stage-wrap canvas { pointer-events: none; }
.stage-tag {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 3px 7px;
  background: rgba(10, 13, 16, 0.82);
  font: 10px/1.4 var(--mono);
  color: var(--ink-hi);
}
.stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
  background: #0a0d10;
}
.stage-empty p { margin: 0; font-size: 13px; color: var(--ink-dim); max-width: 34ch; }
.stage-empty.gone { display: none; }

.enroll-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

button {
  background: #0a0d10;
  color: var(--ink);
  border: 1px solid var(--line2);
  padding: 7px 12px;
  font: 12px/1.4 var(--mono);
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--ink-dim); color: var(--ink-hi); }
button:disabled { opacity: 0.4; cursor: default; }
#enrollBtn { border-color: var(--good); color: var(--ink-hi); }
#enrollBtn.holding { background: #16222c; }

/* a long enrolment scrolls sideways rather than growing the page. the default
   scrollbar is a fat white bar across the panel, so it is thinned here. */
.strip { display: flex; gap: 3px; overflow-x: auto; margin-top: 8px; min-height: 4px; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.strip::-webkit-scrollbar { height: 5px; }
.strip::-webkit-scrollbar-track { background: transparent; }
.strip::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 3px; }
.strip img, .strip div { width: 44px; height: 44px; object-fit: cover; border: 1px solid var(--line2); flex: 0 0 auto; }

.readouts { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 10px; }
.ro { background: var(--panel); padding: 7px 10px; flex: 1 1 110px; }
.ro b { display: block; font: 400 17px/1.25 var(--mono); color: var(--ink-hi); }
.ro span { font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-dim); }
.ro small { display: block; font: 11px/1.3 var(--mono); color: var(--ink-dim); }
.ro.hot b { color: var(--defect); }
.ro.alarm b { color: var(--alarm); }

.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); padding: 10px 12px; }
.card p { margin: 0; font-size: 13px; color: var(--ink-dim); }

.bits { margin: 0; padding: 0; list-style: none; }
.bits li { position: relative; margin-bottom: 10px; padding-left: 16px; font-size: 13px; line-height: 1.6; }
.bits li:last-child { margin-bottom: 0; }
.bits li::before { content: ''; position: absolute; left: 0; top: 10px; width: 6px; height: 1px; background: var(--ink-dim); }

/* the cost table. cells are nowrap, so a narrow screen scrolls the table rather
   than taking the whole page sideways with it. */
.tbl-wrap { overflow-x: auto; overflow-y: hidden; }
.tbl { width: 100%; border-collapse: collapse; font: 12px/1.4 var(--mono); }
.tbl th, .tbl td { text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th {
  font: 600 10px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-dim); border-bottom-color: var(--line2);
}
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tbody tr:hover { background: #171c21; }
.tbl td.hi { color: var(--ink-hi); }
.tbl td.warn { color: var(--defect); }
.tbl td.good { color: var(--ok); }
.tbl tfoot td { border-top: 1px solid var(--line2); color: var(--ink-hi); }

.src {
  margin: 10px 0 0; padding-top: 6px; border-top: 1px solid var(--line);
  font: 11px/1.5 var(--mono); color: var(--ink-dim); overflow-wrap: anywhere;
}

.about-links { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 14px 0 0; }
.about-links a {
  padding: 5px 10px;
  border: 1px solid var(--line2);
  color: var(--ink);
  text-decoration: none;
  font: 11px/1.5 var(--mono);
}
.about-links a:hover { border-color: var(--ink-dim); color: var(--ink-hi); }

.foot {
  max-width: 74ch;
  margin: 0 auto;
  padding: 22px 14px 40px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-dim);
}
.foot p { margin: 0 0 8px; }
.foot a { color: var(--ink); }
.foot b { color: var(--ink-hi); font-weight: 600; }
