:root {
  color-scheme: dark;
  --bg: #05070d;
  --panel: rgba(15, 22, 36, 0.78);
  --line: rgba(136, 243, 255, 0.18);
  --line-strong: rgba(136, 243, 255, 0.34);
  --text: #eef7fb;
  --muted: #9fb1be;
  --cyan: #00f2ff;
  --pink: #ff4fd8;
  --green: #37ff9a;
  --amber: #ffc857;
  --radius: 8px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 18% 10%, rgba(0, 242, 255, 0.18), transparent 26rem), radial-gradient(circle at 86% 6%, rgba(255, 79, 216, 0.14), transparent 24rem), radial-gradient(circle at 58% 95%, rgba(55, 255, 154, 0.08), transparent 25rem), linear-gradient(135deg, #020409 0%, #070b15 48%, #03050b 100%);
  color: var(--text);
}
button, input { font: inherit; }
button { cursor: pointer; }
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px; border-right: 1px solid var(--line); background: rgba(5, 7, 13, 0.82); backdrop-filter: blur(18px); }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(0, 242, 255, 0.6); border-radius: var(--radius); background: linear-gradient(145deg, rgba(0, 242, 255, 0.24), rgba(157, 108, 255, 0.18)); box-shadow: 0 0 28px rgba(0, 242, 255, 0.22); color: white; font-weight: 800; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; }
h2 { font-size: 28px; }
h3 { font-size: 18px; }
.eyebrow { color: var(--cyan); font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
.nav { display: grid; gap: 8px; }
.nav-item, .ghost-button, .icon-button, .chip { border: 1px solid transparent; border-radius: var(--radius); color: var(--text); background: transparent; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; color: var(--muted); text-align: left; }
.nav-item:hover, .nav-item.active { border-color: var(--line-strong); background: rgba(0, 242, 255, 0.09); color: var(--text); }
.nav-item svg, .panel-head svg, .search svg, .icon-button svg { width: 18px; height: 18px; }
.main { min-width: 0; padding: 24px; }
.topbar { display: flex; justify-content: center; gap: 18px; align-items: center; margin-bottom: 30px; }
.title-block h2 { font-size: clamp(40px, 5vw, 68px); line-height: 1; text-align: center; text-shadow: 0 0 30px rgba(0, 242, 255, 0.22); }
.dashboard-title h2 span { color: var(--cyan); text-shadow: 0 0 30px rgba(0, 242, 255, 0.38); }
.dashboard-title h2 strong { color: var(--text); font-weight: 800; }
.topbar .top-actions { position: absolute; right: 28px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; width: min(420px, 44vw); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(9, 13, 22, 0.7); color: var(--muted); }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border-color: var(--line); background: rgba(0, 242, 255, 0.08); }
.view { display: none; }
.view.active { display: grid; gap: 18px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric, .panel, .content-card, .source-row, .node-detail { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.metric { padding: 14px; }
.metric strong { display: block; margin-top: 6px; font-size: 26px; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr); gap: 18px; }
.panel { padding: 18px; }
.panel-head, .graph-toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 16px; }
.hero-panel { position: relative; min-height: 176px; overflow: hidden; display: flex; align-items: flex-end; }
.hero-panel h3 { max-width: 760px; margin: 8px 0; font-size: 28px; }
.hero-panel p:not(.eyebrow) { max-width: 700px; color: var(--muted); line-height: 1.55; }
.hero-orbit { position: absolute; inset: auto 5% 20px auto; width: 180px; height: 180px; opacity: 0.75; }
.hero-orbit span { position: absolute; inset: 18px; border: 1px solid rgba(0, 242, 255, 0.24); border-radius: 50%; }
.hero-orbit span:nth-child(1) { box-shadow: 0 0 40px rgba(0, 242, 255, 0.18); }
.hero-orbit span:nth-child(2) { inset: 36px; border-color: rgba(255, 79, 216, 0.28); }
.hero-orbit span:nth-child(3) { inset: 62px; border-color: rgba(55, 255, 154, 0.32); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.recent-grid { grid-template-rows: repeat(2, minmax(230px, 1fr)); gap: 24px; align-content: stretch; min-height: calc(100vh - 150px); }
.recent-grid .content-card {
  min-height: 230px;
  padding: 22px;
  background: linear-gradient(145deg, rgba(18, 28, 48, 0.88), rgba(8, 12, 24, 0.82));
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255,255,255,0.06);
}
.recent-grid .content-card h3 { font-size: 22px; }
.recent-grid .content-card p { font-size: 14px; }
.content-card {
  position: relative;
  min-height: 178px;
  padding: 16px;
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
a.content-card { cursor: pointer; }
.content-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background: radial-gradient(circle at 82% 12%, var(--card-color, #00f2ff), transparent 12rem);
  pointer-events: none;
}
.content-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius) - 1px);
  background: linear-gradient(145deg, rgba(255,255,255,0.06), transparent 36%);
  pointer-events: none;
}
.content-card > * { position: relative; z-index: 1; }
.content-card:hover {
  border-color: color-mix(in srgb, var(--card-color, #00f2ff) 56%, rgba(255,255,255,0.18));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42), 0 0 32px color-mix(in srgb, var(--card-color, #00f2ff) 22%, transparent);
  background: color-mix(in srgb, rgba(18, 28, 48, 0.88) 84%, var(--card-color, #00f2ff));
}
.card-top { display: flex; justify-content: space-between; gap: 12px; }
.type-dot { width: 11px; height: 11px; margin-top: 6px; border-radius: 999px; background: var(--cyan); box-shadow: 0 0 22px currentColor; }
.content-card p { color: var(--muted); line-height: 1.4; font-size: 13px; }
.meta-row, .tag-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill, .tag { border-radius: 999px; padding: 5px 8px; font-size: 12px; }
.pill { border: 1px solid rgba(255, 255, 255, 0.12); color: var(--text); background: rgba(255, 255, 255, 0.05); }
.tag { color: var(--muted); background: rgba(255, 255, 255, 0.06); }
.compact-list { display: grid; gap: 10px; }
.compact-item { padding: 12px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius); background: rgba(255, 255, 255, 0.04); }
.compact-item p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.ghost-button, .chip { padding: 9px 11px; border-color: var(--line); background: rgba(255, 255, 255, 0.04); }
.chip.active, .ghost-button:hover, .chip:hover { border-color: var(--line-strong); background: rgba(0, 242, 255, 0.1); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-bar.compact { justify-content: flex-end; }
.graph-view { min-height: calc(100vh - 118px); }
.graph-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; min-height: 620px; }
#graph-canvas { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(rgba(0, 242, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 242, 255, 0.04) 1px, transparent 1px), rgba(5, 7, 13, 0.62); background-size: 42px 42px; }
.node-detail { padding: 16px; align-self: stretch; }
.node-detail h3 { margin: 8px 0; }
.node-detail p { color: var(--muted); line-height: 1.5; }
.card-actions { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.action-link { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 242, 255, 0.08); color: var(--text); font-size: 12px; text-decoration: none; }
.action-link:hover { border-color: var(--line-strong); background: rgba(0, 242, 255, 0.14); transform: translateY(-1px); }
.action-link svg { width: 14px; height: 14px; }
.muted { color: var(--muted); }
@media (max-width: 1050px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: grid; gap: 16px; }
  .nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sync-panel { position: static; }
  .work-grid, .graph-layout { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent-grid { grid-template-rows: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { width: min(100%, 460px); }
}
@media (max-width: 680px) {
  .main, .sidebar { padding: 16px; }
  .topbar, .top-actions { align-items: stretch; flex-direction: column; }
  .topbar .top-actions { position: static; }
  .search { width: 100%; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-item { justify-content: center; }
  .metrics, .card-grid { grid-template-columns: 1fr; }
  .hero-panel h3 { font-size: 24px; }
  .hero-orbit { opacity: 0.34; }
  .source-row { grid-template-columns: 1fr; }
  #graph-canvas { height: 520px; }
}
