:root {
  --bg: #0b0f14;
  --card: #121821;
  --text: #e7eef7;
  --muted: #8b9bb0;
  --line: #1e2a3a;
  --acc: #3d8bfd;
  --ok: #1f6f4a;
  --err: #8b2e2e;
  --warn: #8a6d1d;
  --danger: #b33a3a;
  --radius: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 10% -10%, #152033 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(11,15,20,.9); backdrop-filter: blur(8px);
}
.brand { font-weight: 700; color: var(--text); letter-spacing: .2px; }
nav { display: flex; gap: .9rem; align-items: center; }
main { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }
.foot { text-align: center; padding: 2rem 1rem; font-size: .85rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.card.once { border-color: #c9a227; background: #1a1608; }
h1,h2 { margin: 0 0 .75rem; font-size: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.btn, button, select {
  background: var(--acc); color: #fff; border: 0; border-radius: 8px;
  padding: .55rem .9rem; cursor: pointer; font: inherit;
}
button.warn { background: var(--warn); }
button.danger { background: var(--danger); }
button:hover { filter: brightness(1.08); }
label { display: block; margin: .7rem 0; font-size: .92rem; }
input[type=text], input[type=password], input:not([type]), select {
  width: 100%; margin-top: .3rem; padding: .55rem .7rem;
  border-radius: 8px; border: 1px solid var(--line); background: #0c121a; color: var(--text);
}
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.row input { width: auto; min-width: 160px; flex: 1; margin: 0; }
.check { display: flex; gap: .4rem; align-items: center; white-space: nowrap; margin: 0; }
.check input { width: auto; margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.actions form { display: inline; }
.actions button, .actions select { padding: .35rem .55rem; font-size: .85rem; }
.badge {
  display: inline-block; padding: .15rem .45rem; border-radius: 999px;
  font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  background: #243044; color: #c9d7ea;
}
.badge.approved, .badge.online { background: #143528; color: #8dffc0; }
.badge.pending, .badge.registered { background: #3a2f10; color: #ffd978; }
.badge.revoked, .badge.disabled, .badge.offline { background: #3a1515; color: #ff9d9d; }
.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash.ok { background: #143528; border: 1px solid #1f6f4a; }
.flash.err { background: #3a1515; border: 1px solid #8b2e2e; }
.secret {
  background: #05080c; border: 1px dashed #c9a227; padding: .9rem;
  overflow-x: auto; word-break: break-all; border-radius: 8px; font-size: .9rem;
}
.grid.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.stat .n { font-size: 1.6rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .85rem; }
.bullets { padding-left: 1.1rem; }
.inline { display: inline; margin: 0; }
.inline button { background: transparent; border: 1px solid var(--line); color: var(--text); }
@media (max-width: 720px) {
  .grid.stats { grid-template-columns: 1fr; }
  .row input { min-width: 100%; }
}

/* Tutorial / Markdown */
.tutorial { max-width: 820px; margin: 0 auto 1.5rem; }
.tutorial-top { margin-bottom: .5rem; }
.tutorial-meta { margin: 0 0 1rem; }
.md-body { font-size: .98rem; }
.md-body h1 { font-size: 1.45rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.md-body h2 { font-size: 1.15rem; margin: 1.6rem 0 .7rem; color: #d7e6ff; }
.md-body h3 { font-size: 1.02rem; margin: 1.2rem 0 .5rem; }
.md-body p, .md-body li { color: #d5deea; }
.md-body ul, .md-body ol { padding-left: 1.25rem; }
.md-body a { word-break: break-all; }
.md-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }
.md-body table { width: 100%; border-collapse: collapse; margin: .8rem 0 1rem; font-size: .9rem; }
.md-body th, .md-body td { border: 1px solid var(--line); padding: .45rem .55rem; vertical-align: top; }
.md-body th { background: #0c121a; color: var(--muted); font-weight: 600; }
.md-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; background: #0c121a; padding: .1rem .35rem; border-radius: 5px; }
.md-body pre { background: #05080c; border: 1px solid var(--line); border-radius: 8px; padding: .85rem 1rem; overflow-x: auto; margin: .6rem 0 1rem; }
.md-body pre code { background: transparent; padding: 0; font-size: .84rem; line-height: 1.45; color: #e8f0fa; }
.code-wrap { position: relative; }
.copy-btn {
  position: absolute; top: .45rem; right: .45rem;
  background: #243044; color: #e7eef7; border: 1px solid var(--line);
  border-radius: 6px; padding: .25rem .55rem; font-size: .75rem; cursor: pointer;
}
.copy-btn:hover { filter: brightness(1.12); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* Dual list server permissions */
.dual-lists {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .75rem;
  align-items: center;
}
.dual-col { min-width: 0; }
.dual-h { margin: 0 0 .4rem; font-size: .95rem; color: #d7e6ff; }
.dual-select {
  width: 100%;
  min-height: 240px;
  background: #0c121a;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .35rem;
  font: inherit;
}
.dual-actions {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.dual-actions .btn { min-width: 2.4rem; padding: .4rem .55rem; }
.prompt-cell { max-width: 320px; }
.prompt-pre {
  margin: 0;
  max-height: 7rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .78rem;
  background: #05080c;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .4rem .5rem;
  color: #c9d7ea;
}
.req-group h2 { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.stack-form label { display: block; margin-bottom: .75rem; }
.stack-form input, .stack-form select { width: 100%; max-width: 480px; }
table.mini { width: 100%; font-size: .85rem; margin: .5rem 0 .75rem; border-collapse: collapse; }
table.mini th, table.mini td { text-align: left; padding: .35rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.mini th { color: var(--muted); font-weight: 600; width: 28%; }
@media (max-width: 720px) {
  .dual-lists { grid-template-columns: 1fr; }
  .dual-actions { flex-direction: row; justify-content: center; }
}
