
  :root {
    --bg: #0b0f14;
    --bg-2: #101722;
    --panel: #11161d;
    --panel-2: #151c25;
    --ink: #e6edf3;
    --muted: #8b949e;
    --line: #1f2937;
    --accent: #e6edf3;
    --speed: 1;
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 13px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
  }
  button, input { font: inherit; }
  header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(11, 15, 20, .92);
    position: relative;
    z-index: 5;
  }
  .brand { display: flex; align-items: baseline; gap: 9px; min-width: 240px; }
  .brand strong { font-size: 15px; letter-spacing: .02em; }
  .brand .slash { color: var(--muted); }
  .brand .sub { color: var(--muted); font-size: 12px; }
  .controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
  .tabs { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
  .tabs button {
    border: 0; background: transparent; color: var(--muted); padding: 5px 10px; border-radius: 6px; cursor: pointer;
  }
  .tabs button.active { background: #1d2733; color: var(--ink); }
  .ctrl {
    border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px;
    padding: 6px 9px; cursor: pointer;
  }
  .ctrl:hover { background: var(--panel-2); }
  input[type="search"] {
    width: 210px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
    border-radius: 8px; padding: 6px 9px; outline: none;
  }
  input[type="search"]:focus { border-color: #334155; }
  .speed { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
  .speed input { width: 80px; accent-color: #e6edf3; }
  #status { color: var(--muted); font-size: 12px; min-width: 64px; }
  main { display: flex; height: calc(100dvh - 57px); }
  #stage { position: relative; flex: 1; min-width: 0; background: radial-gradient(circle at 50% 45%, #121924 0%, #0b0f14 62%); }
  #tree { width: 100%; height: 100%; display: block; touch-action: none; }
  aside {
    width: 342px; flex: none; border-left: 1px solid var(--line); background: var(--panel);
    overflow: auto; padding: 16px 16px 40px;
  }
  #tooltip {
    position: absolute; pointer-events: none; opacity: 0; transition: opacity .12s ease;
    background: rgba(17, 22, 29, .97); border: 1px solid #263241; border-radius: 8px;
    padding: 9px 11px; max-width: 290px; font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
    z-index: 20;
  }
  #tooltip.show { opacity: 1; }
  #tooltip strong { display: block; font-size: 13px; }
  #tooltip .tip-sub { color: var(--muted); margin: 2px 0 5px; }
  #tooltip .tip-row { color: var(--muted); }
  #legend {
    position: absolute; left: 14px; bottom: 14px; display: flex; gap: 5px 12px; flex-wrap: wrap;
    max-width: 62%; color: var(--muted); font-size: 11px; pointer-events: none;
  }
  .legend-item { display: inline-flex; align-items: center; gap: 5px; }
  .legend-item i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
  #era-legend {
    position: absolute; left: 14px; top: 12px; display: flex; gap: 12px; flex-wrap: wrap;
    color: var(--muted); font-size: 11px; pointer-events: none;
  }
  #era-legend span { display: inline-flex; align-items: center; gap: 5px; }
  .era { width: 9px; height: 9px; border-radius: 50%; border: 1.6px solid #8b949e; display: inline-block; }
  .era.pre { background: transparent; }
  .era.trans { background: linear-gradient(90deg, #8b949e 50%, transparent 50%); }
  .era.ai { background: #8b949e; border-color: #8b949e; }
  .ring { width: 9px; height: 9px; border-radius: 50%; border: 1px dashed #8b949e; }
  .hint {
    position: absolute; right: 14px; bottom: 14px; color: #667085; font-size: 11px; pointer-events: none;
  }

  .panel-head h2, aside h2 { margin: 2px 0 4px; font-size: 18px; letter-spacing: -.01em; }
  .eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
  .muted { color: var(--muted); }
  .small { font-size: 12px; }
  .stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 18px; }
  .stat {
    border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; background: var(--panel-2);
    display: flex; flex-direction: column; gap: 1px;
  }
  .stat-value { font-size: 16px; font-variant-numeric: tabular-nums; }
  .stat-label { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
  .section-title {
    color: var(--muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
    margin: 18px 0 7px; padding-bottom: 5px; border-bottom: 1px solid var(--line);
  }
  .row {
    display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; cursor: pointer;
    border: 1px solid transparent; background: transparent; color: var(--ink);
    padding: 7px 7px; border-radius: 7px;
  }
  .row:hover { background: var(--panel-2); border-color: var(--line); }
  .row.compact { padding: 5px 7px; }
  .row-main { display: flex; flex-direction: column; min-width: 0; }
  .row-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .row-sub { color: var(--muted); font-size: 11px; }
  .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
  .back {
    border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer;
    border-radius: 7px; padding: 4px 8px; margin-bottom: 12px;
  }
  .back:hover { color: var(--ink); background: var(--panel-2); }
  .chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
  .chip {
    border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
    border-radius: 999px; padding: 2px 8px; font-size: 11px;
  }
  .project {
    border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px;
    padding: 9px 10px; margin-bottom: 8px;
  }
  .project-title { font-size: 12.5px; line-height: 1.3; }
  .project-meta { color: var(--muted); font-size: 11px; margin-top: 3px; font-variant-numeric: tabular-nums; }
  .project-tech { color: #93a4b8; font-size: 11px; margin-top: 4px; }

  .node { cursor: pointer; }
  .node-inner { transform-origin: 0 0; }
  .node.dim, .label.dim, .edge.dim { opacity: .08; }
  .node, .label, .edge { transition: opacity .18s ease; }
  .node.hl .node-inner { filter: drop-shadow(0 0 7px currentColor); }
  .node.match .node-inner { filter: drop-shadow(0 0 9px #fff); }
  .label {
    pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 3.2px;
    stroke-linejoin: round; font-weight: 500;
  }
  .label.role { font-weight: 700; letter-spacing: .01em; stroke-width: 5px; }
  .edge { fill: none; stroke-linecap: round; }

  .animated .edge {
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: draw .55s ease-out both; animation-delay: var(--delay, 0ms);
  }
  .animated .node-inner {
    opacity: 0; transform: scale(.2);
    animation: pop .4s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--delay, 0ms);
  }
  .animated .label {
    opacity: 0; animation: fade .32s ease both; animation-delay: var(--delay, 0ms);
  }
  .static .edge { stroke-dashoffset: 0; }
  .static .node-inner { opacity: 1; transform: scale(1); }
  .static .label { opacity: 1; }

  @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes pop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }

  @media (max-width: 900px) {
    body { overflow: auto; }
    main { flex-direction: column; height: auto; }
    #stage { height: 64vh; }
    aside { width: auto; border-left: 0; border-top: 1px solid var(--line); }
    input[type="search"] { width: 150px; }
  }

/* demian.app surface overrides */
:root {
  --bg: #000000;
  --bg-2: #030805;
  --panel: #040906;
  --panel-2: #071009;
  --ink: #d8ffe4;
  --muted: #5f8f70;
  --line: #0f2c1a;
  --accent: #00ff6a;
}
.tabs button.active { background: #0f2c1a; }
input[type="search"]:focus { border-color: #1f5a36; }
#stage { background: radial-gradient(circle at 50% 45%, #071009 0%, #000000 62%); }
#tooltip { background: rgba(4, 9, 6, .97); border-color: #0f2c1a; }
.era { border-color: #5f8f70; }
.era.ai { background: #5f8f70; border-color: #5f8f70; }
.era.trans { background: linear-gradient(90deg, #5f8f70 50%, transparent 50%); }
.ring { border-color: #5f8f70; }
.hint { color: #3f6b4f; }
.project-tech { color: #7fae8f; }
.brand a { color: inherit; text-decoration: none; }
.brand a:hover { color: var(--accent); }
.site-link { text-decoration: none; }
