/* Dark-only on purpose: this page is read through a headset passthrough or on a
   phone next to the robot, where a light ground is glare. */
:root {
  --bg: #0e1418;
  --panel: #161e24;
  --line: #2a353d;
  --ink: #e8edf0;
  --ink-2: #9aaab5;
  --good: #45cfc3;
  --warn: #e09257;
  --bad: #e2685f;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* The robot this page drives. Deliberately loud: picking the wrong one and
   finding out when an arm moves is the failure this is here to prevent. */
.robot-badge {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--good);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 6px 10px;
  white-space: nowrap;
}

h1 { font-size: 27px; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 13px; margin: 0 0 8px; color: var(--ink-2); font-weight: 600; }
.sub { margin: 8px 0 0; color: var(--ink-2); font-size: 14.5px; max-width: 56ch; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 14px;
  align-items: center;
}

label { font-size: 13px; color: var(--ink-2); }

input, select {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  border-radius: 2px;
  width: 100%;
}

input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--good);
  outline-offset: 2px;
}

.controls { display: flex; flex-wrap: wrap; gap: 10px; }

button {
  flex: 1 1 130px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
  min-height: 48px; /* headset-sized target */
}
button:hover:not(:disabled) { border-color: var(--good); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
#btn-take { border-color: var(--good); color: var(--good); }

/* Release is a way out, not a step: quieter, and it never stretches to match the
   three main buttons. */
button.secondary {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  min-height: 36px;
  color: var(--ink-2);
}


.status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.status > div {
  background: var(--panel);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.status .wide { grid-column: 1 / -1; }
.status span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.status b {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
/* The control line is the only one that answers "will the arms move if I squeeze
   the trigger", so it reads as a sentence rather than a monospace field. */
.status b#status-control {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
}

.status b[data-tone="good"] { color: var(--good); }
.status b[data-tone="warn"] { color: var(--warn); }
.status b[data-tone="bad"]  { color: var(--bad); }

.logwrap { display: flex; flex-direction: column; }

pre#log {
  background: #0a0f12;
  border: 1px solid var(--line);
  margin: 0;
  padding: 12px;
  height: 300px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The WebXR session renders into this; it must exist but never take layout. */
#xr-canvas {
  position: fixed;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
