:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #edf4f7;
  --muted: #91a4af;
  --surface: rgba(11, 17, 24, 0.9);
  --surface-strong: rgba(8, 13, 19, 0.97);
  --line: rgba(193, 220, 229, 0.14);
  --line-strong: rgba(193, 220, 229, 0.28);
  --accent: #78d7c4;
  --accent-ink: #071713;
  --danger: #ff8c80;
  --drawer-width: min(390px, calc(100vw - 42px));
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0b1118;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.laboratory,
.viewport,
.viewport canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.crosshair {
  position: fixed;
  z-index: 3;
  top: 50%;
  left: 50%;
  color: rgba(237, 244, 247, 0.92);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.crosshair--third-person {
  color: rgba(245, 250, 252, 0.96);
  font-size: 16px;
  font-weight: 600;
  will-change: left, top;
}

.crosshair[hidden] {
  display: none;
}

.viewport {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(48, 72, 82, 0.26), transparent 46%),
    #0b1118;
}

.viewport canvas {
  display: block;
  outline: 0;
}

.brand {
  position: fixed;
  z-index: 4;
  top: 12px;
  left: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  cursor: help;
  pointer-events: auto;
}

.brand__mark {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.brand__text {
  color: inherit;
}

.scene-summary {
  position: fixed;
  z-index: 4;
  top: 16px;
  right: 16px;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(237, 244, 247, 0.82);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.metrics-hud {
  position: fixed;
  z-index: 4;
  top: 16px;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(7, max-content);
  gap: 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  transform: translateX(-50%);
  pointer-events: none;
}

.metrics-hud__metric {
  --metric-label-width: 3.5ch;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 5px;
  color: rgba(237, 244, 247, 0.74);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metrics-hud__label {
  flex: 0 0 var(--metric-label-width);
  inline-size: var(--metric-label-width);
  text-align: left;
  white-space: nowrap;
}

.metrics-hud b {
  display: inline-block;
  flex: 0 0 var(--metric-value-width);
  inline-size: var(--metric-value-width);
  min-inline-size: var(--metric-value-width);
  max-inline-size: var(--metric-value-width);
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-align: right;
  white-space: nowrap;
}

#metric-fps {
  --metric-value-width: 3ch;
}

#metric-frame {
  --metric-value-width: 6ch;
}

#metric-calls {
  --metric-value-width: 4ch;
}

#metric-triangles {
  --metric-value-width: 7ch;
}

#metric-robots,
#metric-projectiles {
  --metric-value-width: 3ch;
}

#metric-heap {
  --metric-value-width: 6ch;
}

