@import url(/ui/css/pages-a.css?v=2864c6e4c499);
@import url(/ui/css/pages-b.css?v=2864c6e4c499);
@import url(/ui/css/reports.css?v=2864c6e4c499);
@import url(/ui/css/pages-notify.css?v=2864c6e4c499);
@import url(/ui/css/pages-mitigation.css?v=2864c6e4c499);
/* Trivox Shield panel. Design language: Trivox client portal (TailAdmin). */

/* ---------- fonts ---------- */
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(/ui/fonts/Outfit-latin.woff2?v=2864c6e4c499) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(/ui/fonts/Outfit-latin-ext.woff2?v=2864c6e4c499) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Country flags everywhere, Windows included (it has no flag emoji): the
   Twemoji flags as a font, used only for the flag characters. */
@font-face { font-family: "Twemoji Country Flags"; font-display: swap; src: url("../fonts/TwemojiCountryFlags.woff2?v=2864c6e4c499") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/ui/fonts/JetBrainsMono-latin.woff2?v=2864c6e4c499) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/ui/fonts/JetBrainsMono-latin-ext.woff2?v=2864c6e4c499) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- tokens ---------- */
:root {
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --brand-25: #f2f7ff; --brand-50: #ecf3ff; --brand-100: #dde9ff; --brand-200: #c2d6ff; --brand-300: #9cb9ff;
  --brand-400: #7592ff; --brand-500: #465fff; --brand-600: #3641f5; --brand-700: #2a31d8; --brand-800: #252dae;
  --brand-900: #262e89; --brand-950: #161950;
  --gray-25: #fcfcfd; --gray-50: #f9fafb; --gray-100: #f2f4f7; --gray-200: #e4e7ec; --gray-300: #d0d5dd;
  --gray-400: #98a2b3; --gray-500: #667085; --gray-600: #475467; --gray-700: #344054; --gray-800: #1d2939;
  --gray-900: #101828; --gray-950: #0c111d;
  --success-50: #ecfdf3; --success-100: #d1fadf; --success-500: #12b76a; --success-600: #039855; --success-700: #027a48;
  --error-50: #fef3f2; --error-100: #fee4e2; --error-300: #fda29b; --error-500: #f04438; --error-600: #d92d20; --error-700: #b42318;
  --warning-50: #fffaeb; --warning-100: #fef0c7; --warning-500: #f79009; --warning-600: #dc6803; --warning-700: #b54708;

  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-2xl: 24px; --r-full: 9999px;
  --shadow-xs: 0 1px 2px rgb(16 24 40 / .05);
  --shadow-sm: 0 1px 3px rgb(16 24 40 / .1), 0 1px 2px rgb(16 24 40 / .06);
  --shadow-md: 0 4px 8px -2px rgb(16 24 40 / .1), 0 2px 4px -2px rgb(16 24 40 / .06);
  --shadow-lg: 0 12px 16px -4px rgb(16 24 40 / .08), 0 4px 6px -2px rgb(16 24 40 / .03);
  --shadow-xl: 0 20px 24px -4px rgb(16 24 40 / .08), 0 8px 8px -4px rgb(16 24 40 / .03);
  --ring: 0 0 0 4px rgb(70 95 255 / .2);

  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 150ms; --t-med: 250ms; --t-slow: 450ms;

  --sidebar-w: 290px; --sidebar-w-collapsed: 90px; --header-h: 72px;

  /* semantic (light) */
  --canvas: var(--gray-50);
  --surface: #fff;
  --surface-2: var(--gray-50);
  --surface-sunken: var(--gray-100);
  --chrome: #fff;                 /* sidebar + header */
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --divider: var(--gray-100);
  --text: var(--gray-800);
  --text-strong: var(--gray-900);
  --text-2: var(--gray-700);
  --muted: var(--gray-500);
  --faint: #6b7588;               /* AA on white (4.6:1); gray-400 was 2.6:1 */
  --hover: var(--gray-100);
  --active-bg: var(--brand-50);
  --active-fg: var(--brand-600);
  --input-bg: #fff;
  --overlay: rgb(152 162 179 / .5);
  --tooltip-bg: #fff;
  --chart-grid: var(--gray-200);
  --chart-axis: var(--gray-500);
  --badge-success-bg: var(--success-50); --badge-success-fg: var(--success-700);
  --badge-error-bg: var(--error-50);     --badge-error-fg: var(--error-700);
  --badge-warning-bg: var(--warning-50); --badge-warning-fg: var(--warning-700);
  --badge-brand-bg: var(--brand-50);     --badge-brand-fg: var(--brand-600);
  --text-error: var(--error-600);
  --badge-gray-bg: var(--gray-100);      --badge-gray-fg: var(--gray-700);
  color-scheme: light;
}
.dark {
  --canvas: var(--gray-950);
  --surface: rgb(255 255 255 / .03);
  --surface-2: rgb(255 255 255 / .02);
  --surface-sunken: var(--gray-800);
  --chrome: var(--gray-900);
  --border: var(--gray-800);
  --border-strong: var(--gray-700);
  --divider: var(--gray-800);
  --text: rgb(255 255 255 / .9);
  --text-strong: #fff;
  --text-2: var(--gray-300);
  --muted: var(--gray-400);
  --faint: #7a8496;
  --hover: rgb(255 255 255 / .05);
  --active-bg: rgb(70 95 255 / .12);
  --active-fg: var(--brand-400);
  --input-bg: var(--gray-900);
  --overlay: rgb(12 17 29 / .7);
  --tooltip-bg: var(--gray-900);
  --chart-grid: var(--gray-800);
  --chart-axis: var(--gray-400);
  --badge-success-bg: rgb(18 183 106 / .15); --badge-success-fg: var(--success-500);
  --badge-error-bg: rgb(240 68 56 / .15);    --badge-error-fg: #f97066;
  --text-error: #f97066;
  --badge-warning-bg: rgb(247 144 9 / .15);  --badge-warning-fg: #fdb022;
  --badge-brand-bg: rgb(70 95 255 / .15);    --badge-brand-fg: var(--brand-400);
  --badge-gray-bg: rgb(255 255 255 / .05);   --badge-gray-fg: var(--gray-300);
  --shadow-lg: 0 12px 16px -4px rgb(0 0 0 / .4), 0 4px 6px -2px rgb(0 0 0 / .2);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* the panel keeps room for the scrollbar so nothing shifts when one appears;
   the sign-in page has none, and its navy panel runs to the edge */
html:has(.shell) { scrollbar-gutter: stable; }
/* the theme cross-fade: short, so a slow machine spends few frames on it */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 20px; font-weight: 400;
  color: var(--text); background: var(--canvas);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.dark :focus-visible { outline-color: var(--brand-400); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }
.skip { position: fixed; left: 16px; top: 12px; z-index: 300; padding: 10px 16px; border-radius: var(--r-lg); background: var(--brand-500); color: #fff; font-weight: 500;
  transform: translateY(-160%); transition: transform var(--t-fast) var(--ease); }
.skip:focus-visible { transform: none; outline-color: var(--brand-200); }
/* theme switch: no per-element colour transitions (they cost long frames and showed a grey midpoint) */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
.icon-18 { width: 18px; height: 18px; flex: none; }
::selection { background: var(--brand-100); color: var(--brand-950); }
.dark ::selection { background: rgb(70 95 255 / .35); color: #fff; }
.mono { font-family: var(--mono); font-size: .93em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.strong { color: var(--text-strong); font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
#app { min-height: 100%; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent; }
.dark * { scrollbar-color: var(--gray-700) transparent; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar-w);
  display: flex; flex-direction: column; padding: 0 20px;
  background: var(--chrome); border-right: 1px solid var(--border);
  transition: width var(--t-med) var(--ease), transform var(--t-med) var(--ease), background-color var(--t-med) var(--ease);
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; height: var(--header-h); padding: 0 10px; flex: none; }
.sidebar__brand img { width: 30px; height: 33px; flex: none; }
.sidebar__brand .wordmark { font-size: 21px; font-weight: 700; letter-spacing: -.02em; color: var(--text-strong); white-space: nowrap; }
.sidebar__brand .wordmark span { color: var(--brand-500); font-weight: 600; }
.sidebar__nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 0 24px; scrollbar-width: none; }
.sidebar__nav::-webkit-scrollbar { display: none; }
.nav-group { margin-bottom: 24px; }
.nav-group__label { display: block; margin: 0 0 12px 12px; font-size: 12px; line-height: 20px; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); white-space: nowrap; overflow: hidden; transition: opacity var(--t-fast) var(--ease); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 12px; margin-bottom: 4px; border-radius: var(--r-lg);
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-2);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav-item svg { width: 24px; height: 24px; flex: none; color: var(--muted); transition: color var(--t-fast) var(--ease); }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item:hover svg { color: var(--text-2); }
.nav-item.is-active { background: var(--active-bg); color: var(--active-fg); }
.nav-item.is-active svg { color: var(--active-fg); }
.nav-item__label { white-space: nowrap; overflow: hidden; max-width: 200px; transition: opacity var(--t-fast) var(--ease); }
.nav-item__count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-full);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
  background: var(--error-600); color: #fff; animation: pop .35s var(--ease-out); }
