:root {
  --bg0: #06080D;
  --bg1: #0B0F17;
  --bg2: #101623;
  --bg3: #151D2E;
  --line: #1C2434;
  --line2: #28334A;
  --text: #E9EDF5;
  --text-dim: #AAB3C5;
  --muted: #6E7A92;
  --accent: #FFC400;
  --accent2: #FFDD55;
  --accent-dim: rgba(255, 196, 0, 0.12);
  --ok: #3DDC97;
  --ok-dim: rgba(61, 220, 151, 0.12);
  --warn: #FFC24B;
  --warn-dim: rgba(255, 194, 75, 0.12);
  --fail: #FF6B6B;
  --fail-dim: rgba(255, 107, 107, 0.12);
  --info: #6CABFF;
  --info-dim: rgba(108, 171, 255, 0.12);
  --shadow1: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow2: 0 30px 90px rgba(0, 0, 0, 0.55);
  --r: 12px;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-display: "Unbounded", "IBM Plex Sans", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(640px 420px at 82% -2%, rgba(255, 196, 0, 0.075), transparent 62%),
    radial-gradient(760px 520px at 8% 104%, rgba(108, 171, 255, 0.06), transparent 62%),
    radial-gradient(520px 420px at 92% 78%, rgba(61, 220, 151, 0.045), transparent 62%);
  animation: drift 26s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.6'/></svg>");
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 100%);
}

.display { font-family: var(--font-display); }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--bg2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
b { font-weight: 600; }

::selection { background: rgba(255, 196, 0, 0.25); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; border: 2px solid var(--bg0); }
::-webkit-scrollbar-thumb:hover { background: #33415e; }

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

/* ---------- login ---------- */

.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.login-card {
  width: min(430px, 100%);
  background: rgba(13, 17, 26, 0.72);
  backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 44px 38px 26px;
  box-shadow: var(--shadow2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.login-card.shake { animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

.login-mark { text-align: center; margin-bottom: 30px; position: relative; }

.mark-core {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border-radius: 15px;
  border: 2.5px solid var(--accent);
  display: grid;
  place-items: center;
  position: relative;
  background: rgba(255, 196, 0, 0.05);
}
.mark-core span { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }

.mark-rings { position: absolute; top: -14px; left: 50%; width: 60px; height: 60px; transform: translateX(-50%); pointer-events: none; }
.mark-rings i { position: absolute; inset: 0; border: 1px solid rgba(255, 196, 0, 0.4); border-radius: 15px; animation: radar 3.2s cubic-bezier(0.2, 0.6, 0.4, 1) infinite; }
.mark-rings i:nth-child(2) { animation-delay: 1.05s; }
.mark-rings i:nth-child(3) { animation-delay: 2.1s; }

.login-card h1 { font-size: 25px; font-weight: 900; letter-spacing: 0.05em; }
.login-sub { color: var(--text-dim); font-size: 13px; margin-top: 7px; }
.login-hint { color: var(--muted); font-size: 12px; text-align: center; margin-top: 18px; }
.login-ver { color: var(--muted); font-size: 10.5px; text-align: center; margin-top: 6px; font-family: var(--font-mono); letter-spacing: 0.06em; opacity: 0.7; }

/* ---------- topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 10, 16, 0.78);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.topbar-inner { max-width: 100%; padding: 13px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 2.5px solid var(--accent);
  display: grid;
  place-items: center;
  flex: none;
  background: rgba(255, 196, 0, 0.05);
  box-shadow: 0 0 20px rgba(255, 196, 0, 0.12);
}
.brand-mark span { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: led 2.4s ease-in-out infinite; }

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.07em;
  display: block;
  background: linear-gradient(90deg, #F2F5FA 30%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub { color: var(--muted); font-size: 12px; display: block; }

.topnav { display: flex; align-items: center; gap: 8px; }

.svc { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ok); font-family: var(--font-mono); padding: 4px 11px; border: 1px solid rgba(61, 220, 151, 0.3); background: var(--ok-dim); border-radius: 999px; margin-right: 6px; }
.svc i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: led 2s infinite; }

.nav-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font: inherit;
  font-weight: 500;
  padding: 8px 15px;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); box-shadow: inset 0 0 0 1px rgba(255, 196, 0, 0.3); }

.nav-user { color: var(--muted); font-size: 13px; margin-left: 10px; padding-left: 14px; border-left: 1px solid var(--line); }

.warnbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 24px -6px;
  padding: 10px 16px;
  background: var(--warn-dim);
  border: 1px solid rgba(255, 194, 75, 0.3);
  border-radius: var(--r);
  color: var(--warn);
  font-size: 13.5px;
}
.warn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px var(--warn); animation: led 1.6s infinite; flex: none; }

/* ---------- layout ---------- */

.content { position: relative; z-index: 1; max-width: 100%; margin: 0 auto; padding: 28px 24px 64px; }

#view-main { animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-title { display: flex; align-items: center; gap: 12px; }
.toolbar-title h2 { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: 0.02em; }
.count-chip { font-family: var(--font-mono); font-size: 12px; color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(255, 196, 0, 0.25); padding: 2px 9px; border-radius: 999px; }
.toolbar-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- buttons & inputs ---------- */

.btn {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 9px;
  padding: 9px 16px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, background 0.15s, box-shadow 0.15s, filter 0.15s;
}
.btn:hover { border-color: #38466144; border-color: #384661; transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  border-color: rgba(255, 196, 0, 0.6);
  color: #1A1405;
  box-shadow: 0 4px 18px rgba(255, 196, 0, 0.18);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(255, 196, 0, 0.3); filter: brightness(1.04); }

.btn-danger { background: var(--fail-dim); border-color: rgba(255, 107, 107, 0.4); color: var(--fail); }
.btn-danger:hover { background: rgba(255, 107, 107, 0.2); }

.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: wait; transform: none; }

.input, .field input, .field select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: rgba(10, 14, 22, 0.8);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input:focus, .field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.13); background: var(--bg1); }
.input::placeholder, .field input::placeholder { color: var(--muted); }
.input-search { width: 280px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-dim); letter-spacing: 0.04em; text-transform: uppercase; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }

