@font-face { font-family: 'Bahnschrift'; src: url('/assets/fonts/bahnschrift.ttf') format('truetype'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Proxima'; src: url('/assets/fonts/proxima.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Proxima'; src: url('/assets/fonts/proximabd.ttf') format('truetype'); font-weight: 600 800; font-display: swap; }

:root {
	--bg: #07060b;
	--bg-2: #0c0a12;
	--panel: #0f0d16;
	--panel-2: #15121e;
	--panel-3: #1b1726;
	--line: rgba(255, 255, 255, .07);
	--line-2: rgba(255, 255, 255, .12);
	--text: #ece9f3;
	--muted: #9a95a8;
	--dim: #6c6779;
	--accent: rgb(190, 115, 255);
	--accent-2: #d378ff;
	--accent-soft: rgba(190, 115, 255, .14);
	--good: #63dc82;
	--info: #6aa9ff;
	--warn: #d9a441;
	--bad: #ff6b6b;
	--c1: #be73ff;
	--c2: #6aa9ff;
	--c3: #63dc82;
	--c4: #d9a441;
	--c5: #ff6b6b;
	--c6: #4fd1c5;
	--c7: #9a95a8;
	--r: 12px;
	--display: 'Bahnschrift', 'DIN Alternate', 'Segoe UI', system-ui, sans-serif;
	--body: 'Proxima', 'Segoe UI', system-ui, -apple-system, sans-serif;
	--mono: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
	--side: 236px;
	color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: rgba(255, 255, 255, .06); padding: 1px 6px; border-radius: 5px; }
::selection { background: var(--accent); color: #0b0612; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: #0b0612; padding: 8px 12px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }
.noscript { padding: 24px; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { display: flex; align-items: center; gap: 12px; color: var(--muted); }

/* shell */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; background: linear-gradient(to right, var(--bg-2) calc(var(--side) - 1px), var(--line) calc(var(--side) - 1px), var(--line) var(--side), transparent var(--side)); }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--line); padding: 16px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--text); font-family: var(--display); font-size: 18px; font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.nav a:hover { background: rgba(255, 255, 255, .04); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav svg { width: 17px; height: 17px; flex: none; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 4px 10px; }
.side-foot { margin-top: auto; position: relative; }
.me-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; }
.me-btn:hover { border-color: var(--line-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-3); display: grid; place-items: center; font-weight: 700; color: var(--accent); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; }
.me-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 12px; color: var(--dim); }
.menu { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 4px; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .6); z-index: 30; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px; border: 0; background: none; color: var(--text); cursor: pointer; }
.menu a:hover, .menu button:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.topbar { display: none; }
.main { min-width: 0; }
.content:focus { outline: none; }
.content { max-width: 1240px; margin: 0 auto; padding: 28px 28px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--muted); margin-top: 4px; }

/* banner */
.site-banner { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; font-weight: 600; font-size: 14px; text-align: center; }
.site-banner.info { background: rgba(190, 115, 255, .16); color: #e8d4ff; }
.site-banner.warning { background: rgba(217, 164, 65, .18); color: #ffe0a3; }
.site-banner.critical { background: rgba(255, 107, 107, .2); color: #ffd0d0; }
.site-banner a { color: inherit; text-decoration: underline; }

/* building blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
a.tile { display: block; color: inherit; }
a.tile:hover { border-color: var(--line-2); text-decoration: none; }
.tile-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile-value { font-family: var(--display); font-size: 26px; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 12px; color: var(--dim); margin-top: 2px; }
.delta-up { color: var(--good); }
.delta-down { color: var(--bad); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .18); background: linear-gradient(180deg, #c787ff, #a85cf0); color: #12071d; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn-ghost { background: rgba(255, 255, 255, .04); color: var(--text); border-color: var(--line-2); }
.btn-danger { background: rgba(255, 107, 107, .12); color: #ffb3b3; border-color: rgba(255, 107, 107, .35); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; }

input[type="text"], input[type="search"], input[type="date"], input[type="datetime-local"], input[type="url"], select, textarea {
	height: 36px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; min-width: 0;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; width: 100%; }
select { padding-right: 6px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea { color: var(--text); font-size: 15px; width: 100%; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.stack > .check { display: flex; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .06); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.on { background: var(--accent-soft); color: var(--text); border-color: rgba(190, 115, 255, .4); }
button.chip { cursor: pointer; }
.chip.good { color: var(--good); }
.chip.warn { color: var(--warn); }
.chip.bad { color: var(--bad); }
.chip.info { color: var(--info); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 8px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters { align-items: center; }
.filters > input[type="search"] { flex: 1 1 200px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 600; background: var(--bg-2); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: rgba(255, 255, 255, .03); }
td.wrap { white-space: normal; min-width: 240px; }
.table-foot { display: flex; justify-content: center; padding: 12px; }

.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.error-box { border: 1px solid rgba(255, 107, 107, .35); background: rgba(255, 107, 107, .08); color: #ffc9c9; border-radius: 10px; padding: 12px 14px; }
.note { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 10px; padding: 12px 14px; color: var(--muted); font-size: 14px; }
.skeleton { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; min-height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .pulse::after { animation: none !important; } }

.pulse { position: relative; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--good); }
.pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--good); animation: ping 1.8s infinite; }
.pulse.off, .pulse.off::after { background: var(--dim); animation: none; }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.6); opacity: 0; } }

/* drawer, modal, toast */
.backdrop { position: fixed; inset: 0; background: rgba(4, 3, 8, .6); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--panel); border-left: 1px solid var(--line-2); z-index: 41; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; z-index: 41; padding: 20px; }
.modal h2 { margin-bottom: 8px; }
.modal .row { justify-content: flex-end; margin-top: 18px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; max-width: calc(100% - 32px); }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 14px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6); font-size: 14px; }
.toast.bad { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--good); }