.sidebar__foot { padding: 16px 4px 20px; border-top: 1px solid var(--divider); flex: none; }

/* Collapsing: the logo and the icons keep their places (they sit where the
   narrow sidebar's centre is), the labels fade and are clipped as it narrows,
   and the content glides with it. Charts redraw once at the end (sb-anim),
   which is what made gliding the content expensive. */
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; transition: margin-left var(--t-med) var(--ease); }
.is-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.is-collapsed .main { margin-left: var(--sidebar-w-collapsed); }
.is-collapsed .nav-item__label, .is-collapsed .wordmark, .is-collapsed .nav-group__label { opacity: 0; pointer-events: none; }
.is-collapsed .nav-item__count { position: absolute; top: 0; left: 40px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; box-shadow: 0 0 0 2px var(--chrome); }
.sidebar__brand .wordmark { overflow: hidden; max-width: 220px; line-height: 28px; transition: opacity var(--t-fast) var(--ease); }

.header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: var(--chrome); border-bottom: 1px solid var(--border);
  transition: background-color var(--t-med) var(--ease);
}
.header__spacer { flex: 1; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  border-radius: var(--r-lg); border: 1px solid var(--border); color: var(--muted); background: var(--surface);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.round { border-radius: var(--r-full); }
.search { position: relative; width: min(430px, 100%); }
.search-open { display: none; }
#main:focus { outline: none; }
.search svg { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 48px !important; padding-right: 56px !important; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 2px;
  padding: 3px 7px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2);
  font: 500 12px/18px var(--font); color: var(--muted); }

