/* ZeroScript Workspace v1.8.0 - Liquid Glass & Spring Motion */
:root {
  --bg: #06070c;
  --surface: rgba(16, 19, 30, 0.58);
  --surface-solid: #0f111a;
  --surface-2: rgba(24, 28, 44, 0.68);
  --surface-hover: rgba(34, 40, 62, 0.72);
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.22);
  --glass-rim: rgba(255, 255, 255, 0.24);
  --glass-rim-bottom: rgba(255, 255, 255, 0.05);
  --glass-blur: 24px;
  --glass-sat: 185%;
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.48), 0 4px 16px rgba(0, 0, 0, 0.25);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  --text: #f4f5f9;
  --text-muted: #9aa3b8;
  --text-dim: #68728a;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --accent: #818cf8;
  --accent-2: #38bdf8;
  --accent-soft: rgba(129, 140, 248, 0.16);
  --accent-border: rgba(129, 140, 248, 0.42);
  --accent-glow: rgba(129, 140, 248, 0.26);
  --display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

html[data-glass="frosted"] {
  --surface: rgba(15, 17, 26, 0.84);
  --surface-2: rgba(23, 26, 39, 0.88);
  --surface-hover: rgba(32, 36, 54, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --glass-rim: rgba(255, 255, 255, 0.09);
  --glass-blur: 14px;
  --glass-sat: 130%;
}

html[data-glass="crystal"] {
  --surface: rgba(18, 22, 36, 0.42);
  --surface-2: rgba(26, 32, 52, 0.52);
  --surface-hover: rgba(40, 48, 76, 0.58);
  --border: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.30);
  --glass-rim: rgba(255, 255, 255, 0.34);
  --glass-blur: 28px;
  --glass-sat: 210%;
}

html[data-accent="prism"] {
  --accent: #38bdf8;
  --accent-2: #c084fc;
  --accent-soft: rgba(192, 132, 252, 0.18);
  --accent-border: rgba(125, 211, 252, 0.46);
  --accent-glow: rgba(192, 132, 252, 0.28);
}

html[data-accent="cyan"] {
  --accent: #38bdf8;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(56, 189, 248, 0.16);
  --accent-border: rgba(56, 189, 248, 0.42);
  --accent-glow: rgba(56, 189, 248, 0.22);
}

html[data-accent="emerald"] {
  --accent: #34d399;
  --accent-2: #38bdf8;
  --accent-soft: rgba(52, 211, 153, 0.16);
  --accent-border: rgba(52, 211, 153, 0.42);
  --accent-glow: rgba(52, 211, 153, 0.20);
}

html[data-accent="amber"] {
  --accent: #fbbf24;
  --accent-2: #fb923c;
  --accent-soft: rgba(251, 191, 36, 0.16);
  --accent-border: rgba(251, 191, 36, 0.42);
  --accent-glow: rgba(251, 191, 36, 0.20);
}

html[data-accent="crimson"] {
  --accent: #fb7185;
  --accent-2: #f43f5e;
  --accent-soft: rgba(251, 113, 133, 0.16);
  --accent-border: rgba(251, 113, 133, 0.42);
  --accent-glow: rgba(251, 113, 133, 0.20);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.bg-aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 8%, var(--accent-glow), transparent 48%),
    radial-gradient(circle at 86% 14%, rgba(56, 189, 248, 0.14), transparent 44%),
    radial-gradient(circle at 60% 95%, rgba(16, 185, 129, 0.10), transparent 48%);
  transition: background 0.45s var(--ease-spring);
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.42;
  will-change: transform;
}
.aurora-orb.orb-1 {
  width: 460px; height: 460px;
  top: -120px; left: 8%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  animation: orbFloat1 18s ease-in-out infinite alternate;
}
.aurora-orb.orb-2 {
  width: 420px; height: 420px;
  top: 22%; right: -90px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 70%);
  animation: orbFloat2 22s ease-in-out infinite alternate;
}
.aurora-orb.orb-3 {
  width: 380px; height: 380px;
  bottom: -110px; left: 42%;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.22), transparent 70%);
  animation: orbFloat3 25s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(70px, 50px, 0) scale(1.14); }
}
@keyframes orbFloat2 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-80px, 65px, 0) scale(1.1); }
}
@keyframes orbFloat3 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(60px, -55px, 0) scale(1.18); }
}

html[data-motion="off"] .aurora-orb,
html[data-motion="off"] .diagram-flow span {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .aurora-orb, .diagram-flow span { animation: none !important; }
}

