:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --border: #2d3a4d;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --accent-dim: #2a5fad;
  --ok: #3ecf8e;
  --err: #f07178;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 52rem;
}

.panel {
  margin: 1rem 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 52rem;
}

.chat-panel {
  margin-bottom: 2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field span {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

textarea {
  resize: vertical;
  min-height: 4.5rem;
  font-family: inherit;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.btn {
  padding: 0.45rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}

.btn:hover:not(:disabled) {
  border-color: var(--muted);
}

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

.btn.primary {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent);
}

.status {
  font-size: 0.85rem;
  color: var(--muted);
}

.status.connected {
  color: var(--ok);
}

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

.output {
  margin-top: 0.75rem;
  padding: 1rem;
  min-height: 8rem;
  max-height: 28rem;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.output .meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}
