/* ===========================================================================
   Design tokens
   Three selectable themes (light / dim / dark). Status colors (good / warn /
   danger / neutral) are fixed-meaning and validated for contrast + CVD
   (colorblind) separation on every surface below — see TESTING.md §15/§16.
   =========================================================================== */

:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #ffffff;
  --panel-2: #f1efe7;
  --border: #e3ded3;
  --border-soft: #ece7dc;
  --text: #16221f;
  --muted: #45524d;
  --muted-2: #7c8781;
  --radius: 12px;

  --accent: #0e7c86;
  --accent-2: #0b6169;
  --accent-ink: #ffffff;
  --accent-bg: rgba(14,124,134,0.10);

  --success-border: #196b1a;
  --success-text: #196b1a;
  --success-bg: #e6f6e1;
  --good: #0ca30c;

  --warn-border: #8a5a00;
  --warn-text: #8a5a00;
  --warn-bg: #fdf1d8;
  --warn-solid: #d98c00;

  --danger-border: #a5241f;
  --danger-text: #a5241f;
  --danger-bg: #fbe6e5;
  --crit: #d03b3b;

  --neutral-border: #cdd3cf;
  --neutral-text: #4f5c58;
  --neutral-bg: #edf1ef;
  --unk: #6b7a76;

  --log-bg: #f1efe7;
  --shadow-1: 0 1px 2px rgba(22,34,31,0.06);
  --shadow-2: 0 6px 20px -6px rgba(22,34,31,0.16), 0 2px 6px rgba(22,34,31,0.06);
  --shadow-3: 0 24px 48px -12px rgba(22,34,31,0.28);
}

/* Dark — system preference, no explicit choice saved yet */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c1513;
    --panel: #121d1a;
    --panel-2: #172420;
    --border: #24332e;
    --border-soft: #1c2925;
    --text: #eef4f1;
    --muted: #a9b8b2;
    --muted-2: #71827b;

    --accent: #4fd6d9;
    --accent-2: #37b6b9;
    --accent-ink: #06211f;
    --accent-bg: rgba(79,214,217,0.16);

    --success-border: #8de89a;
    --success-text: #8de89a;
    --success-bg: #143820;
    --good: #4ade5a;

    --warn-border: #f6cf7d;
    --warn-text: #f6cf7d;
    --warn-bg: #3a2c0c;
    --warn-solid: #f5b93a;

    --danger-border: #f6a4a1;
    --danger-text: #f6a4a1;
    --danger-bg: #3a1616;
    --crit: #f0605c;

    --neutral-border: #24332e;
    --neutral-text: #b7c4bf;
    --neutral-bg: #1c2925;
    --unk: #93a6a0;

    --log-bg: #0d1614;
    --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-2: 0 6px 20px -6px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
    --shadow-3: 0 24px 48px -12px rgba(0,0,0,0.6);
  }
}

/* ... or the explicit toggle wins either direction */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1513;
  --panel: #121d1a;
  --panel-2: #172420;
  --border: #24332e;
  --border-soft: #1c2925;
  --text: #eef4f1;
  --muted: #a9b8b2;
  --muted-2: #71827b;

  --accent: #4fd6d9;
  --accent-2: #37b6b9;
  --accent-ink: #06211f;
  --accent-bg: rgba(79,214,217,0.16);

  --success-border: #8de89a;
  --success-text: #8de89a;
  --success-bg: #143820;
  --good: #4ade5a;

  --warn-border: #f6cf7d;
  --warn-text: #f6cf7d;
  --warn-bg: #3a2c0c;
  --warn-solid: #f5b93a;

  --danger-border: #f6a4a1;
  --danger-text: #f6a4a1;
  --danger-bg: #3a1616;
  --crit: #f0605c;

  --neutral-border: #24332e;
  --neutral-text: #b7c4bf;
  --neutral-bg: #1c2925;
  --unk: #93a6a0;

  --log-bg: #0d1614;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 6px 20px -6px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-3: 0 24px 48px -12px rgba(0,0,0,0.6);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #ffffff;
  --panel-2: #f1efe7;
  --border: #e3ded3;
  --border-soft: #ece7dc;
  --text: #16221f;
  --muted: #45524d;
  --muted-2: #7c8781;

  --accent: #0e7c86;
  --accent-2: #0b6169;
  --accent-ink: #ffffff;
  --accent-bg: rgba(14,124,134,0.10);

  --success-border: #196b1a;
  --success-text: #196b1a;
  --success-bg: #e6f6e1;
  --good: #0ca30c;

  --warn-border: #8a5a00;
  --warn-text: #8a5a00;
  --warn-bg: #fdf1d8;
  --warn-solid: #d98c00;

  --danger-border: #a5241f;
  --danger-text: #a5241f;
  --danger-bg: #fbe6e5;
  --crit: #d03b3b;

  --neutral-border: #cdd3cf;
  --neutral-text: #4f5c58;
  --neutral-bg: #edf1ef;
  --unk: #6b7a76;

  --log-bg: #f1efe7;
  --shadow-1: 0 1px 2px rgba(22,34,31,0.06);
  --shadow-2: 0 6px 20px -6px rgba(22,34,31,0.16), 0 2px 6px rgba(22,34,31,0.06);
  --shadow-3: 0 24px 48px -12px rgba(22,34,31,0.28);
}