#bg-matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 18px 13px 14px;
  background: rgba(11, 13, 22, 0.68);
  border-right: 1px solid var(--border);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 14px;
}

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

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--accent-border);
  color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.brand-name {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-ver {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.palette-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.028);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.palette-trigger:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--border-strong);
  color: var(--text);
}
.pal-left { display: flex; align-items: center; gap: 7px; }
kbd {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: background 0.24s var(--ease-spring), border-color 0.24s var(--ease-spring), color 0.2s ease, transform 0.22s var(--ease-spring), box-shadow 0.24s var(--ease-spring);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  transform: translateX(2px);
}
.nav-item:active { transform: scale(0.98); }

.nav-item.active {
  background: linear-gradient(120deg, var(--accent-soft), rgba(255, 255, 255, 0.05));
  border-color: var(--accent-border);
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.nav-ic {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  flex: none;
  color: var(--text-muted);
}

.nav-item.active .nav-ic {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.nav-title {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.nav-sub {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.nav-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  margin-right: 4px;
}

.nav-pill {
  width: 3px;
  height: 16px;
  border-radius: 99px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.16s ease;
}
.nav-item.active .nav-pill { opacity: 1; }

.side-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 12px;
}

.social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
  color: var(--text);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07080d;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex: none;
}

.profile-meta { flex: 1; min-width: 0; }
.profile-name {
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-role {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.07em;
  color: var(--text-dim);
}

.icon-mini {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.icon-mini:hover {
  background: rgba(248, 113, 113, 0.16);
  color: var(--red);
}

/* ── Main Area & Header ───────────────────────────────────────────────── */
.main-area {
  overflow-y: auto;
  padding: 24px 32px 38px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.top-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow, .eyebrow-muted {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}
.eyebrow-muted { color: var(--text-dim); }

.page-greeting {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: -0.028em;
}

.page-sub {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: rgba(16, 24, 22, 0.72);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: #d1fae5;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-pill.warn { border-color: rgba(251, 191, 36, 0.32); background: rgba(28, 22, 12, 0.72); color: #fef3c7; }
.status-pill.off { border-color: rgba(248, 113, 113, 0.32); background: rgba(28, 14, 16, 0.72); color: #fecaca; }

.pulse-dot, .dot-sm {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.85);
}
.status-pill.warn .pulse-dot { background: var(--amber); box-shadow: 0 0 10px rgba(251, 191, 36, 0.85); }
.status-pill.off .pulse-dot { background: var(--red); box-shadow: 0 0 10px rgba(248, 113, 113, 0.85); }

.hdr-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.hdr-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
  color: var(--text);
}

.hdr-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent);
  color: #07080d;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ── Subtabs & Views ──────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; animation: viewEnter 0.34s var(--ease-spring) both; }
.subpanel { display: none; }
.subpanel.active { display: block; animation: viewEnter 0.28s var(--ease-spring) both; }
.tk-panel { display: none; }
.tk-panel.active { display: block; animation: viewEnter 0.28s var(--ease-spring) both; }
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(8px) scale(0.994); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.is-spinning svg { animation: spin360 0.75s linear infinite; }
@keyframes spin360 { to { transform: rotate(360deg); } }

.subtab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.subtab-group, .telemetry-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.subtab, .tk-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.subtab:hover, .tk-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.subtab.active, .tk-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07080d;
}
.count-pill {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.22);
}
.mini-pill {
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.025);
}
.mini-pill.accent {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ── Hero Split Card & Liquid Glass Surfaces ──────────────────────────── */
.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.075) 0%, var(--surface) 45%, rgba(10, 12, 20, 0.72) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-rim), inset 0 -1px 0 var(--glass-rim-bottom);
}

.hero-left {
  padding: 26px 28px;
  border-right: 1px solid var(--border);
}

.hero-headline {
  margin: 6px 0 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 36px;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero-gradient {
  background: linear-gradient(95deg, #ffffff 0%, var(--accent) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  margin: 0 0 18px;
  color: var(--text-muted);
  max-width: 470px;
  line-height: 1.55;
  font-size: 13px;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pinned-wrap {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.pinned-label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.pinned-row { display: flex; flex-wrap: wrap; gap: 7px; }
.pinned-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.12s ease;
}
.pinned-chip:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.pinned-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.btn-primary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 11px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.22s var(--ease-spring), filter 0.18s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.22s var(--ease-spring);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07080d;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 24px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1.5px); box-shadow: 0 12px 28px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.btn-primary:active, .btn-outline:active { transform: scale(0.97); }

.btn-outline {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.095); border-color: rgba(255, 255, 255, 0.28); transform: translateY(-1px); }
.btn-primary.sm, .btn-outline.sm { padding: 7px 12px; font-size: 10px; border-radius: 8px; }

.hero-right {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(circle at 50% 45%, var(--accent-soft), transparent 72%);
}

.diagram-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0;
}
.diagram-node { text-align: center; min-width: 84px; }
.diag-idx { font-family: var(--mono); font-size: 10px; color: var(--text-dim); }
.diag-title { margin-top: 4px; font-family: var(--display); font-size: 13.5px; font-weight: 700; }
.diag-sub { margin-top: 2px; font-size: 11px; color: var(--text-muted); }

