:root {
  --bg0: #0c1210;
  --bg1: #14201c;
  --bg2: #1b2b25;
  --line: #2a3d35;
  --text: #e7f0ea;
  --muted: #8aa398;
  --accent: #3ecf8e;
  --warn: #e6b84d;
  --bad: #e86a5c;
  --ok: #3ecf8e;
  --card: rgba(20, 32, 28, 0.92);
  --radius: 14px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg0);
  line-height: 1.45;
}

.bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, #1a3d32 0%, transparent 55%),
    radial-gradient(700px 400px at 90% 0%, #243528 0%, transparent 50%),
    linear-gradient(180deg, #0c1210, #101816 40%, #0c1210);
}

.top {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  background: rgba(12, 18, 16, 0.75);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; gap: 0.75rem; align-items: center; min-width: 180px; }
.brand strong { display: block; letter-spacing: 0.02em; }
.brand .muted { font-size: 0.8rem; color: var(--muted); }
.mark { color: var(--accent); font-size: 1.4rem; }

.tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; flex: 1; }
.tabs button, .ghost, .btn {
  font: inherit; cursor: pointer; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 0.45rem 0.9rem;
}
.tabs button.active, .btn.primary {
  background: var(--accent); color: #062016; border-color: var(--accent); font-weight: 600;
}
.ghost:hover, .tabs button:hover { color: var(--text); border-color: var(--muted); }

main { padding: 1.25rem 1.5rem 3rem; max-width: 1200px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; animation: in 0.25s ease; }
@keyframes in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; }
h3 { font-size: 0.95rem; margin: 1.5rem 0 0.75rem; color: var(--muted); font-weight: 500; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}
.stat, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.stat .label { color: var(--muted); font-size: 0.8rem; }
.stat .value { font-size: 1.6rem; font-weight: 600; margin-top: 0.25rem; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: rgba(62, 207, 142, 0.04); }

.mono { font-family: var(--mono); font-size: 0.85rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500;
  border: 1px solid var(--line);
}
.pill.ok { color: var(--ok); border-color: rgba(62,207,142,0.35); background: rgba(62,207,142,0.08); }
.pill.bad { color: var(--bad); border-color: rgba(232,106,92,0.35); background: rgba(232,106,92,0.08); }
.pill.warn { color: var(--warn); border-color: rgba(230,184,77,0.35); background: rgba(230,184,77,0.08); }

.bar {
  height: 6px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin-top: 0.35rem; min-width: 80px;
}
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }

.edge {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.75rem 0; border-bottom: 1px solid var(--line);
}
.edge .path { font-family: var(--mono); font-size: 0.82rem; }
.form {
  display: grid; gap: 0.75rem; max-width: 420px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem;
}
.form label { display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.form input, .form select {
  font: inherit; color: var(--text); background: var(--bg0);
  border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.7rem;
}
.form .row { display: flex; gap: 0.75rem; align-items: center; }
.form .row label { display: flex; gap: 0.5rem; align-items: center; color: var(--text); }
.result {
  margin-top: 1rem; padding: 1rem; border-radius: var(--radius);
  border: 1px solid rgba(62,207,142,0.35); background: rgba(62,207,142,0.08);
  font-family: var(--mono); font-size: 0.8rem; white-space: pre-wrap; word-break: break-all;
}
#toast {
  position: fixed; bottom: 1.25rem; right: 1.25rem;
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  padding: 0.75rem 1rem; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.muted { color: var(--muted); }
.scroll { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
@media (max-width: 720px) {
  .top { padding: 0.85rem 1rem; }
  main { padding: 1rem; }
}