.content { width: 100%; max-width: 1536px; margin: 0 auto; padding: 24px; container-type: inline-size; }
/* backwards, not both: a lingering transform would trap position:fixed modals inside the page */
.page { animation: page-in 180ms var(--ease-out) backwards; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 24px; }
.page-title { font-size: 20px; line-height: 30px; font-weight: 600; color: var(--text-strong); }
/* Titles sit at one height on every page; header buttons centre on the title line. */
.page-head > .row-wrap { margin-top: -7px; }
@media (max-width: 640px) { .page-head > .row-wrap { margin-top: 0; } }
.page-sub { margin-top: 2px; font-size: 14px; color: var(--muted); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.crumbs a:hover { color: var(--brand-500); }
.grid { display: grid; gap: 24px; }
.grid-4 { display: grid; gap: 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-12 { display: grid; gap: 24px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.type-badges { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tbl .type-badges { flex-wrap: nowrap; }
.spacer { flex: 1; }

.backdrop { position: fixed; inset: 0; z-index: 45; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity var(--t-med) var(--ease); }

/* ---------- sortable column headers: the header text is the button ---------- */
.sorth { display: inline-flex; align-items: center; gap: 4px; margin: -4px -6px; padding: 4px 6px; border: 0; border-radius: var(--r-sm);
  background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.sorth:hover { color: var(--text-strong); background: var(--hover); }
.sorth:focus-visible { outline: none; box-shadow: var(--ring); }
.sorth.is-on { color: var(--text-strong); font-weight: 600; }
.sorth__arrow { font-size: 11px; line-height: 1; color: var(--brand-500); }

/* ---------- advanced settings (folded away) ---------- */
.adv { display: flex; flex-direction: column; gap: 16px; }
.adv__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 56px; padding: 12px 20px;
  border: 1px dashed var(--border); border-radius: var(--r-xl); background: transparent; color: var(--text); text-align: left; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.adv__head:hover { background: var(--hover); }
.adv__head:focus-visible { outline: none; box-shadow: var(--ring); }
.adv.is-open .adv__head { border-style: solid; }
.adv__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adv__t { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text-strong); }
.adv__hint { font-size: 13px; line-height: 18px; color: var(--muted); }
.adv__chev { display: inline-flex; flex: none; color: var(--muted); transition: transform var(--t-med) var(--ease); }
.adv.is-open .adv__chev { transform: rotate(180deg); }
.adv__body { animation: rise var(--t-med) var(--ease-out) backwards; }
@media (max-width: 640px) { .adv__head { padding: 12px 16px; } }

/* ---------- cards ---------- */
.card { position: relative; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface);
  transition: background-color var(--t-med) var(--ease), border-color var(--t-med) var(--ease); }
.card.enter { animation: rise var(--t-slow) var(--ease-out) backwards; }
/* Content that takes a skeleton's place appears in it: the skeleton already
   held the layout, and a second entrance blinked the page empty. */
.swap .card.enter, .swap tr.enter, .swap .banner.enter { animation: none; }
/* a tab's content fades in once; its card doesn't rise as well */
.pb-fade .card.enter { animation: none; }
/* a clickable row answers the press at once, before the next page shows */
.tbl tbody tr.click:active { background: var(--hover); }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 20px 24px; }
.card__head + .card__body { padding-top: 0; }
.card__title { font-size: 18px; line-height: 28px; font-weight: 600; color: var(--text-strong); }
.card__sub { font-size: 14px; color: var(--muted); }
.card__body { padding: 20px 24px 24px; }
.card__body.flush { padding: 0 0 8px; }
.card__foot { display: flex; align-items: center; justify-content: center; padding: 12px 24px 16px; border-top: 1px solid var(--divider); }

.metric { padding: 20px 24px 22px; }
.metric__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--r-lg);
  background: var(--surface-sunken); color: var(--text); flex: none; transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease); }
.metric__icon svg { width: 24px; height: 24px; }
.metric__icon.is-error { background: var(--badge-error-bg); color: var(--badge-error-fg); }
.metric__icon.is-brand { background: var(--badge-brand-bg); color: var(--badge-brand-fg); }
.metric__label { margin-top: 20px; font-size: 14px; color: var(--muted); }
.metric__value { margin-top: 6px; font-size: 30px; line-height: 38px; font-weight: 700; color: var(--text-strong); letter-spacing: -.01em; white-space: nowrap; transition: color var(--t-med) var(--ease); }
.metric__value .unit { margin-left: 6px; font-size: 16px; font-weight: 500; color: var(--muted); }
.metric__value.is-alert { color: var(--error-500); }
.metric__foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; color: var(--muted); }

