:root {
  --bg: #0b0b0d;
  --panel: #141417;
  --panel-2: #1b1b1f;
  --line: #2a2a30;
  --ink: #f2f2f4;
  --ink-dim: #9c9ca6;
  --brand: #ff6a1a;
  --brand-lift: #ff9420;
  --ok: #35c07a;
  --err: #ff6b6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
.muted { color: var(--ink-dim); }
.sm { font-size: 13px; }
.err { color: var(--err); font-size: 13px; }

.btn {
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #2a2a30;
  color: var(--ink);
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
}
.btn:hover { background: #35353d; }
.btn--brand { background: var(--brand); color: #0a0a0a; font-weight: 600; }
.btn--brand:hover { background: var(--brand-lift); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { border-color: #4a4a55; background: #1e1e23; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Login */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate__box {
  width: min(100%, 360px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  display: grid;
  gap: 10px;
}
.gate__box h1 { margin: 0; font-size: 20px; }
.gate__box p { margin: 0 0 8px; font-size: 13px; }
.gate__box label { font-size: 12px; color: var(--ink-dim); }
.gate__box input {
  padding: 10px 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
}
.gate__box input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Shell */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.top__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

.tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 12px 20px 0;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  padding: 8px 14px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--ink-dim); cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-current="true"] { color: var(--ink); border-bottom-color: var(--brand); }

.pane { padding: 24px 20px 120px; max-width: 940px; margin: 0 auto; }

/* Fields */
.grp { margin-bottom: 30px; }
.grp > h2 { font-size: 15px; margin: 0 0 4px; }
.grp > p { margin: 0 0 14px; font-size: 13px; color: var(--ink-dim); }
.f { display: grid; gap: 5px; margin-bottom: 13px; }
.f label { font-size: 12px; color: var(--ink-dim); }
.f input, .f textarea {
  width: 100%; padding: 9px 11px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
}
.f textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
.f input:focus, .f textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.f .hint { font-size: 11px; color: #6e6e78; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
@media (max-width: 620px) { .row2 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; margin-bottom: 12px;
}
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card__head strong { font-size: 13px; }
.card__head .btn { margin-left: auto; padding: 5px 10px; font-size: 12px; }

/* Collapsible cards — used for help articles, where 15 open forms is unusable. */
details.card > summary {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 13px; font-weight: 600; list-style: none;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before {
  content: "▸"; color: var(--brand); font-size: 11px; transition: rotate .15s;
}
details.card[open] > summary::before { rotate: 90deg; }
details.card > summary em {
  margin-left: auto; font-style: normal; font-size: 11px; font-weight: 500;
  color: var(--ink-dim); text-transform: uppercase; letter-spacing: .06em;
}
details.card[open] > summary { margin-bottom: 14px; }
details.card .btn { margin-top: 6px; }

.f select {
  width: 100%; padding: 9px 11px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
}
.f select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }

/* Save bar */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: var(--panel); border-top: 1px solid var(--brand);
}
.bar span { margin-right: auto; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 76px; translate: -50% 0; z-index: 9;
  padding: 10px 18px; border-radius: 8px;
  background: #23232a; border: 1px solid var(--line); font-size: 13px;
}
.toast.ok { border-color: var(--ok); }
.toast.bad { border-color: var(--err); }

pre.log {
  background: #0e0e11; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; font-size: 12px; overflow-x: auto; white-space: pre-wrap;
  color: var(--ink-dim);
}
