/* ==========================================================================
   dstat.cat — quiet graphite console
   Same palette family as before, softened: layered near-black surfaces,
   silver accent, muted category dots, functional status colours only.
   ========================================================================== */

:root {
  --bg: #090b0e;
  --bg-soft: #0b0d11;
  --side: #0b0d11;
  --panel: #101318;
  --panel-2: #14181e;
  --panel-3: #191e25;
  --line: #222833;
  --line-soft: #191e25;
  --line-strong: #303845;

  --text: #e9edf2;
  --text-2: #bcc5cf;
  --muted: #8a939f;
  --dim: #5f6873;

  --accent: #c6d0db;
  --green: #92c2a3;
  --amber: #cbb27d;
  --red: #ca8f8f;

  --massive: #9aa8b9;
  --nonprotected: #b5a78f;
  --protected: #90a9a1;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-color: #2b323b transparent; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 18% -12%, rgba(135, 155, 180, .055), transparent 62%),
    radial-gradient(900px 520px at 96% -6%, rgba(105, 125, 150, .04), transparent 58%),
    linear-gradient(180deg, #0a0c10 0%, #080a0d 58%, #07090c 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 85% 55% at 50% -10%, rgba(170, 190, 215, .05), transparent 70%);
  z-index: 0;
}

#bg-net {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: .72;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
canvas { display: block; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  transition: top .15s;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid rgba(198, 208, 219, .65); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Frame
   ----------------------------------------------------------------------- */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  width: 100%;
  max-width: none;
  margin: 0 auto;
  min-height: 100vh;
}

.main { min-width: 0; display: flex; flex-direction: column; }

/* --------------------------------------------------------------------------
   Sidebar
   ----------------------------------------------------------------------- */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(13, 16, 21, .96), rgba(9, 11, 15, .98));
  border-right: 1px solid var(--line);
  padding: 0 10px;
  overflow: hidden;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 8px 13px;
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
}

.brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; border-radius: 8px; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #0b0b0b;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  background: #f3f2ef;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 6px 18px -10px rgba(0, 0, 0, .9);
  flex: 0 0 auto;
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-name { font-size: 17px; font-weight: 650; letter-spacing: -.025em; white-space: nowrap; }
.brand-name span { color: var(--accent); }

.beta {
  margin-left: auto;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  flex: 0 0 auto;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0 8px;
  flex: 0 0 auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}
.nav-item:hover { background: rgba(255, 255, 255, .025); color: var(--text-2); }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--dim); }
.nav-item:hover svg { color: var(--muted); }
.nav-item.is-active {
  background:
    linear-gradient(90deg, rgba(198, 208, 219, .09), rgba(198, 208, 219, .025));
  border-color: rgba(198, 208, 219, .10);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-item.is-active svg { color: var(--accent); }

.nav-join { color: var(--text-2); }
.nav-join svg { color: #8fb0c8; }
.nav-join:hover svg { color: #a9c6dd; }
.nav-ext { margin-left: auto; font-size: 10px; color: var(--dim); }

.nav-count {
  margin-left: auto;
  font-size: 8.5px;
  font-weight: 600;
  color: var(--dim);
  background: rgba(255, 255, 255, .04);
  border-radius: 4px;
  padding: 0 5px;
  font-variant-numeric: tabular-nums;
}
.nav-chevron {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  color: var(--dim);
  transition: transform .16s;
  flex: 0 0 auto;
}
.nav-chevron svg { width: 12px; height: 12px; }
.nav-item[aria-expanded="false"] .nav-chevron { transform: rotate(-90deg); }

.soon {
  margin-left: auto;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
}

/* networks --------------------------------------------------------------- */

.networks {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-soft);
  padding-top: 6px;
}

.networks-bar { flex: 0 0 auto; padding: 0 0 6px; }

.expand-all {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  transition: background .13s, border-color .13s;
}
.expand-all:hover { background: rgba(255, 255, 255, .025); border-color: var(--line-soft); }
.ea-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ea-count {
  font-size: 8.5px;
  color: var(--dim);
  background: rgba(255, 255, 255, .04);
  border-radius: 3px;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}
.expand-all svg { width: 11px; height: 11px; margin-left: auto; color: var(--dim); transition: transform .16s; }
.expand-all[aria-expanded="true"] svg { transform: rotate(180deg); }

.rail-cats {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 1px 2px 6px;
}

.rail-cat { --cat-accent: var(--massive); }
.rail-cat[data-accent="violet"] { --cat-accent: var(--massive); }
.rail-cat[data-accent="amber"] { --cat-accent: var(--nonprotected); }
.rail-cat[data-accent="emerald"] { --cat-accent: var(--protected); }
.rail-cat[hidden] { display: none; }

.cat-head {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .13s;
}
.cat-head:hover { background: rgba(255, 255, 255, .025); }
.cat-mark { width: 5px; height: 5px; border-radius: 50%; background: var(--cat-accent); opacity: .8; flex: 0 0 auto; }
.cat-name {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.cat-count { font-size: 8.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.cat-chevron {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  color: var(--dim);
  transition: transform .15s;
}
.cat-chevron svg { width: 11px; height: 11px; }
.rail-cat.is-collapsed .cat-chevron { transform: rotate(-90deg); }
.rail-cat.is-collapsed .net-list { display: none; }
.rail-cat.force-open .net-list { display: flex; }
.rail-cat.force-open .cat-chevron { transform: rotate(0deg); }
.rail-cat.has-active .cat-mark { opacity: 1; box-shadow: 0 0 0 2px rgba(255, 255, 255, .06); }
.rail-cat.has-active .cat-name { color: var(--text-2); }

.net-list { display: flex; flex-direction: column; gap: 1px; padding: 1px 0 4px; }

.net {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  grid-template-rows: 15px 14px;
  column-gap: 7px;
  align-items: center;
  width: 100%;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .13s, border-color .13s;
}
.net:hover { background: rgba(255, 255, 255, .028); border-color: var(--line-soft); }
.net[aria-current="true"] {
  background: rgba(198, 208, 219, .075);
  border-color: rgba(198, 208, 219, .12);
  box-shadow: inset 2px 0 0 var(--accent);
}

.flag-circle {
  grid-row: 1 / 3;
  grid-column: 1;
  position: relative;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: #171b21;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .09);
}
.flag-circle .flag {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 23px;
  transform: translate(-50%, -50%);
}

.net-name {
  grid-row: 1;
  grid-column: 2;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-2);
  letter-spacing: -.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.net[aria-current="true"] .net-name { color: var(--text); }

.net-cap {
  grid-row: 1;
  grid-column: 3;
  justify-self: end;
  font-size: 7.5px;
  font-weight: 600;
  color: var(--dim);
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 1.55;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.net-metric {
  grid-row: 2;
  grid-column: 2;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  min-width: 0;
  color: var(--dim);
}
.net-metric b {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.005em;
}
.net-metric small { font-size: 7px; color: var(--dim); }

.net-st { grid-row: 2; grid-column: 3; justify-self: end; display: inline-flex; }
.net-st i { width: 4.5px; height: 4.5px; border-radius: 50%; background: var(--dim); }
.net-st[data-st="on"] i { background: var(--green); box-shadow: 0 0 0 2px rgba(146, 194, 163, .12); }
.net-st[data-st="stale"] i { background: var(--amber); }
.net-st[data-st="off"] i { background: var(--red); }
.net-st[data-st="unknown"] i { background: var(--dim); }

.rail-empty { margin: 12px 8px; font-size: 10px; color: var(--dim); text-align: center; }

.side-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 9px 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 9.5px;
  color: var(--dim);
}
.side-status { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.side-status b { color: var(--muted); font-weight: 600; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.status-dot[data-st="on"] { background: var(--green); box-shadow: 0 0 0 2px rgba(146, 194, 163, .1); }
.status-dot[data-st="stale"] { background: var(--amber); }
.status-dot[data-st="off"] { background: var(--red); }

/* --------------------------------------------------------------------------
   Stage / ads
   ----------------------------------------------------------------------- */

.stage {
  flex: 1 0 auto;
  width: 100%;
  padding: 16px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border: 1px dashed #29303a;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .012), rgba(255, 255, 255, 0)),
    rgba(9, 11, 14, .55);
  overflow: hidden;
  flex: 0 0 auto;
}
.ad-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 0 0 auto; }
.ad-empty {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #49515c;
  user-select: none;
}
.ad-media { display: block; width: 100%; height: 100%; max-height: 110px; object-fit: contain; }

.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(203, 178, 125, .25);
  background: rgba(203, 178, 125, .05);
  color: #d9c7a2;
  font-size: 11.5px;
  flex: 0 0 auto;
}
.banner-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }

.view { min-width: 0; }

/* --------------------------------------------------------------------------
   Dashboard
   ----------------------------------------------------------------------- */

.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 2px 0; }
.dash-head h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.03em; }
.dash-head p { margin: 2px 0 0; font-size: 10.5px; color: var(--dim); }
.dash-head p b { color: var(--muted); font-weight: 600; }

.dash-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 11px;
}
.dash-tile {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(20, 24, 30, .72), rgba(12, 15, 19, .72));
  padding: 11px 13px;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}
