[hidden] { display: none !important; }
:root {
  --bg: #f5f7fb; --panel: #ffffff; --line: #e6e9f2; --fg: #0b1020; --muted: #64708a; --soft: #eef2fb;
  --a: #38bdf8; --b: #818cf8; --up: #10b981; --down: #f43f5e;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #070b16; --panel: #0d1324; --line: #1b2440; --fg: #e8ecf8; --muted: #8b96b3; --soft: #121a30; --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 20px 40px -20px rgba(0, 0, 0, .6); color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; border-radius: 8px; }

.app { max-width: 1320px; margin: 0 auto; padding: 18px 20px 80px; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 12px 0; margin-bottom: 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; text-decoration: none; color: var(--fg); letter-spacing: -.02em; }
.logo svg { color: var(--a); }
.beat { stroke-dasharray: 80; stroke-dashoffset: 80; animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 40%, 60% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -80; } }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1; }
.select { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.select select { appearance: none; border: 0; background: transparent; font: 600 14px var(--sans); color: var(--fg); padding-right: 16px; cursor: pointer; }
.select::after { content: "▾"; position: absolute; right: 10px; color: var(--muted); pointer-events: none; font-size: 11px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; transition: all .15s; }
.seg button.on { background: var(--fg); color: var(--bg); }
.live { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; background: color-mix(in srgb, var(--up) 12%, transparent); color: var(--up); font-weight: 600; font-size: 13px; }
.live b { font-variant-numeric: tabular-nums; font-size: 15px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--up); animation: livep 1.6s infinite; }
@keyframes livep { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); } 100% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); } }
.top-links { display: flex; gap: 6px; }
.top-links a { padding: 7px 11px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--muted); }
.top-links a:hover { background: var(--soft); color: var(--fg); }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.panel { grid-column: span 4; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; letter-spacing: .01em; }
.panel[hidden] { display: none; }

.kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.kpi { text-align: left; border: 0; background: transparent; padding: 18px 20px; display: grid; gap: 4px; cursor: pointer; border-right: 1px solid var(--line); position: relative; transition: background .2s; }
.kpi:last-child { border-right: 0; }
.kpi:hover { background: var(--soft); }
.kpi.on::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--a), var(--b)); }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi-val { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: 12px; font-weight: 600; min-height: 18px; }
.kpi-delta.up { color: var(--up); } .kpi-delta.down { color: var(--down); }

.chart-panel { grid-column: 1 / -1; padding: 18px 18px 12px; }
.chart { position: relative; height: 320px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .ax { fill: var(--muted); font: 500 11px var(--mono); }
.chart .area-a { fill: url(#ga); } .chart .area-b { fill: url(#gb); }
.chart .line-a { fill: none; stroke: var(--a); stroke-width: 2.4; stroke-linejoin: round; }
.chart .line-b { fill: none; stroke: var(--b); stroke-width: 1.6; stroke-dasharray: 4 4; }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.1s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .pt { fill: var(--panel); stroke: var(--a); stroke-width: 2.5; }
.tip { position: absolute; top: 8px; pointer-events: none; padding: 10px 12px; border-radius: 10px; background: var(--fg); color: var(--bg); font-size: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); white-space: nowrap; transform: translateX(-50%); }
.tip b { font-size: 14px; }
.legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; padding: 8px 4px 0; }
.lg { width: 14px; height: 3px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.lg-a { background: var(--a); } .lg-b { background: var(--b); }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bars li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 8px; overflow: hidden; font-size: 13px; }
.bars li::before { content: ""; position: absolute; inset: 0; width: var(--w); background: linear-gradient(90deg, color-mix(in srgb, var(--a) 22%, transparent), color-mix(in srgb, var(--b) 14%, transparent)); border-radius: 8px; transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.bars li > * { position: relative; }
.bars .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bars .v { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.bars .empty { color: var(--muted); }

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 130px; height: 130px; flex: none; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 16; transition: stroke-dasharray .8s cubic-bezier(.2, .8, .2, 1); }
.donut-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; text-transform: capitalize; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend b { margin-left: auto; padding-left: 10px; font-family: var(--mono); }

.feed-panel { grid-column: span 8; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 330px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 72px 90px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.feed li:nth-child(odd) { background: var(--soft); }
.feed li.new { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--up) 30%, transparent); transform: translateY(-6px); } }
.feed time { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.feed .site { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.feed .path { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .meta { color: var(--muted); font-size: 12px; white-space: nowrap; }

.install pre { margin: 0; padding: 12px; border-radius: 10px; background: #0b1020; color: #c7d2fe; font: 12px/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; }
.install-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 14px; border-radius: 9px; border: 0; background: var(--fg); color: var(--bg); font-weight: 600; font-size: 13px; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.hint { color: var(--muted); font-size: 12px; margin: 12px 0 0; }

.docs { max-width: 820px; margin: 0 auto; padding: 40px 20px 90px; }
.docs.center { text-align: center; padding-top: 120px; }
.docs h1 { font-size: 40px; letter-spacing: -.03em; margin: 28px 0 8px; }
.docs pre { background: #0b1020; color: #c7d2fe; padding: 16px; border-radius: 12px; overflow: auto; font: 13px/1.6 var(--mono); }
.endpoint { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 12px 0; box-shadow: var(--shadow); }
.endpoint code { font: 600 14px var(--mono); }
.endpoint p { margin: 8px 0 0; color: var(--muted); }
.method { display: inline-block; padding: 3px 8px; border-radius: 6px; font: 700 11px var(--mono); margin-right: 6px; }
.m-get { background: color-mix(in srgb, var(--a) 18%, transparent); color: #0284c7; }
.m-post { background: color-mix(in srgb, var(--up) 18%, transparent); color: #059669; }
.try { display: inline-block; margin-top: 8px; font-weight: 600; color: var(--b); text-decoration: none; }

.loading .kpi-val, .loading .bars, .loading .chart { opacity: .45; transition: opacity .2s; }

@media (max-width: 1000px) {
  .panel { grid-column: span 6; }
  .feed-panel { grid-column: 1 / -1; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(3) { border-right: 0; }
  .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .app { padding: 10px 12px 80px; }
  .top { flex-wrap: wrap; }
  .controls { order: 3; flex-basis: 100%; }
  .seg { overflow-x: auto; max-width: 100%; }
  .panel { grid-column: 1 / -1; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi-val { font-size: 24px; }
  .chart { height: 240px; }
  .feed li { grid-template-columns: 64px 1fr auto; }
  .feed .meta { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