/* Dim — a distinct third stamp: a soft slate-green, easier at a desk at
   night than full black, not just a slightly-darker copy of dark mode. */
:root[data-theme="dim"] {
  color-scheme: dark;
  --bg: #26332f;
  --panel: #30403a;
  --panel-2: #384c44;
  --border: #4c645a;
  --border-soft: #405449;
  --text: #f5faf8;
  --muted: #c7d4ce;
  --muted-2: #93a69e;

  --accent: #5bdbdd;
  --accent-2: #3fc0c2;
  --accent-ink: #06211f;
  --accent-bg: rgba(91,219,221,0.18);

  --success-border: #9aeca4;
  --success-text: #9aeca4;
  --success-bg: #1f4128;
  --good: #57e06d;

  --warn-border: #f8d488;
  --warn-text: #f8d488;
  --warn-bg: #45350f;
  --warn-solid: #f7c250;

  --danger-border: #f8afac;
  --danger-text: #f8afac;
  --danger-bg: #452020;
  --crit: #f4726e;

  --neutral-border: #4c645a;
  --neutral-text: #c3cfca;
  --neutral-bg: #2c3d38;
  --unk: #9db0aa;

  --log-bg: #384c44;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-2: 0 6px 20px -6px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.25);
  --shadow-3: 0 24px 48px -12px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

/* Smooth, non-laggy theme + hover transitions site-wide — kept short so
   they read as "polished" rather than sluggish. */
a, .btn, .badge, .pill, input, textarea, fieldset, .panel, .stat-tile, .table td,
.identity-row, .lst-tab, .wp-btn, .toast, .topbar, .row-link, .ip-card, .chip {
  transition: background-color 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

.container { max-width: 1120px; margin: 0 auto; padding: 32px 24px 80px; }

/* --------------------------------------------------------------- topbar --- */
.topbar {
  background: var(--panel); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { font-weight: 700; color: var(--text); font-size: 16px; display: flex; align-items: center; gap: 9px; letter-spacing: -0.01em; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  background: var(--accent); color: var(--accent-ink);
}
.brand-mark svg { width: 16px; height: 16px; }
.brand-logo { height: 24px; max-width: 160px; object-fit: contain; flex-shrink: 0; }
.login-logo { display: block; height: 48px; max-width: 240px; object-fit: contain; margin: 0 auto 12px; }

.branding-field { display: flex; flex-direction: column; gap: 8px; }
.branding-label { font-weight: 600; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.branding-preview {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); width: fit-content; max-width: 100%;
}
.branding-preview img { max-height: 48px; max-width: 200px; object-fit: contain; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: var(--muted); font-weight: 600; font-size: 13.5px; position: relative; padding: 7px 11px; border-radius: 7px; }
.topbar nav a:hover { color: var(--text); text-decoration: none; background: var(--panel-2); }
.logout-form { display: flex; align-items: center; gap: 14px; }
.username { color: var(--muted); font-size: 13px; }
.link-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 0; text-decoration: underline;
}

/* ---------------------------------------------------------- theme switch --- */
.theme-switch {
  display: flex; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 2px; gap: 2px;
}
.theme-switch button {
  border: none; background: transparent; color: var(--muted-2); cursor: pointer;
  width: 30px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
}
.theme-switch button svg { width: 15px; height: 15px; }
.theme-switch button.active { background: var(--panel); color: var(--accent); box-shadow: var(--shadow-1); }
.theme-switch button:hover:not(.active) { color: var(--text); }
.theme-switch-float { position: fixed; top: 16px; right: 20px; z-index: 50; box-shadow: var(--shadow-2); }

h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.015em; }
h2 { font-size: 17px; margin: 32px 0 12px; letter-spacing: -0.005em; }
.muted { color: var(--muted); font-size: 13.5px; }

.center-card {
  max-width: 380px; margin: 60px auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow-1);
}
.center-card h1 { text-align: center; }
.center-card .muted { text-align: center; margin-bottom: 20px; }

