:root {
  --navy: #0F172A;
  --navy2: #1E293B;
  --blue: #2563EB;
  --cyan: #06B6D4;
  --text: #E2E8F0;
  --muted: #94A3B8;
  --line: rgba(148, 163, 184, .16);
  --card: rgba(30, 41, 59, .55);
  --ok: #34D399;
  --err: #F87171;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: radial-gradient(1100px 520px at 50% -8%, rgba(37, 99, 235, .28), transparent 62%), var(--navy);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.top {
  width: 100%; max-width: 1040px; margin: 0 auto;
  padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 600; color: #CBD5E1; white-space: nowrap; }
.brand svg { height: 34px; width: auto; }
.server-tag { font-size: 13px; color: var(--muted); }
.server-tag strong { color: var(--text); font-weight: 600; margin-left: 6px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 8px 24px 40px; flex: 1; }
.hero { text-align: center; margin: 18px 0 26px; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 10px; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 560px; font-size: 15px; line-height: 1.55; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 24px 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px rgba(2, 6, 23, .45);
}

.gauge-wrap { position: relative; max-width: 420px; margin: 0 auto; }
#gauge { width: 100%; height: auto; display: block; }
.g-track { fill: none; stroke: rgba(148, 163, 184, .18); stroke-width: 14; stroke-linecap: round; }
.g-fill { fill: none; stroke: url(#gfill); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16; transition: stroke-dashoffset .18s linear; filter: drop-shadow(0 0 8px rgba(6, 182, 212, .45)); }
.g-dot { fill: #fff; stroke: rgba(6, 182, 212, .6); stroke-width: 3; transition: cx .18s linear, cy .18s linear; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .8)); }
#gaugeTicks text { fill: var(--muted); font-size: 9px; font-weight: 600; text-anchor: middle; dominant-baseline: middle; }
#gaugeTicks line { stroke: rgba(148, 163, 184, .35); stroke-width: 1.5; }
.gauge-center { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; pointer-events: none; }
.gauge-center .phase { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.gauge-center .value { font-size: clamp(38px, 9vw, 56px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.gauge-center .unit { font-size: 13px; color: var(--muted); font-weight: 600; }

.progress { height: 4px; border-radius: 999px; background: rgba(148, 163, 184, .15); overflow: hidden; margin: 6px auto 22px; max-width: 420px; }
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .15s linear; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric { background: rgba(15, 23, 42, .55); border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; text-align: center; }
.metric .label { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.metric .val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric .u { font-size: 12px; color: var(--muted); margin-left: 4px; font-weight: 600; }
.metric.dl .val { color: #60A5FA; }
.metric.ul .val { color: #22D3EE; }

.controls { display: flex; gap: 12px; align-items: flex-end; margin-top: 22px; flex-wrap: wrap; }
.field { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.field input {
  font: inherit; font-size: 15px; font-weight: 500; letter-spacing: 0; text-transform: none;
  padding: 13px 14px; border-radius: 12px; color: var(--text);
  background: rgba(15, 23, 42, .7); border: 1px solid rgba(148, 163, 184, .3); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(6, 182, 212, .2); }
.field input[readonly] { color: var(--muted); }
.btn {
  font: inherit; font-size: 15px; font-weight: 700; color: #fff; cursor: pointer;
  padding: 14px 26px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 10px 24px rgba(37, 99, 235, .35);
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(37, 99, 235, .45); }
.btn:active { transform: translateY(0); }
.btn.stop { background: linear-gradient(135deg, #DC2626, #F97316); box-shadow: 0 10px 24px rgba(220, 38, 38, .3); }
.btn.ghost { background: transparent; border: 1px solid rgba(148, 163, 184, .3); box-shadow: none; color: var(--text); padding: 10px 16px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }

.status { margin-top: 14px; min-height: 20px; font-size: 13px; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.actions { margin-top: 10px; display: flex; gap: 10px; }
.actions[hidden] { display: none; }

.info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.info > div { background: rgba(30, 41, 59, .35); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.info .k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.info .v { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tips { margin-top: 26px; color: var(--muted); font-size: 14px; }
.tips h2 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 8px; color: var(--muted); }
.tips ul { margin: 0; padding-left: 18px; line-height: 1.7; }
.tips strong { color: var(--text); font-weight: 600; }

.foot { max-width: 1040px; width: 100%; margin: 0 auto; padding: 18px 24px 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .info { grid-template-columns: 1fr; }
  .panel { padding: 20px 16px 18px; border-radius: 18px; }
  .btn { width: 100%; }
  .server-tag { display: none; }
}
