/* v2uptime — shared styles (public status page + admin panel). */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2-variations"),
       url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Flag emoji only; used when flags.js finds that the browser cannot draw flags (Windows). */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("../fonts/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F;
  font-display: swap;
}

:root {
  --font-ui: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --surface-3: #e8ebf1;
  --border: #e1e5ec;
  --text: #161b22;
  --text-2: #3b4350;
  --muted: #6b7482;
  --accent: #2f6fed;
  --accent-soft: #e6eefe;
  --accent-text: #ffffff;
  --ok: #18a058;
  --ok-soft: #e3f6ec;
  --warn: #d48806;
  --warn-soft: #fdf3dc;
  --bad: #d93a3a;
  --bad-soft: #fde8e8;
  --unknown: #8a94a3;
  --unknown-soft: #eef0f3;
  --lv-up: #22b26b;
  --lv-minor: #9ccc3d;
  --lv-major: #f0a020;
  --lv-down: #e04848;
  --lv-none: #d5dae2;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 18px rgba(17, 24, 39, .05);
  --shadow-lg: 0 12px 40px rgba(17, 24, 39, .18);
  --radius: 14px;
  --radius-sm: 9px;
  --focus: 0 0 0 3px rgba(47, 111, 237, .35);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116;
    --surface: #161a21;
    --surface-2: #1c212a;
    --surface-3: #252b36;
    --border: #2a303b;
    --text: #e8ecf2;
    --text-2: #c3cad5;
    --muted: #8d97a6;
    --accent: #5b8cff;
    --accent-soft: #1d2a45;
    --ok: #34c77b;
    --ok-soft: #14301f;
    --warn: #f0b13d;
    --warn-soft: #332810;
    --bad: #f06464;
    --bad-soft: #3a1a1c;
    --unknown: #8d97a6;
    --unknown-soft: #232831;
    --lv-up: #2fbf73;
    --lv-minor: #9ac83f;
    --lv-major: #e9a12a;
    --lv-down: #e25555;
    --lv-none: #2d333e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1116;
  --surface: #161a21;
  --surface-2: #1c212a;
  --surface-3: #252b36;
  --border: #2a303b;
  --text: #e8ecf2;
  --text-2: #c3cad5;
  --muted: #8d97a6;
  --accent: #5b8cff;
  --accent-soft: #1d2a45;
  --ok: #34c77b;
  --ok-soft: #14301f;
  --warn: #f0b13d;
  --warn-soft: #332810;
  --bad: #f06464;
  --bad-soft: #3a1a1c;
  --unknown: #8d97a6;
  --unknown-soft: #232831;
  --lv-up: #2fbf73;
  --lv-minor: #9ac83f;
  --lv-major: #e9a12a;
  --lv-down: #e25555;
  --lv-none: #2d333e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, strong, b, th { font-weight: 600; }
h1 { font-size: var(--fs-xl); line-height: 1.35; margin: 0; }
h2, h3, h4 { font-size: var(--fs-md); line-height: 1.35; margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.flags-polyfill body, .flags-polyfill button, .flags-polyfill input, .flags-polyfill select,
.flags-polyfill textarea { font-family: "Twemoji Country Flags", var(--font-ui); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
small { font-size: var(--fs-xs); }
code, .mono, input.mono, textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; direction: ltr; }
.ltr, .num, time { unicode-bidi: isolate; }
.ltr, .num { direction: ltr; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; font-weight: 600; font-size: var(--fs-md); white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: var(--fs-sm); }
.btn.btn-icon { width: 32px; min-width: 32px; height: 32px; padding: 0; }
.btn.btn-icon.is-off { color: var(--muted); opacity: .45; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

/* ------------------------------------------------------------------ public page */
.public .wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.fine { font-size: var(--fs-sm); color: var(--muted); }
.page-top { padding: 16px 0 8px; }
.page-top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.page-top-actions { display: inline-flex; align-items: center; gap: 4px; }
.page-top .fine { margin: 4px 0 0; }
.sort-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 16px; }
.public .segmented { max-width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.check-line { margin: 14px 0 32px; text-align: center; }
.theme-toggle .ic-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ic-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .ic-moon { display: block; }
}

.segmented { display: flex; gap: 4px; flex-wrap: wrap; background: var(--surface-2); border-radius: 8px; padding: 4px; width: fit-content; }
.seg {
  display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent;
  padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-weight: 400; text-decoration: none;
}
.public .seg { color: var(--muted); }
.seg:hover { text-decoration: none; color: var(--text); }
.seg.is-active { background: var(--surface); color: var(--text); font-weight: 600; }
.public .seg.is-active { font-weight: 400; }

/* ------------------------------------------------------------------ summary */
.summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.stat .ic { width: 28px; height: 28px; padding: 5px; border-radius: 10px; box-sizing: content-box; }
.stat-online .ic { color: var(--ok); background: var(--ok-soft); }
.stat-degraded .ic { color: var(--warn); background: var(--warn-soft); }
.stat-offline .ic { color: var(--bad); background: var(--bad-soft); }
.stat-uptime .ic { color: var(--accent); background: var(--accent-soft); }
.stat-value { display: block; font-size: var(--fs-xl); font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
time, .num, .card-ping, .card-stats dd, .stat-value { font-variant-numeric: tabular-nums; }
.stat-label { display: block; color: var(--muted); font-size: var(--fs-sm); }
@media (min-width: 700px) { .summary { grid-template-columns: repeat(4, 1fr); } }
.updated { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: var(--fs-sm); margin: 12px 2px 14px; }
.updated .sep { opacity: .6; }

/* Server cards. Closed: name and ping, the 24h bar, status and uptime. The bar sits outside the
   button (it has its own pointer handling), positioned over the gap the button leaves for it. */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card {
  --pad: 11px; --top: 26px; --bar-h: 16px; --bar-gap: 8px;
  position: relative; min-width: 0; padding-block: var(--pad); padding-inline: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; cursor: pointer;
}
.card:hover { border-color: color-mix(in srgb, var(--border) 55%, var(--text-2)); }
.card:has(.card-main:focus-visible) { box-shadow: var(--focus); }
.card-main {
  display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: start; cursor: pointer;
}
.card-main:focus-visible { box-shadow: none; }
.card-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.card-top { height: var(--top); }
.card-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); font-weight: 600; }
.card-ping { flex: none; font-size: var(--fs-lg); font-weight: 600; }
.card-ping.is-empty { color: var(--muted); }
.card-gap { display: block; height: calc(var(--bar-h) + 2 * var(--bar-gap)); }
.card-sub { height: 22px; font-size: var(--fs-sm); color: var(--muted); }
.card-state { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-state strong { color: var(--text); font-weight: 600; }
.card-range { flex: none; display: inline-flex; align-items: center; gap: 2px; }
.card-range .ic { width: 16px; height: 16px; vertical-align: 0; transition: transform .2s; }
.card.is-open .card-range .ic { transform: rotate(180deg); }
.card-bars {
  position: absolute; top: calc(var(--pad) + var(--top) + var(--bar-gap)); inset-inline: 14px; height: var(--bar-h);
  cursor: default; touch-action: pan-y;
}
.card.is-open .card-bars, .card.is-open .card-gap { display: none; }
.card-sub { margin-top: 0; }
.card.is-open .card-sub { margin-top: 6px; }
/* Open card: one range control for the numbers, the bar and the ping chart (one time axis). */
.card-detail { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); cursor: default; }
.range-seg { margin-bottom: 12px; }
.card-stats { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0 0 12px; }
.card-stats dt { font-size: var(--fs-sm); color: var(--muted); }
.card-stats dd { margin: 0; font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; width: fit-content; }
.timeline { position: relative; touch-action: pan-y; direction: ltr; }
.range-bars { height: var(--bar-h, 16px); margin-bottom: 6px; }
.timeline .chart { height: 134px; } /* 116px plot + 18px time labels */
.timeline.is-loading .range-bars, .timeline.is-loading .chart { background: var(--surface-2); border-radius: 6px; }
.timeline.is-loading canvas { visibility: hidden; }
.cursor { position: absolute; top: 0; bottom: 18px; width: 1px; margin-left: -0.5px; background: var(--text-2); pointer-events: none; }
.card-incident { margin: 8px 0 0; }
.chip {
  font-size: var(--fs-xs); padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2);
  direction: ltr; font-weight: 400;
}
/* Each cell takes exactly 1/n of the width (so it lines up with the chart's time axis); the colour is inset 1px. */
.bars { display: flex; height: 16px; direction: ltr; align-items: stretch; }
.b {
  flex: 1 1 0; min-width: 0; padding: 0 1px; border-radius: 3px; background: var(--lv-none); background-clip: content-box;
  transition: filter .1s;
}
.b.is-hover { filter: brightness(1.25); }
.lv-up { background-color: var(--lv-up); }
.lv-minor { background-color: var(--lv-minor); }
.lv-major { background-color: var(--lv-major); }
.lv-down { background-color: var(--lv-down); }
.empty {
  text-align: center; color: var(--muted); padding: 48px 16px; background: var(--surface);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty .ic { width: 40px; height: 40px; opacity: .6; }
.site-footer { color: var(--muted); font-size: var(--fs-sm); padding-top: 24px; padding-bottom: 32px; text-align: center; }
.public .empty { color: var(--muted); }

/* ------------------------------------------------------------------ tooltip */
.tooltip {
  position: fixed; z-index: 60; pointer-events: none; max-width: calc(100vw - 16px); white-space: nowrap;
  background: var(--text); color: var(--bg); border-radius: 8px; padding-block: 8px; padding-inline: 12px;
  font-family: inherit; font-size: var(--fs-xs); font-weight: 400; text-align: start;
}
.chart { position: relative; height: 160px; direction: ltr; }
.chart canvas { width: 100%; height: 100%; display: block; }
.chart.is-loading { background: var(--surface-2); border-radius: 8px; }

/* ================================================================== admin */
.admin { background: var(--bg); }
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.topbar .brand:hover { text-decoration: none; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.nav-toggle { display: inline-grid; }
.admin-body { display: flex; flex: 1; min-width: 0; }
.sidenav {
  position: fixed; inset-block: 57px 0; inset-inline-start: 0; z-index: 25; width: 240px; padding: 12px;
  background: var(--surface); border-inline-end: 1px solid var(--border); transform: translateX(-100%);
  transition: transform .2s; overflow-y: auto;
}
.sidenav.is-open { transform: none; box-shadow: var(--shadow-lg); }
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-2);
  font-weight: 400; margin-bottom: 2px;
}
.sidenav a:hover { background: var(--surface-2); text-decoration: none; }
.sidenav a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.admin-main { flex: 1; min-width: 0; padding: 18px 16px 40px; }
@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .sidenav { position: sticky; top: 57px; height: calc(100vh - 57px); transform: none; flex: none; }
  .admin-main { padding: 24px 28px 48px; }
}
.section-tabs { margin-bottom: 16px; }
.section-tabs .seg { min-height: 36px; }
.settings-page #monitoring { display: none; }
.settings-page:has(#monitoring:target) #general { display: none; }
.settings-page:has(#monitoring:target) #monitoring { display: block; }
.settings-page:not(:has(#monitoring:target)) a[data-settings-tab="general"],
.settings-page:has(#monitoring:target) a[data-settings-tab="monitoring"] { background: var(--surface); color: var(--text); }
.advanced { margin-top: 16px; }
.advanced summary { cursor: pointer; font-weight: 400; margin-bottom: 8px; }
.status-line { margin: 0 0 8px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.page-head h1 { font-size: var(--fs-xl); }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; min-width: 0;
}
.panel > h2 { margin-bottom: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: var(--fs-md); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1000px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 800px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: var(--fs-md); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 9px 8px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: var(--fs-xs); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td.actions { white-space: nowrap; text-align: end; }
.table .num { direction: ltr; text-align: end; white-space: nowrap; }
tr.is-dragging { opacity: .4; }
tr.drop-target td { box-shadow: inset 0 2px 0 var(--accent); }
.drag-handle { cursor: grab; color: var(--muted); touch-action: none; }
.grip { display: inline-grid; place-items: center; width: 24px; height: 24px; cursor: grab; }
.check-col { width: 36px; }
.row-check { width: 20px; height: 20px; margin: 0; vertical-align: middle; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--unknown); margin-inline-end: 6px; }
.status-dot.online { background: var(--ok); }
.status-dot.degraded { background: var(--warn); }
.status-dot.offline { background: var(--bad); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-xs); background: var(--surface-2); color: var(--text-2); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 800px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
@media (min-width: 800px) { .form-grid.single { grid-template-columns: 1fr; } }
#server-table { --col-check: 36px; --col-handle: 28px; width: max-content; min-width: 100%; }
#server-table th, #server-table td { padding-inline: 6px; }
#server-table td { white-space: nowrap; }
#server-table .col-check { width: var(--col-check); min-width: var(--col-check); max-width: var(--col-check); }
#server-table .col-handle { width: var(--col-handle); min-width: var(--col-handle); max-width: var(--col-handle); padding-inline: 0; text-align: center; }
#server-table .col-name { width: 208px; max-width: 208px; }
#server-table td.col-name a {
  display: block; width: 208px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#server-table .btn.btn-icon { width: 28px; min-width: 28px; height: 28px; }
#server-table td.col-status { white-space: normal; }
#server-table .row-actions { display: inline-flex; align-items: center; gap: 4px; }
#server-table .row-actions form { display: inline-flex; margin: 0; }
#server-table .test-mark {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px;
  width: 60px; min-width: 60px; max-width: 60px; overflow: hidden;
  font-size: var(--fs-xs); font-variant-numeric: tabular-nums;
}
#server-table .test-mark::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none;
}
#server-table .test-mark.is-ok { color: var(--ok); }
#server-table .test-mark.is-bad { color: var(--bad); }
@media (max-width: 1279px) {
  #server-table .col-check,
  #server-table .col-handle,
  #server-table .col-name { position: sticky; background: var(--surface); }
  #server-table thead .col-check,
  #server-table thead .col-handle,
  #server-table thead .col-name { z-index: 2; }
  #server-table tbody .col-check,
  #server-table tbody .col-handle,
  #server-table tbody .col-name { z-index: 1; }
  #server-table .col-check { left: 0; }
  #server-table .col-handle { left: var(--col-check); }
  #server-table .col-name { left: calc(var(--col-check) + var(--col-handle)); }
  #server-table tbody tr:hover td { background: var(--surface-2); }
  #server-table tbody tr:has(.row-check:checked) td { background: var(--accent-soft); }
}
.field label, .field .label { display: block; font-weight: 400; font-size: var(--fs-sm); margin-bottom: 5px; }
.field .help { display: block; color: var(--muted); font-size: var(--fs-xs); margin-top: 4px; }
.input, .field input[type=text], .field input[type=password], .field input[type=number], .field input[type=url],
.field input[type=time], .field input[type=search], .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
  padding: 9px 12px; min-height: 40px; color: var(--text);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: var(--fs-md); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.checks { display: grid; gap: 6px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.alert { border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; font-size: var(--fs-md); border: 1px solid transparent; }
.alert ul { margin: 6px 0 0; padding-inline-start: 20px; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert-error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert-info { background: var(--accent-soft); color: var(--accent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { margin-bottom: 4px; }
.test-result { font-size: var(--fs-xs); margin-inline-start: 6px; }
.status-note { margin: 10px 0 0; min-height: 1.5em; font-size: var(--fs-md); color: var(--text-2); }
.status-note.is-ok { color: var(--ok); }
.status-note.is-bad { color: var(--bad); }
.toast {
  position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(50%); z-index: 70;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: var(--fs-md);
}
.log-box {
  background: var(--surface-2); border-radius: 10px; padding: 10px; max-height: 260px; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-xs); white-space: pre-wrap; word-break: break-all;
}
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.filter-bar .field { min-width: 160px; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }

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