.diagram-flow {
  position: relative;
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  border-radius: 99px;
}
.diagram-flow span {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: flowPulse 2.2s linear infinite;
}
@keyframes flowPulse { from { left: -40%; } to { left: 100%; } }

.diagram-hub {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  background: rgba(12, 14, 22, 0.92);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 22px var(--accent-glow);
  display: grid;
  place-items: center;
  flex: none;
}

.diagram-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: rgba(16, 22, 20, 0.55);
  font-family: var(--mono);
  font-size: 11px;
  color: #d1fae5;
}
.diagram-status.warn { border-color: rgba(251, 191, 36, 0.3); background: rgba(28, 22, 12, 0.55); color: #fef3c7; }
.diagram-status.warn .dot-sm { background: var(--amber); box-shadow: 0 0 8px rgba(251, 191, 36, 0.75); }
.diagram-status.off { border-color: rgba(248, 113, 113, 0.3); color: #fecaca; }
.diagram-status.off .dot-sm { background: var(--red); box-shadow: 0 0 8px rgba(248, 113, 113, 0.75); }

/* ── KPI Strip ────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.kpi-card {
  padding: 16px 18px;
  border-right: 1px solid var(--border);
}
.kpi-card:last-child { border-right: none; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kpi-label, .kpi-idx { font-family: var(--mono); font-size: 10px; letter-spacing: 0.11em; color: var(--text-dim); }
.kpi-val { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.1; margin-bottom: 4px; }
.kpi-sub { font-size: 11.5px; color: var(--text-muted); line-height: 1.35; }

.action-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 11px;
}

.quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.quick-card:hover { border-color: var(--accent-border); background: var(--surface-hover); transform: translateY(-1px); }
.quick-card.danger:hover { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.08); }
.quick-ic {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.035);
  display: grid; place-items: center; font-size: 15px; flex: none; color: var(--accent);
}
.quick-body { flex: 1; min-width: 0; }
.quick-title { font-family: var(--display); font-weight: 700; font-size: 13px; }
.quick-sub { margin-top: 2px; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-arrow { color: var(--text-dim); font-size: 14px; }

/* ── Shared Surface Cards & Headings ──────────────────────────────────── */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head.tight { margin-bottom: 12px; }
.sec-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.15; letter-spacing: -0.02em; }
.sec-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; }

.providers-grid, .guides-grid, .prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 12px;
}

.provider-card, .guide-card, .skill-card, .server-card, .settings-card, .add-server-card, .surface-card, .prompt-card, .presets-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055) 0%, var(--surface) 55%, rgba(10, 12, 20, 0.65) 100%);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 16px 18px;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 var(--glass-rim), inset 0 -1px 0 var(--glass-rim-bottom);
  transition: border-color 0.24s var(--ease-spring), transform 0.28s var(--ease-spring), box-shadow 0.28s var(--ease-spring), background 0.24s ease;
}

.hero-card::after, .provider-card::after, .guide-card::after, .skill-card::after, .server-card::after, .settings-card::after, .surface-card::after, .prompt-card::after, .quick-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.11), transparent 60%);
  transition: opacity 0.28s ease;
}
.hero-card:hover::after, .provider-card:hover::after, .guide-card:hover::after, .skill-card:hover::after, .server-card:hover::after, .settings-card:hover::after, .surface-card:hover::after, .prompt-card:hover::after, .quick-card:hover::after {
  opacity: 1;
}

.provider-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.provider-card:hover { border-color: var(--accent-border); transform: translateY(-2px); }

