:root {
  --bg: #0d0f13;
  --bg2: #13161c;
  --card: #171a21;
  --line: #262a33;
  --text: #eef0f3;
  --muted: #a3a8b3;
  --dim: #6d7380;
  --accent: #3987e5;
  --accent2: #5aa2ff;
  --teal: #2cc3b0;
  --amber: #f0b44c;
  --red: #ef6b6b;
  --radius: 14px;
  --max: 1120px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
  background-image: radial-gradient(1000px 500px at 85% -10%, rgba(57,135,229,.12), transparent 60%),
                    radial-gradient(800px 400px at -10% 10%, rgba(44,195,176,.07), transparent 60%);
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 13px; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px;
  padding: 12px max(16px, calc((100vw - var(--max)) / 2));
  background: rgba(13,15,19,.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 26px; height: 26px; color: var(--muted); }
.tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--amber);
  border: 1px solid rgba(240,180,76,.35); background: rgba(240,180,76,.08); padding: 2px 8px; border-radius: 999px; }
.nav nav { display: flex; gap: 4px; flex: 1; }
.nav nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.nav nav a:hover { color: var(--text); text-decoration: none; background: rgba(255,255,255,.04); }
.nav nav a.on { color: var(--text); background: rgba(57,135,229,.14); }
.who { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.who button { margin-left: 8px; }

.netbar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim);
  padding: 6px max(16px, calc((100vw - var(--max)) / 2)); border-bottom: 1px solid rgba(255,255,255,.03); }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.led.ok { background: var(--teal); box-shadow: 0 0 8px rgba(44,195,176,.6); }
.led.bad { background: var(--red); }

main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 32px 16px 64px; outline: none; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--dim);
  padding: 18px max(16px, calc((100vw - var(--max)) / 2)); border-top: 1px solid rgba(255,255,255,.05); }
.foot a { color: var(--muted); }

/* layout */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.head h1 { font-size: 28px; font-weight: 800; }
.head p { color: var(--muted); margin-top: 6px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--muted); }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.space { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.break { word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* hero */
.hero { padding: 28px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center;
  background: linear-gradient(135deg, rgba(57,135,229,.12), rgba(44,195,176,.06)); }
.hero h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
.hero p { color: var(--muted); margin-top: 10px; max-width: 560px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; color: var(--muted); }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--text); background: rgba(57,135,229,.25); }
.steps li.done::before { content: "✓"; background: rgba(44,195,176,.3); }
.steps li b { color: var(--text); font-weight: 600; }

/* forms */
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--dim); margin-top: 4px; }
input, select, textarea {
  width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 14px; outline: none; transition: border-color .15s;
}
textarea { font-family: var(--mono); font-size: 13px; min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=file] { padding: 8px; }
.field { min-width: 0; }
details { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: rgba(255,255,255,.01); }
details summary { cursor: pointer; font-weight: 600; color: var(--muted); }
details[open] summary { margin-bottom: 14px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 1px solid var(--line);
  background: rgba(255,255,255,.03); color: var(--text); font: inherit; font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: 10px; transition: background .15s, border-color .15s, transform .15s;
}
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .btn.primary { background: linear-gradient(135deg, var(--accent), #2463c9); border-color: transparent; color: #fff; }
button.primary:hover { transform: translateY(-1px); }
button.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button.danger { color: var(--red); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--dim);
  padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
tr.link { cursor: pointer; }
tr.link:hover td { background: rgba(255,255,255,.02); }
.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 16px; }
.kv dt { color: var(--dim); font-size: 13px; }
.kv dd { margin: 0; min-width: 0; word-break: break-all; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.run { color: var(--accent2); background: rgba(57,135,229,.14); }
.badge.ok { color: var(--teal); background: rgba(44,195,176,.12); }
.badge.warn { color: var(--amber); background: rgba(240,180,76,.12); }
.badge.bad { color: var(--red); background: rgba(239,107,107,.12); }

/* timeline */
.tl { display: flex; gap: 0; margin: 8px 0 4px; }
.tl div { flex: 1; text-align: center; font-size: 11px; color: var(--dim); position: relative; padding-top: 18px; }
.tl div::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--line); }
.tl div::after { content: ""; position: absolute; top: 0; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.tl div.done { color: var(--muted); }
.tl div.done::before, .tl div.done::after { background: var(--teal); }
.tl div.now { color: var(--text); font-weight: 600; }
.tl div.now::after { background: var(--accent2); box-shadow: 0 0 0 4px rgba(90,162,255,.2); }
.tl div.fail::after { background: var(--red); }

.notice { border: 1px solid rgba(240,180,76,.3); background: rgba(240,180,76,.06); color: #f3d79e; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.notice.info { border-color: rgba(57,135,229,.3); background: rgba(57,135,229,.07); color: #b9d5f7; }
.notice.err { border-color: rgba(239,107,107,.35); background: rgba(239,107,107,.07); color: #f6c1c1; }
pre.cli { background: #0a0c10; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px; color: #cfe3ff; margin: 0; white-space: pre-wrap; word-break: break-all; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal .card { width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: #1f2430; border: 1px solid var(--line); color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.err { border-color: rgba(239,107,107,.5); }

@media (max-width: 860px) {
  .nav { flex-wrap: wrap; gap: 10px; }
  .nav nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .hero, .g2, .g3 { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .hide-sm { display: none; }
}
