:root {
  color-scheme: dark;
  font: 16px/1.5 system-ui, sans-serif;
  --surface: rgba(22, 12, 39, .9);
  --line: #53406b;
  --text: #f1ecff;
  --muted: #bdb1d4;
  --accent: #75efd7;
  background: #0b0615;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(160deg, #180d2be8, #0b0615f0), url('/media/bg-poster.jpg') center / cover fixed; }
header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem 5vw; border-bottom: 1px solid var(--line); background: #130a22; }
header a { color: #d3a8ff; font-weight: 800; text-decoration: none; letter-spacing: .08em; }
header a span { color: var(--text); font-weight: 550; letter-spacing: normal; }
#identity { color: var(--muted); }
.shell { max-width: 90rem; margin: auto; display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: 85vh; }
nav { border-right: 1px solid var(--line); padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: .4rem; background: #100a1bbd; }
nav:empty { display: none; }
.shell:has(nav:empty) { grid-template-columns: minmax(0, 42rem); justify-content: center; }
main { padding: clamp(1rem, 3vw, 2.5rem); min-width: 0; }
h1 { margin: 0 0 1.25rem; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15; }
h2 { font-size: 1.25rem; margin-top: 1.6rem; }
h3 { margin: 0 0 .4rem; }
p { margin: .4rem 0 1rem; }
.card, form, #notice { background: var(--surface); padding: 1rem; border: 1px solid var(--line); border-radius: .75rem; margin: 0 0 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .75rem; }
.actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #261639; padding: .5rem .85rem; border-radius: .5rem; }
button:hover, button[aria-current="page"] { border-color: var(--accent); }
button.primary { background: var(--accent); color: #0c2621; border-color: var(--accent); font-weight: 700; }
button:disabled { opacity: .6; cursor: wait; }
nav button { text-align: left; }
.nav-group { display: grid; gap: .35rem; margin-bottom: .65rem; }
.nav-label { color: var(--muted); font-size: .78rem; padding: 0 .4rem; }
.nav-link { padding: .5rem .85rem; }
label { display: block; margin: 0 0 .8rem; font-weight: 650; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; background: #0f091a; padding: .55rem; margin-top: .2rem; border: 1px solid var(--line); border-radius: .45rem; }
input[type=checkbox] { margin-right: .55rem; }
small, .muted { color: var(--muted); font-weight: normal; }
code { overflow-wrap: anywhere; color: var(--accent); }
.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .65rem; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
td { vertical-align: top; min-width: 5rem; }
#notice[data-error=true] { border-color: #f39d9c; color: #ffc2c1; }
canvas { width: 100%; height: auto; display: block; }
.motd { white-space: pre-line; }
.metric { font-size: 2rem; font-weight: 750; color: var(--accent); }
.server-card { min-width: 0; }
.server-card > .actions { margin-top: .85rem; }
.state { color: var(--muted); }
.state[data-online=true] { color: var(--accent); }
.console { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 28rem; overflow: auto; font-size: .85rem; }
.totp-qr { display: block; max-width: 100%; height: auto; border-radius: .5rem; }
a { color: #d3a8ff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 680px) {
  .shell { display: block; }
  nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .65rem; }
  nav button { white-space: nowrap; }
  .nav-group { margin: 0; min-width: max-content; }
  .nav-link { white-space: nowrap; }
}
