:root {
  color-scheme: dark;
  --bg: #020608;
  --bg-deep: #000203;
  --panel: rgba(4, 13, 17, 0.86);
  --panel-soft: rgba(5, 18, 22, 0.7);
  --line: rgba(135, 231, 242, 0.14);
  --line-strong: rgba(135, 231, 242, 0.32);
  --ink: #edfaff;
  --muted: #8ca0a5;
  --faint: #54656a;
  --cyan: #74ecff;
  --green: #7cf2b1;
  --blue: #8fb8ff;
  --amber: #ffd36b;
  --coral: #ff8b72;
  --danger: #ff625e;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: 2px;
}

.ambient-grid,
.ambient-shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient-grid {
  z-index: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(112, 223, 237, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 223, 237, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
}

.ambient-shade {
  z-index: 1;
  background:
    radial-gradient(circle at 50% 48%, transparent 0 29%, rgba(0, 2, 3, 0.34) 74%, rgba(0, 1, 2, 0.93) 132%),
    linear-gradient(180deg, rgba(2, 10, 13, 0.04), rgba(0, 2, 3, 0.5));
}

.osbar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  height: 62px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(300px, 1fr);
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(1, 6, 8, 0.78);
  backdrop-filter: blur(18px) saturate(1.15);
}

.system-id {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
}

.system-id > span:last-child {
  display: grid;
  gap: 2px;
}

.system-id strong {
  font-size: 12px;
  font-weight: 650;
}

.system-id small,
.scene-meta,
.rail-head p,
.panel-head p,
.ledger-panel header p {
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.system-mark {
  width: 15px;
  height: 15px;
  border: 1px solid rgba(116, 236, 255, 0.8);
  border-radius: 50%;
  box-shadow: inset 0 0 8px rgba(116, 236, 255, 0.28), 0 0 12px rgba(116, 236, 255, 0.16);
  position: relative;
}

.system-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(124, 242, 177, 0.62);
  transform: rotate(45deg);
}

.top-metrics {
  display: flex;
  gap: 24px;
  margin: 0;
}

.top-metrics > div,
.render-metrics > div {
  display: grid;
  gap: 3px;
  min-width: 62px;
}

.top-metrics dt,
.render-metrics dt {
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.top-metrics dd,
.render-metrics dd {
  margin: 0;
  color: #cceef3;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
}

.top-metrics dd.healthy {
  color: var(--green);
}

.top-metrics dd.warning {
  color: var(--amber);
}

.top-metrics dd.incident {
  color: var(--coral);
}

.os-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 7px;
}

.command,
.icon-command,
.close-command,
.panel-actions button,
.skin-action,
.ledger-panel button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(3, 13, 17, 0.68);
  color: #a9c1c6;
  padding: 0 11px;
  font-size: 10px;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.command:hover,
.icon-command:hover,
.close-command:hover,
.panel-actions button:hover,
.skin-action:hover,
.ledger-panel button:hover {
  border-color: rgba(116, 236, 255, 0.5);
  background: rgba(18, 49, 57, 0.7);
  color: var(--ink);
}

.command span {
  min-width: 18px;
  margin-left: 6px;
  border-left: 1px solid var(--line);
  color: var(--cyan);
  text-align: right;
}

.icon-command {
  width: 34px;
  padding: 0;
  gap: 4px;
}

.pause-icon i {
  width: 2px;
  height: 11px;
  background: var(--cyan);
  box-shadow: 0 0 7px rgba(116, 236, 255, 0.38);
}

.pause-icon.paused i:first-child {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--cyan);
  background: transparent;
}

.pause-icon.paused i:last-child {
  display: none;
}

.os-layout {
  position: fixed;
  z-index: 3;
  inset: 62px 0 64px;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 292px;
  min-width: 0;
  min-height: 0;
}

.region-rail,
.event-rail {
  position: relative;
  z-index: 5;
  min-width: 0;
  min-height: 0;
  background: rgba(1, 7, 9, 0.72);
  backdrop-filter: blur(14px);
}

.region-rail {
  border-right: 1px solid var(--line);
  padding: 20px 14px 14px;
  display: flex;
  flex-direction: column;
}

.event-rail {
  border-left: 1px solid var(--line);
  padding: 20px 14px 14px;
  display: flex;
  flex-direction: column;
}

.rail-head {
  min-height: 50px;
  padding: 0 6px;
}