.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.page-header .page-sub { margin-top: 2px; }

section.block { margin: 34px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 13px; gap: 12px; flex-wrap: wrap; }
.block-head h2 { font-size: 15px; margin: 0; letter-spacing: -0.005em; }
.hint { color: var(--muted-2); font-size: 12.5px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.wide { max-width: 640px; }

label { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.checkbox-label { flex-direction: row; align-items: center; gap: 8px; }
.checkbox-label input { width: auto; }

input[type=text], input[type=password], input[type=number], input[type=file] {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 11px; font-size: 14px; font-family: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
legend { padding: 0 8px; color: var(--text); font-weight: 600; font-size: 13.5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); padding: 9px 16px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; text-decoration: none; box-shadow: var(--shadow-1);
}
.btn:hover { border-color: var(--muted-2); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 10px -4px var(--accent); }
.btn.primary:hover { filter: brightness(1.05); border-color: var(--accent); }
.btn.danger { background: transparent; border-color: var(--danger-border); color: var(--danger-border); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }

.alert { padding: 12px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.alert.error { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-text); }
.alert.warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); }
.alert.success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-text); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--border-soft); }
.row-link { cursor: pointer; }
.row-link:hover { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.status-queued { background: var(--neutral-bg); color: var(--neutral-text); }
.status-running { background: var(--accent-bg); color: var(--accent); }
.status-paused { background: var(--warn-bg); color: var(--warn-text); }
.status-completed { background: var(--success-bg); color: var(--success-text); }
.status-error { background: var(--danger-bg); color: var(--danger-text); }
.status-cancelled { background: var(--neutral-bg); color: var(--neutral-text); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .btn { margin-top: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 20px 0; }
@media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: var(--shadow-1); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.stat-value { font-size: 22px; font-weight: 700; font-family: "IBM Plex Mono", monospace; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-tile.valid .stat-value { color: var(--success-border); }
.stat-tile.invalid .stat-value { color: var(--danger-border); }
.stat-tile.catchall .stat-value { color: var(--warn-border); }
.stat-tile.unknown .stat-value { color: var(--warn-border); }

.actions { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow-1); }
.panel h2 { margin-top: 0; }

.blocklist-banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; line-height: 1.5;
}
.blocklist-banner .bl-icon { font-weight: 700; flex-shrink: 0; }
.blocklist-banner a { text-decoration: underline; }
.blocklist-banner.clean { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-text); }
.blocklist-banner.warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); }
.blocklist-banner.critical { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-text); }
.blocklist-banner.unknown { background: var(--neutral-bg); border: 1px solid var(--border); color: var(--muted); }

.blocklist-details { margin: -8px 0 16px; font-size: 13px; }
.blocklist-details summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.blocklist-details summary:hover { color: var(--text); }
.table.compact th, .table.compact td { padding: 7px 10px; font-size: 13px; }

.identity-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.identity-row:last-child { border-bottom: none; }
.identity-row .ident-main { flex: 1; min-width: 220px; }
.identity-row .ident-ip { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; }
.identity-row .ident-host { color: var(--muted); font-size: 12.5px; }

