/* ═══════════════════════════════════════════════════════════════════════════
   CortexDB Admin — design system v2
   Zero-dependency, dark, layered glass. Indigo → violet → cyan accent family.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* surfaces */
  --bg-0: #04050a;
  --bg-1: #090b13;
  --bg-2: #0d1019;
  --bg-3: #131725;
  --bg-4: #1a1f31;
  --glass: rgba(255, 255, 255, 0.028);
  --glass-2: rgba(255, 255, 255, 0.055);

  /* lines */
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-3: rgba(255, 255, 255, 0.2);

  /* text */
  --text-1: #f1f3fa;
  --text-2: #a9afc2;
  --text-3: #6d7387;
  --text-4: #484d60;

  /* accents */
  --accent: #6c6ff5;
  --accent-2: #a855f7;
  --accent-3: #22d3ee;
  --accent-ink: #a5b4fc;
  --accent-soft: rgba(108, 111, 245, 0.13);
  --accent-line: rgba(108, 111, 245, 0.32);

  /* status */
  --ok: #2dd4a7;
  --ok-soft: rgba(45, 212, 167, 0.12);
  --warn: #f5b83d;
  --warn-soft: rgba(245, 184, 61, 0.12);
  --bad: #f4685f;
  --bad-soft: rgba(244, 104, 95, 0.12);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.12);

  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;

  --sidebar-w: 252px;
  --topbar-h: 58px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 14px 40px -12px rgba(0, 0, 0, 0.65);
  --ring: 0 0 0 3px rgba(108, 111, 245, 0.2);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-1);
  background: var(--bg-0);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* aurora backdrop — three slow-drifting light fields behind everything */
body::before, body::after {
  content: ""; position: fixed; inset: -20%; z-index: 0; pointer-events: none;
}
body::before {
  background:
    radial-gradient(38% 30% at 78% 12%, rgba(108, 111, 245, 0.14), transparent 65%),
    radial-gradient(30% 26% at 12% 88%, rgba(168, 85, 247, 0.10), transparent 60%);
  animation: aurora-a 46s ease-in-out infinite alternate;
}
body::after {
  background:
    radial-gradient(26% 22% at 88% 78%, rgba(34, 211, 238, 0.075), transparent 62%),
    radial-gradient(24% 20% at 22% 20%, rgba(108, 111, 245, 0.07), transparent 60%);
  animation: aurora-b 58s ease-in-out infinite alternate;
}
@keyframes aurora-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-4%, 3%, 0) scale(1.08); }
}
@keyframes aurora-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to   { transform: translate3d(3%, -4%, 0) scale(1); }
}
.app { position: relative; z-index: 1; }

/* per-section accent — set from the router via body[data-sec] */
body[data-sec="memory"]  { --sec: #a855f7; --sec-soft: rgba(168, 85, 247, 0.14); --sec-line: rgba(168, 85, 247, 0.34); }
body[data-sec="operate"] { --sec: #22d3ee; --sec-soft: rgba(34, 211, 238, 0.12); --sec-line: rgba(34, 211, 238, 0.32); }
body[data-sec="system"]  { --sec: #f5b83d; --sec-soft: rgba(245, 184, 61, 0.13); --sec-line: rgba(245, 184, 61, 0.32); }
:root { --sec: #a855f7; --sec-soft: rgba(168, 85, 247, 0.14); --sec-line: rgba(168, 85, 247, 0.34); }
::selection { background: rgba(108, 111, 245, 0.38); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.09); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,0.18); }
::-webkit-scrollbar-track { background: transparent; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: #c7d2fe; }
code, kbd { font-family: var(--mono); font-size: 0.88em; background: rgba(255,255,255,0.07); padding: 0.12em 0.42em; border-radius: 6px; }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--bg-3); padding: 0.05em 0.4em; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

h1, h2, h3, h4 { margin: 0; }

/* ═══ App frame ═══════════════════════════════════════════════════════════ */
.app { display: flex; min-height: 100vh; }
.frame { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { flex: 1; padding: 26px 34px 90px; max-width: 1640px; width: 100%; margin: 0; }
.view.enter { animation: view-in 0.28s cubic-bezier(.21,1.02,.73,1); }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* gradient-border glass */
.card, .tile, .hero {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.038), rgba(255,255,255,0.014)) padding-box,
    linear-gradient(var(--bg-1), var(--bg-1)) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.11), rgba(255,255,255,0.03) 45%, color-mix(in srgb, var(--sec) 16%, transparent)) border-box;
}