.operator-status {
  position: fixed;
  z-index: 6;
  left: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 8px 10px;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.operator-status > span {
  display: inline-block;
  min-width: 3ch;
  text-align: right;
  white-space: pre;
}

.operator-status > span.operator-status__indicator {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.operator-status > span[hidden] {
  display: none;
}

.operator-status [hidden] {
  display: none;
}

.operator-status__icon-slot {
  display: inline-grid;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  place-items: center;
}

.operator-status__icon {
  display: block;
  fill: currentColor;
  shape-rendering: geometricPrecision;
}

.operator-status__icon[hidden] {
  display: none;
}

.operator-status__icon--health {
  width: 11px;
  height: 11px;
}

.operator-status__icon--cartridge {
  width: 6px;
  height: 13px;
}

.operator-status__icon--cartridges {
  width: 14px;
  height: 13px;
}

.operator-status__icon--grenade {
  width: 11px;
  height: 12px;
}

.operator-status__icon--hourglass {
  width: 10px;
  height: 12px;
}

.operator-status__ammo[data-reloading] {
  animation: operator-ammo-reload-blink 800ms ease-in-out infinite;
}

.help-button {
  position: fixed;
  z-index: 7;
  right: 16px;
  bottom: 16px;
  display: grid;
  place-items: end;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.help-button__indicator {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  transition:
    color 120ms ease,
    background 120ms ease,
    border-color 120ms ease,
    transform 120ms ease;
}

.help-button:hover .help-button__indicator,
.help-button:focus-visible .help-button__indicator {
  border-color: rgba(247, 241, 212, 0.98);
  background: rgba(247, 241, 212, 0.9);
  color: #101418;
  text-shadow: none;
  transform: scale(1.04);
}

.help-button:focus-visible {
  outline: 0;
}

.help-button:focus-visible .help-button__indicator {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.help-overlay {
  position: fixed;
  z-index: 12;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
}

.help-panel {
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(11, 15, 20, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
  color: #fff;
  line-height: 1.45;
  scrollbar-color: rgba(247, 241, 212, 0.62) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.help-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.help-panel__header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.help-panel__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 26px 36px;
}

.help-panel__section {
  min-width: 0;
}

.help-panel__section--robot {
  grid-row: 1 / span 2;
}

.help-panel__section--camera {
  grid-column: 2;
  grid-row: 1;
}

.help-panel__section h3 {
  margin: 0 0 10px;
  color: #f7f1d4;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.help-panel__input-group + .help-panel__input-group {
  margin-top: 16px;
}

.help-panel__input-group h4 {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.help-panel__section--editor {
  grid-column: 2;
  grid-row: 2;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.help-panel__row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: baseline;
  gap: 14px;
  padding: 5px 0;
}

.help-panel__row.help-panel__row--gesture {
  grid-template-columns: 52px 40px minmax(0, 1fr);
  gap: 10px;
}

.help-panel__gesture {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.help-panel__row kbd {
  color: #f7f1d4;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

.help-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
}

.help-panel__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.drawer {
  position: absolute;
  z-index: 8;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: var(--drawer-width);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(22px) saturate(1.15);
  transition: transform 180ms ease;
}

.drawer--left {
  left: 0;
  border-right: 1px solid var(--line);
  transform: translateX(calc(-100% - 4px));
}

.drawer--right {
  right: 0;
  border-left: 1px solid var(--line);
  transform: translateX(calc(100% + 4px));
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
}

.drawer__header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 660;
  letter-spacing: -0.02em;
}

.drawer__header h1 a {
  color: inherit;
  text-decoration: none;
}

.drawer__header h1 a:hover,
.drawer__header h1 a:focus-visible {
  color: var(--accent);
}

.button-row {
  display: flex;
  gap: 8px;
}

.icon-button,
.edge-handle {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.icon-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.icon-button:hover,
.edge-handle:hover,
.button:hover,
.settings-tabs button:hover,
.segmented button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.edge-handle {
  position: absolute;
  z-index: 7;
  top: 50%;
  width: 28px;
  height: 68px;
  border-radius: 0 11px 11px 0;
  background: rgba(8, 13, 19, 0.76);
  color: var(--muted);
  font-size: 25px;
  backdrop-filter: blur(12px);
  transform: translateY(-50%);
}

.edge-handle--left {
  left: 0;
  border-left: 0;
}

.edge-handle--right {
  right: 0;
  border-right: 0;
  border-radius: 11px 0 0 11px;
}

.edge-zone {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  width: 14px;
}

.edge-zone--left { left: 0; }
.edge-zone--right { right: 0; }

.scene-tree {
  flex: 1;
  overflow: auto;
  padding: 8px 9px 24px;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.tree-group {
  margin: 2px 0;
}

.tree-row {
  display: grid;
  grid-template-columns: 22px 22px minmax(0, 1fr) 24px auto;
  align-items: center;
  gap: 3px;
  min-height: 34px;
  padding: 3px 7px 3px calc(7px + var(--depth, 0) * 14px);
  border: 1px solid transparent;
  border-radius: 8px;
  color: #cdd9de;
}

.tree-row:hover,
.tree-row.is-selected {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.tree-row.is-selected {
  color: var(--accent);
}

.tree-row button {
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.tree-row.is-absent .tree-row__label,
.tree-row.is-absent .tree-row__count {
  opacity: 0.38;
}

.tree-row.is-absent input {
  opacity: 0.32;
}

.tree-row__toggle {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.tree-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.tree-row__edit {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: color 120ms ease, background 120ms ease, opacity 120ms ease;
}

.tree-row:hover .tree-row__edit,
.tree-row:focus-within .tree-row__edit,
.tree-row.is-selected .tree-row__edit {
  opacity: 1;
  pointer-events: auto;
}

.tree-row__edit:hover,
.tree-row__edit:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.tree-row__edit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.tree-row__edit.is-empty {
  visibility: hidden;
}

@media (hover: none) {
  .tree-row__edit:not(.is-empty) {
    opacity: 1;
    pointer-events: auto;
  }
}

.tree-row__count {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.settings-tabs button,
.segmented button {
  min-height: 34px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.settings-tabs button {
  padding: 6px 4px;
  border-radius: 7px;
  font-size: 11px;
}

.settings-tabs button[aria-selected="true"],
.segmented button[aria-pressed="true"] {
  background: rgba(120, 215, 196, 0.12);
  color: var(--accent);
}

.settings-scroll {
  flex: 1;
  overflow: auto;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.settings-page {
  --settings-value-width: 52px;
  --settings-slider-width: 128px;
  --settings-editor-gap: 8px;
  --settings-editor-width:
    calc(
      var(--settings-value-width)
      + var(--settings-editor-gap)
      + var(--settings-slider-width)
    );
  padding: 5px 17px 26px;
}

.control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--settings-editor-width);
  align-items: center;
  gap: 8px;
  margin: 15px 0;
}

.control__name {
  min-width: 0;
  overflow: hidden;
  color: #cbd7dc;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control__editor {
  display: grid;
  grid-template-columns: var(--settings-value-width) var(--settings-slider-width);
  align-items: center;
  gap: var(--settings-editor-gap);
  width: var(--settings-editor-width);
  min-width: 0;
}

.control output {
  grid-column: 1;
  min-width: 0;
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.control input[type="range"] {
  grid-column: 2;
  width: var(--settings-slider-width);
}

.control--select select {
  grid-column: 1 / -1;
  min-width: 0;
}

input[type="range"] {
  width: 100%;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}

select,
input[type="text"] {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
}

select {
  color-scheme: dark;
}

select option {
  background: #101820;
  color: #edf4f7;
}

select option:checked {
  background: #78d7c4;
  color: #071713;
}

select:focus,
input[type="text"]:focus,
input[type="color"]:focus {
  border-color: rgba(120, 215, 196, 0.62);
}

.profile-form,
.profile-fields {
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-page[data-page="profile"] .profile-fields {
  --profile-tree-indent: 10px;
}

.profile-group {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.profile-fields > .profile-group {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.profile-group legend {
  box-sizing: border-box;
  width: 100%;
  padding: 0 5px 0 calc(var(--profile-depth) * var(--profile-tree-indent));
  color: #b7c6cc;
  font-size: max(11px, calc(15px - var(--profile-depth) * 1px));
  /*font-weight: 760;*/
  letter-spacing: 0.04em;
}

.profile-group__heading {
  position: relative;
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
}

.profile-group__toggle {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 100%;
  display: grid;
  width: 12px;
  height: 16px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  transform: translateY(-50%);
}

.profile-group__toggle:hover {
  background: rgba(120, 215, 196, 0.12);
  color: var(--accent);
}

.profile-group__toggle:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.profile-group__children {
  min-width: 0;
}

.profile-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--settings-editor-width);
  align-items: center;
  gap: 8px;
  margin: 9px 0;
}

.profile-field__name {
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  padding-left: calc(var(--profile-depth) * var(--profile-tree-indent));
  color: #cbd7dc;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-field__editor {
  display: grid;
  grid-template-columns: var(--settings-value-width) var(--settings-slider-width);
  align-items: center;
  gap: var(--settings-editor-gap);
  width: var(--settings-editor-width);
  min-width: 0;
}

.profile-field output {
  min-width: 0;
  color: var(--accent);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.profile-field--range input[type="range"] {
  grid-column: 2;
  width: var(--settings-slider-width);
  margin: 0;
}

.profile-field--range output {
  grid-column: 1;
}

.profile-field input[type="text"] {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 5px 7px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.profile-field input[type="color"] {
  grid-column: 2;
  justify-self: end;
  width: 38px;
  height: 30px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.profile-field input[type="checkbox"] {
  grid-column: 2;
  justify-self: end;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.profile-error {
  margin: 13px 0 0;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.45;
}

.switch-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin: 17px 0;
  color: #cbd7dc;
  font-size: 12px;
}

.switch-control input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 17px 0;
}

.switch-row .switch-control {
  min-width: 0;
  margin: 0;
}

.hinted-label {
  cursor: help;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(183, 198, 204, 0.72);
  text-underline-offset: 3px;
}

.hinted-label:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.button-row {
  flex-wrap: wrap;
  margin-top: 21px;
}

.button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(120, 215, 196, 0.26);
  border-radius: 8px;
  background: rgba(120, 215, 196, 0.13);
  color: var(--accent);
  font-size: 11px;
  font-weight: 640;
  cursor: pointer;
}

.button--quiet {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  margin: 17px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.segmented button {
  border-radius: 7px;
  font-size: 12px;
}

.metrics-details {
  margin: 15px 0 0;
}

.metrics-details div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.metrics-details dt {
  color: var(--muted);
  font-size: 11px;
}

.metrics-details dd {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.drawer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: rgba(5, 9, 13, 0.35);
  color: var(--muted);
  font-size: 10px;
}

.drawer__footer--editor {
  display: block;
  min-height: 0;
  padding: 10px 12px 12px;
}

.profile-footer-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  margin-bottom: 9px;
}

.profile-footer-status strong {
  color: var(--ink);
  font-size: 10px;
}

.profile-footer-status span {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-footer-status[data-state="error"] strong,
.profile-footer-status[data-state="error"] span {
  color: var(--danger);
}

.profile-footer-status[data-state="ready"] strong {
  color: var(--accent);
}

.profile-footer-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.profile-footer-actions .button {
  min-width: 0;
  min-height: 31px;
  padding: 5px 4px;
  font-size: 9px;
}

.authoring-login {
  width: min(430px, calc(100vw - 30px));
  max-width: none;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface-strong);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.6);
  color: var(--ink);
}

.authoring-login::backdrop {
  background: rgba(2, 6, 10, 0.78);
  backdrop-filter: blur(12px);
}

.authoring-login__form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.authoring-login__form header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.authoring-login__form h2,
.authoring-login__form p {
  margin: 0;
}

.authoring-login__form h2 {
  font-size: 18px;
}

.authoring-login__form header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.authoring-login__form > label:not(.authoring-login__remember) {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.authoring-login__form input[type="text"],
.authoring-login__form input[type="password"] {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
}

.authoring-login__form input:focus {
  border-color: var(--accent);
}

.authoring-login__remember {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.authoring-login__error {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.authoring-login__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.authoring-login__form[aria-busy="true"] {
  opacity: 0.72;
}

.status-overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background: rgba(7, 12, 17, 0.78);
  backdrop-filter: blur(12px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.status-overlay.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.status-overlay.is-error p {
  color: var(--danger);
}

.status-overlay p {
  max-width: min(560px, calc(100vw - 40px));
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 650;
  text-align: center;
}

.status-overlay small {
  max-width: min(560px, calc(100vw - 40px));
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.status-progress {
  display: grid;
  width: min(320px, calc(100vw - 40px));
  gap: 6px;
  margin-top: 4px;
}

.status-progress progress {
  width: 100%;
  height: 6px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: rgba(120, 215, 196, 0.16);
}

.status-progress progress::-webkit-progress-bar {
  border-radius: inherit;
  background: rgba(120, 215, 196, 0.16);
}

.status-progress progress::-webkit-progress-value {
  border-radius: inherit;
  background: var(--accent);
  transition: inline-size 100ms linear;
}

.status-progress progress::-moz-progress-bar {
  border-radius: inherit;
  background: var(--accent);
  transition: inline-size 100ms linear;
}

.status-progress output {
  color: rgba(237, 244, 247, 0.88);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: center;
}

.status-overlay.is-error .status-progress {
  display: none;
}

.loader {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(120, 215, 196, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.status-overlay.is-error .loader {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes operator-ammo-reload-blink {
  50% { opacity: 0.25; }
}

@media (max-width: 960px) {
  .brand {
    top: 5px;
    left: 9px;
    max-width: calc(100vw - 18px);
  }

  .scene-summary {
    top: 9px;
    right: 9px;
    max-width: calc(100vw - 225px);
  }

  .metrics-hud {
    top: 62px;
    width: calc(100vw - 18px);
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .metrics-hud__metric {
    min-width: 0;
    gap: 2px;
    justify-content: center;
    padding: 6px 2px;
    font-size: 8px;
    letter-spacing: 0.02em;
  }

  .metrics-hud__label {
    flex: 0 1 auto;
    inline-size: auto;
  }

  .metrics-hud b {
    flex: 0 1 auto;
    inline-size: auto;
    min-inline-size: 0;
    max-inline-size: none;
    font-size: 10px;
  }

  .drawer {
    width: min(100vw - 28px, 390px);
  }

  .settings-tabs button {
    font-size: 10px;
  }

}

@media (max-width: 760px) {
  .help-panel {
    width: min(520px, calc(100vw - 48px));
  }

  .help-panel__columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .help-panel__section--robot,
  .help-panel__section--camera,
  .help-panel__section--editor {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 520px) {
  .settings-page {
    --settings-value-width: 46px;
    --settings-slider-width: 100px;
    --settings-editor-gap: 6px;
  }

  .scene-summary {
    top: 38px;
    max-width: calc(100vw - 18px);
  }

  .operator-status {
    left: 9px;
    bottom: 9px;
  }

  .help-button {
    right: 9px;
    bottom: 9px;
  }

  .help-overlay {
    padding: 16px;
  }

  .help-panel {
    width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
  }

  .help-panel__row {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .operator-status__ammo[data-reloading] {
    animation: none;
  }

  .drawer,
  .status-overlay,
  .help-button__indicator {
    transition: none;
  }

  .status-progress progress::-webkit-progress-value {
    transition: none;
  }

  .status-progress progress::-moz-progress-bar {
    transition: none;
  }

  .loader {
    animation-duration: 1.4s;
  }
}