pre.json { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; max-height: 360px; font: 12px/1.5 var(--mono); color: var(--muted); white-space: pre; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--dim); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* community cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cfg-card { display: flex; flex-direction: column; gap: 8px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; cursor: pointer; min-height: 170px; }
.cfg-card:hover { border-color: rgba(190, 115, 255, .4); }
.cfg-card h3 { font-size: 16px; }
.cfg-card p { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cfg-meta { display: flex; gap: 12px; font-size: 12px; color: var(--dim); margin-top: auto; }

/* drop zone */
.drop { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 26px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

/* coming soon */
.soon { position: relative; overflow: hidden; }
.soon-body { opacity: .38; filter: grayscale(.6); pointer-events: none; user-select: none; }
.ribbon { position: absolute; top: 18px; right: -46px; transform: rotate(35deg); background: linear-gradient(180deg, #c787ff, #a85cf0); color: #12071d; font-weight: 800; padding: 6px 54px; font-size: 13px; z-index: 2; box-shadow: 0 6px 20px -8px var(--accent); }

/* charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg.spark { height: 44px; }
.chart .axis { stroke: var(--line-2); }
.chart .grid-line { stroke: var(--line); }
.chart text { fill: var(--dim); font: 11px var(--body); }
.chart .cross { stroke: var(--line-2); stroke-dasharray: 3 3; }
.tip { position: absolute; pointer-events: none; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font-size: 12px; white-space: nowrap; z-index: 5; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .6); }
.tip b { display: block; margin-bottom: 3px; color: var(--text); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 160px) 1fr 54px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .track { height: 8px; background: var(--panel-3); border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--accent); border-radius: 99px; }
.bar-row .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .num { text-align: right; color: var(--muted); }

.diff-mod { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.diff-mod + .diff-mod { margin-top: 8px; }
.diff-line { font: 12px/1.6 var(--mono); }
.diff-add { color: var(--good); }
.diff-del { color: var(--bad); }
.diff-chg { color: var(--warn); }

.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin-card { width: min(440px, 100%); text-align: center; }
.signin-card img { margin: 0 auto 14px; }
.signin-card p { color: var(--muted); margin: 8px 0 20px; }
.signin-card ul { text-align: left; color: var(--muted); margin: 0 0 20px; padding-left: 20px; font-size: 14px; }

@media (max-width: 1100px) {
	.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
	.shell { grid-template-columns: 1fr; background: none; }
	.side { position: fixed; inset: 0 auto 0 0; width: min(280px, 85vw); transform: translateX(-100%); transition: transform .2s; z-index: 50; }
	.shell.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(4, 3, 8, .6); }
	.topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 10px 16px; }
	.topbar .brand { padding: 0; font-size: 16px; }
	.content { padding: 20px 16px 48px; }
	.grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
	.grid-4 { grid-template-columns: 1fr 1fr; }
	.tile-value { font-size: 21px; }
	h1 { font-size: 22px; }
	.bar-row { grid-template-columns: 90px 1fr 44px; }
}