/* ---------- badges, pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 10px; border-radius: var(--r-full);
  font-size: 12px; line-height: 18px; font-weight: 500; white-space: nowrap; background: var(--badge-gray-bg); color: var(--badge-gray-fg);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.badge svg { width: 12px; height: 12px; }
.badge.success { background: var(--badge-success-bg); color: var(--badge-success-fg); }
.badge.error { background: var(--badge-error-bg); color: var(--badge-error-fg); }
.badge.warning { background: var(--badge-warning-bg); color: var(--badge-warning-fg); }
.badge.brand { background: var(--badge-brand-bg); color: var(--badge-brand-fg); }
.badge.solid-error { background: var(--error-600); color: #fff; }
/* attack types, coloured by what they are */
.badge.t-amp { background: #fef0c7; color: #b54708; }
.badge.t-frag { background: #f4f3ff; color: #5925dc; }
.badge.t-tcp { background: #fdf2fa; color: #c11574; }
.badge.t-udp { background: #eff8ff; color: #175cd3; }
.badge.t-icmp { background: #f0fdf9; color: #107569; }
.badge.t-vol { background: #f2f4f7; color: #344054; }
.dark .badge.t-amp { background: rgb(247 144 9 / .15); color: #fdb022; }
.dark .badge.t-frag { background: rgb(122 90 248 / .18); color: #bdb4fe; }
.dark .badge.t-tcp { background: rgb(238 70 188 / .15); color: #faa7e0; }
.dark .badge.t-udp { background: rgb(46 144 250 / .15); color: #84caff; }
.dark .badge.t-icmp { background: rgb(21 183 158 / .15); color: #5fe9d0; }
.dark .badge.t-vol { background: rgb(152 162 179 / .15); color: #d0d5dd; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dot.live { position: relative; }
.dot.live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: ring 2s var(--ease-out) infinite; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-full);
  border: 1px solid var(--border); font-size: 13px; font-weight: 500; color: var(--text-2); background: var(--surface); white-space: nowrap;
  transition: color var(--t-med) var(--ease), border-color var(--t-med) var(--ease), background-color var(--t-med) var(--ease); }
.pill.ok { color: var(--success-700); } .dark .pill.ok { color: var(--success-500); }
.pill.warn { color: var(--warning-700); border-color: rgb(247 144 9 / .35); } .dark .pill.warn { color: #fdb022; }
.pill.err { color: var(--error-700); border-color: rgb(240 68 56 / .35); } .dark .pill.err { color: #f97066; }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: var(--r-lg); font-size: 14px; font-weight: 500; white-space: nowrap; user-select: none;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: var(--r-md); }
.btn.xs { height: 30px; padding: 0 10px; font-size: 12px; border-radius: var(--r-md); gap: 6px; }
.btn.xs svg { width: 14px; height: 14px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--brand-500); color: #fff; box-shadow: var(--shadow-xs); }
.btn.primary:hover:not(:disabled) { background: var(--brand-600); }
.btn.outline { background: var(--surface); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-xs); }
.dark .btn.outline { background: transparent; color: var(--gray-300); box-shadow: inset 0 0 0 1px var(--gray-700); }
.btn.outline:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn.danger { background: var(--error-600); color: #fff; box-shadow: var(--shadow-xs); }
.btn.danger:hover:not(:disabled) { background: var(--error-700); }
.btn.ghost { color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn.danger-ghost { color: var(--error-700); }
.btn.danger-ghost:hover:not(:disabled) { background: var(--badge-error-bg); }
.dark .btn.danger-ghost { color: #f97066; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-busy { color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; animation: spin .7s linear infinite; }
.btn.outline.is-busy::after, .btn.ghost.is-busy::after { border-color: var(--muted) var(--muted) transparent transparent; }
.link { color: var(--brand-500); font-weight: 500; transition: color var(--t-fast) var(--ease); }
.link:hover { color: var(--brand-600); }
.dark .link { color: var(--brand-400); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-2); }
.dark .label { color: var(--gray-400); }
.hint { font-size: 12px; line-height: 18px; color: var(--muted); }
.hint.error { color: var(--text-error); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 10px 16px; border-radius: var(--r-lg); border: 1px solid var(--border-strong);
  background: var(--input-bg); color: var(--text); font-size: 14px; box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background-color var(--t-med) var(--ease);
}
.dark .input, .dark .select, .dark .textarea { border-color: var(--gray-700); color: rgb(255 255 255 / .9); }
.input::placeholder { color: var(--faint); }
.dark .input::placeholder { color: rgb(255 255 255 / .3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-300); box-shadow: var(--ring); }
.dark .input:focus, .dark .select:focus { border-color: var(--brand-800); }
.input.is-invalid { border-color: var(--error-300); }
.input.is-invalid:focus { box-shadow: 0 0 0 4px rgb(240 68 56 / .12); }
.input.mono { font-family: var(--mono); font-size: 13px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-wrap .eye { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: inline-flex; padding: 2px; border-radius: var(--r-sm); }
.input-wrap .eye:hover { color: var(--text); }
.input-wrap .eye svg { width: 20px; height: 20px; }
.select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23667085' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m4.8 7.4 5.2 5.2 5.2-5.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.check { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box { width: 20px; height: 20px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--input-bg); display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.check .box svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.6); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease-out); }
.check input:checked + .box { background: var(--brand-500); border-color: var(--brand-500); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: var(--ring); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; font-size: 14px; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: relative; width: 44px; height: 24px; border-radius: var(--r-full); background: var(--gray-200); flex: none; transition: background-color var(--t-med) var(--ease); }
.dark .switch .track { background: rgb(255 255 255 / .1); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--t-med) var(--ease-out); }
.switch input:checked + .track { background: var(--brand-500); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.switch input:disabled + .track { opacity: .5; }

/* segmented (chart range tabs) */
.seg { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: var(--r-lg); background: var(--gray-100); isolation: isolate; }
.dark .seg { background: var(--gray-900); }
.seg__thumb { position: absolute; z-index: -1; top: 2px; bottom: 2px; left: 0; border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-xs);
  transition: transform var(--t-med) var(--ease-out), width var(--t-med) var(--ease-out); }
.dark .seg__thumb { background: var(--gray-800); }
/* inside a modal (gray-900) the track needs its own shade to be seen */
.dark .modal .seg { background: var(--gray-800); }
.dark .modal .seg__thumb { background: var(--gray-700); }
.seg button { height: 36px; padding: 0 12px; border-radius: var(--r-md); font-size: 14px; font-weight: 500; color: var(--muted); transition: color var(--t-fast) var(--ease); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { color: var(--text-strong); }
.dark .seg button[aria-pressed="true"] { color: #fff; }
.seg.sm button { height: 30px; padding: 0 10px; font-size: 13px; }

/* tabs (underline) */
.tabs { position: relative; display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; padding: 0 0 12px; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color var(--t-fast) var(--ease); }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--brand-500); }
.dark .tabs button[aria-selected="true"] { color: var(--brand-400); }
.tabs__bar { position: absolute; bottom: -1px; left: 0; height: 2px; border-radius: 2px; background: var(--brand-500); transition: transform var(--t-med) var(--ease-out), width var(--t-med) var(--ease-out); }

/* ---------- tables ---------- */
.table-wrap { position: relative; width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { padding: 12px 16px; text-align: left; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--muted); white-space: nowrap;
  border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }
.tbl th:first-child, .tbl td:first-child { padding-left: 24px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 24px; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl th button.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; font-weight: inherit; }
.tbl th button.sort svg { width: 14px; height: 14px; opacity: .5; transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease); }
.tbl th button.sort.on svg { opacity: 1; }
.tbl th button.sort.asc svg { transform: rotate(180deg); }
.tbl td { padding: 14px 16px; font-size: 14px; line-height: 20px; color: var(--muted); border-bottom: 1px solid var(--divider); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.primary { color: var(--text); font-weight: 500; }
.tbl td .ip { font-family: var(--mono); font-size: 13px; color: var(--text); }
.tbl tbody tr { transition: background-color var(--t-fast) var(--ease); }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--surface-2); }
.dark .tbl tbody tr.click:hover { background: rgb(255 255 255 / .02); }
.tbl tbody tr.enter { animation: row-in 320ms var(--ease-out) backwards; }
.tbl tbody tr.flash td { animation: flash 1.6s var(--ease) both; }
.tbl .empty td { padding: 40px 24px; text-align: center; color: var(--muted); }
.tbl .actions { display: flex; justify-content: flex-end; gap: 4px; }
.tbl .bar { position: relative; height: 6px; min-width: 64px; border-radius: var(--r-full); background: var(--gray-100); overflow: hidden; }
.dark .tbl .bar { background: rgb(255 255 255 / .06); }
.tbl .bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--brand-500); transition: width var(--t-slow) var(--ease-out); }
.tbl .bar i.err { background: var(--error-500); }

/* mobile: rows become cards */
@media (max-width: 640px) {
  table.tbl.cards thead { display: none; }
  table.tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { padding: 12px 16px; border-bottom: 1px solid var(--divider); }
  .tbl.cards tbody tr:last-child { border-bottom: 0; }
  .tbl.cards td { padding: 3px 0 !important; border: 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  .tbl.cards td::before { content: attr(data-l); color: var(--faint); font-size: 12px; text-align: left; flex: none; }
  .tbl.cards td.lead { justify-content: flex-start; text-align: left; font-size: 15px; padding-bottom: 6px !important; }
  .tbl.cards td.lead::before { content: none; }
  .tbl.cards .actions { justify-content: flex-start; }
  .tbl.cards .empty td { display: block; text-align: center; }
  .tbl.cards .empty td::before { content: none; }
}

/* ---------- bar list ---------- */
.barlist { display: flex; flex-direction: column; gap: 14px; }
.barlist__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.barlist__name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--text); }
.barlist__val { font-size: 14px; font-weight: 500; color: var(--text); }
.barlist__track { grid-column: 1 / -1; height: 6px; border-radius: var(--r-full); background: var(--gray-100); overflow: hidden; }
.dark .barlist__track { background: rgb(255 255 255 / .06); }
.barlist__fill { height: 100%; border-radius: inherit; background: var(--brand-500); transform-origin: left; animation: grow .7s var(--ease-out) both; transition: width var(--t-slow) var(--ease-out); }

/* ---------- status banner ---------- */
.banner { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--r-xl); border: 1px solid var(--border); background: var(--surface);
  transition: background-color var(--t-slow) var(--ease), border-color var(--t-slow) var(--ease); }
.banner__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-full); flex: none;
  background: var(--badge-success-bg); color: var(--badge-success-fg); transition: background-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease); }
.banner__icon svg { width: 20px; height: 20px; }
.banner__title { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--text-strong); }
.banner__text { font-size: 14px; color: var(--muted); }
.banner.attack { border-color: rgb(240 68 56 / .35); background: var(--error-50); }
.dark .banner.attack { background: rgb(240 68 56 / .08); }
.banner.attack .banner__icon { position: relative; background: var(--error-500); color: #fff; }
/* the pulse is a ring that scales and fades: compositor-only, where the old
   box-shadow animation repainted every frame for as long as an attack ran */
.banner.attack .banner__icon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 6px rgb(240 68 56 / .4);
  opacity: 0; animation: halo 1.6s var(--ease-out) infinite; }
.banner.attack .banner__title { color: var(--error-700); }
.dark .banner.attack .banner__title { color: #fda29b; }
.banner.blind { border-color: rgb(247 144 9 / .35); background: var(--warning-50); }
.dark .banner.blind { background: rgb(247 144 9 / .08); }
.banner.blind .banner__icon { background: var(--badge-warning-bg); color: var(--badge-warning-fg); }
.banner.setup .banner__icon { background: var(--badge-brand-bg); color: var(--badge-brand-fg); }

/* ---------- modal, dropdown, toast ---------- */
/* Anchored near the top, not centred: a message appearing in the form grows the
   dialog downward instead of shifting everything in it up. */
.modal-root { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: min(12vh, 120px) 16px 16px; }
.modal-root .scrim { position: absolute; inset: 0; background: var(--overlay); animation: fade var(--t-med) var(--ease) both; }
.modal { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - min(12vh, 120px) - 16px); overflow-y: auto; padding: 32px; border-radius: var(--r-2xl);
  background: #fff; box-shadow: var(--shadow-xl); animation: modal-in 320ms var(--ease-out) both; }
.dark .modal { background: var(--gray-900); }
.modal.wide { max-width: 720px; }
.modal.closing { animation: modal-out 180ms var(--ease) both; }
.modal-root.closing .scrim { animation: fade-out 180ms var(--ease) both; }
.modal__close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: var(--r-full); display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-100); color: var(--muted); transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.dark .modal__close { background: var(--gray-800); }
.modal__close:hover { color: var(--text); background: var(--gray-200); }
.dark .modal__close:hover { background: var(--gray-700); }
.modal__close svg { width: 20px; height: 20px; }
.modal__title { font-size: 20px; line-height: 30px; font-weight: 600; color: var(--text-strong); padding-right: 40px; }
.modal__text { margin-top: 6px; font-size: 14px; color: var(--muted); }
.modal__body { margin-top: 24px; display: flex; flex-direction: column; gap: 18px; }
.modal__foot { margin-top: 28px; display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }

.menu-anchor { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; min-width: 240px; padding: 12px; border-radius: var(--r-xl);
  border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow-lg); transform-origin: top right; animation: menu-in 200ms var(--ease-out) both; }
.dark .menu { background: var(--gray-900); }
.menu.closing { animation: menu-out 120ms var(--ease) both; pointer-events: none; }
.menu__head { padding: 4px 8px 12px; border-bottom: 1px solid var(--divider); margin-bottom: 8px; }
.menu__item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border-radius: var(--r-lg); font-size: 14px; font-weight: 500; color: var(--text-2); }
.menu__item:hover { background: var(--hover); color: var(--text); }
.menu__item svg { width: 20px; height: 20px; color: var(--muted); }

.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-xl); border: 1px solid var(--border);
  background: #fff; box-shadow: var(--shadow-lg); animation: toast-in 360ms var(--ease-out) both; }
