:root {
  color-scheme: dark;
  --bg: #071014;
  --bg-deep: #04090c;
  --surface: rgba(15, 28, 34, 0.82);
  --surface-strong: #102129;
  --surface-soft: rgba(19, 39, 47, 0.62);
  --line: rgba(151, 193, 207, 0.16);
  --line-strong: rgba(151, 193, 207, 0.28);
  --text: #edf7f8;
  --muted: #91a8ad;
  --muted-strong: #b4c5c8;
  --cyan: #56d6d0;
  --cyan-strong: #83f4ed;
  --cyan-dark: #123e42;
  --amber: #e9b967;
  --green: #70d6a0;
  --red: #ff8c86;
  --red-dark: #51282b;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-deep);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(7, 16, 20, 0.25), var(--bg) 34rem),
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(255, 255, 255, 0.014) 80px),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

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

button {
  color: inherit;
}

button:not(:disabled),
select:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(86, 214, 208, 0.34);
  outline-offset: 3px;
}

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

.page-glow {
  position: fixed;
  z-index: -1;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.13;
  pointer-events: none;
}

.page-glow--cyan {
  top: -20rem;
  left: -12rem;
  background: radial-gradient(circle, var(--cyan), transparent 68%);
}

.page-glow--amber {
  top: 22rem;
  right: -28rem;
  background: radial-gradient(circle, var(--amber), transparent 68%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 12, 15, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(86, 214, 208, 0.5);
  border-radius: 11px;
  color: var(--cyan-strong);
  background: linear-gradient(145deg, rgba(86, 214, 208, 0.18), rgba(86, 214, 208, 0.04));
  box-shadow: inset 0 0 24px rgba(86, 214, 208, 0.08);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand__text {
  display: grid;
  gap: 1px;
}

.brand__text strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand__text small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.test-badge {
  padding: 7px 10px;
  border: 1px solid rgba(233, 185, 103, 0.26);
  border-radius: 999px;
  color: #f3d49e;
  background: rgba(233, 185, 103, 0.08);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.connection-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 650;
}

.connection-state__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(233, 185, 103, 0.08);
}

.connection-state[data-state="ready"] .connection-state__dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(112, 214, 160, 0.09), 0 0 18px rgba(112, 214, 160, 0.3);
}

.connection-state[data-state="error"] .connection-state__dot {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 140, 134, 0.09);
}

.shell {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: 74px 0 90px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.72fr);
  gap: clamp(36px, 7vw, 96px);
  align-items: end;
  margin-bottom: 52px;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.21em;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6vw, 78px);
  font-weight: 770;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: var(--muted);
  font-weight: 620;
}

.hero__lead {
  max-width: 660px;
  margin: 25px 0 0;
  color: var(--muted-strong);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.65;
}

.test-note {
  display: flex;
  gap: 15px;
  padding: 20px;
  border: 1px solid rgba(233, 185, 103, 0.2);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(233, 185, 103, 0.09), rgba(233, 185, 103, 0.025));
}

.test-note__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(233, 185, 103, 0.36);
  border-radius: 50%;
  color: var(--amber);
  font-size: 13px;
  font-weight: 900;
}

.test-note strong {
  display: block;
  margin: 3px 0 7px;
  color: #f1d7aa;
  font-size: 14px;
}

