/* ════════════════════════════════════════════════════════════════════
   teleop-app.css — the MABEL browser operator console.
   One full-bleed view at a time; a floating liquid-glass dock (view tabs
   + link + telemetry + reset/E-STOP) persists at the bottom of the
   viewport over page scroll, like the site's side nav. Scoped under
   .ta-app / .ta-dock.
   ════════════════════════════════════════════════════════════════════ */

.ta-wrap { position: relative; padding: 0 24px 110px; max-width: 1480px; margin: 0 auto; }
.ta-wrap:fullscreen { padding: 0; max-width: none; background: #0d0c0b; }
.ta-wrap:fullscreen .ta-dock { position: fixed; z-index: 999; }
.ta-wrap:fullscreen .ta-app { height: 100%; border-radius: 0; border: none; }

.ta-app {
  position: relative;
  height: min(86vh, 980px);
  min-height: 560px;
  border-radius: 22px;
  overflow: hidden;
  background: #0d0c0b;
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.65);
  font-family: 'Archivo', system-ui, sans-serif;
  color: #efeae3;
  user-select: none;
  -webkit-user-select: none;
}
.ta-app *, .ta-dock * { box-sizing: border-box; }
.ta-app canvas { display: block; touch-action: none; }

/* ── views: one at a time, full bleed ──────────────────────────────── */
.ta-view { position: absolute; inset: 0; display: none; }
.ta-view.on { display: block; }
.ta-stage { position: absolute; inset: 0; }
.ta-stage canvas { width: 100%; height: 100%; }

