:root {
  --brand: #1d4ed8;
  --teal: #14b8a6;
  --ink: #070b14;
  --card: rgba(15, 22, 36, 0.78);
  --line: rgba(148, 163, 184, 0.16);
  --fg: #e8eef8;
  --muted: #8ea0b8;
  --ok: #14b8a6;
  --warn: #f59e0b;
  --bad: #f43f5e;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(29, 78, 216, 0.28), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(20, 184, 166, 0.14), transparent 50%),
    var(--ink);
  color: var(--fg);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
textarea.input { min-height: 6rem; resize: vertical; }

.shell { display: grid; min-height: 100vh; }
@media (min-width: 880px) {
  .shell { grid-template-columns: 272px 1fr; }
}

.side {
  display: none;
  flex-direction: column;
  padding: 1.1rem 1rem 1.2rem;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 90%, #070b14);
  position: relative;
  overflow: hidden;
  max-height: 100vh;
}
@media (min-width: 880px) { .side { display: flex; } }

.fiber span {
  position: absolute; height: 1px; left: -20%; width: 50%;
  background: linear-gradient(90deg, transparent, #14b8a6, #1d4ed8, transparent);
  opacity: .3; animation: fiber 10s linear infinite;
}
.fiber span:nth-child(2) { top: 30%; animation-duration: 13s; }
.fiber span:nth-child(3) { top: 70%; animation-duration: 16s; width: 70%; }
@keyframes fiber { to { transform: translateX(170%); } }

.brand { display: flex; gap: .75rem; align-items: center; margin-bottom: 1.4rem; position: relative; }
.brand b { display: block; letter-spacing: .04em; }
.brand small { color: var(--teal); font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 2px; position: relative; overflow: auto; flex: 1; padding-bottom: .5rem; }
.nav-g {
  font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--teal); padding: .85rem .75rem .25rem;
}
.nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .48rem .75rem; border-radius: 12px; color: var(--muted); font-size: .92rem;
}
.nav a:hover { color: var(--fg); background: color-mix(in srgb, var(--brand) 14%, transparent); }
.nav a.on {
  color: #fff;
  background: linear-gradient(90deg, #1d4ed8, color-mix(in srgb, #1d4ed8 60%, #14b8a6));
  box-shadow: 0 8px 20px rgba(29, 78, 216, .28);
}

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  padding: .75rem 1.25rem; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 70%, transparent);
}
.content { padding: 1.25rem 1.4rem 2.5rem; }

.kicker { font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--teal); }
h1 { font-size: 1.85rem; margin: .15rem 0 .35rem; letter-spacing: -.03em; }
.lead { color: var(--muted); max-width: 46rem; margin: 0 0 1.2rem; font-size: .92rem; }

.grid { display: grid; gap: .75rem; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(2, 1fr); }
.g4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) {
  .g3 { grid-template-columns: repeat(3, 1fr); }
  .g4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.05rem;
  backdrop-filter: blur(14px);
}
.card.hot { position: relative; overflow: hidden; }
.card.hot::before {
  content: ""; position: absolute; inset: 0 auto auto 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, #1d4ed8, #14b8a6);
}
.card .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.card .num { font-size: 1.65rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: .15rem 0; }
.card .sub { font-size: 11px; color: var(--muted); }