.test-note p {
  margin: 0;
  color: #ad9e86;
  font-size: 13px;
  line-height: 1.55;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(11, 23, 28, 0.64);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.metric {
  min-width: 0;
  padding: 22px 24px;
}

.metric + .metric {
  border-left: 1px solid var(--line);
}

.metric__label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric__value {
  display: block;
  overflow: hidden;
  margin-bottom: 5px;
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  gap: 24px;
  margin-top: 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.spawn-panel,
.info-panel {
  padding: clamp(24px, 4vw, 38px);
}

.panel__heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.panel__heading {
  margin-bottom: 30px;
}

.panel__heading h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.step-mark {
  color: rgba(145, 168, 173, 0.35);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

#spawn-form {
  display: grid;
  gap: 25px;
}

.field {
  display: grid;
  gap: 10px;
}

.field label,
.field__label-row > label {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 720;
}

.field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

select,
.number-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  background: rgba(5, 14, 18, 0.8);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

select {
  height: 52px;
  padding: 0 46px 0 16px;
  appearance: none;
}

select:hover:not(:disabled),
.number-input:hover {
  border-color: rgba(86, 214, 208, 0.38);
}

select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.preset-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 27px;
}

.preset-preview span {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 11px;
}

.preset-preview span:first-child:not(:only-child) {
  color: var(--cyan-strong);
  border-color: rgba(86, 214, 208, 0.2);
  background: rgba(86, 214, 208, 0.06);
}

.text-action {
  padding: 4px;
  border: 0;
  color: var(--cyan);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.text-action:hover:not(:disabled) {
  color: var(--cyan-strong);
}

.text-action:disabled {
  color: var(--muted);
  cursor: wait;
}

.field__hint,
.submit-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.field__hint[data-state="error"] {
  color: var(--red);
}

.level-field output {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(86, 214, 208, 0.2);
  border-radius: 8px;
  color: var(--cyan-strong);
  background: rgba(86, 214, 208, 0.07);
  font-size: 13px;
  font-weight: 850;
}

input[type="range"] {
  width: 100%;
  height: 5px;
  margin: 8px 0 3px;
  border-radius: 999px;
  accent-color: var(--cyan);
  appearance: none;
  background: rgba(151, 193, 207, 0.14);
}

input[type="range"]::-webkit-slider-thumb {
  width: 19px;
  height: 19px;
  border: 4px solid #10272d;
  border-radius: 50%;
  appearance: none;
  background: var(--cyan-strong);
  box-shadow: 0 0 0 1px rgba(86, 214, 208, 0.44), 0 0 18px rgba(86, 214, 208, 0.24);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 4px solid #10272d;
  border-radius: 50%;
  background: var(--cyan-strong);
  box-shadow: 0 0 0 1px rgba(86, 214, 208, 0.44);
}

.level-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
}

.number-input {
  display: flex;
  align-items: center;
  width: auto;
  min-width: 144px;
  height: 40px;
  overflow: hidden;
}

.number-input input {
  width: 64px;
  height: 100%;
  padding: 0 10px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-weight: 750;
}

.number-input small {
  padding-right: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.form-message {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  line-height: 1.5;
}

.form-message[data-state="success"] {
  border-color: rgba(112, 214, 160, 0.22);
  color: #a7e7c3;
  background: rgba(112, 214, 160, 0.055);
}

.form-message[data-state="error"] {
  border-color: rgba(255, 140, 134, 0.22);
  color: #ffc0bc;
  background: rgba(255, 140, 134, 0.055);
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 11px;
  font-weight: 780;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, opacity 150ms ease;
}

.primary-button {
  min-height: 53px;
  border: 1px solid rgba(131, 244, 237, 0.32);
  color: #062125;
  background: linear-gradient(135deg, var(--cyan-strong), #55c5c2);
  box-shadow: 0 13px 34px rgba(49, 177, 174, 0.15);
}

.primary-button__icon {
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #a0fff9, #63d7d3);
}

.primary-button:disabled {
  cursor: not-allowed;
  filter: saturate(0.45);
  opacity: 0.48;
}

.secondary-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
}

.secondary-button:hover:not(:disabled) {
  border-color: rgba(86, 214, 208, 0.32);
  color: var(--text);
  background: rgba(86, 214, 208, 0.055);
}

.secondary-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.policy-list {
  display: grid;
  gap: 5px;
}

.policy-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.policy-item__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--cyan);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 900;
}

.policy-item h3 {
  margin: 1px 0 6px;
  font-size: 14px;
}

.policy-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.status-box {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 24px;
  padding: 17px;
  border: 1px solid rgba(233, 185, 103, 0.18);
  border-radius: var(--radius-md);
  background: rgba(233, 185, 103, 0.045);
}

.status-box__pulse {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(233, 185, 103, 0.07);
}

.status-box[data-state="ready"] {
  border-color: rgba(112, 214, 160, 0.18);
  background: rgba(112, 214, 160, 0.045);
}

.status-box[data-state="ready"] .status-box__pulse {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(112, 214, 160, 0.07);
}

.status-box[data-state="error"] {
  border-color: rgba(255, 140, 134, 0.18);
  background: rgba(255, 140, 134, 0.045);
}

.status-box[data-state="error"] .status-box__pulse {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(255, 140, 134, 0.07);
}

.status-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.status-box p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.bots-section {
  margin-top: 76px;
}

.section-heading {
  align-items: end;
  margin-bottom: 24px;
}

.section-heading > div > p:last-child {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.bots-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  display: grid;
  justify-items: center;
  min-height: 210px;
  padding: 42px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
}

.empty-state__mark,
.loader {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
}

