:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2e38;
  --text: #e6e8eb;
  --muted: #8a90a0;
  --accent: #4f8cff;
  --ok: #3ecf8e;
  --warn: #e8b339;
  --err: #f16565;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 24px;
  max-width: 980px;
  margin-inline: auto;
}

h1 { font-size: 20px; margin-bottom: 4px; }
h2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 12px; }
.subtitle { color: var(--muted); margin-top: 0; margin-bottom: 24px; font-size: 13px; }

section.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

section.panel[hidden] { display: none; }

label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=password], textarea, select {
  width: 100%;
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}
textarea { min-height: 90px; font-family: ui-monospace, monospace; font-size: 12px; }

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
  margin-right: 8px;
}
button:disabled { background: #3a3f4c; cursor: not-allowed; }
button.secondary { background: #2a2e38; }
button.danger { background: var(--err); }

.row { display: flex; gap: 24px; flex-wrap: wrap; }
.row > .col { flex: 1; min-width: 320px; }

.list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-top: 8px;
}
.list-item {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #1e222c; }
.list-item.selected { background: #1c2b4d; }
.list-item .meta { color: var(--muted); font-size: 11px; }

.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; margin-left: 6px; }
.pill.ok { background: rgba(62,207,142,0.15); color: var(--ok); }
.pill.warn { background: rgba(232,179,57,0.15); color: var(--warn); }
.pill.err { background: rgba(241,101,101,0.15); color: var(--err); }
.pill.muted { background: rgba(138,144,160,0.15); color: var(--muted); }

.status-line { font-size: 12px; color: var(--muted); margin-top: 6px; }
.error-box {
  background: rgba(241,101,101,0.1);
  border: 1px solid var(--err);
  color: var(--err);
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 10px;
  white-space: pre-wrap;
}
.warn-box {
  background: rgba(232,179,57,0.1);
  border: 1px solid var(--warn);
  color: var(--warn);
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 10px;
}
.ok-box {
  background: rgba(62,207,142,0.1);
  border: 1px solid var(--ok);
  color: var(--ok);
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 10px;
}

.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.selected-summary {
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 12px;
  margin-top: 8px;
}

pre.raw {
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px;
  font-size: 11px;
  max-height: 400px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

ul.plain { margin: 6px 0 0; padding-left: 18px; font-size: 12px; }