.dash-tile > span {
  display: block;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 3px;
}
.dash-tile b {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.dash-tile small { font-size: 10px; font-weight: 500; color: var(--muted); }

.dash-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(16, 19, 24, .75), rgba(11, 14, 18, .8));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}
.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line-soft);
}
.dash-card-head h2 {
  margin: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
}
.dash-search {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 210px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c0f13;
  color: var(--dim);
  transition: border-color .14s;
}
.dash-search:focus-within { border-color: rgba(198, 208, 219, .3); }
.dash-search svg { width: 12px; height: 12px; flex: 0 0 auto; }
.dash-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 10.5px;
}
.dash-search input::placeholder { color: var(--dim); }

.dash-table-wrap { max-height: 430px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.dash-thead,
.dash-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) 118px 96px 112px 92px 86px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
}
.dash-thead {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 28px;
  background: #0c0f13;
  border-bottom: 1px solid var(--line-soft);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--dim);
}
.dash-row {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.dash-row:hover { background: rgba(255, 255, 255, .028); }
.dash-row:last-child { border-bottom: 0; }
.dash-net { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dash-net .flag-circle { width: 20px; height: 20px; grid-row: auto; grid-column: auto; }
.dash-net .flag-circle .flag { width: 30px; height: 20px; }
.dash-name {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-group {
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 0 4px;
  justify-self: start;
  white-space: nowrap;
}
.dash-cap,
.dash-bw,
.dash-pps { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-cap { font-size: 9.5px; color: var(--dim); }
.dash-bw b { font-size: 11px; font-weight: 600; color: var(--text-2); }
.dash-bw small,
.dash-pps small { font-size: 7.5px; color: var(--dim); margin-left: 2px; }
.dash-pps b { font-family: var(--mono); font-size: 9.5px; font-weight: 500; color: var(--muted); }
.dash-st { font-size: 8px; }
.dash-empty { margin: 0; padding: 22px 14px; text-align: center; font-size: 10.5px; color: var(--dim); }

/* --------------------------------------------------------------------------
   Dstat panel
   ----------------------------------------------------------------------- */

.dstat {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(17, 21, 27, .92) 0%, rgba(11, 14, 18, .96) 100%);
  padding: 18px 20px 16px;
  min-width: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .03),
    0 34px 80px -60px rgba(0, 0, 0, .95);
}

.dstat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dstat-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.dstat-flag {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: #171b21;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .09);
}
.dstat-flag .flag { position: absolute; left: 50%; top: 50%; width: 62px; height: 42px; transform: translate(-50%, -50%); }
.dstat-id { min-width: 0; }
.dstat-id h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dstat-id p { margin: 2px 0 0; font-size: 10.5px; color: var(--dim); }

.st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--dim);
}
.st i { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.st em { font-style: normal; }
.st[data-st="on"] { color: var(--green); }
.st[data-st="on"] i { background: var(--green); box-shadow: 0 0 0 2px rgba(146, 194, 163, .12); }
.st[data-st="stale"] { color: var(--amber); }
.st[data-st="stale"] i { background: var(--amber); }
.st[data-st="off"] { color: var(--red); }
.st[data-st="off"] i { background: var(--red); }

.dstat-ip {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: #eef2f7;
  line-height: 1.1;
}
.dstat-ports {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}
.copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, .02);
  color: var(--dim);
  font-size: 8.5px;
  cursor: pointer;
  transition: color .14s, border-color .14s;
}
.copy:hover { color: var(--text-2); border-color: var(--line-strong); }
.copy svg { width: 10px; height: 10px; }

