.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg1);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: .02em;
}
.brand .mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--blu);
  color: var(--bg0);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.shell { max-width: 980px; margin: 0 auto; padding: 28px; display: flex; flex-direction: column; gap: 20px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 360px;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 32px;
  display: flex; flex-direction: column; gap: 18px;
}

h1 { font-size: 20px; font-weight: 700; margin: 0; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 700; margin: 0; }
.sub { color: var(--t2); font-size: 13.5px; line-height: 1.5; margin: 0; }

label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 6px;
}
.field { display: flex; flex-direction: column; }
.field-hint { font-size: 11.5px; color: var(--t3); margin-top: 5px; }

input[type="text"], input[type="url"], input[type="password"], select, textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--t1);
}
select { font-family: var(--font-sans); }
textarea { min-height: 72px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--blu);
  outline-offset: 1px;
}
input::placeholder, textarea::placeholder { color: var(--t3); }

button {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13.5px;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 10px 15px;
  cursor: pointer;
  transition: filter .15s ease;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--blu); color: var(--bg0); }
.btn-secondary { background: var(--bg2); color: var(--t1); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--t2); border-color: var(--line); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: center; }

.card {
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 24px;
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--t3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 0 10px 10px; font-weight: 700; }
td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: var(--bg2); }
.table-wrap { overflow-x: auto; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.pending { background: var(--amb-soft); color: var(--amb); }
.pill.connected { background: var(--grn-soft); color: var(--grn); }
.pill.disabled { background: var(--bg3); color: var(--t3); }

.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--t2); }
.empty { color: var(--t3); font-size: 13.5px; padding: 24px 0; text-align: center; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--t3);
  margin: 4px 0 -4px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.section-title:first-child { border-top: none; padding-top: 0; }

.method-pair { display: flex; gap: 8px; }
.method-pair select { max-width: 92px; flex: none; }
.method-pair input { flex: 1; }

details.debug { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
details.debug summary { cursor: pointer; font-weight: 700; font-size: 13px; }
details.debug pre {
  margin: 10px 0 0;
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  max-height: 260px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--t2);
}
.test-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.banner { border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.banner.err { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-line); }
.banner.ok { background: var(--grn-soft); color: var(--grn); border: 1px solid var(--grn-line); }
.banner.info { background: var(--blu-soft); color: var(--blu); border: 1px solid var(--blu-line); }

.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; }

[hidden] { display: none !important; }