.qr-wrap { display: flex; justify-content: center; padding: 16px; background: #fff; border-radius: var(--radius); max-width: 260px; margin: 14px auto; }
.qr-wrap img { display: block; }
.secret-key {
  display: block; text-align: center; font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 14px; letter-spacing: 1px; background: var(--log-bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 14px; margin: 8px 0 16px; word-break: break-all;
}
.twofa-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.twofa-status .badge.on { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-text); }
.twofa-status .badge.off { background: var(--neutral-bg); border: 1px solid var(--border); color: var(--muted); }

/* --------------------------------------------------------------- toasts --- */
#toast-root {
  position: fixed; top: 18px; right: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(380px, calc(100vw - 36px));
}
#toast-root .toast {
  position: relative; margin-bottom: 0; padding-right: 34px;
  box-shadow: var(--shadow-2);
  opacity: 0; transform: translateX(24px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#toast-root .toast.toast-in { opacity: 1; transform: translateX(0) scale(1); }
#toast-root .toast.toast-out { opacity: 0; transform: translateX(24px) scale(0.98); }
.toast-close {
  position: absolute; top: 8px; right: 8px; width: 20px; height: 20px;
  border-radius: 999px; border: none; background: transparent; color: inherit;
  cursor: pointer; font-size: 15px; line-height: 1; opacity: 0.6;
  display: flex; align-items: center; justify-content: center;
}
.toast-close:hover { opacity: 1; background: rgba(0,0,0,0.08); }

/* --------------------------------------------------------- warm-up presets --- */
.warmup-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.wp-btn {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  cursor: pointer;
}
.wp-btn:hover { border-color: var(--accent); color: var(--text); }
.wp-btn.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.field-flash {
  animation: field-flash-anim 0.65s ease;
}
@keyframes field-flash-anim {
  0% { background-color: var(--accent-bg); border-color: var(--accent); }
  100% { background-color: var(--panel-2); }
}

/* ------------------------------------------------- upload / paste tabs --- */
.list-source-tabs { display: flex; gap: 4px; margin: 10px 0 12px; border-bottom: 1px solid var(--border); }
.lst-tab {
  background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
  color: var(--muted); font-size: 13.5px; font-weight: 600; padding: 8px 4px; margin-bottom: -1px;
}
.lst-tab:hover { color: var(--text); }
.lst-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.list-source-pane { padding-top: 2px; }
.list-source-pane textarea {
  width: 100%; min-height: 140px; resize: vertical;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font-size: 13.5px; font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.list-source-pane .tight { margin: 6px 0 0; }

/* =====================================================================
   Pills — the accessible 4-tier status system (good / flagged / invalid /
   unknown). Always icon + label, never color alone. See TESTING.md §15.
   ===================================================================== */
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 3px 9px 3px 7px; border-radius: 999px; white-space: nowrap;
}
.pill svg { width: 11px; height: 11px; flex-shrink: 0; }
.pill.good { background: var(--success-bg); color: var(--success-text); }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); }
.pill.crit { background: var(--danger-bg); color: var(--danger-text); }
.pill.unk  { background: var(--neutral-bg); color: var(--neutral-text); }

/* ------------------------------------------------------------ stat row --- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
@media (max-width: 920px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-tile-lg {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-1); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-tile-lg:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.stat-tile-lg .label { font-size: 11.5px; color: var(--muted-2); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.stat-tile-lg .value-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.stat-tile-lg .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-family: "IBM Plex Mono", monospace; }
.stat-tile-lg .delta { font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 5px; }
.stat-tile-lg .delta.up { color: var(--success-text); background: var(--success-bg); }
.stat-tile-lg .delta.down { color: var(--danger-text); background: var(--danger-bg); }
.stat-tile-lg .foot { margin-top: 9px; font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.stat-tile-lg .spark { display: block; margin-top: 10px; }

/* -------------------------------------------------------------- ip cards --- */
.ip-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.ip-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 10px;
}
.ip-card.state-warn { border-color: color-mix(in srgb, var(--warn-solid) 45%, var(--border)); }
.ip-card.state-crit { border-color: color-mix(in srgb, var(--crit) 45%, var(--border)); background: color-mix(in srgb, var(--danger-bg) 35%, var(--panel)); }
.ip-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ip-host { font-weight: 700; font-size: 13.5px; }
.ip-addr { font-size: 12px; color: var(--muted-2); margin-top: 1px; font-family: "IBM Plex Mono", monospace; }
.ip-metric-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.ip-metric-row b { color: var(--text); font-weight: 700; font-family: "IBM Plex Mono", monospace; }
.ip-note { font-size: 11.5px; color: var(--muted-2); line-height: 1.45; border-top: 1px dashed var(--border-soft); padding-top: 8px; }
.ip-note.crit-note { color: var(--danger-text); }
.ip-note code { background: var(--panel-2); padding: 1px 4px; border-radius: 4px; }