.rail-head p,
.rail-head h1,
.rail-head h2,
.panel-head p,
.panel-head h2,
.ledger-panel h3,
.ledger-panel p {
  margin: 0;
}

.rail-head h1,
.rail-head h2 {
  margin-top: 5px;
  font-size: 17px;
  font-weight: 420;
}

.region-list {
  display: grid;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.region-row {
  min-height: 57px;
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid rgba(135, 231, 242, 0.08);
  background: transparent;
  color: var(--muted);
  padding: 0 7px;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.region-row:hover,
.region-row.active {
  background: rgba(102, 223, 239, 0.055);
  color: var(--ink);
}

.region-row > i {
  width: 6px;
  height: 6px;
  border: 1px solid var(--region-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--region-color);
}

.region-row.active > i {
  background: var(--region-color);
}

.region-row > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.region-row strong {
  font-size: 11px;
  font-weight: 540;
}

.region-row small {
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-row b {
  color: #729096;
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 400;
}

.region-focus {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 15px 6px 4px;
}

.region-focus > div {
  display: grid;
  gap: 4px;
}

.region-focus span,
.region-focus dt,
.gateway-strip span,
.visitor-summary span {
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.region-focus strong {
  color: var(--cyan);
  font-size: 15px;
  font-weight: 430;
}

.region-focus dl {
  display: grid;
  gap: 7px;
  margin: 13px 0 0;
}

.region-focus dl > div {
  display: flex;
  justify-content: space-between;
}

.region-focus dd {
  margin: 0;
  color: #aac4c9;
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
}

.brain-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: rgba(0, 4, 6, 0.2);
  cursor: crosshair;
}

.brain-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.scene-meta {
  position: absolute;
  z-index: 4;
  top: 17px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.scene-meta strong {
  color: rgba(176, 233, 240, 0.55);
  font-weight: 400;
}

.brain-labels {
  position: absolute;
  z-index: 6;
  inset: 0;
  pointer-events: none;
}

.brain-label {
  position: absolute;
  width: 116px;
  min-height: 38px;
  display: grid;
  gap: 2px;
  align-content: center;
  border-left: 1px solid rgba(116, 236, 255, 0.42);
  background: rgba(1, 7, 9, 0.52);
  color: #b8d0d5;
  padding: 5px 7px;
  text-align: left;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease, border-color 160ms ease, color 160ms ease;
}

.brain-label:hover,
.brain-label.active {
  border-color: var(--cyan);
  color: var(--ink);
}

.brain-label span {
  font-size: 9px;
  text-transform: uppercase;
}

.brain-label small {
  color: var(--faint);
  font-size: 8px;
}

.brain-reticle {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(116, 236, 255, 0.07);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.brain-reticle::before,
.brain-reticle::after,
.brain-reticle i {
  content: "";
  position: absolute;
  background: rgba(116, 236, 255, 0.15);
}

.brain-reticle::before {
  width: 110px;
  height: 1px;
  left: -15px;
  top: 40px;
}

.brain-reticle::after {
  width: 1px;
  height: 110px;
  left: 40px;
  top: -15px;
}

.healing-banner {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 24px;
  min-width: 250px;
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 12px;
  border: 1px solid rgba(255, 211, 107, 0.25);
  background: rgba(18, 14, 4, 0.82);
  padding: 10px 13px;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.healing-banner[hidden] {
  display: none;
}

.healing-banner span {
  color: var(--amber);
  font-size: 9px;
  text-transform: uppercase;
}

.healing-banner strong {
  color: #fff1c4;
  font-size: 11px;
  font-weight: 500;
}

.healing-banner i {
  grid-column: 1 / -1;
  height: 1px;
  background: linear-gradient(90deg, var(--amber), var(--green));
  animation: healing-progress 3s ease-in-out infinite;
  transform-origin: left;
}

.render-state {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 50%;
  color: rgba(116, 236, 255, 0.5);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  transform: translate(-50%, -50%);
}

.render-state.ready {
  opacity: 0;
  transition: opacity 600ms ease;
}

.event-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.live-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.live-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px rgba(124, 242, 177, 0.7);
  animation: live-pulse 1.8s ease-in-out infinite;
}

.gateway-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  margin-top: 10px;
}

.gateway-strip > div {
  min-height: 48px;
  display: grid;
  place-items: center;
  gap: 2px;
  align-content: center;
  border-right: 1px solid var(--line);
}

.gateway-strip > div:last-child {
  border-right: 0;
}

.gateway-strip strong {
  color: #cbeef2;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 400;
}

.event-feed {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  margin: 13px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.event-feed li {
  min-height: 55px;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid rgba(135, 231, 242, 0.08);
  animation: event-enter 360ms var(--ease) both;
}

.event-feed li > i {
  width: 4px;
  height: 23px;
  background: var(--event-color, var(--cyan));
  box-shadow: 0 0 8px var(--event-color, var(--cyan));
}

.event-feed li > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.event-feed strong {
  overflow: hidden;
  color: #bad0d5;
  font-size: 10px;
  font-weight: 460;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-feed small,
.event-feed time {
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
}

.visitor-summary {
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr 58px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 5px 0;
}

.visitor-summary > div:first-child {
  display: grid;
  gap: 3px;
}

.visitor-summary strong {
  font-size: 20px;
  font-weight: 350;
}

.visitor-summary p {
  grid-column: 1 / -1;
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 9px;
}

.visitor-orbit {
  position: relative;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(124, 242, 177, 0.22);
  border-radius: 50%;
}

.visitor-orbit b,
.visitor-orbit i {
  position: absolute;
  border-radius: 50%;
}

.visitor-orbit b {
  inset: 16px;
  border: 1px solid rgba(116, 236, 255, 0.46);
}

.visitor-orbit i {
  width: 4px;
  height: 4px;
  background: var(--green);
  animation: visitor-spin 4s linear infinite;
  transform-origin: 22px 22px;
}

.visitor-orbit i:nth-child(2) {
  animation-duration: 5.2s;
  animation-delay: -2s;
}

.visitor-orbit i:nth-child(3) {
  animation-duration: 6.4s;
  animation-delay: -4s;
}

.control-dock {
  position: fixed;
  z-index: 20;
  inset: auto 0 0;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  background: rgba(1, 6, 8, 0.84);
  backdrop-filter: blur(18px);
}

.layer-controls {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.layer-controls legend {
  margin-right: 5px;
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.layer-controls label {
  cursor: pointer;
}

.layer-controls input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.layer-controls span,
.mode-control button {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--faint);
  padding: 0 9px;
  font-size: 9px;
}

.layer-controls input:checked + span,
.mode-control button.active {
  border-color: rgba(116, 236, 255, 0.34);
  background: rgba(116, 236, 255, 0.07);
  color: #c8edf2;
}

.mode-control {
  display: flex;
}

.mode-control button {
  border-radius: 0;
  cursor: pointer;
}

.mode-control button:first-child {
  border-radius: 3px 0 0 3px;
}

.mode-control button:last-child {
  border-radius: 0 3px 3px 0;
  border-left: 0;
}

.render-metrics {
  justify-self: end;
  display: flex;
  gap: 17px;
  margin: 0;
}

dialog.panel {
  position: fixed;
  inset: auto;
  margin: auto;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(2, 10, 13, 0.96);
  color: var(--ink);
  padding: 0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(24px) saturate(1.2);
}

dialog.panel::backdrop {
  background: rgba(0, 2, 3, 0.62);
  backdrop-filter: blur(5px);
}

.settings-panel {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow: auto;
}

.skins-panel {
  width: min(900px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow: auto;
}

.panel-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 15px 18px;
}

.panel-head h2 {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 420;
}

.control-list {
  display: grid;
  gap: 0;
  padding: 8px 18px 0;
}

.control-list label {
  min-height: 59px;
  display: grid;
  align-content: center;
  gap: 9px;
  border-bottom: 1px solid rgba(135, 231, 242, 0.08);
}

.control-list label > span,
.toggle-list label {
  display: flex;
  justify-content: space-between;
  color: #a9c1c6;
  font-size: 10px;
}

.control-list output {
  color: var(--cyan);
  font-family: Consolas, "Courier New", monospace;
}

input[type="range"] {
  width: 100%;
  height: 2px;
  border-radius: 0;
  appearance: none;
  background: rgba(116, 236, 255, 0.16);
}

input[type="range"]::-webkit-slider-thumb {
  width: 11px;
  height: 11px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  appearance: none;
  background: #071217;
  box-shadow: 0 0 8px rgba(116, 236, 255, 0.4);
}

.toggle-list {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.toggle-list input {
  accent-color: var(--cyan);
}

.health-palette {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
}

.health-palette i {
  width: 14px;
  height: 7px;
  border: 1px solid currentColor;
}

.health-palette .normal { color: var(--cyan); }
.health-palette .busy { color: var(--amber); }
.health-palette .incident { color: var(--danger); }
.health-palette .healing { color: var(--green); }

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 16px 18px 10px;
}

.panel-actions .primary {
  border-color: rgba(116, 236, 255, 0.45);
  color: var(--ink);
}

.panel-status {
  min-height: 30px;
  margin: 0;
  padding: 4px 18px 14px;
  color: var(--green);
  font-size: 9px;
}

.skin-list {
  display: grid;
}

.skin-item {
  min-height: 156px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.skin-preview {
  position: relative;
  height: 116px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #02080b;
}

.skin-preview.current i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82px;
  height: 54px;
  border: 1px dotted rgba(116, 236, 255, 0.62);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
}

.skin-preview.current i:nth-child(2) { --r: 35deg; border-color: rgba(124, 242, 177, 0.42); }
.skin-preview.current i:nth-child(3) { --r: -35deg; border-color: rgba(255, 211, 107, 0.35); }

.skin-preview.current-skin i {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 48%;
  height: 34px;
  border-top: 1px solid rgba(116, 236, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 -7px 18px rgba(65, 212, 237, 0.25);
  transform: rotate(-5deg);
}

.skin-item h3,
.skin-item p,
.skin-item small {
  margin: 0;
}

.skin-item h3 {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 460;
}

.skin-item p {
  max-width: 520px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.skin-item small {
  display: block;
  margin-top: 9px;
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
}

.status {
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.status.review { color: var(--amber); }
.status.approved { color: var(--green); }

.ledger-panel {
  padding: 16px 18px 20px;
}

.ledger-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ledger-panel h3 {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 430;
}

.ledger-status {
  min-height: 22px;
  padding-top: 8px;
  color: var(--green);
  font-size: 9px;
}

.ledger-panel ol {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.ledger-panel li {
  min-height: 42px;
  display: grid;
  grid-template-columns: 46px 150px minmax(0, 1fr) 116px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid rgba(135, 231, 242, 0.08);
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
}

.ledger-panel li strong {
  overflow: hidden;
  color: #a9c1c6;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-panel li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-toast {
  position: fixed;
  z-index: 40;
  right: 18px;
  bottom: 82px;
  width: min(370px, calc(100% - 36px));
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(2, 11, 14, 0.94);
  padding: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.agent-toast[hidden] {
  display: none;
}

.agent-toast > i {
  width: 8px;
  height: 8px;
  border: 1px solid var(--cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(116, 236, 255, 0.4);
}

.agent-toast strong {
  font-size: 10px;
  font-weight: 540;
}

.agent-toast p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.agent-toast button {
  background: transparent;
  color: var(--faint);
  font-size: 9px;
  cursor: pointer;
}

@keyframes live-pulse {
  50% { opacity: 0.25; transform: scale(0.72); }
}

@keyframes event-enter {
  from { opacity: 0; transform: translateX(10px); }
}

@keyframes visitor-spin {
  from { transform: rotate(0deg) translateX(20px); }
  to { transform: rotate(360deg) translateX(20px); }
}

@keyframes healing-progress {
  0%, 100% { transform: scaleX(0.18); opacity: 0.35; }
  50% { transform: scaleX(1); opacity: 1; }
}

@media (max-width: 1100px) {
  .os-layout {
    grid-template-columns: 196px minmax(0, 1fr) 250px;
  }

  .top-metrics {
    gap: 14px;
  }

  .brain-label {
    width: 100px;
  }

  .render-metrics > div:nth-child(2) {
    display: none;
  }
}

@media (max-width: 800px) {
  .osbar {
    height: 58px;
    grid-template-columns: 1fr auto;
    padding: 0 10px;
  }

  .system-id small,
  .top-metrics,
  .os-actions > a {
    display: none;
  }

  .command,
  .icon-command {
    min-height: 32px;
    font-size: 9px;
  }

  .os-layout {
    inset: 58px 0 78px;
    grid-template-columns: 1fr;
    grid-template-rows: 94px minmax(260px, 1fr) 142px;
  }

  .region-rail {
    padding: 7px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
  }

  .region-rail .rail-head,
  .region-focus {
    display: none;
  }

  .region-list {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    margin: 0;
    border: 0;
    scrollbar-width: none;
  }

  .region-row {
    min-width: 125px;
    min-height: 78px;
    grid-template-columns: 8px minmax(0, 1fr);
    border: 1px solid rgba(135, 231, 242, 0.08);
    padding: 0 9px;
  }

  .region-row b {
    display: none;
  }

  .event-rail {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    grid-template-rows: 48px minmax(0, 1fr);
    gap: 0 10px;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 8px;
  }

  .event-head {
    grid-column: 1;
    min-height: 48px;
    padding: 2px 4px;
  }

  .event-head .live-state,
  .visitor-summary {
    display: none;
  }

  .gateway-strip {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
  }

  .gateway-strip > div {
    min-height: 44px;
  }

  .event-feed {
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 0;
  }

  .event-feed li {
    min-height: 55px;
  }

  .event-feed li:nth-child(n+3) {
    display: none;
  }

  .brain-label {
    display: none;
  }

  .brain-label.active {
    display: grid;
  }

  .scene-meta {
    top: 10px;
    left: 12px;
    right: 12px;
  }

  .control-dock {
    height: 78px;
    grid-template-columns: 1fr auto;
    grid-template-rows: 36px 34px;
    gap: 0 8px;
    padding: 4px 8px;
  }

  .layer-controls {
    grid-column: 1 / -1;
    gap: 4px;
    overflow-x: auto;
  }

  .layer-controls legend {
    display: none;
  }

  .layer-controls span {
    min-height: 27px;
    padding: 0 7px;
  }

  .mode-control {
    grid-row: 2;
  }

  .mode-control button {
    min-height: 27px;
    padding: 0 7px;
    font-size: 8px;
  }

  .render-metrics {
    grid-row: 2;
    gap: 10px;
  }

  .render-metrics > div:nth-child(2),
  .render-metrics > div:nth-child(4) {
    display: none;
  }

  .skin-item {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .skin-item .skin-action {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .ledger-panel li {
    grid-template-columns: 42px 120px minmax(0, 1fr);
  }

  .ledger-panel li code {
    display: none;
  }
}

@media (max-width: 520px) {
  .os-actions {
    gap: 4px;
  }

  .command {
    padding: 0 8px;
  }

  .region-row {
    min-width: 116px;
  }

  .scene-meta span {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .event-rail {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .skin-item {
    grid-template-columns: 1fr;
  }

  .skin-preview {
    height: 104px;
  }

  .skin-item .skin-action {
    grid-column: 1;
  }

  .agent-toast {
    right: 10px;
    bottom: 88px;
    width: calc(100% - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Training Studio V2 */

.demo-command {
  border-color: rgba(124, 242, 177, 0.3);
  color: #d9ffeb;
}

.demo-command > i {
  width: 0;
  height: 0;
  margin-right: 7px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--green);
  filter: drop-shadow(0 0 5px rgba(124, 242, 177, 0.5));
}

.zoom-controls {
  position: absolute;
  z-index: 10;
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: 30px 52px 30px 38px;
  height: 31px;
  border: 1px solid var(--line);
  background: rgba(1, 8, 11, 0.78);
  backdrop-filter: blur(14px);
}

.zoom-controls button,
.zoom-controls output {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background: transparent;
  color: #b7d4d9;
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
}

.zoom-controls button {
  cursor: pointer;
}

.zoom-controls button:hover {
  background: rgba(116, 236, 255, 0.08);
  color: var(--ink);
}

.zoom-controls button:last-child {
  border-right: 0;
  color: var(--faint);
}

.demo-presenter {
  position: absolute;
  z-index: 12;
  left: 18px;
  bottom: 18px;
  width: min(470px, calc(100% - 104px));
  border: 1px solid rgba(116, 236, 255, 0.25);
  background: rgba(1, 8, 11, 0.89);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(22px) saturate(1.15);
  animation: presenter-enter 480ms var(--ease) both;
}

.demo-presenter[hidden] {
  display: none;
}

.demo-presenter > header,
.demo-presenter > footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
}

.demo-presenter > header {
  border-bottom: 1px solid var(--line);
}

.demo-presenter > header > div {
  display: grid;
  gap: 3px;
}

.demo-presenter > header span,
.demo-presenter > footer output,
.academy-head p,
.academy-section header p,
.academy-summary span,
.training-status span,
.training-evidence header span {
  margin: 0;
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.demo-presenter > header strong {
  color: var(--green);
  font-size: 10px;
  font-weight: 480;
}

.demo-presenter button,
.academy-drawer button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(5, 17, 21, 0.72);
  color: #a9c1c6;
  padding: 0 10px;
  font-size: 9px;
  cursor: pointer;
}

.demo-presenter button:hover,
.academy-drawer button:hover {
  border-color: rgba(116, 236, 255, 0.48);
  color: var(--ink);
}

.demo-presenter button.primary,
.academy-drawer button.primary {
  border-color: rgba(124, 242, 177, 0.42);
  color: #d9ffeb;
}

.demo-presenter button:disabled,
.academy-drawer button:disabled {
  opacity: 0.42;
  cursor: default;
}

.demo-copy {
  padding: 17px 16px 13px;
}

.demo-copy h2,
.demo-copy p {
  margin: 0;
}

.demo-copy h2 {
  max-width: 390px;
  font-size: 24px;
  font-weight: 360;
  line-height: 1.12;
}

.demo-copy > p:not(.demo-transcript) {
  max-width: 430px;
  margin-top: 10px;
  color: #a8c0c5;
  font-size: 11px;
  line-height: 1.62;
}

.demo-transcript {
  min-height: 42px;
  margin-top: 13px !important;
  border-left: 1px solid rgba(124, 242, 177, 0.38);
  color: #71898e;
  padding-left: 11px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  line-height: 1.55;
}

.demo-progress,
.training-progress {
  height: 2px;
  overflow: hidden;
  background: rgba(116, 236, 255, 0.08);
}

.demo-progress i,
.training-progress i {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 9px rgba(116, 236, 255, 0.5);
  transition: width 220ms linear;
}

.demo-presenter > footer {
  justify-content: flex-start;
}

.demo-presenter > footer label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}

.demo-presenter > footer input,
.academy-summary input {
  accent-color: var(--green);
}

.demo-presenter > footer output {
  min-width: 31px;
  text-align: right;
}

.academy-drawer {
  position: fixed;
  z-index: 28;
  top: 62px;
  right: 0;
  bottom: 64px;
  width: min(450px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid rgba(116, 236, 255, 0.25);
  background: rgba(1, 7, 10, 0.95);
  box-shadow: -28px 0 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(24px) saturate(1.12);
  animation: academy-enter 420ms var(--ease) both;
}

.academy-drawer[hidden] {
  display: none;
}

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

.academy-head,
.academy-summary,
.academy-section:not(.curriculum),
.academy-runner,
.training-evidence,
.academy-actions {
  flex-shrink: 0;
}

.academy-head h2,
.academy-section h3,
.training-evidence h3 {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 420;
}

.academy-summary {
  min-height: 66px;
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.academy-summary > div,
.academy-summary > label {
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
  padding: 9px 11px;
}

.academy-summary > label {
  justify-items: center;
  border-right: 0;
  color: var(--muted);
  font-size: 8px;
}

.academy-summary strong {
  color: #c9edf2;
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 400;
}

.academy-section {
  border-bottom: 1px solid var(--line);
  padding: 13px 16px 12px;
}

.academy-section > header,
.training-evidence > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.academy-section > header > span {
  color: var(--green);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.training-agent-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 11px;
  background: rgba(116, 236, 255, 0.08);
}

.training-agent {
  min-height: 78px;
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 8px;
  background: #030b0e;
  padding: 9px;
  transition: background 180ms ease;
}

.training-agent.active {
  background: rgba(116, 236, 255, 0.065);
}

.training-agent > i {
  width: 5px;
  height: 5px;
  border: 1px solid var(--agent-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--agent-color);
}

.training-agent > div:not(.agent-mastery) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.training-agent strong {
  color: #c7dfe3;
  font-size: 10px;
  font-weight: 520;
}

.training-agent span,
.training-agent small {
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-mastery {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.agent-mastery b {
  color: var(--agent-color);
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 400;
}

.agent-mastery > span {
  width: 54px;
  height: 2px;
  display: block;
  background: rgba(116, 236, 255, 0.09);
}

.agent-mastery > span i {
  height: 100%;
  display: block;
  background: var(--agent-color);
}

.curriculum {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.curriculum ol,
.training-live-log,
.training-evidence ol {
  margin: 10px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.curriculum li {
  min-height: 53px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(135, 231, 242, 0.08);
}

.curriculum li > b {
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  font-weight: 400;
}

.curriculum li > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.curriculum li strong {
  color: #a9c1c6;
  font-size: 9px;
  font-weight: 480;
}

.curriculum li small {
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.curriculum li > i {
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 7px;
  font-style: normal;
  text-align: right;
  text-transform: uppercase;
}

.curriculum li.active strong,
.curriculum li.active > i {
  color: var(--cyan);
}

.curriculum li.complete > b,
.curriculum li.complete > i {
  color: var(--green);
}

.academy-runner {
  padding: 11px 16px 9px;
  border-bottom: 1px solid var(--line);
}

.training-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.training-status strong {
  color: var(--green);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 400;
}

.training-live-log {
  max-height: 74px;
  overflow: hidden;
  margin-top: 8px;
}

.training-live-log li {
  min-height: 22px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #80979c;
  font-size: 8px;
}

.training-live-log time {
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
}

.training-evidence {
  max-height: 220px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.training-evidence[hidden] {
  display: none;
}

.training-evidence h3 {
  font-size: 13px;
}

.training-evidence li {
  min-height: 40px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid rgba(135, 231, 242, 0.08);
  color: var(--faint);
  font-size: 8px;
}

.training-evidence li > span {
  display: grid;
  gap: 2px;
}

.training-evidence li strong {
  color: #a9c1c6;
  font-weight: 460;
}

.training-evidence code {
  color: var(--faint);
  font-size: 7px;
}

.academy-actions {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
}

.skin-preview.parent-brain i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 75px;
  height: 52px;
  border: 1px dotted rgba(116, 236, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(18deg);
}

.skin-preview.parent-brain i:nth-child(2) {
  transform: translate(-50%, -50%) rotate(-18deg);
  border-color: rgba(124, 242, 177, 0.34);
}

@keyframes presenter-enter {
  from { opacity: 0; transform: translateY(12px); }
}

@keyframes academy-enter {
  from { opacity: 0; transform: translateX(24px); }
}

@media (max-width: 1250px) {
  .osbar {
    grid-template-columns: minmax(180px, 1fr) auto minmax(370px, 1fr);
  }

  .top-metrics {
    gap: 12px;
  }

  .os-actions {
    gap: 4px;
  }

  .command {
    padding: 0 8px;
  }
}

@media (max-width: 1000px) {
  .os-actions > a,
  #open-skins {
    display: none;
  }

  .training-agent-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  #open-settings,
  #open-skins {
    display: none;
  }

  .demo-command > i {
    margin-right: 5px;
  }

  .academy-drawer {
    top: 58px;
    bottom: 78px;
    width: 100%;
    border-left: 0;
  }

  .academy-summary {
    grid-template-columns: repeat(3, 1fr) 58px;
  }

  .training-agent-list {
    grid-template-columns: 1fr 1fr;
  }

  .demo-presenter {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
  }

  .demo-copy {
    padding: 13px 13px 10px;
  }

  .demo-copy h2 {
    font-size: 20px;
  }

  .demo-transcript {
    min-height: 0;
    max-height: 38px;
    overflow: hidden;
  }

  .zoom-controls {
    right: 8px;
    bottom: 8px;
  }

  .presentation-active .zoom-controls {
    display: none;
  }
}

@media (max-width: 520px) {
  .demo-command {
    padding: 0 7px;
  }

  .academy-head {
    min-height: 60px;
  }

  .academy-summary {
    min-height: 58px;
  }

  .academy-summary > div,
  .academy-summary > label {
    padding: 7px;
  }

  .academy-section {
    padding: 10px 12px;
  }

  .training-agent-list {
    grid-template-columns: 1fr 1fr;
  }

  .training-agent {
    min-height: 68px;
    grid-template-columns: 5px minmax(0, 1fr);
  }

  .agent-mastery {
    grid-column: 2;
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: start;
  }

  .agent-mastery > span {
    width: 44px;
  }

  .curriculum li {
    min-height: 47px;
  }

  .academy-runner {
    padding: 9px 12px 7px;
  }

  .training-live-log {
    display: none;
  }

  .academy-actions {
    min-height: 52px;
    padding: 8px 12px;
  }

  .demo-presenter > footer {
    flex-wrap: wrap;
  }

  .demo-presenter > footer label {
    margin-left: 0;
  }

  .demo-presenter > footer output {
    margin-left: auto;
  }
}
