:root {
  --bg: #111418;
  --panel: #1a1f25;
  --line: #2a313a;
  --text: #e8ecf1;
  --muted: #8a96a3;
  --red: #d32f2f;
  --red-hi: #ff5252;
  --green: #2e7d32;
  --amber: #f9a825;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
main { max-width: 560px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 8px; }
h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 8px; }
header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
header #refresh { margin-left: auto; }
.hint.updated { text-align: right; margin: -10px 0 10px; font-size: 12px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; text-align: center; margin: 6px 0 16px; }
.err { color: var(--red-hi); min-height: 1.4em; }

button, input {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: #2b5cad; border-color: #2b5cad; }
button.link { background: none; border: none; color: var(--muted); padding: 4px; }
button.small { padding: 6px 10px; font-size: 14px; }
button.danger { color: var(--red-hi); }
input { width: 100%; }
label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
label input { margin-top: 4px; color: var(--text); }

.big {
  display: block; width: 100%; border: none; border-radius: 18px;
  font-weight: 800; letter-spacing: .06em; color: #fff;
}
.big.stop { background: var(--red); font-size: 34px; padding: 44px 16px; box-shadow: 0 6px 24px rgba(211, 47, 47, .35); }
.big.stop:active { transform: scale(.98); }
.big.stop.armed { background: var(--red-hi); animation: pulse .5s infinite alternate; font-size: 24px; }
.big.start { background: var(--green); font-size: 20px; padding: 18px 16px; }
@keyframes pulse { to { box-shadow: 0 0 0 8px rgba(255, 82, 82, .35); } }

.badge { background: var(--red); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.panel.on { border-color: var(--red); }
.panel p { margin: 0 0 10px; }
summary { cursor: pointer; font-weight: 600; }
#msg { min-height: 1.4em; text-align: center; }
#msg.bad { color: var(--red-hi); }

.acct { margin-bottom: 18px; }
.srv {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px;
}
.srv .name { font-weight: 600; overflow-wrap: anywhere; }
.srv .ip { color: var(--muted); font-size: 13px; }
.srv .info { flex: 1 1 140px; min-width: 0; }
.srv .btns { display: flex; gap: 6px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--line); }
.pill.ok { background: #1b5e20; }
.pill.stopped { background: #5d1a1a; }
.pill.restarting, .pill.launching, .pill.rebuilding { background: #6b5200; }
.pill.error { background: var(--red); }

ul.plain, ol.plain { list-style: none; padding: 0; margin: 0 0 12px; }
#accList li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.log li { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.log time { color: var(--muted); margin-right: 6px; }
.log b { margin-right: 6px; }

.secret { font: 600 18px ui-monospace, Consolas, monospace; letter-spacing: .08em; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-wrap: anywhere; user-select: all; }
a { color: #7fb0ff; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; width: min(340px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog input { font-size: 24px; letter-spacing: .3em; text-align: center; margin-bottom: 12px; }
.row { display: flex; gap: 8px; justify-content: flex-end; }