.dark .toast { background: var(--gray-900); }
.toast.leaving { animation: toast-out 220ms var(--ease) both; }
.toast__icon { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--success-500); }
.toast.error .toast__icon { color: var(--error-500); }
.toast.warn .toast__icon { color: var(--warning-500); }
.toast__text { flex: 1; font-size: 14px; color: var(--text); }
.toast__action { flex: none; margin: -2px 0; padding: 2px 8px; border-radius: var(--r-md); font-size: 13px; font-weight: 600; color: var(--brand-600); }
.toast__action:hover { background: var(--hover); }
.dark .toast__action { color: var(--brand-400); }
.toast__close { color: var(--faint); display: inline-flex; }
.toast__close:hover { color: var(--text); }
.toast__close svg { width: 16px; height: 16px; }

/* ---------- chart ---------- */
.chart { position: relative; width: 100%; height: 310px; user-select: none; touch-action: pan-y; }
.chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart__tip { position: absolute; top: 0; left: 0; z-index: 2; min-width: 168px; padding: 10px 12px; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--tooltip-bg); box-shadow: var(--shadow-lg); pointer-events: none; opacity: 0; font-size: 12px; line-height: 18px;
  transition: opacity var(--t-fast) var(--ease); will-change: transform; }
.chart__tip.on { opacity: 1; }
.chart__tip .t { margin-bottom: 6px; font-weight: 500; color: var(--muted); }
.chart__tip .r { display: flex; align-items: center; gap: 8px; color: var(--text); }
.chart__tip .r b { margin-left: auto; padding-left: 12px; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.chart__tip .sw { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chart__empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legend button { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); transition: opacity var(--t-fast) var(--ease); }
.legend button[aria-pressed="false"] { opacity: .4; }
.legend .sw { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- empty, skeleton, misc ---------- */
div.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 24px; text-align: center; color: var(--muted); }
div.empty > svg { width: 40px; height: 40px; color: var(--faint); }
div.empty .t { font-size: 15px; font-weight: 500; color: var(--text); }
.skel { position: relative; overflow: hidden; border-radius: var(--r-md); background: var(--gray-100); }
.dark .skel { background: rgb(255 255 255 / .05); }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .55), transparent); animation: shimmer 1.4s var(--ease) infinite; }
.dark .skel::after { background: linear-gradient(90deg, transparent, rgb(255 255 255 / .05), transparent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--divider); margin: 4px 0; }
.code { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--surface-sunken); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 13px; color: var(--text); word-break: break-all; }
.code .grow { flex: 1; }
.flag { font-family: "Twemoji Country Flags", var(--font); font-size: 16px; line-height: 1; }
.iconbox { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-lg); background: var(--surface-sunken); color: var(--text); flex: none; }
.iconbox svg { width: 20px; height: 20px; }
.status-dot { display: inline-flex; align-items: center; gap: 8px; }
.stale { opacity: .55; transition: opacity var(--t-slow) var(--ease); }