.prov-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prov-ident { display: flex; align-items: center; gap: 10px; }
.prov-badge {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: #07080d; flex: none;
}
.prov-name { font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.15; }
.prov-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.prov-desc, .guide-card p { margin: 8px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.prov-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.fav-btn {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  cursor: pointer; font-size: 14px; display: grid; place-items: center;
}
.fav-btn.active { color: var(--amber); border-color: rgba(251, 191, 36, 0.38); background: rgba(251, 191, 36, 0.10); }

.guide-card h3 { margin: 8px 0 0; font-family: var(--display); font-size: 15px; }
.guide-card code { font-family: var(--mono); font-size: 11px; background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 4px; }
.guide-card .btn-outline, .guide-card .btn-primary { margin-top: 12px; }
.guide-num { font-family: var(--mono); font-size: 11px; color: var(--accent); }

.tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2.5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.tag.green { border-color: rgba(52, 211, 153, 0.35); color: var(--green); }
.tag.amber { border-color: rgba(251, 191, 36, 0.35); color: var(--amber); }
.tag.red { border-color: rgba(248, 113, 113, 0.38); color: var(--red); }
.tag.accent { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent); }

/* ── Toolbars, Filters & Skills ───────────────────────────────────────── */
.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filter-pills, .toolbar-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.filter-pill {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}
.filter-pill:hover { color: var(--text); border-color: var(--border-strong); }
.filter-pill.active {
  background: var(--accent);
  color: #07080d;
  border-color: var(--accent);
  font-weight: 700;
}

.presets-panel { margin-bottom: 14px; padding: 14px 16px; }
.presets-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.presets-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 8px; }
.preset-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.preset-btn:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.preset-name { font-family: var(--display); font-weight: 700; font-size: 12.5px; }
.preset-desc { margin-top: 3px; font-size: 11px; color: var(--text-muted); line-height: 1.35; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}
.skill-card { display: flex; flex-direction: column; gap: 10px; transition: border-color 0.15s ease; }
.skill-card:hover { border-color: var(--accent-border); }
.skill-card.disabled { opacity: 0.52; }
.skill-top, .srv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.skill-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.2; }
.skill-tagline { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.48; min-height: 36px; }

.skill-controls {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mode-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.mode-btn {
  padding: 5px 8px; border: 0; background: transparent; color: var(--text-muted);
  font-family: var(--mono); font-size: 9.5px; cursor: pointer;
}
.mode-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-track {
  width: 34px; height: 19px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.12); border: 1px solid var(--border);
  position: relative; transition: background 0.15s ease;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%; background: #d4d4d8;
  transition: transform 0.15s ease, background 0.15s ease;
}
.switch input:checked + .switch-track { background: rgba(52, 211, 153, 0.25); border-color: rgba(52, 211, 153, 0.55); }
.switch input:checked + .switch-track::after { transform: translateX(15px); background: var(--green); }

/* ── Activity Timeline ────────────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: 8px; }
.act-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
}
.act-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.act-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.act-dot.err { background: var(--red); }
.act-tool { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.act-right { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.act-ts { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.act-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.act-detail[hidden] { display: none; }
.act-box-label { font-family: var(--mono); font-size: 9.5px; color: var(--text-dim); margin-bottom: 4px; text-transform: uppercase; }
.act-pre {
  margin: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(5, 6, 10, 0.85);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Prompt Studio ────────────────────────────────────────────────────── */
.prompts-layout { display: flex; flex-direction: column; gap: 18px; }
.prompts-split { display: flex; flex-direction: column; gap: 18px; }
.prompt-card { display: flex; flex-direction: column; gap: 10px; }
.prompt-title { font-family: var(--display); font-weight: 700; font-size: 15px; }
.prompt-body {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
  background: rgba(7, 8, 13, 0.65); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 11px;
}

/* ── Connections & Health Doctor ──────────────────────────────────────── */
.conn-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.servers-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.srv-cmd { margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-muted); word-break: break-all; }
.srv-err { margin-top: 6px; font-size: 11.5px; color: var(--red); }
.srv-actions { margin-top: 10px; display: flex; gap: 8px; }

