:root {
  --bg: #0d0f12;
  --panel: #171a1f;
  --panel-2: #20242b;
  --line: #2c313a;
  --text: #f2f3f5;
  --muted: #9aa3ae;
  --accent: #ffcf3f;
  --go: #2fd27a;
  --stop: #ff5a5f;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; cursor: pointer; }
a { color: var(--accent); }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
h1 { font-size: 24px; margin: 8px 0 4px; }
h2 { font-size: 18px; margin: 20px 0 8px; }
p.lead { color: var(--muted); margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); text-decoration: none; color: var(--text); font-weight: 600; user-select: none; -webkit-user-select: none; }
.btn:active { transform: scale(0.98); filter: brightness(1.2); }
.btn.primary { background: var(--accent); color: #111; border-color: var(--accent); }
.btn.danger { color: var(--stop); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; }

input[type=text], input[type=url], input[type=password], textarea, select { width: 100%; background: #0b0d10; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
textarea { min-height: 50vh; resize: vertical; line-height: 1.5; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.dot.online { background: var(--go); }
.dot.offline { background: var(--stop); }
.dot.connecting { background: var(--accent); }

.qr { background: #fff; border-radius: 12px; padding: 6px; display: inline-block; line-height: 0; }
.links { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .links { grid-template-columns: 1fr 1fr; } }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; word-break: break-all; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: calc(100% - 32px); }