.slug-input, .pw-input { position: relative; display: flex; align-items: center; }
.slug-prefix { position: absolute; left: 12px; color: var(--accent); font-family: var(--font-mono); pointer-events: none; }
.slug-input input { padding-left: 24px; font-family: var(--font-mono); }
.pw-toggle { position: absolute; right: 8px; background: none; border: none; cursor: pointer; font-size: 15px; opacity: 0.6; padding: 4px; }
.pw-toggle:hover { opacity: 1; }

.checks { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

.form-error { background: var(--fail-dim); border: 1px solid rgba(255, 107, 107, 0.35); color: var(--fail); border-radius: 8px; padding: 8px 12px; font-size: 13px; }

/* ---------- table ---------- */

.table-card {
  background: rgba(13, 17, 26, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: var(--shadow1), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.bases-table { width: 100%; min-width: 1000px; table-layout: fixed; border-collapse: collapse; }

.bases-table th:nth-child(1) { width: 15%; }
.bases-table th:nth-child(2) { width: 12%; }
.bases-table th:nth-child(3) { width: 20%; }
.bases-table th:nth-child(4) { width: 7%; }
.bases-table th:nth-child(5) { width: 15%; }
.bases-table th:nth-child(6) { width: 15%; }
.bases-table th:nth-child(7) { width: 6%; }
.bases-table th:nth-child(8) { width: 10%; }

.bases-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  white-space: nowrap;
}

.bases-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow: hidden; }
.bases-table tbody tr { animation: rowIn 0.35s ease both; transition: background 0.15s; }
.bases-table tbody tr:hover { background: linear-gradient(90deg, rgba(255, 196, 0, 0.035), rgba(255, 255, 255, 0.015) 40%); box-shadow: inset 2px 0 0 var(--accent); }
.bases-table tbody tr:last-child td { border-bottom: none; }

.cell-name { font-weight: 600; overflow-wrap: anywhere; word-break: break-word; }
.cell-name small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }

.name-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: color 0.15s, border-color 0.15s;
}
.name-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.name-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.endpoint-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(255, 196, 0, 0.22);
  border-radius: 7px;
  padding: 4px 6px 4px 10px;
  max-width: 100%;
  transition: box-shadow 0.15s;
}
.endpoint-chip { transition: box-shadow 0.15s; }
.endpoint-chip:hover { box-shadow: 0 0 14px rgba(255, 196, 0, 0.15); }
.endpoint-chip .ep-slug { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.endpoint-chip button { background: none; border: none; color: var(--accent); opacity: 0.65; cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 4px; flex: none; }
.endpoint-chip button:hover { opacity: 1; background: rgba(255, 196, 0, 0.15); }

.cell-url { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.method-chip { font-family: var(--font-mono); font-size: 11.5px; padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(108, 171, 255, 0.3); color: var(--info); background: var(--info-dim); }

/* status badge with LED */
.status-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; white-space: nowrap; position: relative; }
.status-badge i.led { width: 7px; height: 7px; border-radius: 50%; background: currentColor; position: relative; flex: none; }
.status-badge i.led::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid currentColor; opacity: 0.4; animation: ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite; }

.st-ok { color: var(--ok); background: var(--ok-dim); border: 1px solid rgba(61, 220, 151, 0.3); }
.st-login_failed, .st-limit_exceeded { color: var(--warn); background: var(--warn-dim); border: 1px solid rgba(255, 194, 75, 0.3); }
.st-unreachable, .st-http_error, .st-error, .st-db_unavailable, .st-server_error, .st-ssl_error, .st-dns_error, .st-timeout, .st-not_1c { color: var(--fail); background: var(--fail-dim); border: 1px solid rgba(255, 107, 107, 0.3); }
.st-unreachable i.led::after, .st-timeout i.led::after { animation-duration: 1s; }
.st-disabled { color: var(--muted); background: rgba(110, 122, 146, 0.08); border: 1px solid rgba(110, 122, 146, 0.25); }
.st-none { color: var(--muted); background: transparent; border: 1px dashed var(--line2); }
.st-none i.led::after { display: none; }

.last-check small { display: block; color: var(--muted); font-size: 11.5px; font-family: var(--font-mono); margin-top: 3px; }

/* sparkline */
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; padding: 2px 3px; border: 1px solid var(--line); border-radius: 6px; background: rgba(10, 14, 22, 0.6); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.spark:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(255, 196, 0, 0.15); }
.spark i { width: 4px; border-radius: 1px; min-height: 2px; }
.spark i.ok { background: var(--ok); opacity: 0.85; }
.spark i.warn { background: var(--warn); }
.spark i.fail { background: var(--fail); }
.spark-empty { color: var(--muted); font-size: 12px; font-family: var(--font-mono); }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.icon-btn {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-dim);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line2); transform: translateY(-1px); }
.icon-btn.danger:hover { color: var(--fail); border-color: rgba(255, 107, 107, 0.5); }
.icon-btn.spin { color: var(--accent); animation: spin 0.9s linear infinite; pointer-events: none; }

.toggle { position: relative; width: 36px; height: 20px; flex: none; cursor: pointer; display: inline-block; }
.toggle input { display: none; }
.toggle i { position: absolute; inset: 0; background: var(--line2); border-radius: 999px; transition: background 0.2s; }
.toggle i::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left 0.2s; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.toggle input:checked + i { background: var(--ok); box-shadow: 0 0 12px rgba(61, 220, 151, 0.3); }
.toggle input:checked + i::after { left: 19px; }