.diag-list { display: flex; flex-direction: column; gap: 8px; }
.diag-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(7, 8, 13, 0.6);
}
.diag-ic {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700; flex: none; margin-top: 1px;
}
.diag-ic.ok { background: rgba(52, 211, 153, 0.16); color: var(--green); }
.diag-ic.warn { background: rgba(251, 191, 36, 0.16); color: var(--amber); }
.diag-ic.fail { background: rgba(248, 113, 113, 0.18); color: var(--red); }
.diag-name { font-weight: 600; font-size: 12.5px; }
.diag-detail { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

.tools-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 70vh; overflow-y: auto; padding-right: 4px;
}
.tool-row {
  padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; transition: border-color 0.14s ease, background 0.14s ease;
}
.tool-row:hover { border-color: var(--accent-border); background: var(--surface-hover); }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tool-name { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.tool-desc { margin-top: 4px; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }

/* ── Settings & Forms ─────────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.folder-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.field-caption { font-size: 12px; color: var(--text-muted); margin-bottom: 7px; }
.accent-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.025);
  color: var(--text-muted); font-size: 12px; font-weight: 500; cursor: pointer;
}
.swatch.active { border-color: var(--accent-border); background: var(--accent-soft); color: var(--text); font-weight: 600; }
.sw-dot { width: 10px; height: 10px; border-radius: 50%; }

.card-heading { margin: 0 0 12px; font-family: var(--display); font-size: 15px; font-weight: 700; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-stack label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-muted); }

input[type="text"], input[type="search"], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px;
  border: 1px solid var(--border); background: #090a10; color: var(--text);
  font-family: var(--sans); font-size: 13px; outline: none;
}
textarea { font-family: var(--mono); font-size: 12px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-border); }

.search-input { width: 210px; }
.search-input.full { width: 100%; }

.toggle-row {
  flex-direction: row !important; align-items: center; justify-content: space-between;
  padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(9, 10, 16, 0.85); cursor: pointer;
}
.toggle-title { font-size: 13px; font-weight: 600; color: var(--text); }
.toggle-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-actions.between { justify-content: space-between; }
.form-msg { font-size: 12px; color: var(--green); }
.form-msg.err { color: var(--red); }

/* ── Modals, Palette & Logs Drawer ────────────────────────────────────── */
.modal-backdrop, .drawer-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.drawer-backdrop { justify-content: flex-end; }
.modal-backdrop[hidden], .drawer-backdrop[hidden] { display: none; }

.modal-card {
  width: min(760px, 92vw); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(16, 18, 28, 0.82));
  border: 1px solid var(--border-strong); border-radius: 20px; padding: 22px 24px;
  backdrop-filter: blur(28px) saturate(190%);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.65), inset 0 1px 0 var(--glass-rim);
  animation: modalIn 0.26s var(--ease-spring) both;
}

.palette-card {
  width: min(620px, 92vw);
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(16, 18, 28, 0.84));
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  backdrop-filter: blur(28px) saturate(190%);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.72), 0 0 38px var(--accent-glow), inset 0 1px 0 var(--glass-rim);
  overflow: hidden;
  animation: modalIn 0.24s var(--ease-spring) both;
}
.palette-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-muted);
}
.palette-input-row input {
  border: none; background: transparent; padding: 4px 0; font-size: 14px;
}
.palette-results { max-height: 55vh; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.pal-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text);
  text-align: left; cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s var(--ease-spring);
}
.pal-item:hover, .pal-item.selected { background: var(--accent-soft); border-color: var(--accent-border); }
.pal-item-title { font-weight: 600; font-size: 13px; }
.pal-item-sub { font-size: 11px; color: var(--text-muted); }

.drawer-card {
  width: min(560px, 94vw); height: 100%;
  background: linear-gradient(180deg, rgba(20, 24, 38, 0.86), rgba(10, 12, 20, 0.92));
  border-left: 1px solid var(--border-strong);
  backdrop-filter: blur(26px) saturate(185%);
  padding: 22px; display: flex; flex-direction: column; gap: 14px;
  animation: drawerIn 0.28s var(--ease-spring) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes drawerIn {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; }

.logs-stream {
  flex: 1; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px;
  background: #07080d; padding: 12px; font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
}
.log-line { display: flex; gap: 10px; padding: 2px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.log-ts { color: var(--text-dim); flex: none; }
.log-msg.gr { color: var(--green); }
.log-msg.yl { color: var(--amber); }
.log-msg.rd { color: var(--red); }
.log-msg.cy { color: #93c5fd; }

.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  padding: 10px 16px; border-radius: 12px;
  background: rgba(18, 22, 36, 0.84);
  backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--accent-border);
  font-size: 12.5px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6), inset 0 1px 0 var(--glass-rim);
  animation: modalIn 0.22s var(--ease-spring) both;
}

/* ── Reference-Matched Apple Liquid Glass Mode ────────────────────────── */
.liquid-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  display: none;
}
html[data-liquid="on"] .liquid-backdrop {
  display: block;
}
html[data-liquid="on"] .bg-aurora {
  opacity: 0.42;
}

.lb-sky, .lb-sun, .lb-cloud, .lb-horizon, .lb-water {
  position: absolute;
  inset: 0;
}