/* chart ------------------------------------------------------------------ */

.chart-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(12, 15, 19, .9), rgba(9, 12, 15, .9));
  padding: 12px 14px 8px;
  min-width: 0;
}
.chart-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.chart-heading h2 { margin: 0; font-size: 11px; font-weight: 650; letter-spacing: .01em; color: var(--text-2); }
.chart-heading p { margin: 1px 0 0; font-size: 9px; color: var(--dim); }

.chart-modes {
  display: inline-flex;
  gap: 1px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d1015;
  flex: 0 0 auto;
}
.chart-modes button {
  width: 25px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background .13s, color .13s;
}
.chart-modes button:hover { color: var(--text-2); }
.chart-modes button.on { background: var(--panel-3); color: var(--text-2); }
.chart-modes svg { width: 13px; height: 13px; }

#d-chart {
  width: 100%;
  height: clamp(320px, 46vh, 500px);
  margin-top: 7px;
  cursor: crosshair;
}

.chart-card::before {
  content: "DSTAT.CAT";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(56px, 8vw, 118px);
  font-weight: 700;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .028);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}
.chart-card > * { position: relative; z-index: 1; }

.chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 5px;
  margin-top: 1px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 8px;
  color: var(--dim);
}
.chart-foot span:nth-child(2) { color: var(--muted); }

.chart-tip {
  position: absolute;
  min-width: 176px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(13, 16, 20, .98);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .95);
  pointer-events: none;
  display: grid;
  gap: 4px;
  z-index: 3;
}
.tip-time {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-soft);
}
.tip-row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.tip-row em { font-style: normal; font-size: 9.5px; color: var(--muted); }
.tip-row b { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text); }

/* info bar + horizontal stats -------------------------------------------- */

