:root {
  color-scheme: light;
  --paper: #f5f2eb;
  --surface: #fffdf8;
  --ink: #252d2c;
  --muted: #66716d;
  --line: #dcded4;
  --accent: #b84222;
  --accent-fill: #fbe5d8;
  --blue: #315c6b;
  --map: #c7cbb5;
  --shadow: 0 8px 30px #25312b18;
  --radius: 8px;
  font:
    15px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}
body.night {
  color-scheme: dark;
  --paper: #172429;
  --surface: #203238;
  --ink: #e9eee7;
  --muted: #a7bbb8;
  --line: #3b5055;
  --accent: #ffac7f;
  --accent-fill: #493a33;
  --blue: #a2d5db;
  --map: #1a2f39;
  --shadow: 0 8px 30px #0004;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  min-height: 44px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 15px;
  border-radius: 5px;
  font-weight: 600;
}
button:hover {
  border-color: var(--muted);
  background: var(--paper);
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
button.primary,
a.primary {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}
body.night button.primary,
body.night a.primary {
  color: #20282b;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
a.primary {
  display: inline-flex;
  min-height: 46px;
  padding: 11px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 650;
}
input,
textarea,
select {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 44px;
  padding: 10px;
  width: 100%;
}
input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  accent-color: var(--accent);
}
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
label input,
label select,
label textarea {
  margin-top: 5px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.04;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.025em;
}
h3 {
  font-size: 16px;
}
p {
  margin: 12px 0;
}
small,
.hint {
  color: var(--muted);
  font-size: 13px;
}
.mono,
.eyebrow {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
::selection {
  background: var(--accent-fill);
}
.skip {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  background: var(--surface);
  padding: 12px;
}
.skip:focus {
  top: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.brand-mark {
  width: 30px;
  height: 30px;
  background: var(--accent);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 4px;
  transform: rotate(-6deg);
}
.brand-mark i {
  background: var(--paper);
}
.brand-mark i:nth-child(2),
.brand-mark i:nth-child(6) {
  visibility: hidden;
}
.brand span.subtitle {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  display: block;
}
.brand-title {
  line-height: 1.25;
}
.pill {
  font:
    11px ui-monospace,
    monospace;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  white-space: nowrap;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #587b60;
  border-radius: 50%;
  margin-right: 6px;
}
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
  background: var(--paper);
}
.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}
.topbar-right button {
  font-size: 13px;
}
.workspace-name {
  border-left: 1px solid var(--line);
  padding-left: 22px;
  margin-left: 8px;
  color: var(--muted);
  font-size: 14px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(280px, 28vw, 420px) minmax(0, 1fr);
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 3;
}
.sidebar-heading {
  padding: 26px 22px 18px;
}
.sidebar-heading h2 {
  font-size: 23px;
  margin: 5px 0 12px;
}
.summary {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.summary b {
  color: var(--ink);
  font-weight: 650;
}
.search {
  margin: 0 18px 12px;
  width: calc(100% - 36px);
  font-size: 13px;
  background: var(--paper);
}
.roster {
  overflow-anchor: none;
  overflow: auto;
  flex: 1;
  padding: 0 10px 12px;
}
.roster-group + .roster-group {
  margin-top: 12px;
}
.roster-group-heading {
  margin: 0;
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.roster-group-count {
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}
.roster-group-disclosure {
  padding: 0;
}
.roster-group-toggle {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: left;
}
.roster-group-toggle::before {
  content: "▸";
  display: inline-block;
  width: 14px;
}
.roster-group-toggle[aria-expanded="true"]::before {
  content: "▾";
}
.roster-group-toggle:hover {
  background: var(--paper);
}
.agent-row {
  width: 100%;
  border: 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px;
  min-height: 70px;
  background: transparent;
  font-weight: 400;
}
.agent-row:hover {
  background: var(--paper);
}
.agent-row[aria-pressed="true"] {
  background: var(--accent-fill);
}
.portrait {
  width: 33px;
  height: 36px;
  flex: none;
  position: relative;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--hue) 16%, var(--surface));
  border-bottom: 3px solid var(--hue);
  font:
    600 14px ui-monospace,
    monospace;
  color: var(--ink);
}
.portrait:before {
  content: "";
  height: 6px;
  width: 6px;
  background: var(--hue);
  position: absolute;
  right: -2px;
  bottom: 0;
}
.agent-copy {
  min-width: 0;
  flex: 1;
}
.agent-name {
  font-size: 14px;
  font-weight: 650;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.agent-activity {
  font-size: 12px;
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  margin-top: 3px;
}
.agent-state {
  font:
    10px ui-monospace,
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.sidebar-bottom {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.sidebar-bottom b {
  font-weight: 500;
  color: var(--ink);
}
.stage {
  position: relative;
  overflow: hidden;
  background: var(--map);
  min-height: 0;
  isolation: isolate;
  container-type: size;
}
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  outline-offset: -4px;
}
.stage canvas:active {
  cursor: grabbing;
}
.stage-top {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 2;
}
.city-title {
  padding: 12px 15px;
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.city-title h1 {
  font-size: 20px;
  letter-spacing: -0.03em;
}
.city-title p {
  margin: 4px 0 0;
  font:
    11px ui-monospace,
    monospace;
  color: var(--muted);
}
.compass {
  font:
    12px ui-monospace,
    monospace;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.north-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 16px solid var(--accent);
}
.map-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.map-agent {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  border-left: 3px solid var(--hue);
  border-radius: 1px;
  min-height: 0;
  padding: 4px 8px;
  font:
    600 11px/1.3 ui-monospace,
    monospace;
  max-width: 175px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  box-shadow: 0 2px 8px #0002;
  transform: translate(-50%, -100%);
}
.map-agent span {
  display: block;
  color: var(--muted);
  font:
    10px/1.3 ui-monospace,
    monospace;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-agent.selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  z-index: 2;
}
.map-agent .speech {
  color: var(--ink);
  font-family: inherit;
  max-width: 170px;
}
.map-bottom {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}
.camera-controls {
  pointer-events: auto;
  width: 258px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  flex: none;
}
.camera-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.camera-buttons button {
  padding: 6px 10px;
  min-height: 38px;
  font-size: 12px;
  flex: 1;
}
.camera-overview {
  width: 100%;
  margin-bottom: 10px;
}
.angle-heading {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  align-items: center;
}
.angle-heading output {
  font:
    12px ui-monospace,
    monospace;
}
.angle-endpoints {
  display: flex;
  justify-content: space-between;
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
}
.camera-controls input {
  min-height: 28px;
  margin: 0;
}
.pager {
  flex: 1 1 300px;
  min-width: 0;
  max-width: 720px;
  max-height: 25cqh;
  overflow: auto;
  pointer-events: auto;
}
.pager-heading {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin: 0 0 8px;
  text-shadow: 0 1px 3px var(--paper);
}
.pager-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pager-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  text-align: left;
  font:
    11px/1.4 ui-monospace,
    monospace;
  min-height: 0;
  font-weight: 400;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
}
.pager-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.9em;
  white-space: nowrap;
}
.pager-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.map-instructions {
  position: absolute;
  bottom: 6px;
  margin: 0;
  left: 24px;
  font:
    9px ui-monospace,
    monospace;
  color: var(--ink);
  opacity: 0.8;
}
.detail {
  position: absolute;
  right: 24px;
  top: 108px;
  width: 300px;
  max-height: calc(100% - 325px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px;
  z-index: 4;
}
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.detail h2 {
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.detail .activity {
  font-size: 14px;
  color: var(--muted);
  margin: 12px 0 20px;
}
.detail-actions {
  display: flex;
  gap: 8px;
}
.detail-actions button {
  flex: 1;
  font-size: 12px;
}
.close {
  min-height: 32px;
  width: 32px;
  padding: 2px;
  font-size: 20px;
  background: transparent;
  border: 0;
}
.detail dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.detail dt {
  color: var(--muted);
}
.detail dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.detail .danger {
  color: var(--accent);
}
.connection-error {
  position: absolute;
  top: 95px;
  left: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--accent);
  padding: 14px;
  z-index: 5;
  box-shadow: var(--shadow);
}
.connection-error button {
  margin-left: 12px;
}
.footer {
  height: 34px;
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
  border-top: 1px solid var(--line);
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
  background: var(--paper);
  gap: 12px;
}
.footer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.footer b {
  font-weight: 500;
  color: var(--ink);
}
dialog {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: min(520px, calc(100% - 32px));
  max-height: 85dvh;
  padding: 26px;
  box-shadow: 0 30px 100px #0005;
}
dialog::backdrop {
  background: #11272c80;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
dialog p {
  color: var(--muted);
}
dialog label {
  margin: 15px 0;
}
dialog .row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 44px;
}
.check input {
  margin: 0;
}
.chat-log {
  height: 270px;
  overflow: auto;
  border: 1px solid var(--line);
  padding: 12px;
  background: var(--paper);
  margin: 12px 0;
}
.chat-message {
  font-size: 13px;
  padding-bottom: 14px;
  overflow-wrap: anywhere;
}
.chat-message strong {
  font-size: 11px;
  color: var(--accent);
}
.chat-message p {
  margin: 2px 0;
  color: var(--ink);
  white-space: pre-wrap;
}
.chat-compose {
  display: flex;
  gap: 8px;
}
.chat-compose input {
  flex: 1;
  min-width: 0;
}
.notice {
  font-size: 12px;
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  background: var(--paper);
}
.error {
  color: var(--accent);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.code {
  display: block;
  background: var(--paper);
  padding: 14px;
  font:
    12px/1.6 ui-monospace,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.copy-field {
  min-width: 0;
  margin: 12px 0;
}
.copy-field label {
  margin: 0 0 5px;
}
.copy-surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}
.copy-surface > :first-child {
  min-width: 0;
  margin: 0;
  border: 0;
  background: transparent;
}
.copy-surface > p {
  padding: 14px;
}
.copy-surface > input {
  align-self: center;
}
.copy-surface > .copy-button {
  margin: 4px;
  padding: 8px 10px;
}
.copy-status {
  display: block;
  margin-top: 6px;
}
.copy-status:empty {
  margin: 0;
}
.invite {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.invite .row {
  justify-content: space-between;
}
.invite input {
  font: 11px monospace;
}
.landing {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 36px;
}
.landing-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  padding: 26px 0;
  align-items: center;
}
.landing-nav .brand {
  flex-shrink: 0;
}
.landing-nav button {
  white-space: nowrap;
}
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  min-height: 580px;
  padding: 60px 0;
}
.landing h1 {
  font-size: clamp(36px, 4.3vw, 56px);
  margin: 20px 0;
  text-wrap: balance;
}
.landing h1 span {
  display: block;
}
.landing-hero .lead {
  color: var(--muted);
  font-size: 19px;
  max-width: 430px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0;
}
.hero-actions > * {
  white-space: nowrap;
  justify-content: center;
}
.hero-art {
  height: 400px;
  position: relative;
  background: var(--map);
  border: 1px solid var(--line);
  overflow: hidden;
}
.hero-art canvas {
  width: 100%;
  height: 100%;
}
.hero-agent-labels .map-agent {
  pointer-events: none;
}
.hero-caption {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  width: fit-content;
  max-width: calc(100% - 36px);
  background: var(--paper);
  padding: 8px 12px;
  font: 11px monospace;
}
.landing-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  padding: 32px 0;
}
.landing-strip p {
  color: var(--muted);
  font-size: 14px;
}
.landing-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
  padding: 50px 0;
  color: var(--muted);
  font-size: 12px;
}
.consent {
  max-width: 560px;
  padding: 48px 28px;
  margin: 0 auto;
}
.consent .brand {
  display: block;
}
.consent .brand span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.consent .eyebrow {
  margin-top: 50px;
}
.consent h1 {
  font-size: 44px;
  margin: 15px 0 25px;
}
.consent label {
  margin-top: 22px;
}
.consent button {
  width: 100%;
  margin: 16px 0;
}
.hidden,
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  .sidebar-heading {
    padding-left: 28px;
  }
  .roster {
    padding: 0 16px;
  }
}
@media (max-width: 900px) {
  .topbar {
    padding: 10px 18px;
  }
  .workspace-name {
    display: none;
  }
  .map-bottom {
    gap: 10px;
    left: 16px;
    right: 16px;
  }
  .camera-controls {
    width: 220px;
  }
  .detail {
    right: 16px;
    width: 270px;
  }
  .landing-hero {
    gap: 26px;
  }
  .topbar-right {
    gap: 6px;
  }
  .topbar-right button {
    padding: 8px 10px;
  }
  .sidebar-heading {
    padding: 20px 18px;
  }
  .agent-row {
    padding: 10px 8px;
  }
}
@media (max-width: 900px) {
  .landing-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 40px 0;
  }
  .landing-hero .lead {
    max-width: 560px;
  }
  .landing-strip {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .landing-strip article {
    max-width: 560px;
  }
}
@media (max-width: 650px) {
  .topbar {
    height: 70px;
    padding: 10px 12px;
  }
  .brand {
    gap: 8px;
    font-size: 15px;
  }
  .brand span.subtitle {
    font-size: 9px;
  }
  .brand-mark {
    width: 25px;
    height: 25px;
  }
  .topbar-right .pill {
    display: none;
  }
  .topbar-right button {
    min-height: 40px;
    font-size: 11px;
    padding: 7px 10px;
  }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 35%);
  }
  .stage {
    grid-row: 1;
  }
  .sidebar {
    grid-row: 2;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .sidebar-heading {
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .sidebar-heading h2 {
    font-size: 15px;
    margin: 0;
  }
  .sidebar-heading .eyebrow,
  .search,
  .sidebar-bottom {
    display: none;
  }
  .roster {
    display: block;
    padding: 0 8px 8px;
    overflow: auto;
    gap: 6px;
    flex: 1;
  }
  .agent-row {
    width: 100%;
    flex: none;
    align-self: flex-start;
    border: 1px solid var(--line);
    min-height: 70px;
    padding: 10px 8px;
  }
  .agent-name {
    display: block;
    font-size: 12px;
  }
  .agent-state {
    display: block;
    font-size: 9px;
  }
  .agent-activity {
    font-size: 10px;
  }
  .portrait {
    width: 25px;
    height: 30px;
    font-size: 12px;
  }
  .stage-top {
    top: 12px;
    left: 12px;
    right: 12px;
  }
  .city-title {
    padding: 8px 10px;
  }
  .city-title h1 {
    font-size: 16px;
  }
  .city-title p {
    font-size: 9px;
  }
  .compass {
    font-size: 10px;
    padding: 8px;
  }
  .map-bottom {
    bottom: 18px;
    left: 12px;
    right: 12px;
    gap: 8px;
  }
  .camera-controls {
    width: 190px;
    padding: 8px 10px;
  }
  .pager-heading {
    font-size: 8px;
  }
  .pager-line {
    font-size: 9px;
    padding: 5px 7px;
  }
  .camera-buttons button {
    font-size: 10px;
    min-height: 32px;
    padding: 4px 7px;
  }
  .camera-buttons {
    gap: 4px;
    margin-bottom: 5px;
  }
  .angle-heading {
    font-size: 11px;
  }
  .angle-endpoints {
    font-size: 8px;
  }
  .map-instructions {
    display: none;
  }
  .footer {
    height: 26px;
    padding: 0 12px;
    font-size: 8px;
  }
  .footer .desktop {
    display: none;
  }
  .detail {
    top: 80px;
    right: 12px;
    width: 250px;
    max-height: calc(100% - 240px);
    padding: 14px;
  }
  .detail h2 {
    font-size: 18px;
  }
  .detail .activity {
    margin: 8px 0;
  }
  .detail dl {
    display: none;
  }
  .detail .detail-actions button {
    min-height: 36px;
  }
  .landing {
    padding: 0 22px;
  }
  .landing-nav {
    padding: 18px 0;
  }
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 35px 0;
  }
  .landing-hero .lead {
    font-size: 17px;
  }
  .hero-art {
    height: 320px;
  }
  .landing-strip {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .landing h1 {
    font-size: clamp(36px, 8vw, 48px);
  }
  .landing-bottom {
    gap: 20px;
  }
  .connection-error {
    top: 75px;
    left: 12px;
    right: 12px;
    font-size: 12px;
  }
  dialog {
    padding: 20px;
  }
  .map-agent {
    font-size: 10px;
    max-width: 130px;
  }
  .map-agent span {
    font-size: 9px;
    max-width: 120px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
/* Roster and workspace containers must shrink within narrow viewports. */
.workspace,
.stage,
.sidebar,
.roster {
  min-width: 0;
}

@media (prefers-color-scheme: dark) {
  body:not(.day):not(.night) {
    color-scheme: dark;
    --paper: #172429;
    --surface: #203238;
    --ink: #e9eee7;
    --muted: #a7bbb8;
    --line: #3b5055;
    --accent: #ffac7f;
    --accent-fill: #493a33;
    --blue: #a2d5db;
    --map: #1a2f39;
    --shadow: 0 8px 30px #0004;
  }
}

.workspace.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.stage-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  pointer-events: auto;
}
.stage-top {
  gap: 12px;
}
.city-title {
  min-width: 0;
  overflow-wrap: anywhere;
}
.agent-name {
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.agent-name > span:first-child {
  min-width: 0;
  flex: 1 1 100px;
}
.agent-state {
  flex: none;
  white-space: nowrap;
}
.agent-row {
  align-items: flex-start;
}
.sidebar-heading,
.search,
.sidebar-bottom {
  flex-shrink: 0;
}
.detail .activity {
  overflow-wrap: anywhere;
}
@container (max-width: 560px) {
  .map-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .pager {
    flex: none;
    width: 100%;
  }
  .camera-controls {
    align-self: flex-end;
  }
  .compass {
    display: none;
  }
}
@media (max-height: 500px) and (min-width: 651px) {
  .sidebar-heading {
    padding: 8px 18px;
  }
  .sidebar-heading .eyebrow,
  .sidebar-bottom {
    display: none;
  }
  .sidebar-heading h2 {
    margin: 0;
    font-size: 18px;
  }
  .stage-top {
    top: 8px;
  }
  .city-title {
    padding: 6px 10px;
  }
  .map-bottom {
    bottom: 12px;
  }
  .map-instructions {
    display: none;
  }
  .camera-controls {
    padding: 6px 10px;
  }
  .camera-buttons {
    margin-bottom: 0;
  }
  .camera-buttons button {
    min-height: 30px;
  }
  .angle-endpoints {
    display: none;
  }
  .pager-heading {
    margin-bottom: 3px;
  }
}

@media (max-width: 650px) {
  .search {
    display: block;
    margin: 0 12px 6px;
    width: calc(100% - 24px);
    min-height: 32px;
    padding: 5px 8px;
  }
  .agent-name {
    display: flex;
    font-size: 13px;
  }
  .agent-activity {
    font-size: 12px;
  }
}

.camera-buttons #reset {
  flex: 2;
  white-space: nowrap;
}
@media (max-height: 500px) and (min-width: 651px) {
  .stage-tools .compass,
  .city-title p {
    display: none;
  }
}

/* The workspace uses the same phone breakpoint as viewer's mobileQuery. */
.mobile-dock {
  display: none;
}
.mobile-sheet {
  padding: 0;
}
@media (max-width: 650px),
  (max-width: 950px) and (max-height: 500px) and (pointer: coarse) {
  .shell.mobile {
    padding-top: env(safe-area-inset-top);
    height: 100dvh;
  }
  .mobile .topbar {
    height: 48px;
    min-height: 48px;
    padding: 4px max(12px, env(safe-area-inset-right)) 4px
      max(12px, env(safe-area-inset-left));
    gap: 8px;
  }
  .mobile .header-left {
    min-width: 0;
    gap: 8px;
    flex: 1;
  }
  .mobile .brand {
    gap: 6px;
    font-size: 12px;
    flex: none;
  }
  .mobile .brand-mark {
    width: 22px;
    height: 22px;
  }
  .mobile .brand .subtitle {
    display: none;
  }
  .mobile .workspace-name {
    display: block;
    min-width: 0;
    margin: 0;
    padding-left: 8px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile .topbar-right {
    flex: none;
  }
  .mobile .topbar-right .pill {
    display: block;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 9px;
    padding: 5px;
  }
  .mobile .workspace {
    display: block;
    position: relative;
  }
  .mobile .stage {
    width: 100%;
    height: 100%;
  }
  .mobile .stage-top,
  .mobile .map-bottom,
  .mobile .map-instructions {
    display: none;
  }
  .mobile .connection-error {
    top: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    font-size: 12px;
    max-height: 35%;
    overflow: auto;
    padding: 8px;
  }
  .mobile .mobile-dock {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    flex: none;
    height: calc(56px + env(safe-area-inset-bottom));
    padding: 6px max(8px, env(safe-area-inset-right))
      calc(6px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .mobile-dock button {
    min-height: 44px;
    padding: 6px;
    font-size: 13px;
  }
  .mobile-sheet {
    position: fixed;
    inset: auto 0 var(--keyboard-bottom, 0px);
    margin: 0 auto;
    width: 100%;
    max-width: 650px;
    max-height: min(60dvh, var(--visual-height, 60dvh));
    border: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    background: var(--surface);
    color: var(--ink);
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-sheet[open] {
    display: flex;
    flex-direction: column;
  }
  .sheet-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    flex: none;
    border-bottom: 1px solid var(--line);
  }
  .sheet-head h2 {
    flex: 1;
    font-size: 17px;
    margin: 0;
  }
  .sheet-head button {
    min-height: 44px;
  }
  .sheet-body {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 12px;
  }
  .sheet-body:has(> .sidebar) {
    display: flex;
    padding: 0;
    overflow: hidden;
  }
  .mobile-sheet .sidebar {
    flex: 1;
    border: 0;
    min-width: 0;
  }
  .mobile-sheet .sidebar-heading {
    display: flex;
    padding: 8px 12px;
    justify-content: space-between;
    gap: 12px;
  }
  .mobile-sheet .sidebar-heading h2 {
    font-size: 16px;
    margin: 0;
  }
  .mobile-sheet .sidebar-heading .eyebrow,
  .mobile-sheet .sidebar-bottom {
    display: none;
  }
  .mobile-sheet .search {
    display: block;
    min-height: 44px;
    margin: 0 12px 8px;
    width: calc(100% - 24px);
  }
  .mobile-sheet .roster {
    overflow: auto;
    overscroll-behavior: contain;
    min-height: 0;
  }
  .mobile-sheet .detail {
    position: static;
    width: 100%;
    max-height: none;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
  .mobile-sheet .detail dl {
    display: grid;
  }
  .mobile-sheet .detail-actions button,
  .mobile-sheet .camera-buttons button {
    min-height: 44px;
    font-size: 13px;
  }
  .mobile-sheet .camera-controls,
  .mobile-sheet .pager {
    width: 100%;
    max-height: none;
  }
  .mobile-sheet .pager-heading {
    font-size: 11px;
  }
  .mobile-sheet .pager-line {
    font-size: 13px;
    min-height: 44px;
  }
  .mobile-sheet .check {
    margin-top: 12px;
    min-height: 44px;
  }
  .mobile-sheet .mobile-more {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    overflow-wrap: anywhere;
  }
  .mobile-more h3,
  .mobile-more p {
    width: 100%;
    margin: 0;
  }
  .mobile-sheet .footer {
    display: flex;
    flex-wrap: wrap;
    height: auto;
    width: 100%;
    gap: 12px;
    padding: 12px 0;
  }
  .mobile-sheet .footer .desktop {
    display: none;
  }
  body:has(.shell.mobile) > dialog:not(.mobile-sheet) {
    max-height: min(calc(100dvh - 24px), var(--visual-height, 100dvh));
    bottom: var(--keyboard-bottom, 0px);
  }
}