/* Sunset Skyline (Toronto golden-hour reference palette) */
html[data-backdrop="sunset"] .lb-sky {
  background:
    radial-gradient(ellipse 90% 55% at 72% 48%, rgba(255, 208, 145, 0.68), transparent 62%),
    radial-gradient(ellipse 75% 45% at 24% 38%, rgba(240, 184, 128, 0.42), transparent 60%),
    linear-gradient(180deg, #33435b 0%, #525e73 28%, #9b7f6e 56%, #d9a774 74%, #3c3a3a 82%, #1d2229 100%);
}
html[data-backdrop="sunset"] .lb-sun {
  inset: auto;
  width: 520px; height: 520px;
  top: 12%; right: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 175, 0.62) 0%, rgba(246, 172, 102, 0.24) 45%, transparent 72%);
  filter: blur(28px);
}
.lb-cloud {
  inset: auto;
  border-radius: 50%;
  filter: blur(42px);
  will-change: transform;
}
html[data-backdrop="sunset"] .lb-cloud-1 {
  width: 680px; height: 260px;
  top: 10%; left: 6%;
  background: radial-gradient(circle at 45% 40%, rgba(255, 240, 224, 0.72), rgba(214, 178, 152, 0.28) 65%, transparent 80%);
  animation: orbFloat1 26s ease-in-out infinite alternate;
}
html[data-backdrop="sunset"] .lb-cloud-2 {
  width: 760px; height: 280px;
  top: 22%; right: 4%;
  background: radial-gradient(circle at 50% 45%, rgba(255, 223, 184, 0.65), rgba(162, 138, 128, 0.25) 68%, transparent 82%);
  animation: orbFloat2 30s ease-in-out infinite alternate;
}
html[data-backdrop="sunset"] .lb-cloud-3 {
  width: 540px; height: 210px;
  top: 44%; left: 32%;
  background: radial-gradient(circle, rgba(252, 198, 132, 0.45), transparent 72%);
  animation: orbFloat3 22s ease-in-out infinite alternate;
}
html[data-backdrop="sunset"] .lb-horizon {
  inset: auto 0 22% 0;
  height: 11%;
  background: linear-gradient(180deg, transparent 0%, rgba(30, 34, 42, 0.78) 60%, rgba(20, 24, 30, 0.94) 100%);
  clip-path: polygon(0 64%, 7% 64%, 7% 42%, 11% 42%, 11% 62%, 17% 62%, 17% 28%, 21% 28%, 21% 58%, 29% 58%, 29% 12%, 31% 4%, 33% 12%, 33% 56%, 41% 56%, 41% 34%, 46% 34%, 46% 52%, 53% 52%, 53% 24%, 58% 24%, 58% 58%, 67% 58%, 67% 32%, 73% 32%, 73% 56%, 82% 56%, 82% 38%, 89% 38%, 89% 60%, 100% 60%, 100% 100%, 0 100%);
}
html[data-backdrop="sunset"] .lb-water {
  inset: auto 0 0 0;
  height: 22%;
  background:
    repeating-linear-gradient(180deg, rgba(255, 210, 158, 0.14) 0px, rgba(255, 210, 158, 0.14) 2px, rgba(16, 20, 26, 0.35) 3px, rgba(16, 20, 26, 0.35) 7px),
    linear-gradient(180deg, #4b4744 0%, #26292f 55%, #171a1f 100%);
}

/* Aurora Sky backdrop */
html[data-backdrop="aurora"] .lb-sky {
  background:
    radial-gradient(ellipse 80% 50% at 30% 25%, rgba(52, 211, 153, 0.42), transparent 65%),
    radial-gradient(ellipse 75% 50% at 75% 32%, rgba(129, 140, 248, 0.46), transparent 65%),
    linear-gradient(180deg, #0b1120 0%, #111c33 55%, #090d16 100%);
}
html[data-backdrop="aurora"] .lb-cloud-1 {
  width: 720px; height: 280px; top: 8%; left: 12%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.36), transparent 70%);
  animation: orbFloat1 22s ease-in-out infinite alternate;
}
html[data-backdrop="aurora"] .lb-cloud-2 {
  width: 640px; height: 260px; top: 26%; right: 6%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.34), transparent 70%);
  animation: orbFloat2 26s ease-in-out infinite alternate;
}

/* Deep Ocean backdrop */
html[data-backdrop="ocean"] .lb-sky {
  background:
    radial-gradient(ellipse 75% 55% at 68% 36%, rgba(125, 211, 252, 0.56), transparent 62%),
    linear-gradient(180deg, #164e63 0%, #0e7490 42%, #155e75 72%, #082f49 100%);
}
html[data-backdrop="ocean"] .lb-cloud-1 {
  width: 680px; height: 260px; top: 14%; left: 10%;
  background: radial-gradient(circle, rgba(224, 242, 254, 0.48), transparent 72%);
  animation: orbFloat1 24s ease-in-out infinite alternate;
}
html[data-backdrop="ocean"] .lb-water {
  inset: auto 0 0 0; height: 24%;
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.55), rgba(8, 47, 73, 0.92));
}