/* ---------- login ---------- */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: #fff; }
.dark .auth { background: var(--gray-900); }
.auth__form { display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 448px; margin: 0 auto; padding: 40px 24px; animation: rise 600ms var(--ease-out) both; }
/* the error line keeps its place, so a message doesn't move the centred form */
.auth__err { min-height: 18px; }
.auth__mini { display: none; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth__mini img { width: 30px; height: 33px; }
.auth__mini .wordmark { font-size: 21px; font-weight: 700; letter-spacing: -.02em; color: var(--text-strong); }
.auth__mini .wordmark span { color: var(--brand-500); font-weight: 600; }
.auth__title { font-size: 36px; line-height: 44px; font-weight: 600; letter-spacing: -.02em; color: var(--text-strong); }
.auth__sub { margin-top: 8px; font-size: 14px; color: var(--muted); }
.auth__rule { height: 1px; background: var(--border); margin: 28px 0; }
.auth__panel { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--brand-950); }
.dark .auth__panel { background: rgb(255 255 255 / .05); }
.auth__grid { position: absolute; inset: 0; opacity: .9;
  background-image: linear-gradient(rgb(255 255 255 / .05) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .05) 1px, transparent 1px);
  background-size: 52px 52px; mask-image: radial-gradient(ellipse 60% 55% at 50% 50%, #000 30%, transparent 75%); }
.auth__cells { position: absolute; inset: 0; }
.auth__cells i { position: absolute; width: 52px; height: 52px; background: rgb(255 255 255 / .04); animation: cell 6s var(--ease) infinite; }
.auth__brand { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; animation: rise 800ms var(--ease-out) 120ms both; }
.auth__brand .mark { display: flex; align-items: center; gap: 14px; }
.auth__brand img { width: 44px; height: 48px; }
.auth__brand .wm { font-size: 34px; font-weight: 700; letter-spacing: .02em; color: #fff; }
.auth__brand .wm span { color: var(--brand-300); font-weight: 600; }
.auth__brand p { max-width: 320px; color: var(--gray-400); font-size: 15px; line-height: 24px; }
.theme-fab { position: fixed; right: 24px; bottom: 24px; z-index: 20; width: 56px; height: 56px; border-radius: var(--r-full); display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-500); color: #fff; box-shadow: var(--shadow-lg); transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.theme-fab:hover { background: var(--brand-600); transform: translateY(-1px); }
.theme-fab svg { width: 22px; height: 22px; }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-lg); font-size: 14px; border: 1px solid; animation: rise 300ms var(--ease-out) both; }
.alert.error { border-color: var(--error-100); background: var(--error-50); color: var(--error-700); }
.dark .alert.error { border-color: rgb(240 68 56 / .3); background: rgb(240 68 56 / .1); color: #fda29b; }
.alert.info { border-color: var(--brand-100); background: var(--brand-25); color: var(--brand-800); }
.dark .alert.info { border-color: rgb(70 95 255 / .3); background: rgb(70 95 255 / .1); color: var(--brand-300); }
.alert svg { width: 20px; height: 20px; flex: none; }

/* ---------- connection overlay ---------- */
.conn { position: fixed; left: 50%; bottom: 24px; z-index: 150; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-radius: var(--r-full); background: var(--gray-900); color: #fff; font-size: 13px; box-shadow: var(--shadow-lg); animation: toast-in 360ms var(--ease-out) both; }
.dark .conn { background: var(--gray-800); }
.conn .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .3); border-top-color: #fff; animation: spin .8s linear infinite; }

/* ---------- keyframes ---------- */
/* from 40%, not 0: the old page is gone the moment the new one renders, and
   a fade from nothing drew an empty frame between them */
@keyframes page-in { from { opacity: .4; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes modal-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes ring { 0% { opacity: .7; transform: scale(.6); } 80%, 100% { opacity: 0; transform: scale(1.6); } }
@keyframes halo { 0% { transform: scale(.85); opacity: .9; } 70%, 100% { transform: scale(1.3); opacity: 0; } }
@keyframes menu-out { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes flash { 0% { background: rgb(240 68 56 / .12); } 100% { background: transparent; } }
@keyframes cell { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* ---------- responsive ---------- */
/* Columns follow the room the content has (sidebar open or collapsed), not the window. */
@container (max-width: 899px) {
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}
.top-hosts { container-type: inline-size; }
@container (max-width: 400px) { .top-hosts .col-mix { display: none; } }
@media (max-width: 1279px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: var(--shadow-xl); visibility: hidden;
    transition: transform var(--t-med) var(--ease), visibility 0s linear var(--t-med); }
  .is-open .sidebar { transform: none; visibility: visible; transition: transform var(--t-med) var(--ease), visibility 0s; }
  .is-open .backdrop { opacity: 1; pointer-events: auto; }
  .main, .is-collapsed .main { margin-left: 0; }
  .is-collapsed .nav-item__label, .is-collapsed .nav-group__label, .is-collapsed .wordmark { opacity: 1; pointer-events: auto; }
  .is-collapsed .nav-item__count { position: static; min-width: 22px; height: 22px; padding: 0 7px; font-size: 12px; box-shadow: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__panel { display: none; }
  .auth__mini { display: flex; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .content { padding: 16px; }
  .header { padding: 0 16px; gap: 10px; }
  .search { display: none; }
  .search-open { display: inline-flex; }
  .search.is-open { display: block; position: absolute; left: 16px; right: 16px; top: 50%; width: auto; z-index: 2; transform: translateY(-50%); animation: fade 150ms var(--ease) both; }
  .search.is-open kbd { display: none; }
  .search.is-open input { padding-right: 16px !important; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  /* four figures in two columns, not four screens of cards */
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid-4 .metric { padding: 14px; }
  .grid-4 .metric__icon { width: 36px; height: 36px; border-radius: var(--r-md); }
  .grid-4 .metric__icon svg { width: 20px; height: 20px; }
  .grid-4 .metric__label { margin-top: 10px; font-size: 13px; }
  .grid-4 .metric__value { font-size: 22px; line-height: 30px; }
  .grid-4 .metric__value .unit { font-size: 14px; margin-left: 4px; }
  .grid-4 .metric__foot { font-size: 12px; }
  .grid, .grid-2, .grid-12, .stack { gap: 16px; }
  .card__head { padding: 16px; }
  .card__body { padding: 16px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
  .metric { padding: 16px; }
  .metric__label { margin-top: 14px; }
  .metric__value { font-size: 26px; line-height: 34px; }
  .chart { height: 240px; }
  .modal { padding: 24px 20px; border-radius: var(--r-xl); }
  .page-head { margin-bottom: 16px; }
  .toasts { right: 16px; bottom: 16px; }
  .pill .pill__text { display: none; }
  .pill { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ---------- additions ---------- */
.crumbs svg { width: 14px; height: 14px; }
.mixbar { display: flex; width: 84px; height: 8px; border-radius: var(--r-full); overflow: hidden; background: var(--gray-100); gap: 2px; }
.dark .mixbar { background: rgb(255 255 255 / .06); }
.mixbar i { display: block; height: 100%; transition: width var(--t-slow) var(--ease-out); }
.mixbar i:first-child { border-radius: 9999px 0 0 9999px; }
.mixbar i:last-child { border-radius: 0 9999px 9999px 0; }
.chart-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.card-tight .card__head { padding-bottom: 12px; }
.stat-inline { display: inline-flex; align-items: baseline; gap: 6px; }
.stat-inline b { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.tbl td.r, .tbl td.num { white-space: nowrap; }
.tbl td .badge + .badge { margin-left: 4px; }

/* account menu: a user's name (or a key's role) beside the avatar */
.user-trigger { gap: 10px; min-width: 0; }
.user-trigger__name { font-size: 14px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__head .truncate { max-width: 240px; }
.menu__sub { font-size: 12px; margin-top: 2px; }
/* phones: the avatar alone (a name would push the header sideways); the menu says who */
@media (max-width: 480px) { .user-trigger__name { display: none; } }

/* sign-in: username and password, or a key */
.auth__fields { display: flex; flex-direction: column; gap: 20px; }
.auth__alt { margin-top: 24px; text-align: center; font-size: 14px; }