.loader {
  border-color: rgba(86, 214, 208, 0.14);
  border-top-color: var(--cyan);
  animation: spin 900ms linear infinite;
}

.empty-state strong {
  margin-bottom: 8px;
  font-size: 15px;
}

.empty-state p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.empty-state[data-state="error"] {
  border-color: rgba(255, 140, 134, 0.2);
}

.empty-state[data-state="error"] .empty-state__mark {
  color: var(--red);
  border-color: rgba(255, 140, 134, 0.24);
}

.bot-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(210px, 0.78fr) auto;
  gap: 24px;
  align-items: center;
  padding: 21px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(110deg, rgba(16, 33, 41, 0.9), rgba(10, 23, 28, 0.74));
}

.bot-card[data-state="inactive"] {
  border-color: rgba(233, 185, 103, 0.18);
}

.bot-card__main {
  min-width: 0;
}

.bot-card__identity {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 17px;
}

.bot-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid rgba(86, 214, 208, 0.28);
  border-radius: 12px;
  color: var(--cyan-strong);
  background: rgba(86, 214, 208, 0.07);
  font-size: 14px;
  font-weight: 900;
}

.bot-card__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.bot-name {
  margin: 0;
  font-size: 16px;
}

.bot-state,
.persistence-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(112, 214, 160, 0.2);
  border-radius: 999px;
  color: #a1e5bf;
  background: rgba(112, 214, 160, 0.06);
  font-size: 10px;
  font-weight: 800;
}

.bot-card[data-state="inactive"] .bot-state {
  border-color: rgba(233, 185, 103, 0.22);
  color: #eacb95;
  background: rgba(233, 185, 103, 0.06);
}

.bot-id {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.bot-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(60px, 1fr));
  gap: 10px;
  margin: 0;
}

.bot-stats div {
  min-width: 0;
}

.bot-stats dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bot-stats dd {
  overflow: hidden;
  margin: 0;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-card__health {
  min-width: 0;
}

.bot-card__health > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 10px;
}

.bot-card__health > div:first-child span {
  color: var(--muted);
}

.bot-health-label {
  overflow: hidden;
  color: var(--muted-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-track {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: rgba(151, 193, 207, 0.12);
}

.health-track::-webkit-progress-bar {
  border-radius: inherit;
  background: rgba(151, 193, 207, 0.12);
}

.health-track::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(90deg, #52bd82, var(--green));
}

.health-track::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, #52bd82, var(--green));
}

.bot-card[data-state="inactive"] .health-track::-webkit-progress-value {
  background: var(--amber);
}

.bot-card[data-state="inactive"] .health-track::-moz-progress-bar {
  background: var(--amber);
}

.bot-state-copy {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.bot-card__actions {
  display: grid;
  justify-items: end;
  gap: 11px;
}

.persistence-pill[data-state="temporary"] {
  border-color: var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.danger-button {
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid rgba(255, 140, 134, 0.22);
  color: #ffb7b2;
  background: rgba(255, 140, 134, 0.055);
  font-size: 11px;
}

.danger-button:hover:not(:disabled) {
  border-color: rgba(255, 140, 134, 0.4);
  color: #ffd0cd;
  background: rgba(255, 140, 134, 0.1);
}

.danger-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(4, 10, 13, 0.6);
  font-size: 10px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(390px, calc(100vw - 44px));
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: rgba(13, 29, 35, 0.96);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 180ms ease-out;
}

.toast[data-state="error"] {
  border-color: rgba(255, 140, 134, 0.28);
}

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

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .test-note {
    max-width: 620px;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .metric:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .bot-card {
    grid-template-columns: 1fr auto;
  }

  .bot-card__health {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .bot-card__actions {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 650px) {
  .topbar {
    min-height: 66px;
    padding-inline: 16px;
  }

  .brand__text small,
  .test-badge {
    display: none;
  }

  .connection-state {
    font-size: 11px;
  }

  .shell {
    width: min(100% - 28px, 1220px);
    padding: 48px 0 68px;
  }

  .hero {
    gap: 28px;
    margin-bottom: 34px;
  }

  .hero h1 {
    font-size: clamp(37px, 12vw, 54px);
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metric + .metric,
  .metric:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .spawn-panel,
  .info-panel {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .field__label-row {
    align-items: flex-start;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .bot-card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 18px;
  }

  .bot-card__health,
  .bot-card__actions {
    grid-column: auto;
    grid-row: auto;
  }

  .bot-card__actions {
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: stretch;
  }

  .bot-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 13px;
  }

  .footer {
    flex-direction: column;
  }
}

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