/* ------------------------------------------------------------- run panel --- */
.run-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-1); overflow: hidden; margin: 20px 0; }
.run-top { padding: 18px 20px 16px; border-bottom: 1px solid var(--border-soft); }
.run-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.run-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 9px; }
.run-title .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--success-bg); animation: pulse 2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .run-title .live-dot { animation: none; } }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
.run-actions { display: flex; gap: 8px; }
.progress-line { display: flex; align-items: center; gap: 12px; margin-top: 13px; }
.progress-track { flex: 1; height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; display: flex; }
.progress-track span { height: 100%; }
.progress-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-family: "IBM Plex Mono", monospace; }
.verdict-legend { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.verdict-legend .li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.verdict-legend .sw { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }

.filter-row { display: flex; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--muted);
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip:hover:not(.active) { border-color: var(--muted-2); color: var(--text); }

table.feed { width: 100%; border-collapse: collapse; }
table.feed th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted-2); font-weight: 700; padding: 10px 20px; border-bottom: 1px solid var(--border-soft);
}
table.feed td { padding: 9px 20px; border-bottom: 1px solid var(--border-soft); font-size: 13px; vertical-align: middle; }
table.feed tr:last-child td { border-bottom: none; }
table.feed tr:hover td { background: var(--panel-2); }
.email-cell { display: flex; flex-direction: column; }
.email-cell .addr { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; word-break: break-all; }
.email-cell .flags { display: flex; gap: 5px; margin-top: 3px; flex-wrap: wrap; }
.tag {
  font-size: 10.5px; font-weight: 700; color: var(--muted-2); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 5px; text-transform: uppercase; letter-spacing: .03em;
}
.code-cell { color: var(--muted); font-family: "IBM Plex Mono", monospace; }
.ip-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; font-family: "IBM Plex Mono", monospace; }
.ip-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.ip-tag .dot.warn { background: var(--warn-solid); }
.ip-tag .dot.crit { background: var(--crit); }

.live-log-empty { padding: 26px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------- jobs list --- */
.job-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow-1); }
.job-row { display: grid; grid-template-columns: 1.6fr .9fr 1.4fr .9fr; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.job-row:hover { background: var(--panel-2); }
.job-row:last-child { border-bottom: none; }
.job-name { font-weight: 700; font-size: 13.5px; }
.job-meta { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.mini-bar { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; display: flex; }
.mini-bar span { height: 100%; }
.job-status { justify-self: end; }
@media (max-width: 820px) {
  .job-row { grid-template-columns: 1fr; row-gap: 6px; }
  .job-status { justify-self: start; }
}

.legend-note {
  margin-top: 26px; padding: 14px 18px; border: 1px dashed var(--border); border-radius: 12px;
  font-size: 12.5px; color: var(--muted); display: flex; gap: 12px; align-items: flex-start;
}
.legend-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--muted-2); }

/* -------------------------------------------------------------- modal --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,16,14,0.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 300; padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-3);
  width: 380px; max-width: 100%; padding: 22px 22px 18px; border: 1px solid var(--border);
}
.modal-icon {
  width: 40px; height: 40px; border-radius: 11px; background: var(--warn-bg); color: var(--warn-text);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.modal-icon svg { width: 21px; height: 21px; }
.modal-card h3 { margin: 0 0 8px; font-size: 16px; letter-spacing: -0.01em; }
.modal-card p { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