/* ── top chrome over each view ─────────────────────────────────────── */
.ta-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; pointer-events: none;
}
.ta-top > * { pointer-events: auto; }
.ta-title { font: 500 12px/1 'Space Mono', monospace; letter-spacing: .14em; color: #97908a; }

/* segmented control (Apple style) */
.ta-seg {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 17px;
  background: rgba(20,18,16,.62); backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.08);
}
.ta-seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 16px; border-radius: 14px; border: none; cursor: pointer;
  background: transparent; color: #97908a; font: 500 12.5px 'Archivo', sans-serif;
  transition: background .18s, color .18s; white-space: nowrap;
}
.ta-seg button svg { width: 14px; height: 14px; }
.ta-seg button.on { background: #efeae3; color: #151820; }
/* compact variant for the in-panel toggles (control area · space) */
.ta-seg.sm button { height: 26px; padding: 0 12px; font-size: 11.5px; border-radius: 12px; }

/* ── teleop view ───────────────────────────────────────────────────── */
.ta-video { position: absolute; inset: 0; background: #000; overflow: hidden; }
.ta-video img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ta-video .ta-novid {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px),
    radial-gradient(80% 90% at 50% 30%, #15131180, transparent),
    #0a0908;
}
.ta-novid .inner { color: #6d6660; font: 400 13px 'Archivo', sans-serif; max-width: 38ch; line-height: 1.6; }
.ta-novid .inner b { color: #97908a; font-weight: 500; display: block; margin-bottom: 6px; font-size: 14px; }
.ta-novid .inner p { margin: 0 0 16px; }
.ta-trylive {
  display: inline-flex; align-items: center; height: 42px; padding: 0 24px;
  border-radius: 21px; border: none; cursor: pointer;
  background: linear-gradient(180deg, #f0b68b, #e9a679); color: #151820;
  font: 600 14px 'Archivo', sans-serif; letter-spacing: .01em;
  box-shadow: 0 10px 26px -10px rgba(233,166,121,.6);
  transition: transform .12s, box-shadow .18s, filter .18s;
}
.ta-trylive:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 14px 32px -10px rgba(233,166,121,.7); }
.ta-trylive:active { transform: translateY(0); }
.ta-pip {
  position: absolute; top: 60px; width: clamp(120px, 17%, 230px); aspect-ratio: 4/3; z-index: 5;
  border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.14);
  background: #0a0908; box-shadow: 0 10px 28px -12px rgba(0,0,0,.7);
}
.ta-pip.l { left: 14px; } .ta-pip.r { right: 14px; }
.ta-pip img { width: 100%; height: 100%; object-fit: cover; }
.ta-pip .tag {
  position: absolute; left: 8px; bottom: 6px; font: 500 9.5px 'Space Mono', monospace;
  letter-spacing: .14em; color: rgba(239,234,227,.8); text-shadow: 0 1px 4px #000; z-index: 7;
}
/* Per-camera "NOT CONNECTED": teleop-app.js toggles .ta-camoff on a tile when its
   MJPEG stream 404s / errors (e.g. a wrist cam that isn't wired on the robot). */
.ta-camoff::after {
  content: "NOT CONNECTED"; position: absolute; inset: 0; z-index: 6; pointer-events: none;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font: 600 10px 'Space Mono', monospace; letter-spacing: .16em;
  color: rgba(239,234,227,.6); background: repeating-linear-gradient(
    45deg, rgba(20,18,16,.9), rgba(20,18,16,.9) 10px, rgba(28,25,22,.9) 10px, rgba(28,25,22,.9) 20px);
}
.ta-video.ta-camoff::after { font-size: 14px; }
.ta-mini {
  /* sits ABOVE the right joystick (bottom 96px + stick ≤148px + label gap) */
  position: absolute; right: 14px; bottom: calc(96px + clamp(108px, 15vw, 148px) + 38px);
  width: clamp(130px, 17%, 230px); aspect-ratio: 1/1.05;
  border-radius: 14px; overflow: hidden; z-index: 5;
  border: 1px solid rgba(255,255,255,.1); background: rgba(13,12,11,.55);
  backdrop-filter: blur(10px) saturate(1.4); -webkit-backdrop-filter: blur(10px) saturate(1.4);
}
.ta-mini .tag {
  position: absolute; left: 10px; top: 8px; font: 500 9.5px 'Space Mono', monospace;
  letter-spacing: .14em; color: #6d6660;
}

/* joysticks — raised clear of the floating dock */
.ta-joy {
  position: absolute; bottom: 96px; z-index: 6;
  width: clamp(108px, 15vw, 148px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(40,36,32,.55), rgba(18,16,15,.65));
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px) saturate(1.4); -webkit-backdrop-filter: blur(10px) saturate(1.4);
  touch-action: none;
}
.ta-joy.l { left: 22px; } .ta-joy.r { right: 22px; }
.ta-joy .knob {
  position: absolute; left: 50%; top: 50%; width: 44%; aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 38% 32%, #efeae3, #b9b1a8 70%);
  box-shadow: 0 6px 16px rgba(0,0,0,.5), inset 0 -3px 8px rgba(0,0,0,.18);
  transition: transform .12s; will-change: transform;
}
.ta-joy.live .knob { transition: none; }
.ta-joy .lab {
  position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%);
  font: 500 9.5px 'Space Mono', monospace; letter-spacing: .16em; color: #6d6660; white-space: nowrap;
}
.ta-joy.accent .knob { background: radial-gradient(circle at 38% 32%, #f0b68b, #C6301A 75%); }

/* arms cluster (grip + nudges) */
.ta-cluster { position: absolute; bottom: 100px; z-index: 6; display: flex; gap: 12px; align-items: flex-end; }
.ta-cluster.l { left: 22px; } .ta-cluster.r { right: 22px; flex-direction: row-reverse; }
.ta-grip { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ta-grip .track {
  width: 30px; height: 96px; border-radius: 15px; overflow: hidden; position: relative;
  background: rgba(18,16,15,.65); border: 1px solid rgba(255,255,255,.12); cursor: ns-resize;
  touch-action: none;
}
.ta-grip .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; background: linear-gradient(180deg, #f0b68b, #C6301A); }
.ta-grip .lab, .ta-nudge .lab { font: 500 9.5px 'Space Mono', monospace; letter-spacing: .14em; color: #6d6660; }
.ta-nudge { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.ta-nudge button {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); cursor: pointer;
  background: rgba(18,16,15,.65); color: #efeae3; font-size: 15px; line-height: 1;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ta-nudge button:active { background: #efeae3; color: #151820; }

/* ── body view ─────────────────────────────────────────────────────── */
.ta-feelbar { position: absolute; top: 50px; left: 50%; transform: translateX(-50%); z-index: 6; }
.ta-hint {
  position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 6;
  padding: 8px 16px; border-radius: 16px; font: 400 12.5px 'Archivo', sans-serif; color: #97908a;
  background: rgba(20,18,16,.62); border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5);
  white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis;
}
.ta-hint b { color: #3FB56B; font-weight: 500; }
/* Body controls: a SMALL floating card in the top-right corner, so the robot
   model is the view. Stiffness sits on top; the joint sliders collapse behind a
   header and are closed by default — minimal obstruction. Same on every size. */
.ta-side {
  position: absolute; right: 12px; top: 48px; width: clamp(146px, 20vw, 184px);
  max-height: calc(100% - 140px); z-index: 6;
  display: flex; flex-direction: column; gap: 7px; pointer-events: none;
}
.ta-side > * { pointer-events: auto; }
.ta-panel {
  border-radius: 13px; padding: 9px 11px;
  background: rgba(18,16,15,.72); border: 1px solid rgba(255,255,255,.09);
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
}
.ta-panel .row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ta-panel .k { font: 500 9px 'Space Mono', monospace; letter-spacing: .1em; color: #6d6660; }
.ta-panel .v { font: 500 10.5px 'Space Mono', monospace; color: #e9a679; }
.ta-slider { width: 100%; accent-color: #e9a679; height: 18px; }
.ta-joints { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
/* collapsible joints header — present on every viewport, collapsed by default */
.ta-joints-hd {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 24px; padding: 0; border: none; background: none;
  color: #efeae3; font: 600 11px 'Archivo', sans-serif; cursor: pointer;
}
.ta-joints-hd .chev { color: #6d6660; transition: transform .2s; font-size: 13px; }
.ta-joints.collapsed .ta-joints-hd .chev { transform: rotate(-90deg); }
.ta-joints.collapsed .ta-jtabs, .ta-joints.collapsed .ta-jlist { display: none; }
.ta-jtabs { display: flex; gap: 4px; margin: 8px 0; flex-wrap: wrap; }
.ta-jtabs button {
  height: 22px; padding: 0 9px; border-radius: 11px; border: none; cursor: pointer;
  background: rgba(255,255,255,.06); color: #97908a; font: 500 10px 'Archivo', sans-serif;
}
.ta-jtabs button.on { background: #efeae3; color: #151820; }
.ta-jlist { overflow-y: auto; max-height: 36vh; min-height: 0; padding-right: 4px; scrollbar-width: thin; }
.ta-jrow { margin-bottom: 5px; }
.ta-jrow .row { margin-bottom: 0; }
.ta-jrow .k { letter-spacing: .02em; text-transform: none; font-size: 10px; color: #97908a; }
.ta-jrow input { width: 100%; accent-color: #e9a679; height: 16px; }

/* ── navigate view ─────────────────────────────────────────────────── */
.ta-rooms { position: absolute; top: 50px; left: 14px; z-index: 6; display: flex; flex-direction: column; gap: 6px; }
.ta-room {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 168px; padding: 9px 13px; border-radius: 13px; border: 1px solid rgba(255,255,255,.08);
  background: rgba(18,16,15,.62); color: #97908a; cursor: pointer; text-align: left;
  font: 500 12.5px 'Archivo', sans-serif;
  backdrop-filter: blur(12px) saturate(1.5); -webkit-backdrop-filter: blur(12px) saturate(1.5);
}
.ta-room.on { border-color: rgba(233,166,121,.5); color: #efeae3; }
.ta-room .sub { font: 400 10px 'Space Mono', monospace; letter-spacing: .06em; color: #6d6660; }
.ta-navhud {
  /* clear the fixed dock: its height is measured at runtime into
     --ta-dock-h, because the dock grows a second row on narrow screens
     and a hard-coded offset left these controls buried underneath it. */
  position: absolute; left: 50%; bottom: calc(var(--ta-dock-h, 112px) + 30px);
  transform: translateX(-50%); z-index: 6;
  display: flex; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 18px;
  background: rgba(18,16,15,.72); border: 1px solid rgba(255,255,255,.09);
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
}
.ta-navhud .stat { font: 500 11px 'Space Mono', monospace; color: #97908a; padding: 0 8px; }
.ta-navhud .stat b { color: #efeae3; font-weight: 500; }
/* flashed by onNavResult when a goal is unreachable/aborted */
.ta-navhud.ta-warn { border-color: rgba(255,99,71,.85); box-shadow: 0 0 0 1px rgba(255,99,71,.55), 0 0 18px rgba(255,99,71,.4); animation: ta-warn-pulse .5s ease-in-out 0s 3; }
.ta-navhud.ta-warn .stat b { color: #ff8a73; }
@keyframes ta-warn-pulse { 50% { transform: translateX(-50%) scale(1.04); } }
.ta-btn {
  height: 32px; padding: 0 16px; border-radius: 16px; border: none; cursor: pointer;
  font: 500 12.5px 'Archivo', sans-serif; background: rgba(255,255,255,.08); color: #efeae3;
}
.ta-btn:hover { background: rgba(255,255,255,.14); }
.ta-btn.primary { background: #e9a679; color: #151820; }
.ta-btn.primary:hover { background: #f0b68b; }
.ta-btn:disabled { opacity: .35; cursor: default; }

/* ════ THE DOCK — floating liquid glass, persists over page scroll ════ */
.ta-dock {
  /* Absolute inside .ta-wrap, not fixed to the viewport. When the app is
     embedded in a page (teleop.html) a fixed dock kept floating over every
     section below it as the reader scrolled past the simulator. Fullscreen
     restores fixed positioning below. */
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  max-width: min(96vw, 1340px);
  padding: 10px 14px 9px;
  border-radius: 26px;
  /* liquid glass: deep blur + saturation, layered translucency, inner light */
  background: linear-gradient(180deg, rgba(40,36,32,.46), rgba(18,16,14,.55));
  backdrop-filter: blur(26px) saturate(1.8); -webkit-backdrop-filter: blur(26px) saturate(1.8);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow:
    0 20px 50px -18px rgba(0,0,0,.75),
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -1px 0 rgba(0,0,0,.25);
  font-family: 'Archivo', system-ui, sans-serif;
  color: #efeae3;
  user-select: none; -webkit-user-select: none;
}
.ta-dock-row { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 9px; }
.ta-divider { width: 1px; height: 26px; background: rgba(255,255,255,.1); flex: none; }
/* The bar stays simple — indicator · Connect · Reset · E-STOP · fullscreen.
   Auto-connect (baked relay + LAN auto-discovery) handles connectivity, so the
   manual host/key inputs and the live metrics are not shown (kept in the DOM,
   hidden, so the connection logic is untouched). Same on desktop and mobile. */
.ta-host, .ta-metrics, .ta-divider { display: none !important; }

/* view tabs — row one, front and centre. Pilot / Manipulate / Navigate are all
   the SAME width (equal flex basis) so the bar reads evenly. */
.ta-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 21px; background: rgba(0,0,0,.28); }
.ta-tabs button {
  flex: 1 1 0; min-width: 124px; justify-content: center;
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 19px; border: none; cursor: pointer;
  background: transparent; color: #97908a; font: 600 13.5px 'Archivo', sans-serif;
  transition: background .2s, color .2s; white-space: nowrap;
}
.ta-tabs button svg { width: 17px; height: 17px; flex: none; }
.ta-tabs button.on { background: #efeae3; color: #151820; }
.ta-tabs button:not(.on):hover { color: #d8d2ca; }

.ta-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
  border-radius: 15px; font: 500 10px 'Space Mono', monospace; letter-spacing: .12em;
  background: rgba(255,255,255,.06); color: #97908a; white-space: nowrap; flex: none;
}
.ta-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #6d6660; }
.ta-pill.link { color: #3FB56B; } .ta-pill.link .dot { background: #3FB56B; box-shadow: 0 0 8px #3FB56B88; }
.ta-pill.wait { color: #e9a679; } .ta-pill.wait .dot { background: #e9a679; animation: ta-blink 1.1s infinite; }
@keyframes ta-blink { 50% { opacity: .25; } }
.ta-host {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px;
  border-radius: 15px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.1);
  min-width: 0; cursor: text;
}
.ta-host > span { font: 500 9px 'Space Mono', monospace; letter-spacing: .12em; color: #6d6660; flex: none; }
.ta-host input {
  width: clamp(70px, 8vw, 124px); min-width: 0; border: none; background: transparent;
  color: #efeae3; font: 400 11px 'Space Mono', monospace; outline: none;
}
.ta-host input::placeholder { color: #4d4742; }
.ta-host:focus-within { border-color: rgba(233,166,121,.5); }
.ta-host.trying { border-color: rgba(233,166,121,.55); }
.ta-host.trying > span { color: #e9a679; }
.ta-host.live { border-color: rgba(63,181,107,.55); }
.ta-host.live > span { color: #3FB56B; }
/* the secure-relay path: host + token, tinted to read as the "internet" route */
.ta-host-relay > span, .ta-host-key > span { color: #9a86c8; }
.ta-host-relay input { width: clamp(78px, 8vw, 132px); }
.ta-host-key input { width: clamp(64px, 6vw, 104px); }
.ta-host-relay:focus-within, .ta-host-key:focus-within { border-color: rgba(154,134,200,.55); }
.ta-connect {
  height: 30px; padding: 0 13px; border-radius: 15px; border: none; cursor: pointer;
  background: #efeae3; color: #151820; font: 500 12px 'Archivo', sans-serif; flex: none;
  display: inline-flex; align-items: center; gap: 6px; max-width: 180px;
}
.ta-connect .hp-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-connect .hp-cv { font-size: 10px; opacity: .65; flex: none; }
.ta-connect.live { background: #3FB56B; color: #06210f; }
.ta-connect.wait { background: #e9a679; color: #2a1206; }

/* ── host picker dropdown ──────────────────────────────────────────── */
.ta-hostpick { position: relative; flex: none; }
.ta-hostmenu {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: min(264px, 86vw); max-height: 56vh; overflow-y: auto; z-index: 1000;
  padding: 6px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(42,38,33,.95), rgba(18,16,14,.97));
  backdrop-filter: blur(26px) saturate(1.8); -webkit-backdrop-filter: blur(26px) saturate(1.8);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 26px 60px -20px rgba(0,0,0,.82), inset 0 1px 0 rgba(255,255,255,.1);
}
.ta-hostmenu[hidden] { display: none; }
.hm-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 9px 10px 4px; font: 600 9.5px 'Space Mono', monospace; letter-spacing: .12em;
  color: #9a938c; text-transform: uppercase;
}
.hm-head span { font-weight: 400; letter-spacing: .03em; color: #6d6660; text-transform: none; }
.hm-row {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border: none; border-radius: 11px; cursor: pointer;
  background: transparent; color: #efeae3; text-align: left; font-family: 'Archivo', sans-serif;
}
.hm-row:hover { background: rgba(255,255,255,.07); }
.hm-row.on { background: rgba(63,181,107,.14); }
.hm-dot { width: 7px; height: 7px; border-radius: 50%; background: #4d4742; flex: none; }
.hm-row.on .hm-dot { background: #3FB56B; box-shadow: 0 0 7px #3FB56B88; }
.hm-main { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.hm-label { font: 500 13px 'Archivo', sans-serif; }
.hm-sub { font: 400 10.5px 'Space Mono', monospace; color: #8a837c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-del { color: #6d6660; font-size: 17px; line-height: 1; padding: 0 4px; flex: none; }
.hm-del:hover { color: #ff6f57; }
.hm-disc { justify-content: flex-start; margin-top: 2px; }
.hm-disc .hm-label { color: #e9a679; }
.hm-add { display: flex; gap: 5px; padding: 6px 4px 4px; }
.hm-add input {
  height: 30px; min-width: 0; border-radius: 9px; padding: 0 9px;
  background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.1); color: #efeae3;
  font: 400 11px 'Space Mono', monospace; outline: none;
}
.hm-name { flex: 1; } .hm-ip { flex: 1.25; }
.hm-add input:focus { border-color: rgba(233,166,121,.5); }
.hm-addbtn {
  flex: none; padding: 0 12px; height: 30px; border-radius: 9px; border: none; cursor: pointer;
  background: #efeae3; color: #151820; font: 600 12px 'Archivo', sans-serif; line-height: 1;
}
.ta-metrics { display: flex; gap: 12px; align-items: center; }
.ta-metric { font: 500 10px 'Space Mono', monospace; letter-spacing: .08em; color: #6d6660; white-space: nowrap; }
.ta-metric b { color: #efeae3; font-weight: 500; margin-left: 4px; }
/* Reset + fullscreen: solid liquid-glass chips so they read clearly against the
   video/3D behind the dock (were near-invisible ghost outlines before). */
.ta-sbtn {
  height: 34px; padding: 0 16px; border-radius: 17px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.11);
  backdrop-filter: blur(8px) saturate(1.4); -webkit-backdrop-filter: blur(8px) saturate(1.4);
  color: #efeae3; font: 600 12.5px 'Archivo', sans-serif; white-space: nowrap; flex: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 3px 10px -5px rgba(0,0,0,.6);
  transition: background .15s, border-color .15s, transform .1s;
}
.ta-sbtn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); color: #fff; }
.ta-sbtn:active { transform: translateY(1px); }
.ta-estop {
  height: 36px; padding: 0 16px; border-radius: 18px; border: 2px solid #b3402e; cursor: pointer;
  background: rgba(179,64,46,.16); color: #ff6f57; font: 700 12px 'Archivo', sans-serif; letter-spacing: .08em;
  flex: none;
}
.ta-estop:hover { background: rgba(179,64,46,.3); }
.ta-estop.latched { background: #b3402e; color: #fff; animation: ta-blink 1s infinite; }
.ta-fs { width: 36px; padding: 0; display: grid; place-items: center; }
.ta-fs svg { width: 16px; height: 16px; }

/* CSS immersive fullscreen — the fallback for iPhone Safari, which has NO
   Fullscreen API on the iPhone (only iPad). Toggled by the FS button when the
   native API is unavailable: the console fills the viewport, page chrome hidden. */
html.ta-immersive, html.ta-immersive body { overflow: hidden; height: 100%; }
html.ta-immersive #taSection {
  position: fixed; inset: 0; z-index: 900; margin: 0; padding: 0; max-width: none;
  background: #0d0c0b;
}
html.ta-immersive #taSection .ta-app {
  height: 100vh; height: 100dvh; min-height: 0; border-radius: 0; border: none;
}
html.ta-immersive header.nav, html.ta-immersive .sidenav,
html.ta-immersive #progress, html.ta-immersive .page-hero { display: none; }

@media (max-width: 940px) { .ta-tabs button { padding: 0 14px; } }

/* ════ PHONE (≤700px) — same simple 2-line dock, just tighter to fit ════ */
@media (max-width: 700px) {
  .ta-dock { gap: 6px; padding: 7px 10px 6px; bottom: 10px; max-width: 96vw; }
  .ta-dock-row { gap: 7px; width: 100%; }
  .ta-pill span:last-child { display: none; }    /* status dot only when tight */
  .ta-pill { padding: 0 8px; }
  .ta-connect { padding: 0 12px; }
  .ta-sbtn { padding: 0 11px; }
  .ta-estop { height: 32px; padding: 0 12px; }
  .ta-tabs { width: 100%; }
  .ta-tabs button { flex: 1 1 0; min-width: 0; padding: 0 8px; justify-content: center; }
  .ta-pip { width: 104px; top: 52px; }

  /* Arm-control clusters: each holds a wrist stick + RAISE + grip slider. At the
     default 108px stick the LEFT and RIGHT clusters (and their grip sliders) meet
     and overlap in the middle on a phone — shrink everything (stick scales with the
     viewport) so they never touch, down to the smallest 320px iPhone. */
  .ta-cluster { gap: 5px; bottom: 90px; }
  .ta-cluster.l { left: 6px; } .ta-cluster.r { right: 6px; }
  .ta-cluster .ta-joy { width: clamp(52px, 16vw, 72px); }   /* in-cluster wrist stick */
  .ta-cluster .ta-nudge button { width: 26px; height: 26px; font-size: 12px; border-radius: 9px; }
  .ta-cluster .ta-grip .track { width: 18px; height: 56px; }
  .ta-cluster .lab { font-size: 7px; letter-spacing: .02em; white-space: nowrap; }

  /* Body view: keep the small floating card top-right, just a hair narrower */
  .ta-feelbar { top: 14px; }
  .ta-side { top: 44px; right: 10px; width: clamp(132px, 42vw, 168px); }
  .ta-hint { bottom: 84px; font-size: 12px; }
}

/* e-stop overlay */
.ta-estop-veil {
  position: absolute; inset: 0; z-index: 15; display: none; pointer-events: none;
  border: 3px solid rgba(179,64,46,.85); border-radius: 22px;
  background: repeating-linear-gradient(45deg, transparent 0 26px, rgba(179,64,46,.05) 26px 52px);
}
.ta-app.estopped .ta-estop-veil { display: block; }
.ta-estop-veil .tag {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  padding: 6px 18px; border-radius: 15px; background: #b3402e; color: #fff;
  font: 700 12px 'Space Mono', monospace; letter-spacing: .22em;
}

/* loading shimmer over stages until the rig is in */
.ta-loading {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 4;
  background: #0d0c0b; transition: opacity .5s; font: 400 12px 'Space Mono', monospace;
  letter-spacing: .16em; color: #6d6660;
}
.ta-stage.loaded .ta-loading { opacity: 0; pointer-events: none; }

/* ════ PILOT: Start Teleop + always-on Drive/Arms toggle (stacked, top) ════
   Start sits at the very top; the Drive/Arms (base ↔ wrist) toggle floats just
   beneath it and is ALWAYS visible. Only the joysticks wait for Start. Both use
   the same liquid glass as the nav bar. */
.ta-startteleop {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 9;
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 22px;
  border-radius: 21px; cursor: pointer;
  background: linear-gradient(180deg, rgba(240,182,139,.94), rgba(233,166,121,.88));
  color: #1a1208; border: 1px solid rgba(255,255,255,.42);
  backdrop-filter: blur(16px) saturate(1.7); -webkit-backdrop-filter: blur(16px) saturate(1.7);
  font: 600 14px 'Archivo', sans-serif; letter-spacing: .01em;
  box-shadow: 0 14px 32px -12px rgba(233,166,121,.7), inset 0 1px 0 rgba(255,255,255,.55);
  transition: transform .14s, box-shadow .2s, background .2s, filter .2s;
}
.ta-startteleop svg { width: 19px; height: 19px; }
.ta-startteleop:hover { transform: translateX(-50%) translateY(-1px); filter: brightness(1.05); }
.ta-startteleop:active { transform: translateX(-50%); }
/* flying → a compact red Stop chip in the SAME top spot (stays above the toggle) */
.ta-view[data-view="teleop"].flying .ta-startteleop {
  height: 32px; padding: 0 15px; gap: 7px; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
  background: rgba(179,64,46,.88); color: #fff; border-color: rgba(255,255,255,.3);
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.2);
}
.ta-view[data-view="teleop"].flying .ta-startteleop svg { width: 16px; height: 16px; }
/* Drive/Arms toggle — pulled out of the title row, floated just below Start */
.ta-view[data-view="teleop"] .ta-top .ta-seg[data-ck] {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%); z-index: 8; margin: 0;
}
/* gate: only the joysticks / arm clusters wait for Start Teleop */
.ta-view[data-view="teleop"] .ta-joy,
.ta-view[data-view="teleop"] .ta-cluster { transition: opacity .22s; }
.ta-view[data-view="teleop"]:not(.flying) .ta-joy,
.ta-view[data-view="teleop"]:not(.flying) .ta-cluster { opacity: 0; pointer-events: none; }

/* ════ MANIPULATION: context hint + bottom control bar ════════════════ */
.ta-manip-hint {
  position: absolute; left: 50%; top: 92px; transform: translateX(-50%); z-index: 6;
  max-width: min(90%, 460px); text-align: center;
  padding: 7px 16px; border-radius: 16px;
  font: 400 12.5px 'Archivo', sans-serif; color: #c8c1b9;
  background: rgba(20,18,16,.6); border: 1px solid rgba(255,255,255,.09);
  backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5);
}
.ta-manip-bar {
  /* sits as a second glass bar stacked just above the floating dock */
  position: absolute; left: 50%; bottom: 138px; transform: translateX(-50%); z-index: 7;
  width: min(620px, 92vw); padding: 12px 14px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(40,36,32,.5), rgba(18,16,14,.62));
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7);
  box-shadow: 0 18px 44px -18px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.1);
}
.ta-manip-toggles { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.ta-segwrap { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.ta-seglabel { font: 500 8.5px 'Space Mono', monospace; letter-spacing: .14em; color: #6d6660; }
.ta-stiffrow {
  display: flex; align-items: center; gap: 10px;
  margin-top: 11px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.07);
}
.ta-stiffrow .k { font: 500 9px 'Space Mono', monospace; letter-spacing: .12em; color: #6d6660; flex: none; }
.ta-stiffrow .ta-slider { flex: 1; }
.ta-stiffrow .v { font: 500 11px 'Space Mono', monospace; color: #e9a679; flex: none; min-width: 74px; text-align: right; }
.ta-manip-bar .ta-joints { margin-top: 11px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.07); }
.ta-manip-bar .ta-jtabs { justify-content: center; margin: 0 0 8px; }
.ta-manip-bar .ta-jlist { max-height: 150px; }
.ta-soft-note {
  display: flex; align-items: flex-start; gap: 9px;
  font: 400 12.5px 'Archivo', sans-serif; color: #c8c1b9; line-height: 1.45;
}
.ta-soft-note b { color: #66f7c2; font-weight: 600; }
.ta-soft-note .dot { width: 8px; height: 8px; margin-top: 5px; flex: none; border-radius: 50%; background: #66f7c2; box-shadow: 0 0 8px #66f7c2aa; }

/* ════ MANIPULATE: compact right-side control panel ═══════════════════
   All toggles visible at a glance; liquid glass like the nav bar. */
.ta-manip-side {
  top: 46px; right: 12px; width: clamp(192px, 24vw, 232px);
  max-height: calc(100% - 150px); gap: 7px;
}
.ta-manip-side .ta-panel.pc { padding: 8px 10px; }
.ta-manip-side .ta-panel.pc > .ta-seglabel { display: block; margin-bottom: 6px; }
.ta-seglabel { font: 600 8.5px 'Space Mono', monospace; letter-spacing: .14em; color: #6d6660; text-transform: uppercase; }
/* full-width segmented control */
.ta-seg.full { display: flex; width: 100%; }
.ta-seg.full button { flex: 1; padding: 0 6px; }
/* hand grips — two compact sliders side by side */
.ta-grip2 { display: flex; gap: 10px; margin-top: 8px; }
.ta-grip2 label { flex: 1; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.ta-grip2 .k { font: 500 8.5px 'Space Mono', monospace; letter-spacing: .1em; color: #6d6660; }
.ta-grip2 input { width: 100%; accent-color: #e9a679; height: 16px; }
/* joint sliders — LEFT | RIGHT two-column split for arms & hands */
.ta-jlist.two-col { display: flex; gap: 10px; max-height: 32vh; }
.ta-jcol { flex: 1; min-width: 0; }
.ta-jcol-hd { font: 600 8px 'Space Mono', monospace; letter-spacing: .16em; color: #6d6660; margin: 2px 0 6px; }

/* ════ Viewport buttons (re-center / fit / follow) — liquid glass ════ */
.ta-viewbtns {
  position: absolute; left: 50%; bottom: calc(var(--ta-dock-h, 112px) + 86px);
  transform: translateX(-50%); z-index: 6;
  display: flex; gap: 6px;
}
.ta-vbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px;
  border-radius: 16px; cursor: pointer; white-space: nowrap;
  background: rgba(20,18,16,.58); border: 1px solid rgba(255,255,255,.14); color: #c8c1b9;
  backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5);
  font: 500 11.5px 'Archivo', sans-serif;
}
.ta-vbtn svg { width: 15px; height: 15px; }
.ta-vbtn:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.ta-vbtn.on { background: #efeae3; color: #151820; border-color: transparent; }

/* Navigate Go / Clear (icons) */
.ta-btn { display: inline-flex; align-items: center; gap: 7px; }
.ta-btn svg { width: 16px; height: 16px; }
.ta-btn.ghost {
  background: rgba(255,255,255,.07); color: #c8c1b9; width: 34px; padding: 0; justify-content: center;
}
.ta-btn.ghost:hover { background: rgba(255,255,255,.14); color: #fff; }
@media (max-width: 700px) {
  .ta-manip-side { top: 44px; right: 8px; width: clamp(150px, 46vw, 200px); }
  .ta-viewbtns { bottom: 140px; }
  .ta-vbtn { height: 30px; padding: 0 10px; font-size: 11px; }
}

/* ════ HOST PICKER: robots accordion + connection methods ═════════════ */
.ta-hostmenu { width: min(308px, 90vw); }
.hm-card { border-radius: 13px; overflow: hidden; }
.hm-card.open { background: rgba(255,255,255,.04); margin: 2px 0; }
.hm-robot {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px; border: none; border-radius: 12px; cursor: pointer;
  background: transparent; color: #efeae3; text-align: left; font-family: 'Archivo', sans-serif;
}
.hm-robot:hover { background: rgba(255,255,255,.06); }
.hm-robot.on .hm-dot { background: #3FB56B; box-shadow: 0 0 7px #3FB56B88; }
.hm-badge {
  font: 600 8.5px 'Space Mono', monospace; letter-spacing: .1em; padding: 3px 7px; border-radius: 7px;
  background: rgba(255,255,255,.08); color: #8a837c; flex: none;
}
.hm-badge.sim  { background: rgba(63,181,107,.16); color: #5fd08a; }
.hm-badge.real { background: rgba(179,64,46,.2); color: #ff8a73; }
.hm-chev { color: #6d6660; font-size: 12px; flex: none; width: 16px; text-align: center; }
.hm-routes { padding: 0 6px 6px; display: flex; flex-direction: column; gap: 1px; }
.hm-route {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: none; border-radius: 10px; cursor: pointer;
  background: transparent; color: #d8d2ca; text-align: left; font-family: 'Archivo', sans-serif;
}
.hm-route:hover { background: rgba(255,255,255,.07); }
.hm-route.on { background: rgba(63,181,107,.14); color: #efeae3; }
.hm-mic { width: 20px; height: 20px; flex: none; color: #8a837c; display: grid; place-items: center; }
.hm-mic svg { width: 18px; height: 18px; }
.hm-route.on .hm-mic { color: #3FB56B; }
.hm-tick { color: #3FB56B; font-size: 12px; flex: none; }
.hm-routes .hm-label { font-size: 12.5px; }
.hm-pass { display: flex; align-items: center; gap: 6px; padding: 2px 8px 10px; flex-wrap: wrap; }
.hm-passin {
  flex: 1; min-width: 0; height: 32px; border-radius: 9px; padding: 0 11px;
  background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.12); color: #efeae3;
  font: 500 13px 'Space Mono', monospace; letter-spacing: .2em; outline: none;
}
.hm-passin:focus { border-color: rgba(233,166,121,.55); }
.hm-passbtn {
  height: 32px; padding: 0 14px; flex: none; border-radius: 9px; border: none; cursor: pointer;
  background: #e9a679; color: #151820; font: 600 12px 'Archivo', sans-serif;
}
.hm-passerr { width: 100%; font: 500 10.5px 'Space Mono', monospace; color: #ff8a73; padding-left: 2px; }
/* simplified iOS-clean list: live/connecting dot states + the Real key button */
.hm-dot.on { background: #3FB56B; box-shadow: 0 0 7px #3FB56B88; }
.hm-dot.wait { background: #e9a679; animation: ta-blink 1.1s infinite; }
.hm-key {
  flex: none; width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  font-size: 13px; color: #c8c1b9; cursor: pointer; transition: background .15s, color .15s;
}
.hm-key:hover { background: rgba(255,255,255,.16); color: #fff; }
.hm-key.on { background: rgba(63,181,107,.18); color: #5fd08a; border-color: rgba(63,181,107,.4); }
/* worded access-code / forget pill on a robot row */
.hm-codebtn {
  flex: none; padding: 4px 10px; border-radius: 9px; cursor: pointer; white-space: nowrap;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #c8c1b9;
  font: 600 9.5px 'Archivo', sans-serif; letter-spacing: .02em; transition: background .15s, color .15s;
}
.hm-codebtn:hover { background: rgba(255,255,255,.18); color: #fff; }
.hm-codebtn.on { background: rgba(63,181,107,.18); color: #5fd08a; border-color: rgba(63,181,107,.4); }
/* add-host row + plus glyph */
.hm-addrow .hm-plus {
  width: 7px; height: 7px; flex: none; display: grid; place-items: center;
  color: #8a837c; font-size: 15px; line-height: 1;
}
.hm-addrow .hm-label { color: #c8c1b9; }

@media (max-width: 700px) {
  .ta-manip-bar { width: 94vw; padding: 10px 11px; bottom: 128px; }
  .ta-manip-toggles { gap: 10px; }
  .ta-manip-hint { top: 84px; font-size: 11.5px; }
  .ta-startteleop { top: 11px; }
}
