/* msnm public dashboard. Dark only; no external fonts or assets. */
:root {
  --bg: #05070a;
  --panel: rgba(255, 255, 255, 0.028);
  --panel-hi: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.075);
  --text: #e7edf3;
  --muted: #93a1ae;
  --dim: #5f6b77;
  --accent: #ff6a00;
  --accent-soft: rgba(255, 106, 0, 0.16);
  --ok: #3ddc97;
  --warn: #f5b83d;
  --hot: #ff8a3d;
  --bad: #ff4d6d;
  --sync: #4cc9f0;
  --fork: #c77dff;
  --off: #6b7682;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.45 var(--sans);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 8% -12%, rgba(255, 106, 0, 0.16), transparent 62%),
    radial-gradient(900px 480px at 102% -4%, rgba(76, 201, 240, 0.09), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: auto, auto, 100% 36px, 36px 100%;
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.92em; color: #ffd2b0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
small { color: var(--muted); font-weight: 400; }

/* ---------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100vw - 1440px) / 2));
  background: rgba(5, 7, 10, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand > div { min-width: 0; }
.brand h1 {
  margin: 0; font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
  background: linear-gradient(90deg, #fff 0%, #ffd2b0 55%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand .sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.live {
  flex: none; width: 11px; height: 11px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.7);
  animation: pulse 2s infinite;
}
.live.off { background: var(--bad); animation: none; box-shadow: 0 0 12px rgba(255, 77, 109, 0.7); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}
.status { flex: none; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.status .clock { font-size: 18px; color: #fff; }
.conn { font-size: 12px; color: var(--muted); margin-right: 8px; }
.conn.bad { color: var(--bad); }

main { max-width: 1440px; margin: 0 auto; padding: 18px 16px 8px; }
section { margin: 0 0 30px; }
h2 {
  margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #cfd8e1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
}
h2 small { letter-spacing: 0; text-transform: none; font-size: 12px; }

/* ----------------------------------------------------------------- tiles */
.hero { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .hero { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile {
  position: relative; overflow: hidden;
  padding: 14px 16px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tile::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}
.tile.big { background: linear-gradient(135deg, var(--accent-soft), var(--panel) 60%); border-color: rgba(255, 106, 0, 0.28); }
@media (max-width: 600px) { .tile.big, .tile.wide-sm { grid-column: span 2; } }
.label { color: var(--muted); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.label[title] { cursor: help; }
.value { margin-top: 4px; font-size: 26px; font-weight: 600; line-height: 1.15; color: #fff; white-space: nowrap; }
.tile.big .value { font-size: clamp(32px, 5vw, 46px); text-shadow: 0 0 28px rgba(255, 106, 0, 0.35); }
.value .unit { font-size: 0.55em; color: var(--muted); font-weight: 500; margin-left: 4px; }
.foot { margin-top: 5px; color: var(--muted); font-size: 12px; min-height: 1.2em; overflow: hidden; text-overflow: ellipsis; }
.badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(255, 106, 0, 0.35);
}
.badge:empty { display: none; }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash {
  0% { color: #fff; text-shadow: 0 0 34px var(--accent), 0 0 8px #fff; transform: scale(1.03); }
  100% { transform: none; }
}
.meter { margin-top: 8px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--ok), var(--warn) 60%, var(--bad)); transition: width 0.8s ease; }

/* ---------------------------------------------------------------- blocks */
.blocks {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px;
  scrollbar-width: thin; scrollbar-color: #2a323b transparent;
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.blk {
  flex: none; width: 156px; padding: 10px 12px 9px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  position: relative; overflow: hidden;
}
.blk .h { font-family: var(--mono); font-size: 14px; font-weight: 600; color: #fff; }
.blk .row { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 3px; font-family: var(--mono); }
.blk .fill { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.blk.new { animation: slidein 0.9s cubic-bezier(.2, .8, .2, 1); border-color: rgba(255, 106, 0, 0.6); }
@keyframes slidein {
  0% { opacity: 0; transform: translateX(-30px) scale(0.96); box-shadow: 0 0 0 rgba(255, 106, 0, 0); }
  40% { opacity: 1; box-shadow: 0 0 28px rgba(255, 106, 0, 0.45); }
  100% { transform: none; box-shadow: 0 0 0 rgba(255, 106, 0, 0); }
}

/* ---------------------------------------------------------------- charts */
.charts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); }
.chart {
  padding: 12px 12px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  min-width: 0;
}
.chart h3 { margin: 0 4px 2px; font-size: 13px; font-weight: 600; color: #e7edf3; }
.chart p { margin: 0 4px 6px; font-size: 12px; color: var(--muted); }
.chart .plot { width: 100%; min-height: 230px; }
.chart .empty { padding: 60px 0; text-align: center; color: var(--dim); font-size: 12.5px; }
.uplot, .uplot * { font-family: var(--mono); }
.u-legend { font-size: 11.5px; color: var(--muted); text-align: left; padding: 4px 4px 0; }
.u-legend .u-series { padding: 1px 6px; }
.u-legend .u-series > * { padding: 1px 2px; }
.u-legend .u-off > * { opacity: 0.35; }
.u-legend th { font-weight: 500; }
.u-select { background: rgba(255, 106, 0, 0.12); }

/* ----------------------------------------------------------------- nodes */
.nodes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.node {
  --st: var(--off);
  position: relative; overflow: hidden;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--st) 9%, transparent), var(--panel) 42%);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.4s;
}
.node::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--st); box-shadow: 0 0 14px var(--st); }
.node.s-OK { --st: var(--ok); }
.node.s-BEHIND { --st: var(--warn); }
.node.s-FALLING_BEHIND { --st: var(--hot); }
.node.s-SYNCING { --st: var(--sync); }
.node.s-STALLED, .node.s-UNRESPONSIVE { --st: var(--bad); }
.node.s-FORKED, .node.s-WRONG_CHAIN { --st: var(--fork); }
.node.s-DOWN { --st: var(--off); }
.node.s-DOWN .metrics, .node.s-DOWN .spark { opacity: 0.45; }
.node .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.node .name { display: flex; align-items: center; gap: 8px; min-width: 0; font-family: var(--mono); font-size: 15px; font-weight: 700; color: #fff; }
.node .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.pill {
  flex: none; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--st); border: 1px solid color-mix(in srgb, var(--st) 55%, transparent);
  background: color-mix(in srgb, var(--st) 14%, transparent);
}
.tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; }
.tag.ref { color: var(--accent); border-color: rgba(255, 106, 0, 0.4); }
.hw { margin-top: 7px; color: #c3cdd6; font-size: 12.5px; }
.hw .disk { color: var(--muted); }
.note { margin-top: 4px; color: var(--muted); font-size: 12px; font-style: italic; }
.reason { margin-top: 4px; color: var(--st); font-size: 12px; font-family: var(--mono); }
.reason:empty, .note:empty { display: none; }
.metrics { margin-top: 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 10px; }
.metric .k { font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }
.metric .k[title] { cursor: help; }
.metric .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .s { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }
.bar { margin-top: 4px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--st); transition: width 0.8s ease; }
.sync { margin-top: 10px; }
.sync[hidden] { display: none; }
.sync .track { height: 8px; border-radius: 4px; background: rgba(76, 201, 240, 0.1); overflow: hidden; border: 1px solid rgba(76, 201, 240, 0.25); }
.sync .track i {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(-45deg, var(--sync) 0 10px, #2ba3c9 10px 20px);
  background-size: 28px 28px; animation: stripes 1.2s linear infinite;
  box-shadow: 0 0 12px rgba(76, 201, 240, 0.6);
}
@keyframes stripes { to { background-position: 28px 0; } }
.sync .txt { margin-top: 5px; font-family: var(--mono); font-size: 12px; color: var(--sync); }
.spark { margin-top: 10px; display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 11px; }
.spark svg { flex: 1; height: 26px; min-width: 0; }
.foot-line { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--dim); font-size: 11.5px; font-family: var(--mono); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.foot-line span { min-width: 0; overflow-wrap: anywhere; }

/* ----------------------------------------------------------------- about */
.about { color: #c3cdd6; }
.about-grid { display: grid; gap: 8px 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.about p { margin: 0 0 10px; max-width: 70ch; }
.defs { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; font-size: 13px; }
.defs dt { color: var(--accent); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 1px; }
.defs dd { margin: 0; color: var(--muted); }
.links a { margin-right: 18px; }
footer {
  max-width: 1440px; margin: 0 auto; padding: 14px 16px 28px; color: var(--dim); font-size: 12px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .top { padding: 10px 16px; }
  .brand .sub, .conn, .status small { display: none; }
  .brand h1 { font-size: 13px; letter-spacing: 0.03em; }
  .status .clock { font-size: 15px; }
  .value { font-size: 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
