:root {
  --bg: #0b0d10;
  --card: #14181d;
  --card-2: #1b2027;
  --line: #262d36;
  --text: #e8edf3;
  --muted: #8b98a8;
  --accent: #3ddc97;
  --danger: #ff5d5d;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: radial-gradient(1200px 600px at 20% -10%, #16202a 0%, var(--bg) 55%);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  padding: 32px 16px 48px;
}

.shell {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  font-size: 20px;
  font-weight: 650;
  margin: 0;
  letter-spacing: -0.01em;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a4450;
  transition: background 200ms ease, box-shadow 200ms ease;
}

.dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.15);
}

.dot.busy {
  background: #f0b429;
  box-shadow: 0 0 0 4px rgba(240, 180, 41, 0.15);
}

.dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 93, 93, 0.15);
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

select {
  appearance: none;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  width: 100%;
}

select:disabled {
  opacity: 0.65;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 11px 18px;
  cursor: pointer;
  transition: transform 80ms ease, background 150ms ease, border-color 150ms ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #06231a;
  flex: 1;
  min-width: 140px;
}

.btn-primary:hover:not(:disabled) {
  background: #4be8a7;
}

.btn-ghost {
  background: var(--card-2);
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover:not(:disabled) {
  border-color: #3a4553;
}

.btn.danger {
  background: rgba(255, 93, 93, 0.12);
  color: #ff8a8a;
  border-color: rgba(255, 93, 93, 0.35);
}

.meter {
  height: 6px;
  background: var(--card-2);
  border-radius: 999px;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2fbf87, var(--accent));
  transition: width 90ms linear;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.facts div {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
}

.facts dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 3px;
}

.facts dd {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-card h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
  font-weight: 600;
}

.log {
  margin: 0;
  max-height: 190px;
  overflow: auto;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #9fb0c0;
  white-space: pre-wrap;
  word-break: break-word;
}

.log .err {
  color: #ff8a8a;
}

.log .ok {
  color: #6fe3b0;
}

@media (max-width: 520px) {
  .facts {
    grid-template-columns: 1fr;
  }
}
