
:root {
  /* The wallpaper the glass sits on. Pale on purpose: everything above it is translucent, so
     a saturated ground would tint every figure on the page. */
  --wall: #EEF1F6;
  --wall-a: rgba(140, 186, 255, 0.55);
  --wall-b: rgba(196, 170, 255, 0.42);
  --wall-c: rgba(255, 196, 168, 0.40);
  --wall-d: rgba(150, 228, 210, 0.42);

  /* Materials. "glass" is a panel, "thick" is a panel something else is layered over (the
     toolbar, a sheet), "fill" is a control sitting on glass. */
  --glass: rgba(255, 255, 255, 0.62);
  --glass-thick: rgba(255, 255, 255, 0.78);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-blur: blur(30px) saturate(185%);
  --fill: rgba(255, 255, 255, 0.72);
  --fill-hover: rgba(255, 255, 255, 0.95);
  --tint: rgba(28, 39, 60, 0.055);
  --tint-strong: rgba(28, 39, 60, 0.09);

  --bg-elev: #FFFFFF;
  --bg-sunk: rgba(28, 39, 60, 0.06);
  --line: rgba(28, 39, 60, 0.12);
  --line-soft: rgba(28, 39, 60, 0.07);
  --text: #111827;
  --text-dim: #3F4B5E;
  --text-faint: #5E6B80;

  /* System blue, darkened just enough to pass AA as link text on white. */
  --accent: #0071E3;
  --accent-hover: #0062C4;
  --accent-wash: rgba(0, 113, 227, 0.10);
  --accent-ring: rgba(0, 113, 227, 0.34);
  --good: #1A7F37;
  --good-dim: rgba(26, 127, 55, 0.28);
  --good-wash: rgba(52, 199, 89, 0.14);
  --warn: #A85400;
  --warn-dim: rgba(168, 84, 0, 0.26);
  --warn-wash: rgba(255, 159, 10, 0.15);
  --crit: #D0263B;
  --crit-dim: rgba(208, 38, 59, 0.26);
  --crit-wash: rgba(255, 59, 48, 0.11);
  --info: #0071E3;
  --info-dim: rgba(0, 113, 227, 0.26);
  --info-wash: rgba(0, 113, 227, 0.10);

  --shadow: 0 1px 1px rgba(16, 24, 40, 0.03), 0 6px 20px rgba(16, 24, 40, 0.06);
  --shadow-lift: 0 2px 6px rgba(16, 24, 40, 0.06), 0 24px 60px rgba(16, 24, 40, 0.16);
  --shadow-control: 0 0.5px 1px rgba(16, 24, 40, 0.12), 0 1px 3px rgba(16, 24, 40, 0.07);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);

  --radius: 20px;
  --radius-sm: 10px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui,
    sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sidebar: 252px;
  --gap: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

/* Fixed, so scrolling moves the glass and not the light behind it — which is what makes the
   panels read as material rather than as tinted boxes. */
body {
  min-height: 100vh;
  background-color: var(--wall);
  background-image:
    radial-gradient(60vw 55vh at 8% 4%, var(--wall-a), transparent 70%),
    radial-gradient(48vw 50vh at 96% 10%, var(--wall-b), transparent 70%),
    radial-gradient(55vw 55vh at 88% 100%, var(--wall-c), transparent 70%),
    radial-gradient(50vw 50vh at 18% 96%, var(--wall-d), transparent 70%);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-ring); }

/* Keyboard users must always be able to see where they are — the macOS focus ring. */
:focus-visible {
  outline: 3.5px solid var(--accent-ring);
  outline-offset: 1px;
  border-radius: 8px;
}

/* The shared recipe for a glass panel. */
.sidebar, .card, .topbar, .login-card, dialog.origin, .notice, .banner, .section-tabs {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* ── shell ─────────────────────────────────────────────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
  gap: 0;
}

/* A floating sidebar: inset from the window edge with a gap all round, like a source list
   that has been lifted off the wallpaper. */
.sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 2 * var(--gap));
  margin: var(--gap) 0 var(--gap) var(--gap);
  padding: 16px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  box-shadow: var(--highlight), var(--shadow);
}

/* Window controls. Decorative: the console is a page, and these only place it among the
   other windows on the operator's desk. */