.dstat-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, #0d1015, #0b0e12);
  flex-wrap: wrap;
}
.info-items { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.info-item { display: flex; align-items: baseline; gap: 6px; }
.info-item em {
  font-style: normal;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}
.info-item b { font-size: 10.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.strip-cell {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(18, 22, 28, .72), rgba(11, 14, 18, .78));
  padding: 9px 11px;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}
.strip-cell > span {
  display: block;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strip-cell b {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.015em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strip-cell b small { font-size: 9px; font-weight: 500; color: var(--muted); margin: 0 1px; }
.strip-track { display: block; width: 100%; height: 3px; border-radius: 99px; background: #1a1f26; overflow: hidden; margin-top: 5px; }
.strip-bar { display: block; height: 100%; width: 0; border-radius: inherit; background: #94a6b8; transition: width .5s cubic-bezier(.22, .61, .36, 1); }
.strip-bar[data-level="mid"] { background: var(--amber); }
.strip-bar[data-level="high"] { background: var(--red); }

.series-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .04em;
}
.series-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
  transition: color .14s;
}
.series-toggle .dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.series-toggle button:hover { color: var(--text); }
.series-toggle button:not(.on) { color: var(--dim); text-decoration: line-through; text-decoration-thickness: 1px; }
.series-toggle button:not(.on) .dot { opacity: .35; box-shadow: none; }
.series-sep { color: var(--dim); font-size: 8px; }
.dot.bw { background: #c6d0db; box-shadow: 0 0 7px rgba(198, 208, 219, .35); }
.dot.pps { background: #7fa9d0; box-shadow: 0 0 7px rgba(127, 169, 208, .4); }

.chart-card { margin-top: 10px; }
.chart-head { align-items: center; }

/* --------------------------------------------------------------------------
   Placeholder
   ----------------------------------------------------------------------- */

.placeholder {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed #29303a;
  border-radius: 14px;
  background: rgba(255, 255, 255, .008);
  text-align: center;
  padding: 40px 20px;
}
.ph-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  color: var(--dim);
  margin-bottom: 6px;
}
.ph-icon svg { width: 23px; height: 23px; }
.placeholder h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.02em; color: var(--text-2); }
.placeholder p { margin: 1px 0 0; font-size: 11px; color: var(--dim); }
.ph-tag {
  display: inline-block;
  margin: 5px 0 2px !important;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 8px !important;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted) !important;
}

/* --------------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------- */

.site-foot {
  margin-top: auto;
  padding: 18px 4px 20px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}
.copyright { font-size: 12px; color: var(--muted); letter-spacing: .005em; }
.foot-ver { color: var(--text-2); font-variant-numeric: tabular-nums; }
.foot-beta {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 4px;
}
.foot-link { color: var(--muted); }
.foot-link:hover { color: var(--text-2); }

/* toast ------------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 80;
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: rgba(15, 19, 24, .98);
  color: var(--text-2);
  font-size: 10.5px;
  box-shadow: 0 14px 34px -16px rgba(0, 0, 0, .9);
}

/* --------------------------------------------------------------------------
   Large screens: the frame keeps growing instead of stopping at 1760px
   ----------------------------------------------------------------------- */

@media (min-width: 1560px) {
  .app { grid-template-columns: 320px minmax(0, 1fr); }
  .stage { padding: 18px 30px 0; gap: 14px; }
  .side-brand { padding: 17px 8px 15px; }
  .brand-name { font-size: 18px; }
  .dash-head h1 { font-size: 24px; }
  .dash-head p { font-size: 11px; }
  .dash-tile { padding: 13px 15px; }
  .dash-tile > span { font-size: 9px; }
  .dash-tile b { font-size: 20px; }
  .dash-thead, .dash-row { padding: 0 16px; }
  .dash-row { min-height: 44px; }
  .dash-table-wrap { max-height: 56vh; }
  .site-foot { padding: 18px 4px 22px; }
}

@media (min-width: 2000px) {
  .app { grid-template-columns: 340px minmax(0, 1fr); }
  .stage { padding: 22px 40px 0; }
  .dash-tile { padding: 15px 17px; }
  .dash-tile b { font-size: 22px; }
  .dash-row { min-height: 46px; }
  .dash-name { font-size: 12px; }
  .dash-table-wrap { max-height: 60vh; }
  .site-foot { padding: 22px 4px 26px; }
}

@media (min-width: 2400px) {
  .app { grid-template-columns: 360px minmax(0, 1fr); }
  .stage { padding: 24px 48px 0; gap: 16px; }
  .dash-head h1 { font-size: 26px; }
  .dash-tile { padding: 16px 18px; }
  .dash-tile b { font-size: 24px; }
  .dash-row { min-height: 48px; }
  .dash-name { font-size: 12.5px; }
}

/* --------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------- */

@media (max-width: 1220px) {
  .app { grid-template-columns: 274px minmax(0, 1fr); }
  .stage { padding: 14px 16px 0; }
  .dash-thead, .dash-row { grid-template-columns: minmax(150px, 1.5fr) 104px 88px 104px 78px 78px; }
}

@media (max-width: 1040px) {
  .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-thead, .dash-row { grid-template-columns: minmax(150px, 1.5fr) 100px 92px 108px 78px; }
  .dash-thead span:nth-child(5), .dash-pps { display: none; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 12px;
    overflow: visible;
  }
  .side-brand { padding: 12px 4px 10px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 6px 0; }
  .nav-item { width: auto; padding: 0 11px; }
  .nav-item .nav-count, .nav-item .nav-chevron { display: none; }
  .networks { border-top: 0; padding-top: 0; }
  .rail-cats { max-height: 44vh; padding-bottom: 4px; }
  .side-foot { padding: 8px 4px; }
  .stage { padding: 12px 12px 0; }
  .site-foot { padding: 16px 4px 18px; }
}

@media (max-width: 760px) {
  .ad-row { grid-template-columns: 1fr; }
  .ad-slot { min-height: 54px; }
  .dash-head h1 { font-size: 19px; }
  .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dash-tile b { font-size: 16px; }
  .dash-card-head { flex-wrap: wrap; }
  .dash-search { width: 100%; }
  .dash-thead { display: none; }
  .dash-row {
    grid-template-columns: minmax(0, 1fr) 84px 60px;
    grid-template-areas:
      "net cap st"
      "bw pps pps";
    row-gap: 2px;
    padding: 8px 12px;
    min-height: 52px;
  }
  .dash-net { grid-area: net; }
  .dash-group { display: none; }
  .dash-cap { grid-area: cap; text-align: right; }
  .dash-bw { grid-area: bw; }
  .dash-pps { grid-area: pps; display: block; text-align: right; }
  .dash-st { grid-area: st; justify-self: end; }
  .dash-table-wrap { max-height: 50vh; }
  .dstat { padding: 14px 14px 12px; }
  .dstat-ip { font-size: 18px; }
  .dstat-id h1 { font-size: 17px; }
  .dstat-flag { width: 36px; height: 36px; }
  .dstat-flag .flag { width: 54px; height: 36px; }
  .info-items { margin-left: 0; width: 100%; gap: 12px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .strip-cell { padding: 8px 10px; }
  .strip-cell b { font-size: 15px; }
  .series-toggle { margin-left: 0; }
  .chart-heading { flex: 1 1 100%; }
  #d-chart { height: 260px; }
  .placeholder { min-height: 46vh; }
  .site-foot { font-size: 10px; gap: 7px; }
}

@media (max-width: 430px) {
  .brand-name { font-size: 16px; }
  .nav-item { font-size: 11px; padding: 0 9px; height: 36px; }
  .net-cap { display: none; }
  .dash-tiles { grid-template-columns: 1fr 1fr; }
  .dash-tile { padding: 9px 10px; }
  .dash-row { grid-template-columns: minmax(0, 1fr) 70px 54px; padding: 8px 10px; }
  .dstat-info { gap: 6px; padding: 8px 9px; }
  .dstat-ports { font-size: 10px; }
  .info-item b { font-size: 10px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-cell > span { font-size: 7px; letter-spacing: .08em; }
  .strip-cell b { font-size: 14px; }
  .chart-modes { margin-left: auto; }
  .site-foot { justify-content: flex-start; }
}

/* ==========================================================================
   v1.4 - deeper graphite, larger readouts, dstatx-style hover markers
   ========================================================================== */

:root {
  --bg: #06080b;
  --bg-soft: #080a0e;
  --side: #07090d;
  --panel: #0c0f14;
  --panel-2: #10141a;
  --panel-3: #151a21;
  --line: #1b212a;
  --line-soft: #141920;
  --line-strong: #28303a;
  --text: #e8edf3;
  --text-2: #b6c0cb;
  --muted: #828d99;
  --dim: #57616c;
}

body {
  background:
    radial-gradient(1150px 640px at 16% -14%, rgba(128, 150, 176, .06), transparent 64%),
    radial-gradient(900px 520px at 97% -8%, rgba(96, 118, 146, .045), transparent 60%),
    linear-gradient(180deg, #07090d 0%, #05070a 60%, #04060a 100%);
}

#bg-net { opacity: .95; }

/* brand mark: the supplied logo, cropped and placed on the light tile ----- */

.brand-mark { padding: 2px; overflow: hidden; }
.brand-mark-img { width: 100%; height: 100%; display: block; object-fit: contain; }

.dash-lock { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dash-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: #f3f2ef;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 12px 28px -16px rgba(0, 0, 0, .95);
  overflow: hidden;
}
.dash-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* larger stat readouts ---------------------------------------------------- */

.stat-strip { gap: 10px; margin-top: 12px; }
.strip-cell { padding: 12px 14px 13px; border-radius: 10px; }
.strip-cell > span { font-size: 8px; letter-spacing: .14em; }
.strip-cell b { font-size: 20px; margin-top: 3px; letter-spacing: -.02em; }
.strip-cell b small { font-size: 10.5px; }
.strip-track { height: 4px; margin-top: 7px; }

#d-chart { height: clamp(380px, 54vh, 560px); margin-top: 8px; touch-action: pan-y; }

/* tooltip: colour swatches, tighter typography ---------------------------- */

.chart-tip {
  min-width: 198px;
  padding: 10px 12px;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid #333c47;
  background: rgba(11, 14, 19, .974);
  box-shadow: 0 22px 48px -20px rgba(0, 0, 0, 1), inset 0 0 0 1px rgba(255, 255, 255, .02);
  backdrop-filter: blur(6px);
  z-index: 5;
}
.tip-time { font-size: 9.5px; padding-bottom: 6px; }
.tip-row { gap: 22px; }
.tip-row em { display: inline-flex; align-items: center; gap: 6px; font-size: 9.5px; }
.tip-row b { font-size: 11.5px; }
.sw { width: 7px; height: 7px; border-radius: 1.5px; display: inline-block; flex: 0 0 auto; }
.sw.bw { background: #c6d0db; box-shadow: 0 0 6px rgba(198, 208, 219, .5); }
.sw.pps { background: #7fa9d0; box-shadow: 0 0 6px rgba(127, 169, 208, .55); }

/* watermark: sits above the tooltip so it is never buried ----------------- */

.chart-card::before { content: none; }
.chart-mark {
  position: absolute;
  inset: 44px 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(46px, 8.4vw, 126px);
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(232, 240, 250, .085);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .04);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 6;
  mix-blend-mode: screen;
}
.chart-head, .chart-foot { z-index: 7; }

/* footer: readable copyright over any background -------------------------- */

.site-foot { gap: 10px; }
.foot-mark {
  width: 18px;
  height: 18px;
  object-fit: contain;
  padding: 1px;
  border-radius: 4px;
  background: #f3f2ef;
  opacity: .92;
}
.copyright { color: var(--text-2); font-size: 12px; font-weight: 500; letter-spacing: .005em; }

@media (max-width: 900px) {
  .stat-strip { gap: 8px; }
  .strip-cell { padding: 10px 11px 11px; }
  .strip-cell b { font-size: 18px; }
  #d-chart { height: clamp(300px, 46vh, 420px); }
  .chart-mark { font-size: clamp(38px, 13vw, 72px); inset: 38px 0 30px; }
  .chart-tip { min-width: 0; max-width: 62vw; }
  .dash-mark { width: 48px; height: 48px; border-radius: 12px; }
}

@media (max-width: 430px) {
  .dash-mark { width: 44px; height: 44px; }
  .strip-cell b { font-size: 17px; }
  .chart-tip { padding: 9px 10px; max-width: 68vw; }
  .tip-row { gap: 14px; }
  .tip-row b { font-size: 11px; }
  .copyright { font-size: 11.5px; }
}
/* v1.4.1 - long readouts (PPS peak / avg) stack instead of truncating */
.strip-cell:nth-child(8) b { display: flex; flex-direction: column; gap: 1px; line-height: 1.18; }
/* ==========================================================================
   v1.4.2 - quieter readouts, tighter vertical rhythm, brand polish
   ========================================================================== */

:root { --stat: #c9d3de; }

/* readouts: softer than pure white, still crisp */
.dash-tile b { color: var(--stat); }
.strip-cell b { font-size: 18px; font-weight: 600; color: var(--stat); }
.strip-cell { padding: 10px 12px 11px; }
.stat-strip { gap: 9px; margin-top: 11px; }

/* PPS peak / avg: two tidy lines, no stray separator */
.strip-cell:nth-child(8) b { gap: 0; line-height: 1.22; }
.strip-cell:nth-child(8) b small { display: none; }

/* copyright: present but not shouting */
.copyright { color: var(--muted); font-weight: 450; font-size: 12px; }
.foot-ver { color: var(--text-2); font-weight: 600; }

/* vertical rhythm: no dead space between the last block, the ads and the foot */
.stage { flex: 0 0 auto; gap: 10px; padding-bottom: 0; }
.ad-row { gap: 10px; }
.site-foot { margin-top: 4px; padding: 13px 4px 15px; }

/* brand mark: full logo, never clipped */
.brand-mark { width: 38px; height: 38px; padding: 3px; }
.brand-mark-img { object-fit: contain; }
.dash-mark { width: 52px; height: 52px; padding: 4px; }

/* layer 7 placeholder carries the mark */
.ph-logo { background: #f3f2ef; padding: 3px; border-color: rgba(255, 255, 255, .14); }
.ph-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

@media (max-width: 900px) {
  .strip-cell b { font-size: 17px; }
  .brand-mark { width: 36px; height: 36px; }
  .dash-mark { width: 46px; height: 46px; }
}

@media (max-width: 430px) {
  .strip-cell b { font-size: 16.5px; }
  .site-foot { padding: 11px 4px 13px; }
  .copyright { font-size: 11.5px; }
}
/* ==========================================================================
   v1.4.3 - lighter brand tiles, quieter footer, softer mesh
   ========================================================================== */

.brand-mark {
  background: linear-gradient(180deg, #f7f6f3, #e9e7e2);
  border-color: rgba(255, 255, 255, .10);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 5px 14px -9px rgba(0, 0, 0, .9);
  padding: 2px;
  border-radius: 9px;
}
.dash-mark {
  background: linear-gradient(180deg, #f7f6f3, #e9e7e2);
  border-color: rgba(255, 255, 255, .10);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 8px 20px -14px rgba(0, 0, 0, .95);
  padding: 3px;
}

.copyright { font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: .01em; }
.site-foot { gap: 8px; }
.foot-ver { font-size: 11px; }
.foot-link { font-size: 11px; }

#bg-net { opacity: .82; }

@media (max-width: 430px) {
  .copyright { font-size: 10.5px; }
}
/* ==========================================================================
   v1.4.4 - flat IP bar, five core readouts, calmer background
   ========================================================================== */

/* the address row is a label, not a card: no border, no fill */
.dstat-info {
  border: 0;
  background: none;
  box-shadow: none;
  padding: 0 2px;
  margin-top: 8px;
  border-radius: 0;
}

/* five essential readouts instead of eight */
.stat-strip { grid-template-columns: 1.15fr 1fr 1fr 1fr 1fr; gap: 8px; margin-top: 9px; }
.strip-cell { padding: 8px 10px 9px; border-radius: 8px; }
.strip-cell > span { font-size: 7px; letter-spacing: .12em; }
.strip-cell b { font-size: 16px; font-weight: 600; }
.strip-cell b small { font-size: 9.5px; }
.strip-track { height: 3px; margin-top: 5px; }
.strip-sub { display: block; margin-top: 3px; font-size: 7.5px; letter-spacing: .04em; color: var(--dim); }
.strip-sub b { display: inline; margin: 0; font-size: 8.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; }

@media (max-width: 1220px) {
  .strip-cell b { font-size: 15px; }
}

@media (max-width: 1040px) {
  .stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .strip-cell { padding: 8px 9px; }
  .strip-cell b { font-size: 15px; }
}

@media (max-width: 560px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-cell b { font-size: 15.5px; }
}
/* ==========================================================================
   v1.4.5 - native cursor, clean tooltips, updates feed, advertisement panel
   ========================================================================== */

#d-chart { cursor: default; }
.chart-mark { z-index: 2; }
.chart-tip { z-index: 5; }

/* updates feed ------------------------------------------------------------ */

.updates { margin-top: 10px; }
.updates-ver {
  margin-left: auto;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-variant-numeric: tabular-nums;
}
.updates-list { list-style: none; margin: 0; padding: 0; }
.updates-list li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  padding: 8px 2px;
  border-top: 1px solid var(--line-soft);
}
.updates-list li:first-child { border-top: 0; }
.up-ico { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .55; }
.up-ico[data-kind="security"] { background: var(--green); }
.up-ico[data-kind="accuracy"] { background: var(--amber); }
.up-ico[data-kind="chart"] { background: #7fa9d0; }
.up-ico[data-kind="look"] { background: #9aa8b9; }
.up-ico[data-kind="ads"] { background: #b5a78f; }
.up-ico[data-kind="rank"] { background: #e6c34c; }
.updates-list p { margin: 0; font-size: 11.5px; color: var(--text-2); line-height: 1.5; }
.updates-list p b { margin-right: 7px; color: var(--text); font-weight: 600; }
.updates-list time { font-family: var(--mono); font-size: 9px; color: var(--dim); white-space: nowrap; }

/* advertisement panel ----------------------------------------------------- */

body.ads-open { overflow: hidden; }
.ads-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px 14px;
  overflow-y: auto;
  background: rgba(4, 6, 9, .74);
  backdrop-filter: blur(4px);
  animation: ads-in .16s ease-out;
}
.ads-modal[hidden] { display: none; }
@keyframes ads-in { from { opacity: 0 } to { opacity: 1 } }
.ads-panel {
  width: min(560px, 100%);
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, #0e1218, #0a0d12);
  box-shadow: 0 40px 90px -34px #000;
}
.ads-head { display: flex; align-items: center; gap: 9px; padding: 1px 2px 11px; }
.ads-head h2 { margin: 0; font-size: 13px; font-weight: 650; color: var(--text); }
.ads-beacon { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(146, 194, 163, .7); }
.ads-close {
  margin-left: auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b0f14;
  color: var(--muted);
  cursor: pointer;
  transition: color .14s, border-color .14s;
}
.ads-close:hover { color: var(--text); border-color: var(--line-strong); }
.ads-close svg { width: 13px; height: 13px; }
.ads-list { display: grid; gap: 8px; }
.ads-item {
  display: grid;
  place-items: center;
  min-height: 68px;
  border: 1px dashed #232b36;
  border-radius: 9px;
  background: rgba(255, 255, 255, .012);
  overflow: hidden;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.ads-item.is-live { border-style: solid; border-color: #2a3341; }
.ads-item.is-live:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .03); }
.ads-img { display: block; width: 100%; max-height: 112px; object-fit: contain; }
.ads-empty { font-size: 8px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: #49515c; }
.ads-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
  font-size: 10px;
  color: var(--dim);
}
.ads-contact { color: var(--text-2); font-weight: 600; }

.foot-ads {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.foot-ads:hover { color: var(--text-2); }

@media (max-width: 560px) {
  .ads-panel { padding: 11px; border-radius: 12px; }
  .ads-item { min-height: 58px; }
  .ads-img { max-height: 92px; }
  .updates-list p { font-size: 11px; }
  .updates-list time { display: none; }
}
/* v1.4.6 - larger, clearer close button on the advertisement panel */

.ads-close {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border-color: #2b3340;
  background: rgba(255, 255, 255, .045);
  color: #c3ccd7;
}
.ads-close svg { width: 15px; height: 15px; stroke-width: 1.9; }
.ads-close:hover {
  color: #fff;
  background: rgba(202, 143, 143, .18);
  border-color: rgba(202, 143, 143, .5);
}
.ads-close:focus-visible {
  outline: 2px solid rgba(198, 208, 219, .5);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .ads-close { width: 32px; height: 32px; }
}
.ads-close svg path { stroke-width: 1.9; }
/* ==========================================================================
   v1.4.7 - native pointer only in Area, smaller captions
   ========================================================================== */

#d-chart { cursor: crosshair; }
#d-chart.is-area { cursor: default; }

.strip-cell > span { font-size: 6.5px; letter-spacing: .1em; }
.strip-sub { font-size: 7px; }
.strip-sub b { font-size: 8px; }
.updates-list time { font-size: 8.5px; }
.copyright { font-size: 10.5px; }
.foot-ver, .foot-link, .foot-ads { font-size: 10.5px; }

@media (max-width: 430px) {
  .copyright { font-size: 10px; }
}
/* ==========================================================================
   v1.4.8 - even smaller captions and footer
   ========================================================================== */

.strip-cell > span { font-size: 6px; letter-spacing: .09em; }
.strip-cell b small { font-size: 9px; }
.strip-sub { font-size: 6.5px; }
.strip-sub b { font-size: 7.5px; }
.copyright { font-size: 10px; }
.foot-ver, .foot-link, .foot-ads { font-size: 10px; }
.updates-list time { font-size: 8px; }

@media (max-width: 430px) {
  .copyright { font-size: 9.5px; }
  .strip-cell > span { font-size: 5.8px; }
}
/* demo badge: only rendered when DSTAT_DEMO=1 (local mock previews) */
.demo-badge {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  padding: 6px 14px;
  border: 1px solid rgba(203, 178, 125, .45);
  border-radius: 99px;
  background: rgba(32, 24, 12, .94);
  color: #dcc79a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 12px 30px -14px #000;
  pointer-events: none;
}
@media (max-width: 560px) {
  .demo-badge { top: auto; bottom: 12px; font-size: 9px; padding: 5px 11px; }
}
/* ==========================================================================
   v1.4.9 - smaller captions and footer, Hong Kong flag support
   ========================================================================== */

.strip-cell > span { font-size: 5.6px; letter-spacing: .075em; }
.strip-sub { font-size: 6px; }
.strip-sub b { font-size: 7px; }
.updates-list time { font-size: 7.5px; }
.copyright { font-size: 9px; }
.foot-ver, .foot-link, .foot-ads { font-size: 9.5px; }

@media (max-width: 430px) {
  .copyright { font-size: 8.5px; }
  .strip-cell > span { font-size: 5.4px; }
}
/* ==========================================================================
   Flag artwork: real SVG icons from public/assets/flags/
   ========================================================================== */

.flag { object-fit: cover; object-position: center; }
.dstat-flag .flag,
.flag-circle .flag { object-fit: cover; }

.flag-missing {
  display: grid;
  place-items: center;
  font: 600 7px/1 var(--mono);
  letter-spacing: .04em;
  color: #9aa5b1;
  background: linear-gradient(135deg, #1a2431, #233043);
}

/* banner ads: a link wrapping the image keeps the whole slot clickable */
.ad-link { display: block; width: 100%; height: 100%; line-height: 0; }
.ad-link .ad-media { display: block; width: 100%; height: 100%; max-height: 110px; object-fit: contain; }


/* ==========================================================================
   Leaderboard view
   ========================================================================== */

.nav-top { letter-spacing: .06em; }

.lbx-head { align-items: center; margin-top: 2px; }
.lbx-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #e6c34c;
  background:
    radial-gradient(circle at 32% 22%, rgba(230, 195, 76, .16), rgba(230, 195, 76, 0) 62%),
    linear-gradient(180deg, rgba(26, 30, 37, .9), rgba(12, 15, 19, .92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.lbx-mark svg { width: 25px; height: 25px; }

.lbx-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 15px;
  border: 1px solid rgba(127, 169, 208, .38);
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(52, 70, 92, .5), rgba(20, 28, 38, .62));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  color: var(--text-2);
  font-size: 10.5px;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .14s, color .14s, background .14s;
}
.lbx-cta b { color: #a9cff2; font-weight: 700; }
.lbx-cta svg { width: 12px; height: 12px; color: #7fa9d0; }
.lbx-cta:hover {
  color: var(--text);
  border-color: rgba(127, 169, 208, .65);
  background: linear-gradient(180deg, rgba(62, 84, 110, .55), rgba(24, 34, 46, .68));
}

.lbx-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 19, 24, .88), rgba(10, 13, 17, .94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 24px 50px -42px #000;
  overflow: hidden;
}

.lbx-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.lbx-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.lbx-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: color .14s, border-color .14s, background .14s;
}
.lbx-chip:hover { color: var(--text-2); border-color: var(--line-strong); }
.lbx-chip.is-on {
  color: var(--text);
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(38, 44, 53, .8), rgba(24, 28, 34, .8));
}
.lbx-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.lbx-chip[data-accent="violet"] { color: #a78bfa; }
.lbx-chip[data-accent="amber"] { color: #e5b05c; }
.lbx-chip[data-accent="emerald"] { color: #5ccf9b; }
.lbx-chip[data-accent].is-on {
  color: var(--text);
  background: linear-gradient(180deg, rgba(38, 44, 53, .9), rgba(24, 28, 34, .9));
}
.lbx-chip[data-accent="violet"] i { background: #a78bfa; }
.lbx-chip[data-accent="amber"] i { background: #e5b05c; }
.lbx-chip[data-accent="emerald"] i { background: #5ccf9b; }

.lbx-periods {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b0e12;
}
.lbx-seg {
  height: 24px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color .14s, background .14s;
}
.lbx-seg:hover { color: var(--text-2); }
.lbx-seg.is-on { background: var(--panel-3); color: var(--text); }

.lbx-nets {
  display: flex;
  gap: 6px;
  padding: 0 16px 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.lbx-nets::-webkit-scrollbar { display: none; }
.lbx-netrow { display: flex; gap: 6px; }
.lbx-netbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 9.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: color .14s, border-color .14s, background .14s;
}
.lbx-netbtn:hover { color: var(--text-2); border-color: var(--line-strong); }
.lbx-netbtn.is-on {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--panel-3);
}
.lbx-nflag {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: #171b21;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}
.lbx-nflag .flag {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 14px;
  transform: translate(-50%, -50%);
  object-fit: cover;
}
.lbx-netpanel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.lbx-netpanel-head p { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.lbx-netpanel-head span { font-size: 13px; font-weight: 600; color: var(--text); }
.lbx-netpanel-head small { font-size: 9px; color: var(--dim); }
.lbx-netback {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9.5px;
  padding: 5px 10px;
  cursor: pointer;
  transition: color .14s, border-color .14s;
}
.lbx-netback:hover { color: var(--text); border-color: var(--line-strong); }

.lbx-thead,
.lbx-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 150px 108px 96px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}
.lbx-thead {
  height: 34px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 1px solid var(--line-soft);
}
.lbx-thead span:nth-child(n+4) { text-align: right; }

.lbx-list { list-style: none; margin: 0; padding: 0; }
.lbx-row {
  min-height: 62px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .12s;
}
.lbx-row:last-child { border-bottom: 0; }
.lbx-row:hover { background: rgba(255, 255, 255, .022); }
.lbx-row[data-rank="1"] {
  background: linear-gradient(90deg, rgba(244, 201, 78, .11), rgba(244, 201, 78, 0) 55%);
}
.lbx-row[data-rank="1"]:hover {
  background: linear-gradient(90deg, rgba(244, 201, 78, .15), rgba(244, 201, 78, .02) 55%);
}

.lbx-rank { display: grid; place-items: center; }
.lbx-num { font-family: var(--mono); font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.lbx-medal { position: relative; width: 30px; height: 30px; display: grid; place-items: center; }
.lbx-medal svg { position: absolute; inset: 0; width: 30px; height: 30px; }
.lbx-medal circle {
  fill: currentColor;
  stroke: rgba(255, 255, 255, .28);
  stroke-width: .8;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .45));
}
.lbx-medal .rib { fill: currentColor; opacity: .72; }
.lbx-medal .rib-b { opacity: .42; }
.lbx-medal b {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  color: #10141a;
}
.lbx-medal[data-medal="1"] { color: #f4c94e; filter: drop-shadow(0 0 6px rgba(244, 201, 78, .3)); }
.lbx-medal[data-medal="2"] { color: #dbe5f1; }
.lbx-medal[data-medal="3"] { color: #e39a63; }

.lbx-user { display: flex; align-items: center; gap: 11px; min-width: 0; }
.lbx-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid hsl(var(--h) 42% 30%);
  background: hsl(var(--h) 40% 17%);
  color: hsl(var(--h) 55% 74%);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.lbx-avatar { position: relative; overflow: hidden; }
.lbx-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.lbx-avatar img { display: block; }
.lbx-usertext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lbx-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.lbx-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.lbx-name.is-anon { color: var(--dim); font-weight: 500; }

.lbx-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}
.lbx-cat i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.lbx-cat[data-accent="violet"] { color: #a78bfa; }
.lbx-cat[data-accent="amber"] { color: #e5b05c; }
.lbx-cat[data-accent="emerald"] { color: #5ccf9b; }

.lbx-net { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lbx-flag { width: 18px; height: 18px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1); }
.lbx-flag .flag { width: 26px; height: 18px; }
.lbx-net b {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lbx-metric {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lbx-metric b { font-size: 14px; font-weight: 600; color: var(--text); }
.lbx-metric small { margin-left: 3px; font-size: 9.5px; font-weight: 500; color: var(--muted); }
.lbx-metric-pps b { font-size: 12.5px; color: var(--text-2); }

.lbx-empty { margin: 0; padding: 26px 16px; font-size: 11px; color: var(--dim); text-align: center; }

.lbx-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 9.5px;
  color: var(--dim);
}
.lbx-foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
}
.lbx-foot a:hover { color: var(--text); }
.lbx-foot svg { width: 11px; height: 11px; }

@media (max-width: 780px) {
  .lbx-head { flex-wrap: wrap; row-gap: 10px; }
  .lbx-cta { width: 100%; justify-content: center; }
  .lbx-thead { display: none; }
  .lbx-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-areas:
      "rank user bw"
      "rank meta pps";
    align-items: center;
    column-gap: 10px;
    row-gap: 3px;
    min-height: 66px;
    padding: 9px 12px;
  }
  .lbx-rank { grid-area: rank; align-self: center; }
  .lbx-user { grid-area: user; gap: 9px; }
  .lbx-avatar { width: 32px; height: 32px; }
  .lbx-name { font-size: 12.5px; }
  .lbx-net { grid-area: meta; gap: 5px; padding-left: 41px; }
  .lbx-net b { font-size: 9.5px; color: var(--muted); }
  .lbx-flag { width: 14px; height: 14px; }
  .lbx-flag .flag { width: 20px; height: 14px; }
  .lbx-metric { grid-area: bw; align-self: end; }
  .lbx-metric b { font-size: 12.5px; }
  .lbx-metric small { font-size: 8.5px; }
  .lbx-metric-pps { grid-area: pps; display: block; align-self: start; }
  .lbx-metric-pps b { font-size: 10px; }
  .lbx-metric-pps small { font-size: 8px; }
  .lbx-toolbar { padding: 10px 12px; gap: 8px; }
  .lbx-nets { padding: 0 12px 10px; }
  .lbx-netpanel-head { padding: 10px 12px; }
  .lbx-cats { gap: 4px; }
  .lbx-chip { height: 26px; padding: 0 10px; }
  .lbx-foot { padding: 10px 12px; flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (max-width: 400px) {
  .lbx-chip { font-size: 9px; padding: 0 8px; }
  .lbx-seg { padding: 0 8px; font-size: 9px; }
  .lbx-periods { width: 100%; justify-content: space-between; }
  .lbx-net b { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
}


@media (min-width: 1560px) {
  .lbx-thead, .lbx-row {
    grid-template-columns: 54px minmax(240px, 1.4fr) minmax(180px, 1fr) 160px 150px;
    gap: 12px;
    padding: 0 18px;
  }
  .lbx-row { min-height: 66px; }
  .lbx-name { font-size: 14px; }
  .lbx-metric b { font-size: 15px; }
  .lbx-metric-pps b { font-size: 13.5px; }
  .lbx-avatar { width: 36px; height: 36px; }
}
