:root {
  color-scheme: dark;
  --bg: #05090a;
  --panel: #081110;
  --line: rgba(25, 245, 210, .22);
  --muted: #8ca59f;
  --text: #eefcf8;
  --cyan: #19f5d2;
  --lime: #b6ff6a;
  --warn: #ffd37a;
  --error: #ff9caf;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.topbar,
.section-head,
.agent-head,
.agent-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1, h2, p { margin: 0; }
h1 { font-size: 20px; }
h2 { color: var(--cyan); font-size: 14px; text-transform: uppercase; }

.topbar {
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.topbar p,
.meta,
.history-row,
label {
  color: var(--muted);
}

.panel {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(132, 255, 238, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
  padding: 14px;
}

.narrow {
  width: min(420px, 100%);
}

.dashboard {
  display: grid;
  gap: 16px;
}

button,
input,
textarea {
  border: 1px solid rgba(132, 255, 238, .18);
  border-radius: 7px;
  background: rgba(0, 0, 0, .25);
  color: var(--text);
  font: inherit;
}

button {
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
  color: var(--cyan);
  font-weight: 760;
}

button:hover,
button:focus-visible,
input:focus,
textarea:focus {
  border-color: var(--cyan);
  outline: none;
}

input {
  height: 32px;
  padding: 0 10px;
}

textarea {
  min-height: 110px;
  resize: vertical;
  padding: 10px;
}

form,
.settings-grid,
.agent-list,
.agent-card,
.history {
  display: grid;
  gap: 10px;
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 720;
}

.wide {
  grid-column: 1 / -1;
}

.agent-card {
  border: 1px solid rgba(132, 255, 238, .14);
  border-radius: 8px;
  background: rgba(0, 0, 0, .20);
  padding: 12px;
}

.agent-title {
  min-width: 0;
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  border: 1px solid rgba(25, 245, 210, .26);
  border-radius: 999px;
  color: var(--cyan);
  padding: 3px 8px;
  font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-transform: uppercase;
}

.meta,
.history-row {
  font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

.history-message {
  display: flex;
  min-width: 0;
  gap: 8px;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-event {
  flex: 0 0 auto;
  border: 1px solid rgba(25, 245, 210, .22);
  border-radius: 999px;
  color: var(--cyan);
  padding: 1px 6px;
  text-transform: uppercase;
}

.error { color: var(--error); }

@media (max-width: 760px) {
  .settings-grid { grid-template-columns: 1fr; }
  .topbar, .agent-head, .agent-actions { align-items: stretch; flex-direction: column; }
}