/* Midnight Neon backdrop */
html[data-backdrop="midnight"] .lb-sky {
  background:
    radial-gradient(ellipse 75% 55% at 24% 20%, rgba(99, 102, 241, 0.38), transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 72%, rgba(236, 72, 153, 0.30), transparent 62%),
    linear-gradient(180deg, #070812 0%, #101326 60%, #080912 100%);
}

html[data-motion="off"] .lb-cloud {
  animation: none !important;
}

/* Blown Liquid Glass Surface Overrides */
html[data-liquid="on"] {
  --surface: rgba(255, 255, 255, 0.14);
  --surface-2: rgba(255, 255, 255, 0.18);
  --surface-hover: rgba(255, 255, 255, 0.24);
  --border: rgba(255, 255, 255, 0.30);
  --border-strong: rgba(255, 255, 255, 0.46);
  --glass-rim: rgba(255, 255, 255, 0.64);
  --glass-rim-bottom: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.84);
  --text-dim: rgba(255, 255, 255, 0.66);
}

html[data-liquid="on"][data-glass="frosted"] {
  --surface: rgba(24, 30, 44, 0.42);
  --surface-hover: rgba(34, 42, 60, 0.52);
  --glass-rim: rgba(255, 255, 255, 0.36);
}
html[data-liquid="on"][data-glass="crystal"] {
  --surface: rgba(255, 255, 255, 0.09);
  --surface-hover: rgba(255, 255, 255, 0.17);
  --glass-rim: rgba(255, 255, 255, 0.74);
}

html[data-liquid="on"] .sidebar {
  background: linear-gradient(175deg, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0.08) 55%, rgba(255, 255, 255, 0.13) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.30);
  box-shadow: 6px 0 32px rgba(0, 0, 0, 0.22), inset -1px 0 1px rgba(255, 255, 255, 0.35);
}

html[data-liquid="on"] .hero-card,
html[data-liquid="on"] .modal-card,
html[data-liquid="on"] .palette-card {
  border-radius: 26px;
}

html[data-liquid="on"] .provider-card,
html[data-liquid="on"] .guide-card,
html[data-liquid="on"] .skill-card,
html[data-liquid="on"] .server-card,
html[data-liquid="on"] .settings-card,
html[data-liquid="on"] .add-server-card,
html[data-liquid="on"] .surface-card,
html[data-liquid="on"] .prompt-card,
html[data-liquid="on"] .presets-panel,
html[data-liquid="on"] .kpi-grid,
html[data-liquid="on"] .quick-card,
html[data-liquid="on"] .act-card {
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.22) 0%, var(--surface) 48%, rgba(255, 255, 255, 0.12) 100%);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px) saturate(190%) brightness(1.04);
  -webkit-backdrop-filter: blur(22px) saturate(190%) brightness(1.04);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.28),
    inset 0 1.5px 1px var(--glass-rim),
    inset 0 -1.5px 2px var(--glass-rim-bottom),
    inset 1.5px 0 2px rgba(255, 255, 255, 0.22);
}

html[data-liquid="on"] .hero-card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.08) 52%, rgba(255, 255, 255, 0.16) 100%);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.34),
    inset 0 2px 1px rgba(255, 255, 255, 0.68),
    inset 0 -2px 2px rgba(255, 255, 255, 0.24),
    inset 1.5px 0 2px rgba(255, 255, 255, 0.26);
}

html[data-liquid="on"] .page-greeting,
html[data-liquid="on"] .hero-headline,
html[data-liquid="on"] .kpi-val,
html[data-liquid="on"] .sec-title,
html[data-liquid="on"] .skill-title,
html[data-liquid="on"] .prov-name,
html[data-liquid="on"] .brand-name {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

html[data-liquid="on"] .eyebrow {
  color: #ffffff;
  opacity: 0.9;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

html[data-liquid="on"] .nav-item.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.10));
  border-color: rgba(255, 255, 255, 0.46);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), inset 0 1.5px 1px rgba(255, 255, 255, 0.56);
}

html[data-liquid="on"] .palette-trigger,
html[data-liquid="on"] .profile-card,
html[data-liquid="on"] .social-btn,
html[data-liquid="on"] .hdr-btn,
html[data-liquid="on"] .btn-outline,
html[data-liquid="on"] .filter-pill,
html[data-liquid="on"] .swatch,
html[data-liquid="on"] .preset-btn,
html[data-liquid="on"] .toggle-row,
html[data-liquid="on"] .tool-row {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(16px) saturate(170%);
}

