:root {
  --bg: #0e1116;
  --panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #7d8590;
  --accent: #2f81f7;
  --green: #3fb950;
  --red: #f85149;
  --amber: #d29922;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
h1 { margin: 0; font-size: 20px; }
h2 { margin: 0 0 12px; font-size: 16px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 24px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px 14px;
}
label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
  gap: 4px;
}
label.check {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
}
input, select {
  background: #0d1117;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}
input:focus, select:focus { outline: 1px solid var(--accent); }
button {
  background: #21262d;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); }
button.danger { background: #3b1418; border-color: #6e2127; color: #ffa198; }
.muted { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.rowhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.auth { display: flex; gap: 8px; align-items: center; }
.auth input { width: 220px; }
.key-create { display: flex; gap: 8px; margin: 12px 0; }
.key-create input { min-width: 260px; }
.secret {
  background: #0d1117;
  border: 1px solid var(--amber);
  border-radius: 6px;
  color: #ffdf8b;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  margin: 8px 0 12px;
  padding: 10px;
  word-break: break-all;
}
.hidden { display: none; }
.key-row {
  align-items: center;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 10px 12px;
}
.key-row span { color: var(--muted); display: block; font-size: 12px; margin-top: 2px; }
.key-actions { display: flex; gap: 8px; }
.provider {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: #0d1117;
}
.phead { display: flex; justify-content: space-between; margin-bottom: 8px; }
.pstate { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #21262d; color: var(--muted); }
.pstate.up { background: #0f3d1f; color: var(--green); }
.pstate.down { background: #3b1418; color: var(--red); }
.pactions { display: flex; gap: 8px; margin-top: 12px; }
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 360px;
}
.toast-item {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 6px;
  margin-top: 6px;
  font-size: 13px;
}
.toast-item.err { border-color: var(--red); color: #ffa198; }
.toast-item.ok { border-color: var(--green); color: #7ee787; }
