:root {
  --bg: #0f1410;
  --panel: #1a221c;
  --ink: #e8f0ea;
  --muted: #8fa396;
  --accent: #3ecf8e;
  --warn: #e6b84d;
  --bad: #e57373;
  --relay: #6ea8fe;
  --local: #9bdb7d;
  --direct: #3ecf8e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #1e3a2f 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #243044 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
}
.wrap { max-width: 720px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.brand {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
}
h1 { font-size: 1.75rem; margin: 0 0 0.4rem; font-weight: 650; }
.sub { color: var(--muted); margin: 0 0 1.75rem; line-height: 1.45; }
.panel {
  background: color-mix(in srgb, var(--panel) 92%, black);
  border: 1px solid #2a362e;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #344239;
  background: #101611;
  color: var(--ink);
  font: inherit;
}
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.4rem; }
button {
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: #062016;
  font-weight: 650;
  cursor: pointer;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #3a4a40;
}
.status { margin: 1.25rem 0; }
.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  background: #243028;
  border: 1px solid #35463a;
}
.mode-chip::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
}
.mode-chip[data-mode="connecting"] { color: var(--warn); border-color: #5a4a20; }
.mode-chip[data-mode="connecting"]::before { background: var(--warn); }
.mode-chip[data-mode="local"] { color: var(--local); }
.mode-chip[data-mode="local"]::before { background: var(--local); }
.mode-chip[data-mode="direct"] { color: var(--direct); }
.mode-chip[data-mode="direct"]::before { background: var(--direct); }
.mode-chip[data-mode="relay"] { color: var(--relay); }
.mode-chip[data-mode="relay"]::before { background: var(--relay); }
.mode-chip[data-mode="failed"] { color: var(--bad); }
.mode-chip[data-mode="failed"]::before { background: var(--bad); }
.detail { color: var(--muted); font-size: 0.9rem; margin: 0.45rem 0 0; }
.out {
  margin: 0.85rem 0 0;
  padding: 0.85rem;
  background: #0c100d;
  border-radius: 8px;
  border: 1px solid #2a362e;
  overflow: auto;
  max-height: 320px;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