.traffic { display: flex; gap: 8px; padding: 2px 8px 0; }
.traffic i {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.14);
}
.traffic i:nth-child(1) { background: #FF5F57; }
.traffic i:nth-child(2) { background: #FEBC2E; }
.traffic i:nth-child(3) { background: #28C840; }

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--rounded);
  font-weight: 700;
  font-size: 17px;
  color: #FFFFFF;
  background: linear-gradient(145deg, #3A9BFF 0%, #0060DF 55%, #3B2FD0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 6px rgba(0, 80, 200, 0.30);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand-sub { font-size: 12px; color: var(--text-faint); }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  padding: 12px 10px 4px;
}
.nav-group:first-child { padding-top: 0; }
.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--text);
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: var(--tint); text-decoration: none; }
.nav a.active {
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 80, 200, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.nav-badge {
  font-family: var(--rounded);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  min-width: 20px;
  text-align: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
}
.nav-badge.warn { background: #E07A00; color: #FFFFFF; }
.nav-badge.crit { background: #E5383B; color: #FFFFFF; }
.nav a.active .nav-badge { background: rgba(255, 255, 255, 0.95); color: var(--accent); }
.nav a.active .nav-badge.crit { color: var(--crit); }
.nav a.active .nav-badge.warn { color: var(--warn); }

.sidebar-foot {
  margin-top: auto;
  padding: 10px 10px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-foot .mono { color: var(--text-dim); }

/* ── main ──────────────────────────────────────────────────────────────────── */

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

/* The toolbar floats like the sidebar does, so the page reads as one window of two panes. */
.topbar {
  position: sticky;
  top: var(--gap);
  z-index: 20;
  margin: var(--gap) var(--gap) 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 22px;
  min-height: 56px;
  background: var(--glass-thick);
  border: 1px solid var(--glass-edge);
  border-radius: 18px;
  box-shadow: var(--highlight), var(--shadow);
}
.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.topbar .spacer { flex: 1; }
.topbar form { margin: 0; }

/* Who you are signed in as. Always visible: with more than one account, an action taken from
   the wrong session is a real mistake, and the only cure is never having to wonder. */
.whoami { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.whoami-login { font-size: 13px; font-weight: 600; }
.whoami-role { font-size: 11px; color: var(--text-faint); }

.content { padding: 20px 28px 64px 28px; max-width: 1280px; width: 100%; }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  margin: 0 0 10px;
}

/* ── cards ─────────────────────────────────────────────────────────────────── */

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-2.wide-first { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  box-shadow: var(--highlight), var(--shadow);
  padding: 20px 22px;
  min-width: 0;
}
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 16px; }
.card h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card h2 .h2-note {
  float: right;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-faint);
}

.stat-label { font-size: 12.5px; font-weight: 500; color: var(--text-faint); margin-bottom: 4px; }
.stat-value {
  font-family: var(--rounded);
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat-value.good { color: var(--good); }
.stat-value.warn { color: var(--warn); }
.stat-value.crit { color: var(--crit); }
/* Plain text that has to be read as a warning — a table cell, a line under a figure. The
   compound rules above are more specific, so this cannot disturb them. */
.warn { color: var(--warn); }
.stat-note { font-size: 12.5px; color: var(--text-faint); margin-top: 5px; }

/* A disclosure. Deliberately quiet: this is the shelf for what is needed rarely, so it must
   read as "there is more here" and never compete with the figure above it. */
.fold { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.fold > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-faint);
  list-style: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 4px;
  margin-left: -4px;
  border-radius: 7px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
  margin: 0 3px 0 4px;
}
.fold[open] > summary::before { transform: rotate(45deg) translate(-1px, -1px); }
.fold > summary:hover { color: var(--text); background: var(--tint); }
.fold-body { margin-top: 12px; }
/* Cards inside a fold render flat. A box inside a box inside a box reads as three levels of
   nesting when it is really one thing shown on request, and the frame is what says "separate
   card" — inside a disclosure that claim is already made by the disclosure. */
.fold-body .card {
  background: none; border: 0; box-shadow: none; padding: 0;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.fold-body .card + .card, .fold-body .grid + .card { margin-top: 18px; }
/* A card whose whole body is one fold has no figure to sit under, so it needs no rule above. */
.card > .fold:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
/* The paragraph under a card's heading, as opposed to the caption under a figure. Prose set
   the full width of a 1240px page is measurably harder to read; ~90 characters is the line a
   reader can return from without losing their place. */
.card > .stat-note:first-of-type { max-width: 92ch; margin: -6px 0 14px; line-height: 1.55; }

/* ── tables ────────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; margin: 0 -22px -20px; padding: 0 22px 18px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  padding: 0 12px 8px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 9px 12px 9px 8px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
/* A list row highlights as one rounded capsule, the way a Finder row does. */
tbody tr:hover td { background: rgba(0, 113, 227, 0.06); }
tbody tr:hover td:first-child { border-radius: 8px 0 0 8px; }
tbody tr:hover td:last-child { border-radius: 0 8px 8px 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-family: var(--mono); font-size: 13px; }
/* A figure never breaks across lines: "100 USDT" split after the number reads as two facts. */
td.mono, .mono {
  font-family: var(--mono);
  font-size: 0.93em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td.wrap { word-break: break-all; }
/* An address is up to 95 characters (Monero) and would otherwise set the table's width on its
   own, pushing everything before it off the screen. Capped and broken instead. */
.mono.wrap {
  display: inline-block;
  max-width: 34ch;
  white-space: normal;
  word-break: break-all;
}
.empty {
  color: var(--text-faint);
  font-size: 13.5px;
  padding: 18px 0;
  text-align: center;
}

/* ── pills / badges ────────────────────────────────────────────────────────── */

.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 0;
  color: var(--text-dim);
  background: var(--tint-strong);
  white-space: nowrap;
}
.pill.good, .pill.ok { color: var(--good); background: var(--good-wash); }
.pill.warn { color: var(--warn); background: var(--warn-wash); }
.pill.crit, .pill.bad { color: var(--crit); background: var(--crit-wash); }
.pill.info { color: var(--info); background: var(--info-wash); }

/* ── buttons ───────────────────────────────────────────────────────────────── */

/* Capsule push buttons. On glass a button needs its own lit surface, or it is a label. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: 999px;
  border: 0.5px solid rgba(28, 39, 60, 0.14);
  background: var(--fill);
  box-shadow: var(--shadow-control), var(--highlight);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}
.btn:hover { background: var(--fill-hover); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: linear-gradient(180deg, #2A8CFF 0%, var(--accent) 100%);
  border-color: rgba(0, 80, 180, 0.5);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 80, 200, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn.primary:hover { background: linear-gradient(180deg, #1A80F5 0%, var(--accent-hover) 100%); }
.btn.danger { color: var(--crit); }
.btn.danger:hover { background: #FFF3F4; }
.btn.small { padding: 4px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
td .actions { flex-wrap: nowrap; justify-content: flex-end; }

/* ── forms ─────────────────────────────────────────────────────────────────── */

input[type="text"], input[type="number"], input[type="search"], input[type="date"], select,
textarea {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  border: 0.5px solid rgba(28, 39, 60, 0.18);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  min-width: 0;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
select { padding-right: 8px; }
input::placeholder, textarea::placeholder { color: var(--text-faint); opacity: 0.8; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3.5px var(--accent-ring);
  background: #FFFFFF;
}
label { font-size: 12.5px; font-weight: 500; color: var(--text-dim); display: block; margin-bottom: 5px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form-row > div { display: flex; flex-direction: column; }
.form-row input[type="text"] { min-width: 160px; }
.field-wide input { min-width: 320px; }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { width: 130px; }

/* The period control: the presets and, beside them, a range of dates. */
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 16px; }
.period-bar .tabs { margin-bottom: 0; }
.period-form { display: flex; align-items: center; gap: 8px; }
.period-form input[type="date"] { padding: 5px 9px; font-size: 13px; border-radius: 999px; }

/* A month of days, each with what it earned. Seven equal columns at any width; the figure is
   the content, so it never wraps and the grid scrolls sideways before a number is cut. */
.cal-nav { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(84px, 1fr)); gap: 4px; overflow-x: auto; }
.cal-head { text-align: center; font-size: 12.5px; font-weight: 500; color: var(--text-dim); padding: 4px 0 8px; }
.cal-head.off { color: var(--text-faint); }
.cal-day {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 10px; border-radius: var(--radius-sm); color: var(--text);
}
a.cal-day:hover { background: var(--tint-strong); text-decoration: none; }
.cal-day.picked { background: var(--tint-strong); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.cal-day.future .cal-num { color: var(--text-faint); }
.cal-num { font-size: 17px; font-weight: 500; line-height: 1.1; }
.cal-val { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-faint); }
.cal-val.good { color: var(--good); }
.cal-val.bad { color: var(--crit); }

/* ── notices ───────────────────────────────────────────────────────────────── */

/* A notice is a glass strip with a coloured dot, not a coloured box: four of them on one page
   would otherwise turn it into a flag. */
.notice {
  position: relative;
  border: 1px solid var(--glass-edge);
  border-radius: 14px;
  padding: 12px 16px 12px 36px;
  margin-bottom: 16px;
  font-size: 13.5px;
  background: var(--glass);
  box-shadow: var(--highlight), var(--shadow);
}
.notice::before {
  content: "";
  position: absolute;
  left: 16px; top: 18px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
}
.notice.ok { background: linear-gradient(0deg, var(--good-wash), var(--good-wash)), var(--glass); }
.notice.ok::before { background: #34C759; }
.notice.err { background: linear-gradient(0deg, var(--crit-wash), var(--crit-wash)), var(--glass); }
.notice.err::before { background: #FF3B30; }
.notice.warn { background: linear-gradient(0deg, var(--warn-wash), var(--warn-wash)), var(--glass); color: var(--text); }
.notice.warn::before { background: #FF9F0A; }

.banner {
  border: 1px solid var(--crit-dim);
  background: linear-gradient(0deg, var(--crit-wash), var(--crit-wash)), var(--glass);
  border-radius: 16px;
  box-shadow: var(--highlight), var(--shadow);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.banner strong { color: var(--crit); }

/* ── login ─────────────────────────────────────────────────────────────────── */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--highlight), var(--shadow-lift);
  border-radius: 30px;
  padding: 36px 30px 28px;
  text-align: center;
}
.login-card .brand { flex-direction: column; gap: 12px; margin-bottom: 6px; }
.login-card .brand-icon { width: 64px; height: 64px; border-radius: 16px; font-size: 32px; }
.login-card .brand-text { align-items: center; }
.login-card .brand-mark { font-size: 22px; }
.login-card .brand-sub { font-size: 13px; }
.login-hint { color: var(--text-dim); font-size: 13px; margin: 6px 0 22px; }
.code-input {
  width: 100%;
  font-family: var(--rounded);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-align: center;
  padding: 12px 0 12px 0.34em;
  margin-bottom: 14px;
}
.login-card input[type="text"] { border-radius: 14px; }
.login-card .btn { width: 100%; justify-content: center; padding: 10px 15px; font-size: 14.5px; }
.login-card .notice { text-align: left; }
.login-input {
  width: 100%;
  font-size: 15px;
  text-align: center;
  padding: 11px 12px;
  margin-bottom: 10px;
}
.login-foot { margin-top: 20px; font-size: 12px; color: var(--text-faint); }

/* ── sheet ─────────────────────────────────────────────────────────────────── */

/* The address-origin dialog: a sheet over the page, not a new page. */
dialog.origin {
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  padding: 0;
  max-width: 520px;
  width: 92%;
  color: var(--text);
  background: var(--glass-thick);
  box-shadow: var(--highlight), var(--shadow-lift);
}
dialog.origin::backdrop {
  background: rgba(20, 28, 45, 0.22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
dialog.origin .head {
  display: flex; align-items: center; gap: .6rem; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--line-soft);
}
dialog.origin .head .mono { font-size: .8rem; word-break: break-all; white-space: normal; }
dialog.origin dl { margin: 0; padding: .9rem 1.2rem 1.2rem; }
dialog.origin dt { font-size: .78rem; color: var(--text-faint); margin-top: .6rem; }
dialog.origin dd { margin: .15rem 0 0; font-size: .9rem; }
dialog.origin .close {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 0;
  background: var(--tint-strong);
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
dialog.origin .close:hover { background: rgba(28, 39, 60, 0.14); }

/* ── charts ────────────────────────────────────────────────────────────────────
   The SVG arrives from the server at its natural size and is allowed to shrink, never to
   grow: scaled past 1:1 the 11px axis text would render at 17px and stop matching the page.
   Everything the chart needs is a presentation attribute on the mark itself, so the only
   rules here are about how the figure sits in the card. */

.chart { display: block; max-width: 100%; height: auto; }
.chart-wrap { overflow-x: auto; margin: 2px 0 0; }
/* A mark dims under the cursor so the pointer has somewhere to be while the browser gets
   around to showing the <title> the mark carries. */
.chart .mark { cursor: default; }
.chart .mark:hover { opacity: 0.78; }
.chart-note { font-size: 12px; color: var(--text-faint); margin-top: 8px; }

/* The twelve-point trend that rides inside a stat tile: it answers "куда идёт", the figure
   above it answers "сколько". Never wider than the number it belongs to. */
.chart.spark { margin: 2px 0 3px; max-width: 108px; }

/* Identity always travels as a swatch PLUS a word — three of the eight series hues sit below
   3:1 on white, so a coloured word would be the illegible half of the pair. */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
}
.legend .key { display: inline-flex; align-items: center; gap: 7px; }
.legend .dot { display: inline-flex; line-height: 0; }
.legend b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}
.legend .muted { font-size: 11px; }
.legend.wide { gap: 8px 22px; }
.legend.scale { gap: 0 3px; align-items: center; }
.legend.scale .step { display: inline-flex; line-height: 0; }
.legend.scale .muted { margin: 0 8px; }

/* ── misc ──────────────────────────────────────────────────────────────────── */

.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 18px; font-size: 13.5px; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; word-break: break-all; }

.sep { height: 1px; background: var(--line-soft); margin: 18px 0; }
.muted { color: var(--text-faint); }
.err-text { color: var(--crit); }
.warn-text { color: var(--warn); }
.dim { color: var(--text-dim); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }

/* Bar widths as classes, because a strict CSP forbids the inline style a width would need. */
.bar { height: 6px; background: var(--tint-strong); border-radius: 999px; overflow: hidden; margin-top: 7px; }
.bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #4FA3FF, var(--accent));
}
.w0{width:0}.w5{width:5%}.w10{width:10%}.w15{width:15%}.w20{width:20%}.w25{width:25%}
.w30{width:30%}.w35{width:35%}.w40{width:40%}.w45{width:45%}.w50{width:50%}.w55{width:55%}
.w60{width:60%}.w65{width:65%}.w70{width:70%}.w75{width:75%}.w80{width:80%}.w85{width:85%}
.w90{width:90%}.w95{width:95%}.w100{width:100%}

/* The one-time reveal of a new account's key: it exists on screen and nowhere else. */
.secret-box {
  border: 1px solid var(--good-dim);
  background: var(--good-wash);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}
.secret-box img {
  width: 168px; height: 168px; border-radius: 12px;
  background: #fff; padding: 8px; border: 1px solid var(--line-soft);
}
.secret-key {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.08em;
  word-break: break-all;
  color: var(--good);
  margin: 8px 0;
}
.secret-note { font-size: 13px; color: var(--text-dim); max-width: 46ch; }

/* Tabs are a segmented control: one recessed track, the chosen segment lit and raised. */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--tint-strong);
  box-shadow: inset 0 0.5px 1px rgba(16, 24, 40, 0.08);
}
.tabs a {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: 999px;
  color: var(--text-dim);
  transition: background 0.15s ease, color 0.15s ease;
}
.tabs a:hover { color: var(--text); background: rgba(255, 255, 255, 0.5); text-decoration: none; }
.tabs a.active {
  background: #FFFFFF;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 0.5px 1px rgba(16, 24, 40, 0.12), 0 2px 6px rgba(16, 24, 40, 0.08);
}
/* The pages inside the section you are in. Sits above the page's own content, so the answer to
   "where else can I go from here" is always in the same place. */
.section-tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 20px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--highlight), var(--shadow);
}
.section-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 15px; }
.section-tabs a.active { background: var(--accent); color: #FFFFFF; }
.section-tabs .nav-badge { font-size: 10px; padding: 0 6px; min-width: 18px; }
.section-tabs a.active .nav-badge { background: rgba(255, 255, 255, 0.9); color: var(--accent); }

.filter-row { margin: 12px 0 16px; }
.filter-row label { display: inline; margin: 0 4px 0 0; }
.filter-row .inline-form { flex-wrap: wrap; }

/* Pager: two buttons and where you are. Sits under the table it belongs to. */
.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.pager-at { font-size: 13px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.pager [aria-disabled="true"] { opacity: 0.4; cursor: default; pointer-events: none; }

/* Placeholders for a figure still being read off a chain. The pulse is what tells an operator
   the page is working rather than broken — a static dash reads as "nothing here". */
.skeleton {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--tint) 25%, rgba(255, 255, 255, 0.8) 50%, var(--tint) 75%);
  background-size: 200% 100%;
  animation: skeleton-sweep 1.4s ease-in-out infinite;
  vertical-align: middle;
}
.skeleton-line { width: 116px; height: 15px; }
.skeleton-pill { width: 92px; height: 19px; border-radius: 999px; }

@keyframes skeleton-sweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--tint-strong); }
}

/* Without backdrop-filter the glass would be see-through tint over a busy wallpaper; give it
   enough body to read on. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255, 255, 255, 0.9); --glass-thick: rgba(255, 255, 255, 0.95); }
}

/* ── responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  :root { --gap: 8px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    margin: var(--gap) var(--gap) 0;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
  }
  .traffic { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-group { display: none; }
  .nav a { padding: 6px 10px; }
  .sidebar-foot { display: none; }
  .topbar { position: static; padding-left: 16px; }
  .content { padding-left: 12px; padding-right: 12px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-2.wide-first { grid-template-columns: 1fr; }
  /* Wrapped onto several lines, a capsule track turns into a lozenge. */
  .tabs, .section-tabs { border-radius: 16px; }
  .section-tabs { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