.bar { height: 6px; border-radius: 99px; background: rgba(148,163,184,.15); margin-top: .5rem; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--teal); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 99px; padding: .15rem .55rem;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.ok { color: #5eead4; background: rgba(20,184,166,.14); }
.warn { color: #fcd34d; background: rgba(245,158,11,.14); }
.bad { color: #fda4af; background: rgba(244,63,94,.14); }
.off { color: #cbd5e1; background: rgba(100,116,139,.18); }

.dot { width: 8px; height: 8px; border-radius: 99px; background: #14b8a6; box-shadow: 0 0 0 0 rgba(20,184,166,.55); animation: ping 1.8s infinite; }
.dot.off { background: #64748b; animation: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px transparent; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: 12px; padding: .5rem .9rem; border: 0; cursor: pointer; font-weight: 600;
}
.btn.brand { background: linear-gradient(180deg, #1d4ed8, #14b8a6); color: #fff; box-shadow: 0 6px 20px rgba(29,78,216,.35); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--fg); }
.btn.danger { background: #e11d48; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input {
  width: 100%; max-width: 22rem;
  border-radius: 12px; border: 1px solid var(--line); padding: .55rem .8rem;
  background: color-mix(in srgb, var(--card) 55%, #000 20%); color: var(--fg);
}
pre.diff {
  background: #0b1220; border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem; overflow: auto; font-size: 12px; line-height: 1.45;
  font-family: ui-monospace, Menlo, monospace; max-height: 28rem;
}
select.input { appearance: none; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29,78,216,.3); }

.wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th {
  text-align: left; padding: .65rem .75rem; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
table.data td { padding: .65rem .75rem; border-top: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
table.data a.row { display: contents; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; }
.muted { color: var(--muted); }
.right { text-align: right; }
.down { color: #93c5fd; }
.up { color: #5eead4; }

.toast {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 50;
  padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); box-shadow: 0 12px 40px rgba(0,0,0,.3);
}

.login {
  min-height: 100vh; display: grid;
}
@media (min-width: 900px) { .login { grid-template-columns: 1.1fr .9fr; } }
.login .hero { display: none; padding: 3rem; }
@media (min-width: 900px) { .login .hero { display: flex; flex-direction: column; justify-content: space-between; } }
.login .box { display: grid; place-items: center; padding: 2rem; }
.login form { width: min(380px, 100%); }

.mob {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: var(--card);
}
@media (min-width: 880px) { .mob { display: none; } }

.ranges { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 1rem; }

footer.note { margin-top: auto; font-size: 11px; color: var(--muted); padding-top: 1.5rem; }

[x-cloak] { display: none !important; }

.winpage .btn, .winpage .input, .winpage .card, .winpage .wrap { border-radius: 6px; }

.winbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  margin: 0 0 12px;
  background: linear-gradient(180deg, #1a2740, #121a2b);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.wbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(148,163,184,.22);
  background: linear-gradient(180deg, #243656, #1a2740);
  color: #e8eef8;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
}
.wbtn:hover { border-color: #1d4ed8; background: linear-gradient(180deg, #1d4ed8, #1e3a8a); color: #fff; }
.wbtn:disabled, .wbtn[disabled] { opacity: .35; cursor: not-allowed; pointer-events: none; }
.wbtn.add { color: #5eead4; }
.wbtn.add:hover { background: linear-gradient(180deg, #14b8a6, #0f766e); border-color: #14b8a6; color: #fff; }
.wbtn.rm { color: #fda4af; }
.wbtn.rm:hover { background: linear-gradient(180deg, #e11d48, #9f1239); border-color: #e11d48; color: #fff; }
.wbtn.on { color: #5eead4; font-size: 13px; }
.wbtn.off { color: #fcd34d; font-size: 13px; }
.wbtn.txt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wbtn.ok {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: linear-gradient(180deg, #1d4ed8, #14b8a6); border-color: #1d4ed8; color: #fff;
}
.wsep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.wlab { font-size: 11px; color: var(--muted); margin-left: 4px; }

.winfoot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.hint { font-size: 11px; color: var(--muted); margin: .28rem 0 0; line-height: 1.4; }
.winform { margin-bottom: 1rem; }

table.data tbody tr.pick { cursor: pointer; }
table.data tbody tr.on {
  background: color-mix(in srgb, #1d4ed8 28%, transparent);
  box-shadow: inset 3px 0 0 #1d4ed8;
}

.cmdk {
  position: fixed; inset: 18vh 1rem auto; margin: 0 auto;
  max-width: 32rem; z-index: 80;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: .75rem; box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.cmdk a {
  display: block; padding: .45rem .6rem; border-radius: 8px; color: var(--muted);
}
.cmdk a:hover, .cmdk a.on { background: color-mix(in srgb, var(--brand) 22%, transparent); color: #fff; }

.stick {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  padding: .75rem 1.1rem;
  margin: 1.4rem -1.4rem -2.5rem;
  background: color-mix(in srgb, #1d4ed8 24%, #070b14);
  border-top: 1px solid rgba(29,78,216,.55);
  box-shadow: 0 -12px 30px rgba(0,0,0,.35);
}