/* skeleton */
.skel { border-radius: 6px; background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 37%, var(--bg2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }

.empty-state { text-align: center; padding: 64px 20px; color: var(--text-dim); }
.empty-mark { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; border: 2px dashed var(--line2); display: grid; place-items: center; font-size: 22px; color: var(--accent); }
.empty-sub { font-size: 13px; color: var(--muted); margin: 6px auto 18px; max-width: 420px; }

.footnote { color: var(--muted); font-size: 12.5px; margin-top: 14px; }

/* ---------- settings ---------- */

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

.panel {
  background: rgba(13, 17, 26, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: var(--shadow1), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.panel h2 { font-family: var(--font-display); font-size: 15.5px; margin-bottom: 8px; }
.panel-desc { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.panel form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.panel .field { width: 100%; }

.state-list { list-style: none; margin-bottom: 12px; }
.state-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.state-list li:last-child { border-bottom: none; }
.state-list span { color: var(--muted); }
.state-list b { font-weight: 600; }
.state-list a { color: var(--info); text-decoration: none; font-family: var(--font-mono); font-size: 13px; }
.state-list a:hover { text-decoration: underline; }

/* ---------- dialogs ---------- */

.dlg {
  background: rgba(13, 17, 26, 0.92);
  backdrop-filter: blur(20px);
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 18px;
  padding: 0;
  width: min(660px, calc(100vw - 32px));
  box-shadow: var(--shadow2);
}
.dlg::backdrop { background: rgba(4, 6, 10, 0.72); backdrop-filter: blur(5px); }
.dlg-sm { width: min(440px, calc(100vw - 32px)); }
.dlg-lg { width: min(820px, calc(100vw - 32px)); }

.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { font-family: var(--font-display); font-size: 14.5px; }
.dlg-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; padding: 2px 7px; border-radius: 6px; }
.dlg-close:hover { color: var(--text); background: var(--bg3); }

.dlg-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; max-height: min(66vh, 640px); overflow: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1.4fr 0.8fr 1fr; gap: 14px; }

.result-badge { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 12px 16px; border-radius: 10px; font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.tile span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 2px; }
.tile b { font-family: var(--font-mono); font-size: 17px; font-weight: 600; color: var(--text); }

.json-view {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  background: rgba(8, 11, 17, 0.85);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  overflow: auto;
  white-space: pre;
  max-height: 44vh;
}
.j-key { color: #7DD3FC; }
.j-str { color: #86EFAC; }
.j-num { color: #FCA5A5; }
.j-bool { color: #C4B5FD; }
.j-null { color: var(--muted); }

/* history dialog */
.hist-chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding: 14px; background: rgba(8, 11, 17, 0.85); border: 1px solid var(--line); border-radius: 12px; }
.hist-chart i { flex: 1; max-width: 18px; min-height: 3px; border-radius: 2px 2px 0 0; }
.hist-chart i.ok { background: linear-gradient(180deg, var(--ok), rgba(61, 220, 151, 0.25)); }
.hist-chart i.warn { background: linear-gradient(180deg, var(--warn), rgba(255, 194, 75, 0.25)); }
.hist-chart i.fail { background: linear-gradient(180deg, var(--fail), rgba(255, 107, 107, 0.25)); }

.hist-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.hist-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.lg-ok { background: var(--ok); }
.lg-warn { background: var(--warn); }
.lg-fail { background: var(--fail); }
.hist-hint { margin-left: auto; color: var(--muted); }

.hist-list { display: flex; flex-direction: column; }
.hist-row { display: grid; grid-template-columns: 130px 150px 90px 1fr; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.hist-row:last-child { border-bottom: none; }
.hist-row .h-ts { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.hist-row .h-ms { font-family: var(--font-mono); font-size: 12.5px; text-align: right; }
.hist-row .h-detail { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- toasts ---------- */

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 22, 35, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line2);
  border-left: 3px solid var(--accent);
  color: var(--text);
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 13.5px;
  box-shadow: var(--shadow1);
  animation: toastIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  max-width: 360px;
}
.toast.ok { border-left-color: var(--ok); }
.toast.fail { border-left-color: var(--fail); }

/* ---------- animations ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes led { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.5; } 80%, 100% { transform: scale(1.8); opacity: 0; } }
@keyframes radar { from { transform: scale(1); opacity: 0.7; } to { transform: scale(2); opacity: 0; } }
@keyframes drift { from { transform: translate3d(-2%, -1%, 0) scale(1); } to { transform: translate3d(2%, 2%, 0) scale(1.06); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .settings-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .toolbar-actions { width: 100%; }
  .input-search { flex: 1; width: auto; }
  .hist-row { grid-template-columns: 110px 130px 70px 1fr; }
}

@media (max-width: 700px) {
  .tiles { grid-template-columns: 1fr; }
}