html[data-liquid="on"] .btn-outline:hover,
html[data-liquid="on"] .hdr-btn:hover,
html[data-liquid="on"] .social-btn:hover,
html[data-liquid="on"] .swatch:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.46);
}

html[data-liquid="on"] .swatch.active,
html[data-liquid="on"] .filter-pill.active {
  background: rgba(255, 255, 255, 0.90);
  color: #111827;
  border-color: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

html[data-liquid="on"] input[type="text"],
html[data-liquid="on"] input[type="search"],
html[data-liquid="on"] select,
html[data-liquid="on"] textarea,
html[data-liquid="on"] .prompt-body,
html[data-liquid="on"] .diag-row,
html[data-liquid="on"] .act-pre {
  background: rgba(12, 16, 26, 0.42);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

html[data-liquid="on"] .modal-card,
html[data-liquid="on"] .palette-card,
html[data-liquid="on"] .drawer-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.22) 0%, rgba(28, 34, 48, 0.56) 100%);
  border-color: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(30px) saturate(195%);
}

/* ── Toolkit View (Luau Auditor, Modules, Style Vocab, Memory) ──────── */
.audit-layout { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 16px; align-items: start; }
.audit-right { display: flex; flex-direction: column; gap: 12px; }
.audit-right .kpi-grid { margin-top: 0; }
.audit-code { min-height: 290px; font-size: 11.5px; tab-size: 4; }
.findings-list, .recovery-list, .memory-list { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }

.finding-row {
  padding: 11px 13px; border-radius: 13px;
  border: 1px solid var(--border); background: rgba(9, 10, 16, 0.72);
  border-left: 3px solid var(--accent);
}
.finding-row.prio-high { border-left-color: var(--red); }
.finding-row.prio-medium { border-left-color: var(--amber); }
.finding-row.prio-low { border-left-color: var(--green); }
.finding-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.finding-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.finding-code { font-family: var(--mono); font-size: 11px; color: var(--text); font-weight: 600; }
.finding-loc { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); }
.finding-msg { margin-top: 6px; font-size: 12px; color: var(--text-muted); line-height: 1.45; }

.mod-code-pre { max-height: 360px; font-size: 11.5px; }

.router-box { margin-bottom: 16px; }
.router-input-row { display: flex; gap: 8px; margin-top: 10px; }
.router-input-row input { flex: 1; }
.router-results { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.router-chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.guides-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.style-tokens-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.style-token {
  padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(9, 10, 16, 0.56);
}
.style-token-k { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 3px; }
.style-token-v { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.antislop-box { margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: rgba(9, 10, 16, 0.45); }
.antislop-box summary { cursor: pointer; font-weight: 600; font-size: 12px; color: var(--text); }
.antislop-body { margin-top: 8px; font-size: 11.5px; line-height: 1.5; color: var(--text-muted); white-space: pre-wrap; }

.recovery-card { padding: 11px 13px; border-radius: 12px; border: 1px solid var(--border); background: rgba(9, 10, 16, 0.62); }
.recovery-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recovery-title { font-family: var(--display); font-size: 13.5px; font-weight: 700; text-transform: capitalize; }
.recovery-step { margin-top: 5px; font-size: 11.5px; color: var(--text-muted); line-height: 1.42; }
.recovery-step b { color: var(--text); }

.memory-layout { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 16px; align-items: start; }
.memory-row { padding: 11px 13px; border-radius: 12px; border: 1px solid var(--border); background: rgba(9, 10, 16, 0.62); }
.memory-val { margin-top: 7px; font-size: 12px; color: var(--text-muted); line-height: 1.45; white-space: pre-wrap; word-break: break-word; }

html[data-liquid="on"] .finding-row,
html[data-liquid="on"] .style-token,
html[data-liquid="on"] .antislop-box,
html[data-liquid="on"] .recovery-card,
html[data-liquid="on"] .memory-row {
  background: rgba(12, 16, 26, 0.42);
  border-color: rgba(255, 255, 255, 0.24);
}

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 204px 1fr; }
  .hero-card, .conn-layout, .settings-grid, .act-detail, .audit-layout, .guides-split, .memory-layout { grid-template-columns: 1fr; }
  .hero-left { border-right: none; border-bottom: 1px solid var(--border); }
  .kpi-grid, .quick-grid { grid-template-columns: repeat(2, 1fr); }
}