/* ═══ Sidebar ═════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(8, 9, 15, 0.72);
  backdrop-filter: blur(18px);
  padding: 16px 12px 12px;
  z-index: 60;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0; position: relative;
  background: conic-gradient(from 210deg, #6c6ff5, #a855f7, #22d3ee, #6c6ff5);
  box-shadow: 0 0 22px rgba(124, 92, 246, 0.5);
}
.brand-mark::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--bg-0); }
.brand-name { font-weight: 750; font-size: 16.5px; letter-spacing: -0.01em; }
.brand-instance {
  margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--text-3);
  border: 1px solid var(--line); background: var(--glass);
  padding: 2.5px 8px; border-radius: 999px;
  max-width: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; flex: 1; padding-bottom: 8px; }
.nav-group {
  margin: 16px 10px 6px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-4);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7.5px 10px; border-radius: 10px;
  color: var(--text-3); font-size: 13.5px; font-weight: 550;
  cursor: pointer; border: 1px solid transparent;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
  user-select: none; position: relative;
}
.nav-item:hover { color: var(--text-1); background: var(--glass-2); transform: translateX(2px); }
.nav-item.active {
  color: var(--text-1); font-weight: 650;
  background: linear-gradient(90deg, rgba(108,111,245,0.16), rgba(168,85,247,0.06));
  border-color: rgba(108, 111, 245, 0.26);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 20%; bottom: 20%;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(108, 111, 245, 0.8);
}
.nav-item.active .nav-ico { color: var(--accent-ink); }
.nav-ico { width: 17px; height: 17px; display: inline-flex; flex-shrink: 0; }
.nav-ico svg { width: 100%; height: 100%; }
.nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 999px;
  background: var(--bad-soft); color: var(--bad);
}
.nav-badge.amber { background: var(--warn-soft); color: var(--warn); }

.sidebar-foot { border-top: 1px solid var(--line); padding: 10px 10px 2px; display: flex; flex-direction: column; gap: 8px; }
.side-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.side-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.side-status.bad .dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.side-status .ver { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-4); }
.side-link { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); padding: 2px 0; }
.side-link:hover { color: var(--text-1); }
.side-link .nav-ico { width: 14px; height: 14px; }

/* ═══ Topbar ══════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 30px 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 5, 10, 0.75);
  backdrop-filter: blur(18px);
}
.menu-btn { display: none; }
.palette-btn {
  display: flex; align-items: center; gap: 9px;
  background: var(--glass); border: 1px solid var(--line);
  color: var(--text-3); font-size: 12.5px; font-weight: 500;
  padding: 6px 10px; border-radius: 9px; cursor: pointer;
  min-width: 210px; box-shadow: none;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.palette-btn:hover { border-color: var(--line-2); color: var(--text-2); background: var(--glass-2); filter: none; }
.palette-btn svg { width: 13px; height: 13px; }
.palette-btn kbd { margin-left: auto; font-size: 10px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.tfield { display: flex; align-items: center; gap: 7px; }
.tfield > span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.tfield input {
  width: 150px; background: var(--glass); border: 1px solid var(--line);
  color: var(--text-1); padding: 6px 9px; border-radius: 9px;
  font-family: var(--mono); font-size: 12px; outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.tfield input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.tfield.key input { width: 168px; }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px; padding: 0;
  background: var(--glass); border: 1px solid var(--line); color: var(--text-3);
  cursor: pointer; box-shadow: none;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.icon-btn:hover { color: var(--text-1); border-color: var(--line-2); background: var(--glass-2); filter: none; }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn .n-dot {
  position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px;
  border-radius: 999px; background: var(--bad); color: #fff;
  font-size: 9px; font-weight: 800; line-height: 15px; text-align: center;
  padding: 0 3px; box-shadow: 0 0 0 2px var(--bg-0);
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3.5px 11px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 12px; font-weight: 550; color: var(--text-2);
  white-space: nowrap; background: var(--glass);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.pill.bad .dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.pill.warn .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.pill.dim .dot { background: var(--text-4); box-shadow: none; }

/* ═══ Page header ═════════════════════════════════════════════════════════ */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.pagehead .eyebrow { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: var(--sec); margin-bottom: 4px; }
.pagehead h1 {
  font-size: 24px; font-weight: 780; letter-spacing: -0.025em; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #ffffff, rgba(235, 238, 255, 0.68));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pagehead .desc { margin: 5px 0 0; color: var(--text-3); font-size: 13px; max-width: 720px; }
.pagehead .ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ═══ Cards ═══════════════════════════════════════════════════════════════ */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* bento: 12-track grid with explicit spans */
.grid.bento { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.grid.bento > .span3 { grid-column: span 3; }
.grid.bento > .span4 { grid-column: span 4; }
.grid.bento > .span6 { grid-column: span 6; }
.grid.bento > .span8 { grid-column: span 8; }
.grid.bento > .span12 { grid-column: span 12; }
@media (max-width: 1250px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-6 { grid-template-columns: repeat(3, 1fr); } .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid.bento > .span3 { grid-column: span 6; } .grid.bento > .span4 { grid-column: span 6; }
  .grid.bento > .span8 { grid-column: span 12; } .grid.bento > .span6 { grid-column: span 12; }
}
@media (max-width: 820px)  { .grid.cols-4, .grid.cols-3, .grid.cols-2, .grid.cols-6 { grid-template-columns: 1fr; } .grid.bento > * { grid-column: span 12 !important; } }
.grid + .grid, .grid + .card, .card + .grid, .card + .card { margin-top: 14px; }
.grid.align-start { align-items: start; }

.card {
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  box-shadow: var(--shadow-1);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h .t { font-size: 14px; font-weight: 680; letter-spacing: -0.005em; display: flex; align-items: center; gap: 8px; }
.card-h .s { margin: 3px 0 0; color: var(--text-3); font-size: 12.5px; max-width: 640px; }
.card-h .a { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.card > .t { font-size: 14px; font-weight: 680; }
.card > .s { margin: 3px 0 12px; color: var(--text-3); font-size: 12.5px; }

.eyebrow { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }

/* KPI tiles */
.tile {
  border-radius: var(--r-md);
  padding: 14px 16px 12px; min-width: 0; position: relative;
  box-shadow: var(--shadow-1);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  will-change: transform;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.6); }
.tile .t-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tile .t-value {
  font-size: 30px; font-weight: 760; letter-spacing: -0.025em; margin-top: 5px;
  font-variant-numeric: tabular-nums; line-height: 1.08;
  background: linear-gradient(180deg, #ffffff, rgba(232, 236, 255, 0.78));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tile .t-value .unit { font-size: 13px; color: var(--text-3); font-weight: 550; margin-left: 3px; -webkit-text-fill-color: var(--text-3); }
.tile .t-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; min-height: 1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .t-spark { margin: 8px -4px -2px; height: 34px; }
.tile.accent { background: linear-gradient(180deg, rgba(108,111,245,0.12), rgba(108,111,245,0.02)) padding-box, linear-gradient(var(--bg-1), var(--bg-1)) padding-box, linear-gradient(135deg, rgba(108,111,245,0.45), rgba(168,85,247,0.18)) border-box; }
.tile.bad { background: linear-gradient(180deg, rgba(244,104,95,0.09), rgba(244,104,95,0.02)) padding-box, linear-gradient(var(--bg-1), var(--bg-1)) padding-box, linear-gradient(135deg, rgba(244,104,95,0.4), rgba(244,104,95,0.12)) border-box; }
.tile.warn { background: linear-gradient(180deg, rgba(245,184,61,0.09), rgba(245,184,61,0.02)) padding-box, linear-gradient(var(--bg-1), var(--bg-1)) padding-box, linear-gradient(135deg, rgba(245,184,61,0.4), rgba(245,184,61,0.12)) border-box; }

/* live pulse dot (active counters) */
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 167, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(45, 212, 167, 0); }
}

/* hero band (overview) */
.hero {
  border-radius: var(--r-lg);
  background:
    radial-gradient(900px 220px at 10% -40%, color-mix(in srgb, var(--sec) 16%, transparent), transparent 60%) padding-box,
    radial-gradient(700px 260px at 96% 0%, rgba(34,211,238,0.07), transparent 55%) padding-box,
    linear-gradient(var(--bg-1), var(--bg-1)) padding-box,
    linear-gradient(120deg, color-mix(in srgb, var(--sec) 40%, transparent), rgba(255,255,255,0.05) 50%, rgba(34,211,238,0.18)) border-box;
  padding: 24px 26px;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  box-shadow: var(--shadow-1);
  margin-bottom: 14px;
}
.hero .status-ring { flex-shrink: 0; }
.hero .h-main { min-width: 200px; }
.hero .h-status {
  font-size: 21px; font-weight: 760; letter-spacing: -0.015em; display: flex; align-items: center; gap: 9px;
  background: linear-gradient(90deg, #ffffff 20%, color-mix(in srgb, var(--sec) 65%, #fff));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .h-sub { color: var(--text-3); font-size: 12.5px; margin-top: 3px; -webkit-text-fill-color: var(--text-3); }
.hero .h-stats { display: flex; gap: 34px; margin-left: auto; flex-wrap: wrap; }
.hero .h-stat .v {
  font-size: 23px; font-weight: 740; font-variant-numeric: tabular-nums; letter-spacing: -0.015em;
  background: linear-gradient(180deg, #ffffff, rgba(232, 236, 255, 0.74));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .h-stat .k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-top: 2px; }

/* ═══ Buttons ═════════════════════════════════════════════════════════════ */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(180deg, #7477f8, #5f62ef);
  color: #fff; border: 0; padding: 8px 15px; border-radius: 10px;
  font-family: inherit; font-size: 13px; font-weight: 620; cursor: pointer;
  transition: filter 0.12s ease, transform 0.06s ease, background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  box-shadow: 0 1px 0 rgba(255,255,255,0.14) inset, 0 8px 20px -10px rgba(108,111,245,0.65);
  white-space: nowrap; text-decoration: none;
}
button:hover:not(:disabled), .btn:hover:not(:disabled) { filter: brightness(1.1); color: #fff; }
button:active:not(:disabled), .btn:active:not(:disabled) { transform: translateY(1px); }
button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }
button svg, .btn svg { width: 14px; height: 14px; }
button.secondary, .btn.secondary {
  background: var(--glass-2); border: 1px solid var(--line-2);
  color: var(--text-2); box-shadow: none; font-weight: 560;
}
button.secondary:hover:not(:disabled), .btn.secondary:hover:not(:disabled) { border-color: var(--line-3); color: var(--text-1); filter: none; background: rgba(255,255,255,0.08); }
button.danger, .btn.danger { background: linear-gradient(180deg, #f16d64, #e5534b); box-shadow: 0 8px 20px -10px rgba(244,104,95,0.55); }
button.ghost, .btn.ghost { background: transparent; border: 1px dashed var(--line-2); color: var(--text-3); box-shadow: none; font-weight: 540; }
button.ghost:hover:not(:disabled), .btn.ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--text-1); filter: none; }
button.small, .btn.small { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
button.xs, .btn.xs { padding: 3px 8px; font-size: 11px; border-radius: 7px; }

.actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

/* ═══ Forms ═══════════════════════════════════════════════════════════════ */
.field { margin-bottom: 14px; }
.field > label, label.block { display: block; font-size: 11px; font-weight: 680; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.field .help { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; background: rgba(255,255,255,0.045); border: 1px solid var(--line);
  color: var(--text-1); padding: 8.5px 11px; border-radius: 10px;
  font-family: inherit; font-size: 13.5px; outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--text-4); }
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
select { appearance: none; background-color: var(--bg-2); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%236d7387' stroke-width='1.6' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
select option, select optgroup { background-color: var(--bg-3); color: var(--text-1); }
select option:checked { background-color: var(--accent); color: #fff; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.input-wrap { position: relative; }
.input-wrap .suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--text-3); }

/* ═══ Badges / chips ═══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.01em; line-height: 1.45;
  white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.indigo { background: var(--accent-soft); color: var(--accent-ink); }
.badge.violet { background: rgba(168,85,247,0.13); color: #c084fc; }
.badge.green  { background: var(--ok-soft); color: var(--ok); }
.badge.amber  { background: var(--warn-soft); color: var(--warn); }
.badge.red    { background: var(--bad-soft); color: var(--bad); }
.badge.dim    { background: rgba(255,255,255,0.06); color: var(--text-3); }
.badge.cyan   { background: rgba(34,211,238,0.12); color: var(--accent-3); }
.badge.blue   { background: var(--info-soft); color: var(--info); }

/* ═══ Tables ══════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.card.flush .table-wrap { margin: 0; padding: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-3); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { transition: background 0.1s ease; }
tbody tr:hover { background: rgba(255,255,255,0.022); }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }

/* ═══ Tabs / segmented ════════════════════════════════════════════════════ */
.tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  background: transparent; border: 0; color: var(--text-3);
  padding: 9px 15px; cursor: pointer; font-size: 13px; font-weight: 580;
  border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none; white-space: nowrap;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.tab:hover { color: var(--text-1); filter: none; }
.tab.active { color: var(--text-1); border-bottom-color: var(--accent); font-weight: 680; }
.tab .count { display: inline-block; margin-left: 7px; padding: 1px 7px; background: var(--accent-soft); border-radius: 999px; font-size: 10.5px; font-weight: 700; color: var(--accent-ink); }
.panel { display: none; }
.panel.active { display: block; }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: transparent; border: 0; box-shadow: none; color: var(--text-3); padding: 5px 12px; font-size: 12px; font-weight: 600; border-radius: 7px; }
.seg button:hover { color: var(--text-1); filter: none; }
.seg button.active { background: var(--bg-4); color: var(--text-1); box-shadow: var(--shadow-1); }

/* ═══ Records / lists ═════════════════════════════════════════════════════ */
.rec-list { display: grid; gap: 9px; }
.rec-item {
  background: rgba(255,255,255,0.025); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.rec-item.expandable { cursor: pointer; }
.rec-item.expandable:hover { border-color: var(--line-2); background: rgba(255,255,255,0.045); }
.rec-item .meta {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 8px; margin-bottom: 5px; color: var(--text-3); font-size: 11.5px; font-family: var(--mono);
}
.rec-item .content { white-space: pre-wrap; word-break: break-word; color: var(--text-1); line-height: 1.6; }
.rec-item .detail { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.rec-item.expanded .detail { display: block; }
.rec-item .detail pre {
  margin: 0; padding: 10px 12px; background: rgba(0,0,0,0.35);
  border: 1px solid var(--line); border-radius: 9px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto;
}
.field-grid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 9px; font-size: 12.5px; }
.field-grid dt { color: var(--text-3); font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; padding-top: 1px; }
.field-grid dd { margin: 0; word-break: break-word; }
.id-pill { padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 10.5px; font-family: var(--mono); }
.stance { padding: 1px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 650; }
.stance.supported { background: var(--ok-soft); color: var(--ok); }
.stance.contradicted { background: var(--bad-soft); color: var(--bad); }
.stance.disputed { background: var(--warn-soft); color: var(--warn); }
.stance.unverified { background: rgba(255,255,255,0.06); color: var(--text-3); }
.load-more { display: block; width: 100%; margin-top: 10px; }

.empty { padding: 34px 16px; text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.7; }
.empty .big { font-size: 26px; display: block; margin-bottom: 8px; opacity: 0.7; }
.empty strong { color: var(--text-2); }

/* ═══ Toggle switch ═══════════════════════════════════════════════════════ */
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(255,255,255,0.09); border: 1px solid var(--line-2);
  transition: background 0.16s ease, border-color 0.16s ease;
}
.switch .thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #aab0c0; transition: transform 0.18s cubic-bezier(.34,1.4,.64,1), background 0.16s ease;
}
.switch input:checked + .track { background: linear-gradient(90deg, #6c6ff5, #8b5cf6); border-color: transparent; }
.switch input:checked + .track + .thumb { transform: translateX(18px); background: #fff; }
.switch input:disabled + .track { opacity: 0.4; }

/* feature rows */
.feature-row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 16px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: rgba(255,255,255,0.02);
  transition: border-color 0.14s ease, background 0.14s ease;
}
.feature-row:hover { border-color: var(--line-2); background: rgba(255,255,255,0.035); }
.feature-row + .feature-row { margin-top: 9px; }
.feature-row.on { border-color: rgba(108,111,245,0.24); }
.feature-row .f-body { flex: 1; min-width: 0; }
.feature-row .f-name { font-weight: 660; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feature-row .f-desc { color: var(--text-3); font-size: 12.5px; margin-top: 3px; line-height: 1.6; }
.feature-row .f-env { color: var(--text-4); font-size: 10.5px; font-family: var(--mono); margin-top: 6px; display: none; }
.features-advanced .feature-row .f-env { display: block; }

/* ═══ Charts ══════════════════════════════════════════════════════════════ */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart-box { height: 170px; }
.chart-tip {
  position: fixed; z-index: 400; pointer-events: none;
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: 9px; padding: 7px 10px; font-size: 11.5px;
  box-shadow: var(--shadow-2); max-width: 300px;
  opacity: 0; transition: opacity 0.1s ease;
}
.chart-tip .tt-t { font-weight: 700; font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.chart-tip .tt-r { display: flex; gap: 7px; align-items: center; font-variant-numeric: tabular-nums; }
.chart-tip .tt-r .sw { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.chart-tip .tt-r .vv { margin-left: auto; font-weight: 650; padding-left: 12px; }

.hbar-row { display: grid; grid-template-columns: minmax(130px, 2fr) 5fr max-content; gap: 12px; align-items: center; font-size: 12.5px; padding: 4.5px 0; }
.hbar-row .hb-label { color: var(--text-2); font-family: var(--mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-row .hb-track { height: 8px; background: rgba(255,255,255,0.05); border-radius: 6px; overflow: hidden; }
.hbar-row .hb-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6c6ff5, #a855f7); transition: width 0.5s ease; }
.hbar-row .hb-val { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); margin-top: 9px; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 9px; height: 9px; border-radius: 3px; }

.bar { height: 9px; background: rgba(255,255,255,0.06); border-radius: 6px; overflow: hidden; margin: 10px 0 6px; }
.bar > div { height: 100%; background: linear-gradient(90deg, #6c6ff5, #a855f7); transition: width 0.5s ease; border-radius: 6px; }

/* stacked split bar (disk/ram breakdowns) */
.splitbar { display: flex; height: 12px; border-radius: 7px; overflow: hidden; background: rgba(255,255,255,0.05); }
.splitbar > span { display: block; height: 100%; transition: width 0.5s ease; }
.split-legend { display: grid; gap: 5px; margin-top: 10px; font-size: 12px; }
.split-legend .sl-row { display: flex; align-items: center; gap: 8px; }
.split-legend .sl-row .sw { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.split-legend .sl-row .n { color: var(--text-2); font-family: var(--mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split-legend .sl-row .v { margin-left: auto; color: var(--text-3); font-variant-numeric: tabular-nums; }

.lat-cell { display: flex; align-items: center; gap: 3px; }
.lat-seg { height: 7px; border-radius: 4px; min-width: 2px; }

/* ═══ Conflicts ═══════════════════════════════════════════════════════════ */
.conflict { border: 1px solid rgba(245,184,61,0.26); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; background: rgba(245,184,61,0.03); }
.conflict .head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; flex-wrap: wrap; }
.rec { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; margin-top: 7px; background: rgba(0,0,0,0.25); }
.rec .val { flex: 1; min-width: 0; }
.rec .meta { color: var(--text-3); font-size: 11.5px; }

/* ═══ Console diagnostics ═════════════════════════════════════════════════ */
.diag-strip { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.waterfall { margin-top: 10px; }
.wf-row { display: grid; grid-template-columns: minmax(140px, 1fr) 5fr max-content; gap: 10px; align-items: center; font-size: 12px; padding: 3px 0; }
.wf-row .wf-label { font-family: var(--mono); color: var(--text-2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-row .wf-track { height: 7px; position: relative; background: rgba(255,255,255,0.04); border-radius: 4px; }
.wf-row .wf-fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, #22d3ee, #6c6ff5); }
.wf-row .wf-val { color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.answer-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.7; }

.md-body { font-size: 13.5px; line-height: 1.7; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { color: #fff; margin: 1.2em 0 0.45em; letter-spacing: -0.01em; }
.md-body h1 { font-size: 19px; } .md-body h2 { font-size: 16.5px; } .md-body h3 { font-size: 14.5px; }
.md-body table { margin: 10px 0; }
.md-body pre { background: rgba(0,0,0,0.35); border: 1px solid var(--line); padding: 11px 13px; border-radius: 9px; overflow-x: auto; font-size: 12px; }
.md-body ul, .md-body ol { padding-left: 22px; }
.md-body blockquote { border-left: 3px solid var(--accent); margin: 10px 0; padding-left: 14px; color: var(--text-2); }

/* ═══ Logs page ═══════════════════════════════════════════════════════════ */
.log-stream {
  background: rgba(0,0,0,0.4); border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: var(--mono); font-size: 11.8px; line-height: 1.65;
  max-height: 640px; overflow-y: auto; padding: 8px 0;
}
.logline { display: flex; gap: 12px; padding: 2.5px 14px; align-items: baseline; }
.logline:hover { background: rgba(255,255,255,0.03); }
.logline .lt { color: var(--text-4); flex-shrink: 0; font-size: 10.5px; }
.logline .lv { flex-shrink: 0; width: 52px; font-weight: 700; font-size: 10px; letter-spacing: 0.06em; }
.logline .lv.ERROR, .logline .lv.FATAL { color: var(--bad); }
.logline .lv.WARN { color: var(--warn); }
.logline .lv.INFO { color: var(--accent-3); }
.logline .lv.DEBUG { color: var(--text-3); }
.logline .lv.TRACE { color: var(--text-4); }
.logline .lg { color: var(--text-4); flex-shrink: 0; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.logline .lm { color: var(--text-2); white-space: pre-wrap; word-break: break-word; min-width: 0; }
.logline.hl .lm { color: var(--text-1); background: rgba(108,111,245,0.12); border-radius: 3px; }
.log-toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.log-toolbar input[type=text] { width: 240px; font-family: var(--mono); font-size: 12px; }

/* ═══ Toasts ══════════════════════════════════════════════════════════════ */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 9px; z-index: 500; }
.toast {
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 11px 15px; font-size: 13px;
  box-shadow: var(--shadow-2); max-width: 400px;
  animation: toast-in 0.2s cubic-bezier(.21,1.02,.73,1);
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ═══ Drawer ══════════════════════════════════════════════════════════════ */
.backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(2, 3, 6, 0.6); backdrop-filter: blur(3px);
  animation: fade-in 0.15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 310;
  width: min(560px, 94vw);
  background: var(--bg-1); border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 60px -20px rgba(0,0,0,0.7);
  display: flex; flex-direction: column;
  animation: drawer-in 0.22s cubic-bezier(.32,.72,.24,1);
}
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer .d-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer .d-h .t { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.drawer .d-h .s { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.drawer .d-b { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }
.drawer .d-x { margin-left: auto; }

/* ═══ Modal ═══════════════════════════════════════════════════════════════ */
.modal {
  position: fixed; z-index: 320; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, 92vw);
  background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  animation: modal-in 0.18s cubic-bezier(.21,1.02,.73,1);
}
@keyframes modal-in { from { transform: translate(-50%, -48%) scale(0.97); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.modal .m-h { padding: 18px 20px 0; font-size: 15.5px; font-weight: 720; }
.modal .m-b { padding: 10px 20px 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.65; }
.modal .m-f { display: flex; justify-content: flex-end; gap: 9px; padding: 0 20px 18px; }

/* ═══ Notifications panel ═════════════════════════════════════════════════ */
.notif-panel {
  position: fixed; top: calc(var(--topbar-h) + 8px); right: 20px; z-index: 290;
  width: min(400px, 94vw); max-height: 70vh; overflow-y: auto;
  background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  animation: notif-in 0.16s ease;
}
@keyframes notif-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.notif-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-1); }
.notif-h .t { font-size: 13.5px; font-weight: 700; }
.notif-item { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background 0.1s ease; }
.notif-item:hover { background: var(--glass); }
.notif-item:last-child { border-bottom: 0; }
.notif-item .ni-ico { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-item .ni-ico svg { width: 14px; height: 14px; }
.notif-item .ni-t { font-size: 13px; font-weight: 620; line-height: 1.4; }
.notif-item .ni-s { font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.notif-item .ni-when { margin-left: auto; font-size: 10.5px; color: var(--text-4); flex-shrink: 0; }
.notif-empty { padding: 30px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* ═══ Command palette ═════════════════════════════════════════════════════ */
.palette {
  position: fixed; z-index: 330; left: 50%; top: 12vh;
  transform: translateX(-50%);
  width: min(560px, 94vw);
  background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: 16px; box-shadow: var(--shadow-2);
  overflow: hidden; animation: modal-in 0.15s ease;
}
.palette input {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 15px 18px; font-size: 15px; color: var(--text-1); outline: none; border-radius: 0;
}
.palette input:focus { box-shadow: none; }
.palette .p-list { max-height: 46vh; overflow-y: auto; padding: 7px; }
.palette .p-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border-radius: 10px; cursor: pointer; color: var(--text-2); font-size: 13.5px;
}
.palette .p-item .nav-ico { width: 15px; height: 15px; color: var(--text-3); }
.palette .p-item .p-kind { margin-left: auto; font-size: 10.5px; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.08em; }
.palette .p-item.sel { background: var(--accent-soft); color: var(--text-1); }
.palette .p-item.sel .nav-ico { color: var(--accent-ink); }
.palette .p-foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-4); }

/* ═══ Misc ════════════════════════════════════════════════════════════════ */
.skel { position: relative; overflow: hidden; background: rgba(255,255,255,0.045); border-radius: 9px; min-height: 14px; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.auth-note {
  border: 1px solid rgba(108,111,245,0.32); background: var(--accent-soft);
  border-radius: var(--r-md); padding: 12px 15px; font-size: 13px;
  color: var(--text-2); margin-bottom: 14px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.auth-note.green { border-color: rgba(45,212,167,0.35); background: var(--ok-soft); }
.auth-note.amber { border-color: rgba(245,184,61,0.3); background: var(--warn-soft); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 5px 18px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-word; }

.result {
  margin-top: 12px; padding: 12px 14px;
  background: rgba(0,0,0,0.35); border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word; max-height: 440px; overflow: auto;
}
.result.error { border-color: rgba(244,104,95,0.4); color: var(--bad); }
.result.ok { border-color: rgba(45,212,167,0.3); }

/* settings connection cards */
.conn-card { display: flex; flex-direction: column; gap: 0; }
.conn-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 13px; }
.conn-ico {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid rgba(108,111,245,0.22);
}
.conn-ico svg { width: 18px; height: 18px; }
.conn-ico.off { background: rgba(255,255,255,0.05); color: var(--text-3); border-color: var(--line); }
.conn-head .t { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.conn-head .s { color: var(--text-3); font-size: 12.5px; margin-top: 3px; line-height: 1.55; }
.conn-status { margin-left: auto; flex-shrink: 0; }

/* chart entrance animations (applied once per container by charts.bind) */
svg.draw-in path { stroke-dasharray: 2200; stroke-dashoffset: 2200; animation: dash-in 0.9s cubic-bezier(.4,0,.2,1) forwards; }
svg.draw-in path[fill]:not([fill="none"]) { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
@keyframes dash-in { to { stroke-dashoffset: 0; } }
svg.chart-pop { animation: chart-pop 0.45s cubic-bezier(.21,1.02,.73,1); transform-origin: center; }
@keyframes chart-pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

/* responsive */
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform 0.22s ease; box-shadow: var(--shadow-2); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .view { padding: 18px 16px 70px; }
  .topbar { padding: 0 14px; }
  .palette-btn { min-width: 0; }
  .palette-btn .lbl, .palette-btn kbd { display: none; }
  .tfield > span { display: none; }
  .tfield input { width: 104px; }
  .tfield.key input { width: 120px; }
  .hero .h-stats { margin-left: 0; gap: 20px; }
}
